ReportPrintDataClass.cs 1.5 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Data;
  6. using System.Collections;
  7. using System.Windows.Forms;
  8. using System.Drawing;
  9. using System.Drawing.Printing;
  10. using LYFZ.ComponentLibrary;
  11. using System.IO;
  12. using System.ComponentModel;
  13. using System.Text.RegularExpressions;
  14. namespace LYFZ.Software.MainBusiness.ReportPrint
  15. {
  16. /// <summary>
  17. /// 报表打印数据处理类
  18. /// </summary>
  19. public class ReportPrintDataClass
  20. {
  21. /// <summary>
  22. /// 获取订单报表相关数据
  23. /// </summary>
  24. /// <param name="OrderNumber">订单号</param>
  25. /// <param name="VersionEnglishName">打印版本</param>
  26. /// <returns></returns>
  27. public string GetOrderReportData( string OrderNumber, string VersionEnglishName )
  28. {
  29. Hashtable htData = new Hashtable();
  30. #region 查询条件
  31. Dictionary<string, string> DictDataArray = new Dictionary<string, string>();
  32. DictDataArray["Ord_Number"] = OrderNumber;
  33. DataTable tbl = new BLL.BLL_ErpOrder().GetView_Custom( "View_OrderReportPrintData", StrWhere: "Ord_ShowNumber ='" + OrderNumber + "'" ).Tables[0];
  34. #endregion
  35. htData["Ord_Number"] = tbl.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() != "" ? tbl.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() : tbl.Rows[0]["Ord_Number"].ToString().Trim();//自定认编号不为空,则显示自定义编号
  36. htData["Ord_CustomerName1"] = tbl.Rows[0]["Ord_CustomerName1"].ToString().Trim();//客户姓名1
  37. htData["Ord_CustomerName2"] = tbl.Rows[0]["Ord_CustomerName2"].ToString().Trim();//客户姓名2
  38. htData["Ord_CustomerTelephone1"] = tbl.Rows[0]["Ord_CustomerTelephone1"].ToString().Trim();//客户电话1
  39. htData["Ord_CustomerTelephone2"] = tbl.Rows[0]["Ord_CustomerTelephone2"].ToString().Trim();//客户电话2
  40. htData["Ord_CustomerBirthday1"] = tbl.Rows[0]["Ord_CustomerBirthday1"].ToString().Trim();//客户生日1
  41. htData["Ord_CustomerBirthday2"] = tbl.Rows[0]["Ord_CustomerBirthday2"].ToString().Trim();//客户生日2
  42. htData["Ord_CustomerSex1"] = tbl.Rows[0]["Ord_CustomerSex1"].ToString().Trim() == "0" ? "男" : "女";//客户性别1
  43. htData["Ord_CustomerSex2"] = tbl.Rows[0]["Ord_CustomerSex2"].ToString().Trim() == "0" ? "男" : "女";//客户性别2
  44. htData["Ord_Mc_Number"] = tbl.Rows[0]["Ord_Mc_Number"].ToString().Trim();//客户会员卡号
  45. htData["Ord_Price"] = tbl.Rows[0]["Ord_Price"].ToString().Trim();//套系价格
  46. htData["Ord_OrderArrears"] = tbl.Rows[0]["Ord_OrderArrears"].ToString().Trim();//欠款
  47. string IntoBottom = tbl.Rows[0]["Ord_IntoBottom"].ToString().Trim() == "0" ? "全部" : tbl.Rows[0]["Ord_IntoBottom"].ToString().Trim();
  48. htData["Ord_InBottomInBook"] = IntoBottom + "/" + tbl.Rows[0]["Ord_IntoRegister"].ToString().Trim();//入底/入册
  49. htData["Ord_BootDivision"] = tbl.Rows[0]["Ord_BootDivision"].ToString().Trim();//引导师
  50. htData["Ord_TakenStages"] = tbl.Rows[0]["Ord_TakenStages"].ToString().Trim();
  51. htData["Ord_PhotographyCategory"] = tbl.Rows[0]["Ord_PhotographyCategory"].ToString().Trim();//类别
  52. htData["Ord_CustomerSource"] = tbl.Rows[0]["Ord_CustomerSource"].ToString().Trim();//客户来源
  53. htData["Ord_OrdersPerson"] = tbl.Rows[0]["Ord_OrdersPerson"].ToString().Trim();//订单人员
  54. htData["Ord_SeriesName"] = tbl.Rows[0]["Ord_SeriesName"].ToString().Trim();//套系名称
  55. htData["Ord_SeriesPrice"] = tbl.Rows[0]["Ord_SeriesPrice"].ToString().Trim();//套系价格
  56. htData["Ord_Discount"] = tbl.Rows[0]["Ord_Discount"].ToString().Trim();//折扣
  57. htData["Ord_Authorize"] = tbl.Rows[0]["Ord_Authorize"].ToString().Trim();//授权
  58. htData["Ord_AfterDiscount"] = tbl.Rows[0]["Ord_AfterDiscount"].ToString().Trim();//折扣后
  59. htData["Ord_AfterAuthorize"] = tbl.Rows[0]["Ord_AfterAuthorize"].ToString().Trim();//授权后
  60. htData["Ord_EntryClerkName"] = tbl.Rows[0]["Ord_EntryClerkName"].ToString().Trim();//录单
  61. htData["Ord_Remark"] = tbl.Rows[0]["Ord_Remark"].ToString().Trim();//订单备注
  62. htData["Ord_NowDatetime"] = LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy-MM-dd HH:mm:ss" );//订单日期
  63. htData["Ord_DetailsName"] = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;//打单人
  64. DataTable tbl_Product = new LYFZ.BLL.BLL_ErpOrderProductList().GetList( "OPlist_OrderNumber='" + OrderNumber + "'" ).Tables[0];
  65. if ( VersionEnglishName == "OrderReport_Children" )
  66. {
  67. #region 儿童版
  68. htData["Ord_TakenStages"] = "";
  69. ArrayList ary = new ArrayList();
  70. for ( int j = 0; j < tbl_Product.Rows.Count; j++ )
  71. {
  72. bool Isbol = true;
  73. for ( int k = 0; k < ary.Count; k++ )
  74. {
  75. string arys = ary[k].ToString().Trim();
  76. if ( arys.Substring( 0, arys.IndexOf( "数量:" ) ).Trim() == (tbl_Product.Rows[j]["OPlist_ProdName"].ToString().Trim()) )
  77. {
  78. 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() );
  79. Isbol = false; break;
  80. }
  81. }
  82. if ( Isbol )
  83. {
  84. ary.Add( tbl_Product.Rows[j]["OPlist_ProdName"].ToString().Trim() + " 数量:" + tbl_Product.Rows[j]["OPlist_ProdQuantity"].ToString().Trim() );
  85. }
  86. }
  87. for ( int k = 0; k < ary.Count; k++ )
  88. {
  89. if ( k > 0 )
  90. {
  91. htData["Ord_TakenStages"] += "\r\n" + ary[k].ToString();
  92. }
  93. else { htData["Ord_TakenStages"] = ary[k].ToString(); }
  94. }
  95. #region 循环塞数据
  96. string Ord_TakenStages = "";
  97. string Ord_ClothingName = "";
  98. string Ord_PhotographyStatus = "";
  99. string Ord_EarlyRepairStatus = "";
  100. string Ord_FilmSelectionStatus = "";
  101. string Ord_RefinementStatus = "";
  102. string Ord_DesignerStatus = "";
  103. string Ord_LookDesignStatus = "";
  104. string Ord_TakePiecesStatus = "";
  105. string Ord_AppointmentTime = "";
  106. string Ord_PhotographyTime = "";
  107. string Ord_FilmSelectionTime = "";
  108. string Ord_LookDesignTime = "";
  109. string OPlist_PickupDate = "";
  110. string Ord_Photographer = "";
  111. string Ord_MakeupArtist = "";
  112. string Ord_EarlyRepairName = "";
  113. string Ord_FilmSelectionName = "";
  114. string Ord_RefinementName = "";
  115. string Ord_DesignerName = "";
  116. string Ord_LookDesignName = "";
  117. for ( int k = 0; k < tbl.Rows.Count; k++ )
  118. {
  119. string Ord_TakenStagesA = tbl.Rows[k]["Ord_TakenStages"].ToString().Trim();//成长套系
  120. if ( Ord_TakenStages.IndexOf( Ord_TakenStagesA ) == -1 )
  121. {
  122. Ord_TakenStages += Ord_TakenStagesA;
  123. }
  124. string Ord_PhotographyStatusA = tbl.Rows[k]["Ord_PhotographyStatus"].ToString().Trim() == "0" ? "未拍" : tbl.Rows[k]["Ord_PhotographyStatus"].ToString().Trim() == "2" ? "拍摄中" : "OK";//拍照
  125. if ( Ord_PhotographyStatus.IndexOf( Ord_PhotographyStatusA ) == -1 )
  126. {
  127. Ord_PhotographyStatus += Ord_PhotographyStatusA;
  128. }
  129. string Ord_ClothingNameA = tbl.Rows[k]["Ord_ClothingName"].ToString().Trim();//服装师
  130. if ( Ord_ClothingName.IndexOf( Ord_ClothingNameA ) == -1 )
  131. {
  132. Ord_ClothingName += Ord_ClothingNameA;
  133. }
  134. string Ord_EarlyRepairStatusA = tbl.Rows[k]["Ord_EarlyRepairStatus"].ToString().Trim() == "0" ? "未修" : tbl.Rows[k]["Ord_EarlyRepairStatus"].ToString().Trim() == "1" ? "修片中" : "OK";//初修
  135. if ( Ord_EarlyRepairStatus.IndexOf( Ord_EarlyRepairStatusA ) == -1 )
  136. {
  137. Ord_EarlyRepairStatus += Ord_EarlyRepairStatusA;
  138. }
  139. string Ord_FilmSelectionStatusA = tbl.Rows[k]["Ord_FilmSelectionStatus"].ToString().Trim() == "0" ? "未选" : "OK";//选片
  140. if ( Ord_FilmSelectionStatus.IndexOf( Ord_FilmSelectionStatusA ) == -1 )
  141. {
  142. Ord_FilmSelectionStatus += Ord_FilmSelectionStatusA;
  143. }
  144. string Ord_RefinementStatusA = tbl.Rows[k]["Ord_RefinementStatus"].ToString().Trim() == "0" ? "未修" : tbl.Rows[k]["Ord_RefinementStatus"].ToString().Trim() == "0" ? "修片中" : "OK";//精修
  145. if ( Ord_RefinementStatus.IndexOf( Ord_RefinementStatusA ) == -1 )
  146. {
  147. Ord_RefinementStatus += Ord_RefinementStatusA;
  148. }
  149. string Ord_DesignerStatusA = tbl.Rows[k]["Ord_DesignerStatus"].ToString().Trim() == "0" ? "未设计" : tbl.Rows[k]["Ord_DesignerStatus"].ToString().Trim() == "1" ? "设计中" : "OK";//设计
  150. if ( Ord_DesignerStatus.IndexOf( Ord_DesignerStatusA ) == -1 )
  151. {
  152. Ord_DesignerStatus += Ord_DesignerStatusA;
  153. }
  154. string Ord_LookDesignStatusA = tbl.Rows[k]["Ord_LookDesignStatus"].ToString().Trim() == "0" ? "未看" : "OK";//看设计
  155. if ( Ord_LookDesignStatus.IndexOf( Ord_LookDesignStatusA ) == -1 )
  156. {
  157. Ord_LookDesignStatus += Ord_LookDesignStatusA;
  158. }
  159. string Ord_TakePiecesStatusA = tbl.Rows[k]["Ord_TakePiecesStatus"].ToString().Trim();//取件
  160. if ( Ord_TakePiecesStatus.IndexOf( Ord_TakePiecesStatusA ) == -1 )
  161. {
  162. Ord_TakePiecesStatus += Ord_TakePiecesStatusA;
  163. }
  164. string Ord_AppointmentTimeA = tbl.Rows[k]["Ord_AppointmentTime"].ToString().Trim() == "" ? "" : Convert.ToDateTime( tbl.Rows[k]["Ord_AppointmentTime"] ).ToString( "yyyy-MM-dd" );//预约时间
  165. if ( Ord_AppointmentTime.IndexOf( Ord_AppointmentTimeA ) == -1 )
  166. {
  167. Ord_AppointmentTime += Ord_AppointmentTimeA;
  168. }
  169. string Ord_PhotographyTimeA = tbl.Rows[k]["Ord_PhotographyTime"].ToString().Trim() == "" ? "" : Convert.ToDateTime( tbl.Rows[k]["Ord_PhotographyTime"] ).ToString( "yyyy-MM-dd" );//拍照时间
  170. if ( Ord_PhotographyTime.IndexOf( Ord_PhotographyTimeA ) == -1 )
  171. {
  172. Ord_PhotographyTime += Ord_PhotographyTimeA;
  173. }
  174. string Ord_FilmSelectionTimeA = tbl.Rows[k]["Ord_FilmSelectionTime"].ToString().Trim() == "" ? "" : Convert.ToDateTime( tbl.Rows[k]["Ord_FilmSelectionTime"] ).ToString( "yyyy-MM-dd" );//选片时间
  175. if ( Ord_FilmSelectionTime.IndexOf( Ord_FilmSelectionTimeA ) == -1 )
  176. {
  177. Ord_FilmSelectionTime += Ord_FilmSelectionTimeA;
  178. }
  179. string Ord_LookDesignTimeA = tbl.Rows[k]["Ord_LookDesignTime"].ToString().Trim() == "" ? "" : Convert.ToDateTime( tbl.Rows[k]["Ord_LookDesignTime"] ).ToString( "yyyy-MM-dd" );//看设计时间
  180. if ( Ord_LookDesignTime.IndexOf( Ord_LookDesignTimeA ) == -1 )
  181. {
  182. Ord_LookDesignTime += Ord_LookDesignTimeA;
  183. }
  184. string OPlist_PickupDateA = tbl.Rows[k]["Ord_PickupDate"].ToString().Trim() == "" ? "" : Convert.ToDateTime( tbl.Rows[k]["Ord_PickupDate"] ).ToString( "yyyy-MM-dd" );//取件时间
  185. if ( OPlist_PickupDate.IndexOf( OPlist_PickupDateA ) == -1 )
  186. {
  187. OPlist_PickupDate += OPlist_PickupDateA;
  188. }
  189. string Ord_PhotographerA = tbl.Rows[k]["Ord_Photographer"].ToString().Trim();//拍摄师
  190. if ( Ord_Photographer.IndexOf( Ord_PhotographerA ) == -1 )
  191. {
  192. Ord_Photographer += Ord_PhotographerA;
  193. }
  194. string Ord_MakeupArtistA = tbl.Rows[k]["Ord_MakeupArtist"].ToString().Trim();//化妆师
  195. if ( Ord_MakeupArtist.IndexOf( Ord_MakeupArtistA ) == -1 )
  196. {
  197. Ord_MakeupArtist += Ord_MakeupArtistA;
  198. }
  199. string Ord_EarlyRepairNameA = tbl.Rows[k]["Ord_EarlyRepairName"].ToString().Trim();//初修师
  200. if ( Ord_EarlyRepairName.IndexOf( Ord_EarlyRepairNameA ) == -1 )
  201. {
  202. Ord_EarlyRepairName += Ord_EarlyRepairNameA;
  203. }
  204. string Ord_FilmSelectionNameA = tbl.Rows[k]["Ord_FilmSelectionName"].ToString().Trim();//选片师
  205. if ( Ord_FilmSelectionName.IndexOf( Ord_FilmSelectionNameA ) == -1 )
  206. {
  207. Ord_FilmSelectionName += Ord_FilmSelectionNameA;
  208. }
  209. string Ord_RefinementNameA = tbl.Rows[k]["Ord_RefinementName"].ToString().Trim();//精修师
  210. if ( Ord_RefinementName.IndexOf( Ord_RefinementNameA ) == -1 )
  211. {
  212. Ord_RefinementName += Ord_RefinementNameA;
  213. }
  214. string Ord_DesignerNameA = tbl.Rows[k]["Ord_DesignerName"].ToString().Trim();//设计师
  215. if ( Ord_DesignerName.IndexOf( Ord_DesignerNameA ) == -1 )
  216. {
  217. Ord_DesignerName += Ord_DesignerNameA;
  218. }
  219. string Ord_LookDesignNameA = tbl.Rows[k]["Ord_LookDesignName"].ToString().Trim();//看设计师
  220. if ( Ord_LookDesignName.IndexOf( Ord_LookDesignNameA ) == -1 )
  221. {
  222. Ord_LookDesignName += Ord_LookDesignNameA;
  223. }
  224. }
  225. htData["Ord_TakenStages"] = Ord_TakenStages;
  226. htData["Ord_ClothingName"] = Ord_ClothingName;
  227. htData["Ord_PhotographyStatus"] = Ord_PhotographyStatus;
  228. htData["Ord_EarlyRepairStatus"] = Ord_EarlyRepairStatus;
  229. htData["Ord_FilmSelectionStatus"] = Ord_FilmSelectionStatus;
  230. htData["Ord_RefinementStatus"] = Ord_RefinementStatus;
  231. htData["Ord_DesignerStatus"] = Ord_DesignerStatus;
  232. htData["Ord_LookDesignStatus"] = Ord_LookDesignStatus;
  233. htData["Ord_TakePiecesStatus"] = Ord_TakePiecesStatus;
  234. htData["Ord_AppointmentTime"] = Ord_AppointmentTime;
  235. htData["Ord_PhotographyTime"] = Ord_PhotographyTime;
  236. htData["Ord_FilmSelectionTime"] = Ord_FilmSelectionTime;
  237. htData["Ord_LookDesignTime"] = Ord_LookDesignTime;
  238. htData["OPlist_PickupDate"] = OPlist_PickupDate;
  239. htData["Ord_Photographer"] = Ord_Photographer;
  240. htData["Ord_MakeupArtist"] = Ord_MakeupArtist;
  241. htData["Ord_EarlyRepairName"] = Ord_EarlyRepairName;
  242. htData["Ord_FilmSelectionName"] = Ord_FilmSelectionName;
  243. htData["Ord_RefinementName"] = Ord_RefinementName;
  244. htData["Ord_DesignerName"] = Ord_DesignerName;
  245. htData["Ord_LookDesignName"] = Ord_LookDesignName;
  246. #endregion
  247. #endregion
  248. }
  249. else if ( VersionEnglishName == "OrderReport_Wedding" )
  250. {
  251. #region 婚纱
  252. for ( int j = 0; j < tbl_Product.Rows.Count; j++ )
  253. {
  254. if ( j > 0 )
  255. {
  256. htData["Ord_TakenStages"] = tbl_Product.Rows[j]["OPlist_ProdName"].ToString().Trim() + " 数量:" + tbl_Product.Rows[j]["OPlist_ProdQuantity"].ToString().Trim();
  257. }
  258. else { htData["Ord_TakenStages"] += "\r\n" + tbl_Product.Rows[j]["OPlist_ProdName"].ToString().Trim() + " 数量:" + tbl_Product.Rows[j]["OPlist_ProdQuantity"].ToString().Trim(); }
  259. }
  260. #endregion
  261. }
  262. #region 影楼信息
  263. tbl = new LYFZ.BLL.BLL_ErpCompanyInfo().GetList( "Company_DividedShop='" + LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID() + "'" ).Tables[0];
  264. for ( int i = 0; i < tbl.Columns.Count; i++ )
  265. {
  266. htData[tbl.Columns[i].ToString().Trim()] = tbl.Columns[i].ColumnName.Trim();
  267. }
  268. for ( int k = 0; k < tbl.Rows.Count; k++ )
  269. {
  270. for ( int i = 0; i < tbl.Columns.Count; i++ )
  271. {
  272. htData[tbl.Columns[i].ToString().Trim()] = tbl.Rows[k][tbl.Columns[i].ToString().Trim()].ToString().Trim();
  273. }
  274. }
  275. #endregion
  276. return DrawingPrintModelBoard( VersionEnglishName, htData );
  277. }
  278. /// <summary>
  279. /// 绘画出要打印模板
  280. /// </summary>
  281. /// <param name="EnglishName"></param>
  282. /// <param name="htData"></param>
  283. /// <returns>NotExistModel:模板不存在 NotSetModel:模板未设置</returns>
  284. public string DrawingPrintModelBoard( string EnglishName, Hashtable htData )
  285. {
  286. try
  287. {
  288. DataTable tbl = new LYFZ.BLL.BLL_ErpReportModel().GetList( "Rmd_EnglishName='" + EnglishName + "'" ).Tables[0];
  289. if ( tbl.Rows.Count > 0 )
  290. {
  291. if ( tbl.Rows[0]["Rmd_StrJion"].ToString().Trim() != "" )
  292. {
  293. Json.JsontoDataTable jdt = new Json.JsontoDataTable();
  294. DataTable tbl_ModelJion = jdt.toObject( tbl.Rows[0]["Rmd_ModelJion"].ToString().Trim() );
  295. Panel newpanel = new Panel();
  296. newpanel.Name = tbl_ModelJion.Rows[0]["Name"].ToString().Trim();
  297. newpanel.Size = new Size( Convert.ToInt32( tbl_ModelJion.Rows[0]["SizeWidth"].ToString().Trim() ), Convert.ToInt32( tbl_ModelJion.Rows[0]["SizeHigh"].ToString().Trim() ) );
  298. newpanel.Location = new Point( 0, 0 );
  299. if ( tbl_ModelJion.Rows[0]["IsPrint"].ToString().Trim() == "true" )
  300. {
  301. try
  302. {
  303. System.IO.FileStream fs = new System.IO.FileStream( tbl.Rows[0]["Rmd_PhotoPath"].ToString().Trim(), System.IO.FileMode.Open, System.IO.FileAccess.Read );
  304. Image image = System.Drawing.Image.FromStream( fs );
  305. newpanel.BackgroundImageLayout = ImageLayout.Zoom;
  306. newpanel.BackgroundImage = image;
  307. fs.Close();
  308. }
  309. catch { return "模板图片不存在"; }
  310. }
  311. DataTable tbl_Jion = jdt.toObject( tbl.Rows[0]["Rmd_StrJion"].ToString().Trim() );
  312. for ( int i = 0; i < tbl_Jion.Rows.Count; i++ )
  313. {
  314. Label lbl = new Label();
  315. lbl.Name = tbl_Jion.Rows[i]["Name"].ToString().Trim();//Name
  316. lbl.Location = new Point( Convert.ToInt32( tbl_Jion.Rows[i]["LocationWidth"].ToString().Trim() ), Convert.ToInt32( tbl_Jion.Rows[i]["LocationHigh"].ToString().Trim() ) );//坐标
  317. //lbl.Tag = tbl_Jion.Rows[i]["Column"].ToString().Trim();//
  318. string StrText = "";
  319. if ( htData.ContainsKey( tbl_Jion.Rows[i]["Column"].ToString().Trim() ) && htData[tbl_Jion.Rows[i]["Column"].ToString().Trim()].ToString().Trim().Length > 0 )
  320. {
  321. switch ( tbl_Jion.Rows[i]["Type"].ToString().Trim() )
  322. {
  323. case "NvarChar": StrText = htData[tbl_Jion.Rows[i]["Column"].ToString().Trim()].ToString().Trim(); break;
  324. case "DateTime":
  325. if ( htData[tbl_Jion.Rows[i]["Column"].ToString().Trim()].ToString().Trim() != "" )
  326. {
  327. StrText = Convert.ToDateTime( htData[tbl_Jion.Rows[i]["Column"].ToString().Trim()].ToString().Trim() ).ToString( tbl_Jion.Rows[i]["DateFormat"].ToString().Trim() );
  328. }
  329. else { StrText = ""; }
  330. break;
  331. case "Decimal":
  332. if ( tbl_Jion.Rows[i]["ToUpper"].ToString().Trim() == "True" )
  333. {
  334. StrText = ConversionAmount( htData[tbl_Jion.Rows[i]["Column"].ToString().Trim()].ToString().Trim() );
  335. }
  336. else
  337. {
  338. StrText = Convert.ToDecimal( htData[tbl_Jion.Rows[i]["Column"].ToString().Trim()].ToString().Trim() ).ToString( tbl_Jion.Rows[i]["MoneyFormat"].ToString().Trim() );
  339. }
  340. break;
  341. //case "Image":
  342. }
  343. }
  344. lbl.Text = StrText;
  345. if ( tbl_Jion.Rows[i]["Align"].ToString().Trim() == "Left" )
  346. {
  347. lbl.TextAlign = ContentAlignment.MiddleLeft;
  348. }
  349. else if ( tbl_Jion.Rows[i]["Align"].ToString().Trim() == "Right" )
  350. {
  351. lbl.TextAlign = ContentAlignment.MiddleRight;
  352. }
  353. lbl.Size = new Size( Convert.ToInt32( tbl_Jion.Rows[i]["SizeWidth"].ToString().Trim() ), Convert.ToInt32( tbl_Jion.Rows[i]["SizeHigh"].ToString().Trim() ) );
  354. lbl.Font = new Font( "微软雅黑", float.Parse( tbl_Jion.Rows[i]["FontSize"].ToString().Trim() ) );
  355. newpanel.Controls.Add( lbl );
  356. }
  357. //LYFZ.Software.MainBusiness.ReportPrint.SetSmallForm.PrintPreviewSmallForm PrintPreview = new ReportPrint.SetSmallForm.PrintPreviewSmallForm();
  358. //PrintPreview.setPrintPreviewControl(newpanel);
  359. //PrintPreview.ShowDialog();
  360. #region 打印
  361. Nowpanel = newpanel;
  362. PrintDocument ptDocument = new PrintDocument();
  363. ptDocument.PrintPage += ptDocument_PrintPage;
  364. PrintPreviewDialog MyPrintPreviewDialog = new PrintPreviewDialog();
  365. MyPrintPreviewDialog.Document = ptDocument;
  366. MyPrintPreviewDialog.ShowDialog();
  367. #endregion
  368. return "";
  369. }
  370. else { return "报表模板格式未设置"; }
  371. }
  372. return "报表模板不存在";
  373. }
  374. catch { return "生成模板时错误"; }
  375. }
  376. private Panel Nowpanel = new Panel();
  377. private void ptDocument_PrintPage( object sender, PrintPageEventArgs e )
  378. {
  379. Bitmap _NewBitmap = new Bitmap( Nowpanel.Width, Nowpanel.Height );
  380. Nowpanel.DrawToBitmap( _NewBitmap, new Rectangle( 0, 0, _NewBitmap.Width, _NewBitmap.Height ) );
  381. e.Graphics.DrawImage( _NewBitmap, 0, 0, _NewBitmap.Width, _NewBitmap.Height );
  382. }
  383. #region 金额转大写
  384. private static String[] Ls_ShZ = { "零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖", "拾" };
  385. private static String[] Ls_DW_Zh = { "元", "拾", "佰", "仟", "万", "拾", "佰", "仟", "亿", "拾", "佰", "仟", "万" };
  386. private static String[] Num_DW = { "", "拾", "佰", "仟", "万", "拾", "佰", "仟", "亿", "拾", "佰", "仟", "万" };
  387. private static String[] Ls_DW_X = { "角", "分" };
  388. /// <summary>
  389. /// 接收文本框传来的值
  390. /// </summary>
  391. /// <param name="txt_Num"></param>
  392. /// <returns></returns>
  393. public static string ConversionAmount( string txt_Num )
  394. {
  395. Double iNum = 0.0;
  396. if ( Double.TryParse( txt_Num, out iNum ) == false )
  397. {
  398. return "非法的金额数字";
  399. }
  400. return NumGetStr( iNum );
  401. }
  402. /// <summary>
  403. /// 金额小写转中文大写。
  404. /// 整数支持到万亿;小数部分支持到分(超过两位将进行Banker舍入法处理)
  405. /// </summary>
  406. /// <param name="Num">需要转换的双精度浮点数</param>
  407. /// <returns>转换后的字符串</returns>
  408. private static String NumGetStr( Double Num )
  409. {
  410. Boolean iXSh_bool = false;//是否含有小数,默认没有(0则视为没有)
  411. Boolean iZhSh_bool = true;//是否含有整数,默认有(0则视为没有)
  412. string NumStr;//整个数字字符串
  413. string NumStr_Zh;//整数部分
  414. string NumSr_X = "";//小数部分
  415. string NumStr_DQ;//当前的数字字符
  416. string NumStr_R = "";//返回的字符串
  417. Num = Math.Round( Num, 2 );//四舍五入取两位
  418. //各种非正常情况处理
  419. if ( Num < 0 )
  420. return "不转换欠条";
  421. if ( Num > 9999999999999.99 )
  422. return "很难想象谁会有这么多钱!";
  423. if ( Num == 0 )
  424. return Ls_ShZ[0];
  425. //判断是否有整数
  426. if ( Num < 1.00 )
  427. iZhSh_bool = false;
  428. NumStr = Num.ToString();
  429. //默认只有整数部分
  430. NumStr_Zh = NumStr;
  431. //分开整数与小数处理
  432. if ( NumStr_Zh.Contains( "." ) )
  433. {
  434. NumStr_Zh = NumStr.Substring( 0, NumStr.IndexOf( "." ) );
  435. NumSr_X = NumStr.Substring( (NumStr.IndexOf( "." ) + 1), (NumStr.Length - NumStr.IndexOf( "." ) - 1) );
  436. iXSh_bool = true;
  437. }
  438. //判断是否含有小数部分
  439. if ( NumSr_X == "" || int.Parse( NumSr_X ) <= 0 )
  440. {
  441. iXSh_bool = false;
  442. }
  443. //整数部分处理
  444. if ( iZhSh_bool )
  445. {
  446. NumStr_Zh = Reversion_Str( NumStr_Zh );//反转字符串
  447. for ( int a = 0; a < NumStr_Zh.Length; a++ )
  448. {//整数部分转换
  449. NumStr_DQ = NumStr_Zh.Substring( a, 1 );
  450. if ( int.Parse( NumStr_DQ ) != 0 )
  451. NumStr_R = Ls_ShZ[int.Parse( NumStr_DQ )] + Ls_DW_Zh[a] + NumStr_R;
  452. else if ( a == 0 || a == 4 || a == 8 )
  453. {
  454. if ( NumStr_Zh.Length > 8 && a == 4 )
  455. continue;
  456. NumStr_R = Ls_DW_Zh[a] + NumStr_R;
  457. }
  458. else if ( int.Parse( NumStr_Zh.Substring( a - 1, 1 ) ) != 0 )
  459. NumStr_R = Ls_ShZ[int.Parse( NumStr_DQ )] + NumStr_R;
  460. }
  461. if ( !iXSh_bool )
  462. return NumStr_R + "整";
  463. //NumStr_R += "零";
  464. }
  465. //小数部分转换
  466. for ( int b = 0; b < NumSr_X.Length; b++ )
  467. {
  468. NumStr_DQ = NumSr_X.Substring( b, 1 );
  469. if ( int.Parse( NumStr_DQ ) != 0 )
  470. NumStr_R += Ls_ShZ[int.Parse( NumStr_DQ )] + Ls_DW_X[b];
  471. else if ( b != 1 && iZhSh_bool )
  472. NumStr_R += Ls_ShZ[int.Parse( NumStr_DQ )];
  473. }
  474. return NumStr_R;
  475. }
  476. /// <summary>
  477. /// 提供一个数字直接转大写(即不带单位)
  478. /// </summary>
  479. /// <param name="NumStr">需要转换的数字字符串</param>
  480. /// <param name="Dw">是否带单位</param>
  481. /// <returns>转换后的字符串</returns>
  482. public static String LowercaseGetCap( String NumStr, Boolean Dw )
  483. {
  484. String CapStr = "";
  485. String NumStr_LS;
  486. if ( NumStr == String.Empty )
  487. return String.Empty;
  488. if ( Dw )
  489. NumStr = Reversion_Str( NumStr );
  490. try
  491. {
  492. for ( Int32 c = 0; c < NumStr.Length; c++ )
  493. {
  494. NumStr_LS = NumStr.Substring( c, 1 );
  495. if ( Dw )
  496. {
  497. if ( int.Parse( NumStr_LS ) != 0 )
  498. CapStr = Ls_ShZ[int.Parse( NumStr_LS )] + Num_DW[c] + CapStr;
  499. else if ( c == 0 || c == 4 || c == 8 )
  500. {
  501. if ( NumStr_LS.Length > 8 && c == 4 )
  502. continue;
  503. CapStr = Num_DW[c] + CapStr;
  504. }
  505. else if ( int.Parse( NumStr.Substring( c - 1, 1 ) ) != 0 )
  506. CapStr = Ls_ShZ[int.Parse( NumStr_LS )] + CapStr;
  507. }
  508. else
  509. CapStr += Ls_ShZ[int.Parse( NumStr_LS )];
  510. }
  511. return CapStr;
  512. }
  513. catch ( Exception Err )
  514. {
  515. return "转换错误!" + Err.Message;
  516. }
  517. }
  518. /// <summary>
  519. /// 反转字符串
  520. /// </summary>
  521. /// <param name="Rstr">需要反转的字符串</param>
  522. /// <returns>反转后的字符串</returns>
  523. private static String Reversion_Str( String Rstr )
  524. {
  525. Char[] LS_Str = Rstr.ToCharArray();
  526. Array.Reverse( LS_Str );
  527. String ReturnSte = "";
  528. ReturnSte = new String( LS_Str );//反转字符串
  529. return ReturnSte;
  530. }
  531. #endregion
  532. }
  533. /// <summary>
  534. /// 报表列生成类
  535. /// </summary>
  536. public class ReportGenerationColumnClass
  537. {
  538. /// <summary>
  539. /// 列数据
  540. /// </summary>
  541. /// <param name="treeview"></param>
  542. /// <param name="Version"></param>
  543. /// <param name="ReportName"></param>
  544. public void Order_GenerationColumn( LYFZ.ComponentLibrary.TreeViewEx treeview, string Version, string ReportName )
  545. {
  546. string StrColumnText = "";
  547. string StrColumnName = "";
  548. string StrColumnType = "";
  549. if ( ReportName == "OrderReport" )
  550. {
  551. if ( Version == "Children" )
  552. {
  553. StrColumnText = "订单报表|订单号|家长姓名|宝贝姓名|家长电话|家长生日|宝贝生日|拍摄内容|引导师|家长性别|宝贝性别";//11列
  554. StrColumnName = "OrderReport|Ord_Number|Ord_CustomerName1|Ord_CustomerName2|Ord_CustomerTelephone1|Ord_CustomerBirthday1|Ord_CustomerBirthday2|Ord_TakenStages|Ord_BootDivision|Ord_CustomerSex1|Ord_CustomerSex2";
  555. StrColumnType = "NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|NvarChar";
  556. }
  557. else if ( Version == "Wedding" )
  558. {
  559. StrColumnText = "订单报表|订单号|男宾姓名|女宾姓名|男宾电话|女宾电话|男宾生日|女宾生日|拍摄内容|男宾性别|女宾性别";//11列
  560. StrColumnName = "OrderReport|Ord_Number|Ord_CustomerName1|Ord_CustomerName2|Ord_CustomerTelephone1|Ord_CustomerTelephone2|Ord_CustomerBirthday1|Ord_CustomerBirthday2|Ord_TakenStages|Ord_CustomerSex1|Ord_CustomerSex2";
  561. StrColumnType = "NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|NvarChar";
  562. }
  563. StrColumnText += "|会员卡号|定金|入底/入册|欠款|类别|来源|拍照|初修|选片|精修|设计|看设计|取件|预约时间|拍照时间|选片时间|看设计时间|取件时间|拍摄师|摄影助理|化妆师|化妆助理|初修师|选片师|精修师|设计师|看设计师|服装师|接单人|套系名称|套系价格|录单|折扣|授权|折扣后|授权后|订单备注|当前日期|打单人";//39
  564. 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";
  565. 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";
  566. GenerationColumn( StrColumnText, StrColumnName, StrColumnType, treeview );
  567. }
  568. else if ( ReportName == "FinancePayment" )
  569. {
  570. if ( Version == "Children" )
  571. {
  572. StrColumnText = "收款凭据|订单号|家长姓名|宝贝姓名|家长电话|欠款|门市|";//11列
  573. StrColumnName = "OrderReport|Ord_Number|Ord_CustomerName1|Ord_CustomerName2|Ord_CustomerTelephone1|Ord_OrderArrears|Ord_OrdersPerson";
  574. StrColumnType = "NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|Decimal|NvarChar";
  575. }
  576. else if ( Version == "Wedding" )
  577. {
  578. StrColumnText = "收款凭据|订单号|男宾姓名|女宾姓名|男宾电话|女宾电话|欠款|门市";//11列
  579. StrColumnName = "OrderReport|Ord_Number|Ord_CustomerName1|Ord_CustomerName2|Ord_CustomerTelephone1|Ord_CustomerTelephone2|Ord_OrderArrears|Ord_OrdersPerson";
  580. StrColumnType = "NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|Decimal|NvarChar";
  581. }
  582. StrColumnText += "|开单人|收款人|收款金额|付款方式|收款项目|收款时间|收款类别";//39
  583. StrColumnName += "|Pay_OpenSingle|Pay_ThePayee|Pay_AmountOf|Pay_PaymentMethod|Pay_ReceivableProject|Pay_CreateDatetime|Pay_Category";
  584. StrColumnType += "|NvarChar|NvarChar|Decimal|NvarChar|NvarChar|DateTime|NvarChar";
  585. GenerationColumn( StrColumnText, StrColumnName, StrColumnType, treeview );
  586. }
  587. else if ( ReportName == "" )
  588. {
  589. }
  590. StrColumnText = "影楼信息|影楼名称|影楼店长|影楼电话|影楼传真|影楼网址|影楼地址|收款单标题|收款单说明|预约单说明|制作单说明|礼服单说明|二维码|影楼简介|影楼相册缩略图|影楼相册展示|景楼详情";
  591. 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";
  592. StrColumnType = "NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|Image|NvarChar|NvarChar|NvarChar|NvarChar";
  593. GenerationColumn( StrColumnText, StrColumnName, StrColumnType, treeview );
  594. }
  595. /// <summary>
  596. /// 写入列
  597. /// </summary>
  598. /// <param name="StrColumnText"></param>
  599. /// <param name="StrColumnName"></param>
  600. /// <param name="StrColumnType"></param>
  601. /// <param name="treeview"></param>
  602. private void GenerationColumn( string StrColumnText, string StrColumnName, string StrColumnType, LYFZ.ComponentLibrary.TreeViewEx treeview )
  603. {
  604. #region 创建列
  605. string[] ColumnText = StrColumnText.Split( '|' );
  606. string[] ColumnName = StrColumnName.Split( '|' );
  607. string[] ColumnType = StrColumnType.Split( '|' );
  608. int A = ColumnText.Length;
  609. int B = ColumnName.Length;
  610. int C = ColumnType.Length;
  611. System.Windows.Forms.TreeNode root = new System.Windows.Forms.TreeNode();
  612. root.Text = ColumnText[0].Trim();
  613. root.Tag = ColumnType[0].Trim();
  614. root.Name = ColumnName[0].Trim();
  615. for ( int i = 1; i < ColumnText.Length; i++ )
  616. {
  617. System.Windows.Forms.TreeNode node = new System.Windows.Forms.TreeNode();
  618. node.Text = ColumnText[i].Trim();
  619. node.Tag = ColumnType[i].Trim();
  620. node.Name = ColumnName[i].Trim();
  621. root.Nodes.Add( node );
  622. }
  623. treeview.Nodes.Add( root );
  624. #endregion
  625. }
  626. }
  627. /// <summary>
  628. /// 固定格式类
  629. /// </summary>
  630. public class ReportFixedFormat
  631. {
  632. static LYFZ.BLL.BLL_ErpOrder orbll = new BLL.BLL_ErpOrder();
  633. static LYFZ.BLL.BLL_ErpPrinterSetNow pstnbll = new BLL.BLL_ErpPrinterSetNow();
  634. static LYFZ.BLL.BLL_ErpPrinterTemplateSet ptstbll = new BLL.BLL_ErpPrinterTemplateSet();
  635. public ReportFixedFormat()
  636. {
  637. }
  638. #region 调用事件
  639. /// <summary>
  640. /// 调用事件
  641. /// </summary>
  642. /// <param name="EnumType">打印类型</param>
  643. /// <param name="ObjValue">Obj值</param>
  644. /// <param name="EnumPrintType">打印机类型</param>
  645. public static void PrintFixedFormat( LYFZ.EnumPublic.PrintTypeEnum EnumType, object ObjValue, List<SetSmallForm.PrintPreviewSmallForm.ScenicSpot2> listScenicSpot = null, bool IsYuYueDan = true )
  646. {
  647. if (EnumType == EnumPublic.PrintTypeEnum.制作单明细)
  648. {
  649. if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintProductionList)
  650. {
  651. CameraControlBook.frmSelectProductionList frmSelectList = new CameraControlBook.frmSelectProductionList();
  652. frmSelectList.SelectPhoto= ((PhotoSelectSystem.EventSelectPhotoPrint)ObjValue);
  653. if (frmSelectList.SelectPhoto != null)
  654. {
  655. frmSelectList.OrderType = (LYFZ.EnumPublic.OrderType)Enum.Parse(typeof(LYFZ.EnumPublic.OrderType), frmSelectList.SelectPhoto.CurrentModel.Ord_Type);
  656. if (frmSelectList.OrderType == EnumPublic.OrderType.儿童订单)
  657. {
  658. if (frmSelectList.ShowDialog() != DialogResult.OK)
  659. {
  660. return;
  661. }
  662. }
  663. }
  664. else {
  665. MessageBoxCustom.Show("传入参数不正确");
  666. return;
  667. }
  668. }
  669. }
  670. try
  671. {
  672. LYFZ.Software.MainBusiness.ReportPrint.SetSmallForm.PrintPreviewSmallForm frm = new ReportPrint.SetSmallForm.PrintPreviewSmallForm();
  673. frm.EnumType = EnumType;
  674. frm.ObjValue = ObjValue;
  675. frm.listScenicSpot = listScenicSpot;
  676. frm.IsYuYueDan = IsYuYueDan;
  677. frm.WindowState = FormWindowState.Maximized;
  678. frm.ShowDialog();
  679. }
  680. catch (Exception ex){
  681. MessageBoxCustom.Show("打印预览时出错:"+ex.Message);
  682. }
  683. }
  684. /// <summary>
  685. /// 打印机设置匹配设置
  686. /// </summary>
  687. public static bool PrintInitialSetting()
  688. {
  689. string ExecuteSql = orbll.GetView_CustomReturnExecuteSql( "tb_ErpPrinterTemplateSet", StrWhere: "", ShowColumnName: "Count(ID) AS CountID" );
  690. ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql( "tb_ErpPrinterSetNow", StrWhere: "PrintSet_DividedShopNumber = '" + StrDividedShop + "'", ShowColumnName: "Count(ID) AS CountID" );
  691. DataSet dtSet = orbll.GetView_Custom( ExecuteSql );
  692. DataTable tbl = dtSet.Tables["ds"];
  693. DataTable tbl1 = dtSet.Tables["ds1"];
  694. if ( Convert.ToInt32( tbl.Rows[0]["CountID"] ) > Convert.ToInt32( tbl1.Rows[0]["CountID"] ) )
  695. {
  696. List<LYFZ.Model.Model_ErpPrinterTemplateSet> mlistSet = ptstbll.GetModelList( "" );
  697. List<LYFZ.Model.Model_ErpPrinterSetNow> mlistNow = pstnbll.GetModelList( "PrintSet_DividedShopNumber = '" + StrDividedShop + "'" );
  698. DateTime StrTime = SDateTime.Now;
  699. LYFZ.Model.Model_ErpPrinterSetNow model = null;
  700. List<LYFZ.Helper.CommandInfo> clist = new List<Helper.CommandInfo>();
  701. for ( int i = 0; i < mlistSet.Count; i++ )
  702. {
  703. bool isFind = false;
  704. for ( int j = 0; j < mlistNow.Count; j++ )
  705. {
  706. if ( mlistSet[i].TptSet_TemplateName == mlistNow[j].PrintSet_TemplateName )
  707. {
  708. isFind = true; break;
  709. }
  710. }
  711. if ( !isFind )
  712. {
  713. model = new Model.Model_ErpPrinterSetNow();
  714. model.PrintSet_DividedShopNumber = StrDividedShop;
  715. model.PrintSet_TemplateName = mlistSet[i].TptSet_TemplateName;
  716. model.PrintSet_PrintDefault = 0;
  717. model.PrintSet_MachineType = mlistSet[i].TptSet_MachineType;
  718. model.PrintSet_TemplateParentNumber = mlistSet[i].TptSet_TemplateParentNumber;
  719. model.PrintSet_PrintPath = "";
  720. model.PrintSet_PrintPathName = "";
  721. model.PrintSet_PrintSingleTitle = "";
  722. model.PrintSet_PrintSingleLOG = "";
  723. model.PrintSet_PrintOtherDataJson = "";
  724. model.PrintSet_CreateDatetime = StrTime;
  725. model.PrintSet_CreateName = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;
  726. clist.Add( pstnbll.GetAddCommandInfo( model ) );
  727. }
  728. }
  729. if ( clist.Count > 0 )
  730. {
  731. if ( LYFZ.BLL.BaseBllOperate.ExecuteSqlTran( clist ) <= 0 )
  732. {
  733. MessageBoxCustom.Show( "更新风格出错!" ); return false;
  734. }
  735. }
  736. }
  737. return true;
  738. }
  739. /// <summary>
  740. /// 产生随机数
  741. /// </summary>
  742. /// <returns></returns>
  743. private static string StrRandom( string OrdNumber )
  744. {
  745. bool IsAddRandom = LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintOrderNoSuffix;
  746. if ( IsAddRandom )
  747. {
  748. return OrdNumber + new Random().Next( 0, 9 ).ToString();
  749. }
  750. else { return OrdNumber; }
  751. }
  752. /// <summary>
  753. /// 判断是否为针式打印机
  754. /// </summary>
  755. /// <returns></returns>
  756. public static bool IsStylusPrinter( LYFZ.EnumPublic.PrinterPaperType PrinterType )
  757. {
  758. if ( PrinterType == LYFZ.EnumPublic.PrinterPaperType.针式纸 )
  759. {
  760. return true;
  761. }
  762. return false;
  763. }
  764. /// <summary>
  765. /// 是否横向打印
  766. /// </summary>
  767. /// <returns></returns>
  768. public static bool IsLandscapePrinter( string StrValue )
  769. {
  770. if ( StrValue == LYFZ.EnumPublic.PrintTypeEnum.库存采购单.ToString().Trim() ||
  771. StrValue == LYFZ.EnumPublic.PrintTypeEnum.库存采购验收单.ToString().Trim() )
  772. {
  773. return true;
  774. }
  775. return false;
  776. }
  777. /// <summary>
  778. /// 是否是小票打印
  779. /// </summary>
  780. /// <param name="StrName"></param>
  781. /// <returns></returns>
  782. public static bool IsSmallTicketPrinter( LYFZ.EnumPublic.PrinterPaperType PrinterType )
  783. {
  784. if ( PrinterType == LYFZ.EnumPublic.PrinterPaperType.小票纸 )
  785. return true;
  786. else
  787. return false;
  788. }
  789. /// <summary>
  790. /// 是否是A4打印
  791. /// </summary>
  792. /// <param name="StrName"></param>
  793. /// <returns></returns>
  794. public static bool IsA4Printer( LYFZ.EnumPublic.PrinterPaperType PrinterType )
  795. {
  796. if ( PrinterType == LYFZ.EnumPublic.PrinterPaperType.A4纸 )
  797. return true;
  798. else
  799. return false;
  800. }
  801. /// <summary>
  802. /// 是否是针式打印
  803. /// </summary>
  804. /// <param name="StrName"></param>
  805. /// <returns></returns>
  806. public static bool IsDotMatrixPrinter( LYFZ.EnumPublic.PrinterPaperType PrinterType )
  807. {
  808. if ( PrinterType == LYFZ.EnumPublic.PrinterPaperType.针式纸 )
  809. return true;
  810. else
  811. return false;
  812. }
  813. /// <summary>
  814. /// 打印时获取流水单号
  815. /// </summary>
  816. /// <returns></returns>
  817. static string PrintReceiptSerial()
  818. {
  819. DataTable dt = orbll.GetView_Custom( "tb_ErpSystemConfigure", StrWhere: "Sconfig_Code = 'PrintReceiptSerial'", ShowColumnName: "*" ).Tables[0];
  820. if ( dt.Rows.Count > 0 )
  821. {
  822. string SerialNo = (Convert.ToInt32( dt.Rows[0]["Sconfig_Value"] ) + 1).ToString( "d7" );
  823. LYFZ.BLL.BLL_ErpSystemConfigure sgbll = new BLL.BLL_ErpSystemConfigure();
  824. LYFZ.Model.Model_ErpSystemConfigure model = sgbll.DataRowToModel( dt.Rows[0] );
  825. model.Sconfig_Value = SerialNo;
  826. if ( sgbll.Update( model ) )
  827. {
  828. LYFZ.BLL.BLL_CurrentShopSetting cspsBll = new BLL.BLL_CurrentShopSetting( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.CurrentCompanyInfoID );
  829. return (string.IsNullOrEmpty( cspsBll.Model.PrintOrdersPaymentPrefixName.PrintOrderPaymentPrefix ) ? "" : cspsBll.Model.PrintOrdersPaymentPrefixName.PrintOrderPaymentPrefix) + SerialNo;
  830. }
  831. else
  832. {
  833. MessageBoxCustom.Show( "修改票据序号失败,打印失败!" ); return "";
  834. }
  835. }
  836. else
  837. {
  838. MessageBoxCustom.Show( "获取票据序号错误,打印失败!" ); return "";
  839. }
  840. }
  841. /// <summary>
  842. /// 打印时获取流水单号
  843. /// </summary>
  844. /// <returns></returns>
  845. static string PrintReceiptSerial( string companyCode )
  846. {
  847. DataTable dt = orbll.GetView_Custom( "tb_ErpSystemConfigure", StrWhere: "Sconfig_Code = 'PrintReceiptSerial_" + companyCode + "'", ShowColumnName: "*" ).Tables[0];
  848. if ( dt.Rows.Count > 0 )
  849. {
  850. LYFZ.BLL.BLL_CurrentShopSetting cspsBll = new BLL.BLL_CurrentShopSetting( companyCode );
  851. string SerialNo = string.Format( "{0:0000000}", Convert.ToInt32( dt.Rows[0]["Sconfig_Value"] ) + 1 );
  852. LYFZ.BLL.BLL_ErpSystemConfigure sgbll = new BLL.BLL_ErpSystemConfigure();
  853. LYFZ.Model.Model_ErpSystemConfigure model = sgbll.DataRowToModel( dt.Rows[0] );
  854. model.Sconfig_Value = SerialNo;
  855. if ( sgbll.Update( model ) )
  856. {
  857. return (string.IsNullOrEmpty( cspsBll.Model.PrintOrdersPaymentPrefixName.PrintOrderPaymentPrefix ) ? "" : cspsBll.Model.PrintOrdersPaymentPrefixName.PrintOrderPaymentPrefix) + SerialNo;
  858. }
  859. else
  860. {
  861. MessageBoxCustom.Show( "修改票据序号失败,打印失败!" ); return "";
  862. }
  863. }
  864. else
  865. {
  866. MessageBoxCustom.Show( "获取票据序号错误,打印失败!" ); return "";
  867. }
  868. }
  869. /// <summary>
  870. /// 获取画笔粗细度_针式纸
  871. /// </summary>
  872. static Pen GetPen
  873. {
  874. get
  875. {
  876. return new Pen( Brushes.Black, 1 );
  877. }
  878. }
  879. /// <summary>
  880. /// 当前本地接单点ID
  881. /// </summary>
  882. static string StrDividedShop
  883. {
  884. get
  885. {
  886. return LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID();
  887. }
  888. }
  889. /// <summary>
  890. /// 小票打印时要打印几份
  891. /// </summary>
  892. public static int PrintPageCount
  893. {
  894. get
  895. {
  896. int PageCount = LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.TicketPrintingNumber;
  897. if ( PageCount < 1 )
  898. {
  899. PageCount = 1;
  900. }
  901. else if ( PageCount > 3 )
  902. {
  903. PageCount = 3;
  904. }
  905. return PageCount;
  906. }
  907. }
  908. private static string _defaultPrintTitle = "";
  909. /// <summary>
  910. /// 默认打印标题
  911. /// </summary>
  912. public static string DefaultPrintTitle
  913. {
  914. set
  915. {
  916. _defaultPrintTitle = value;
  917. }
  918. get
  919. {
  920. return _defaultPrintTitle;
  921. }
  922. }
  923. private static Hashtable _printOtherData = new Hashtable();
  924. /// <summary>
  925. /// 打印设置的其他数据
  926. /// 参数所有Key分别有:预约单注意事项说明、制作单说明、礼服单说明、收款单说明、预约LOG
  927. /// </summary>
  928. public static Hashtable PrintOtherData
  929. {
  930. set
  931. {
  932. _printOtherData = value;
  933. }
  934. get
  935. {
  936. return _printOtherData;
  937. }
  938. }
  939. private static int _printForCount = 0;
  940. /// <summary>
  941. /// 打印分多页里,记录循环到的行数
  942. /// </summary>
  943. public static int PrintForCount
  944. {
  945. set
  946. {
  947. _printForCount = value;
  948. }
  949. get
  950. {
  951. return _printForCount;
  952. }
  953. }
  954. private static int _printCurrentIndexPage = 1;
  955. /// <summary>
  956. /// 当前打印到第几页
  957. /// </summary>
  958. public static int PrintCurrentIndexPage
  959. {
  960. set
  961. {
  962. _printCurrentIndexPage = value;
  963. }
  964. get
  965. {
  966. return _printCurrentIndexPage;
  967. }
  968. }
  969. private static bool _isHasMorePages = false;
  970. /// <summary>
  971. /// 打印时,是否要附加下一页(意指是否要打下一页)
  972. /// </summary>
  973. public static bool IsHasMorePages
  974. {
  975. set
  976. {
  977. _isHasMorePages = value;
  978. }
  979. get
  980. {
  981. return _isHasMorePages;
  982. }
  983. }
  984. /// <summary>
  985. /// 遍历打印其他设置的Value
  986. /// </summary>
  987. /// <param name="StrPrintOtherDataJson">其他设置Json串</param>
  988. /// <param name="StrPrintOtherDataJson">要查找的Key</param>
  989. /// <returns></returns>
  990. public static string StrPrintOtherDataJson_Traverse_ArrayList( string StrPrintOtherDataJson, string StrKey )
  991. {
  992. string StrReturnValue = "";
  993. if ( StrPrintOtherDataJson != "" )
  994. {
  995. if ( StrPrintOtherDataJson.Trim().IndexOf( StrKey ) != -1 )
  996. {
  997. string[] strArray = StrPrintOtherDataJson.Trim().Split( '∥' );
  998. for ( int i = 0; i < strArray.Length; i++ )
  999. {
  1000. if ( strArray[i].Trim() != "" )
  1001. {
  1002. if ( strArray[i].Trim().Split( '‖' )[0].Trim() == StrKey )
  1003. {
  1004. StrReturnValue = strArray[i].Trim().Split( '‖' )[1].Trim();
  1005. }
  1006. }
  1007. }
  1008. }
  1009. }
  1010. return StrReturnValue;
  1011. }
  1012. #endregion
  1013. #region 收款打印
  1014. #region 订单收款
  1015. /// <summary>
  1016. /// 订单收款
  1017. /// </summary>
  1018. /// <param name="panl"></param>
  1019. public static void FixedFormat_OrderPayment_Print( object objValue, Graphics g, Size size, bool IsPrintSerialNo )
  1020. {
  1021. Hashtable htData = (Hashtable)objValue;
  1022. DataGridViewEx dgvData = (DataGridViewEx)htData["dgvData"];
  1023. string strNumber = htData["strNumber"].ToString().Trim();
  1024. BLL.BLL_ErpMemberCard bllMember = new BLL.BLL_ErpMemberCard();
  1025. List<string> usNumber = new List<string>();
  1026. for ( int i = 0; i < dgvData.SelectedRows.Count; i++ )
  1027. {
  1028. DataRow dr = dgvData.SelectedRows[i].Tag as DataRow;
  1029. if ( dr != null )
  1030. {
  1031. if ( !string.IsNullOrEmpty( Convert.ToString( dr["Pay_McNumber"] ) ) )
  1032. {
  1033. usNumber.Add( Convert.ToString( dr["Pay_McNumber"] ) );
  1034. }
  1035. }
  1036. }
  1037. string memberDisInfo = "";
  1038. DataTable tableMember = bllMember.GetList( " Mc_Number in ('" + string.Join( "','", usNumber.ToArray() ) + "') " ).Tables[0];
  1039. for ( int i = 0; i < tableMember.Rows.Count; i++ )
  1040. {
  1041. if ( LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.MemberBalance )
  1042. {
  1043. memberDisInfo += "[会员卡" + tableMember.Rows[i]["MC_CradNumber"] + " 的余额:" + tableMember.Rows[i]["mc_money"] + "]";
  1044. }
  1045. }
  1046. List<Image> imglist = new List<Image>();
  1047. string ExecuteSql = orbll.GetView_CustomReturnExecuteSql( "tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Address,Company_Telephone,Company_UpdateDatetime" );
  1048. 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 主客户电话," +
  1049. "(select top 1 OrdPe_OrdersPerson from tb_ErpOrdersPerson where OrdPe_OrderNumber = Ord_Number And OrdPe_Type = 0) AS 门市编号";
  1050. ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql( "tb_ErpOrder left join tempTB_AggregationCustomer on tb_ErpOrder.Ord_Number = GP_OrderNumber", StrWhere: "Ord_Number = '" + strNumber + "'", ShowColumnName: StrColumnName );
  1051. 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" );
  1052. DataSet dtSet = orbll.GetView_Custom( ExecuteSql );
  1053. DataTable tbl = dtSet.Tables["ds"];//获取影楼信息
  1054. DataTable tbl2 = dtSet.Tables["ds1"];//订单
  1055. DataTable tbl3 = dtSet.Tables["ds2"];//打印设置
  1056. DataTable dt = new DataTable();
  1057. if ( !string.IsNullOrEmpty( tbl2.Rows[0]["门市编号"].ToString().Trim() ) )
  1058. {
  1059. dt = orbll.GetView_Custom( "tb_ErpUser", StrWhere: "User_EmployeeID = '" + tbl2.Rows[0]["门市编号"].ToString().Trim() + "'", ShowColumnName: "User_Name,User_Telephone,User_PhonePrint" ).Tables[0];
  1060. }
  1061. Brush b = Brushes.Black;
  1062. Pen p = GetPen;
  1063. Font ft16 = new Font( "宋体", 16 );
  1064. Font ft11 = new Font( "宋体", 10 );
  1065. Font ft10 = new Font( "宋体", 9 );
  1066. Font ft9 = new Font( "宋体", 9 );
  1067. #region 二维码
  1068. Image img = CachePhoto( PhotoLogType.DimensionalCode, tbl.Rows[0]["Company_UpdateDatetime"] );
  1069. Rectangle rec1 = new Rectangle( 50, 25, 90, 90 );
  1070. if ( img != null )
  1071. {
  1072. g.DrawImage( img, rec1 );
  1073. }
  1074. #endregion
  1075. int TableWidth = size.Width - rec1.X * 2;
  1076. #region 金色童年收据凭据
  1077. SizeF sizef = g.MeasureString( DefaultPrintTitle, ft16 );
  1078. int FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  1079. int FtHeight = Convert.ToInt32( sizef.Height );
  1080. Rectangle rec2 = new Rectangle( (size.Width / 2) - (FtWidth / 2), 30, FtWidth + 5, FtHeight );
  1081. g.DrawString( DefaultPrintTitle, ft16, b, rec2 );
  1082. #endregion
  1083. #region NO.
  1084. string rec3Value = "NO." + StrRandom( tbl2.Rows[0]["订单号"].ToString().Trim() );
  1085. sizef = g.MeasureString( rec3Value, ft11 );
  1086. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  1087. FtHeight = Convert.ToInt32( sizef.Height );
  1088. Rectangle rec3 = new Rectangle( size.Width - rec1.X - FtWidth, rec2.Y + 35, FtWidth, FtHeight );
  1089. g.DrawString( rec3Value, ft11, b, rec3 );
  1090. //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));
  1091. if (IsPrintSerialNo)
  1092. {
  1093. string strPrintNumber = "";
  1094. for (int i = 0; i < dgvData.SelectedRows.Count; i++)
  1095. {
  1096. if (string.IsNullOrEmpty(strPrintNumber))
  1097. {
  1098. strPrintNumber += ",";
  1099. }
  1100. strPrintNumber += dgvData.SelectedRows[i].Cells[0].Value.ToString_s();
  1101. }
  1102. strPrintNumber = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.CurrentCompanyInfoID + strNumber + strPrintNumber;
  1103. #region 记录打印流水号
  1104. BLL.BLL_ErpSystemConfigure _ErpSystemConfigure = new BLL.BLL_ErpSystemConfigure();
  1105. Model.Model_ErpSystemConfigure model_ErpConfigure = new Model.Model_ErpSystemConfigure();
  1106. if (_ErpSystemConfigure.Exists("Sconfig_Code", "PrintSerialNoLogs"))
  1107. {
  1108. model_ErpConfigure = _ErpSystemConfigure.GetModel("PrintSerialNoLogs");
  1109. }
  1110. string allText = model_ErpConfigure.Sconfig_Value;
  1111. bool bCheck = false;
  1112. string SerialNo = "";
  1113. try
  1114. {
  1115. string[] tempStrs = allText.Split('\t');
  1116. if (tempStrs.Length == 2)
  1117. {
  1118. if (tempStrs[0].ToLower() == strPrintNumber.ToLower())
  1119. {
  1120. if (tempStrs[1].IndexOf("\r") == -1&& tempStrs[1].IndexOf("\n") == -1)
  1121. {
  1122. SerialNo = tempStrs[1];
  1123. if (!string.IsNullOrEmpty(SerialNo))
  1124. {
  1125. bCheck = true;
  1126. }
  1127. }
  1128. }
  1129. }
  1130. }
  1131. catch { }
  1132. #endregion
  1133. if ( !bCheck )
  1134. {
  1135. SerialNo = PrintReceiptSerial();
  1136. if ( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition )
  1137. {
  1138. SerialNo = PrintReceiptSerial( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.CurrentCompanyInfoID );
  1139. }
  1140. strPrintNumber = strPrintNumber + "\t" + SerialNo;
  1141. if ( !_ErpSystemConfigure.Exists( "Sconfig_Code", "PrintSerialNoLogs" ) )
  1142. {
  1143. Model.Model_ErpSystemConfigure model_ErpSystem = new Model.Model_ErpSystemConfigure()
  1144. {
  1145. Sconfig_Code = "PrintSerialNoLogs",
  1146. Sconfig_Name = "订单打印流水记录",
  1147. Sconfig_CreateDatetime = DateTime.Now
  1148. };
  1149. _ErpSystemConfigure.Add( model_ErpSystem );
  1150. }
  1151. model_ErpConfigure = _ErpSystemConfigure.GetModel( "PrintSerialNoLogs" );
  1152. model_ErpConfigure.Sconfig_Value = strPrintNumber; //+ "\r\n" + model_ErpConfigure.Sconfig_Value;
  1153. _ErpSystemConfigure.Update( model_ErpConfigure );
  1154. }
  1155. if ( string.IsNullOrEmpty( SerialNo ) )
  1156. {
  1157. MessageBoxCustom.Show( "获取流水单号失败!" ); return;
  1158. }
  1159. rec3Value = "SerialNo." + SerialNo;
  1160. sizef = g.MeasureString( rec3Value, ft11 );
  1161. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  1162. FtHeight = Convert.ToInt32( sizef.Height );
  1163. Rectangle rec3A = new Rectangle( size.Width - rec1.X - FtWidth, rec3.Y - FtHeight + 2, FtWidth, FtHeight );
  1164. g.DrawString( rec3Value, ft11, b, rec3A );
  1165. }
  1166. #endregion
  1167. #region 地址
  1168. string StrAddress = LYFZ.BLL.OtherCommonModel.FontConversion( "地址:" ) + tbl.Rows[0]["Company_Address"].ToString().Trim();
  1169. sizef = g.MeasureString( StrAddress, ft10 );
  1170. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  1171. FtHeight = Convert.ToInt32( sizef.Height );
  1172. Rectangle rec4 = new Rectangle( rec1.X + rec1.Width - 5, rec3.Y + rec3.Height + FtHeight - 15, TableWidth - rec1.Width + 14, FtHeight );
  1173. g.DrawString( StrAddress, ft10, b, rec4 );
  1174. 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));
  1175. string StrTelephone = LYFZ.BLL.OtherCommonModel.FontConversion( "电话:" ) + tbl.Rows[0]["Company_Telephone"].ToString().Trim();
  1176. if ( dt.Rows.Count > 0 )
  1177. {
  1178. if ( !Convert.ToBoolean( dt.Rows[0]["User_PhonePrint"].ToString() ) )
  1179. StrTelephone += " 门市:" + dt.Rows[0]["User_Name"].ToString().Trim() + "[" + tbl.Rows[0]["Company_Telephone"].ToString().Trim() + "]";
  1180. else
  1181. StrTelephone += " 门市:" + dt.Rows[0]["User_Name"].ToString().Trim() + "[" + dt.Rows[0]["User_Telephone"].ToString().Trim() + "]";
  1182. }
  1183. Rectangle rec4A = new Rectangle( rec4.X, rec4.Y + rec4.Height - FtHeight * 2 + 2, TableWidth - rec1.Width - 10, FtHeight );
  1184. g.DrawString( StrTelephone, ft10, b, rec4A );
  1185. #endregion
  1186. #region 客户姓名
  1187. string StrName = tbl2.Rows[0]["主客户姓名"].ToString().Trim();
  1188. string StrPhone = tbl2.Rows[0]["主客户电话"].ToString().Trim();
  1189. if ( tbl2.Rows[0]["Ord_Type"].ToString().Trim() != "2" )
  1190. {
  1191. StrName = tbl2.Rows[0]["客户姓名"].ToString().Trim();
  1192. StrPhone = tbl2.Rows[0]["客户电话"].ToString().Trim();
  1193. }
  1194. StrName = LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名:" ) + StrName + " " + LYFZ.BLL.OtherCommonModel.FontConversion( "联系电话:" ) + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( StrPhone );
  1195. sizef = g.MeasureString( StrName, ft10 );
  1196. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  1197. FtHeight = Convert.ToInt32( sizef.Height );
  1198. Rectangle rec6 = new Rectangle( rec4.X, rec4.Y + rec4.Height - 2, FtWidth, FtHeight );
  1199. g.DrawString( StrName, ft10, b, rec6 );
  1200. #endregion
  1201. #region 日期
  1202. string StrDate = LYFZ.BLL.OtherCommonModel.FontConversion( "打印日期:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy年MM月dd日" );
  1203. sizef = g.MeasureString( StrDate, ft10 );
  1204. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  1205. FtHeight = Convert.ToInt32( sizef.Height );
  1206. Rectangle rec8 = new Rectangle( TableWidth + rec1.X - FtWidth + 14, rec6.Y, FtWidth, FtHeight );
  1207. g.DrawString( StrDate, ft10, b, rec8 );
  1208. #endregion
  1209. int AddLeft = 3;
  1210. int AddTop2 = 6;
  1211. int AddTop = 6;
  1212. int RowHeight = 26;
  1213. int RowContentHeight = 16;
  1214. int ColumnWidth2 = 90;
  1215. int ColumnWidth3 = 70;
  1216. int ColumnWidth4 = 90;
  1217. int ColumnWidth5 = 60;
  1218. int ColumnWidth6 = 75;
  1219. int ColumnWidth1 = TableWidth - ColumnWidth5 - ColumnWidth2 - ColumnWidth3 - ColumnWidth4 - ColumnWidth6;
  1220. Rectangle rec9 = new Rectangle( rec1.X + 7, rec6.Y + rec6.Height + 1, TableWidth, RowHeight );
  1221. g.DrawRectangle( p, rec9 );//画标题矩形
  1222. #region 收款项目
  1223. string StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "收款项目" );
  1224. sizef = g.MeasureString( StrValue, ft10 );
  1225. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  1226. Rectangle rec9_1 = new Rectangle( rec9.X + (ColumnWidth1 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth1, RowContentHeight );
  1227. g.DrawString( StrValue, ft11, b, rec9_1 );//画第一列的列标题
  1228. Point p1_1 = new Point( rec9.X + ColumnWidth1, rec9.Y );
  1229. Point p1_2 = new Point( rec9.X + ColumnWidth1, rec9.Y + rec9.Height );
  1230. g.DrawLine( p, p1_1, p1_2 );//画第一表与第二列的界线
  1231. #endregion
  1232. #region 支付方式
  1233. Rectangle rec9_2 = new Rectangle( p1_1.X + (ColumnWidth2 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth2, RowContentHeight );
  1234. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "支付方式" ), ft11, b, rec9_2 );//画第二列的列标题
  1235. Point p2_1 = new Point( p1_1.X + ColumnWidth2, rec9.Y );
  1236. Point p2_2 = new Point( p1_1.X + ColumnWidth2, rec9.Y + rec9.Height );
  1237. g.DrawLine( p, p2_1, p2_2 );//画第二表与第三列的界线
  1238. #endregion
  1239. #region 金 额
  1240. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "金 额" );
  1241. sizef = g.MeasureString( StrValue, ft10 );
  1242. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  1243. Rectangle rec9_3 = new Rectangle( p2_1.X + (ColumnWidth3 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth3, RowContentHeight );
  1244. g.DrawString( StrValue, ft11, b, rec9_3 );//画第三列的列标题
  1245. Point p3_1 = new Point( p2_1.X + ColumnWidth3, rec9.Y );
  1246. Point p3_2 = new Point( p2_1.X + ColumnWidth3, rec9.Y + rec9.Height );
  1247. g.DrawLine( p, p3_1, p3_2 );//画第三表与第四列的界线
  1248. #endregion
  1249. #region 接单人
  1250. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "接单人" );
  1251. sizef = g.MeasureString( StrValue, ft10 );
  1252. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  1253. Rectangle rec9_4 = new Rectangle( p3_1.X + (ColumnWidth4 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth4, RowContentHeight );
  1254. g.DrawString( StrValue, ft11, b, rec9_4 );//画第四列的列标题
  1255. Point p4_1 = new Point( p3_1.X + ColumnWidth4, rec9.Y );
  1256. Point p4_2 = new Point( p3_1.X + ColumnWidth4, rec9.Y + rec9.Height );
  1257. g.DrawLine( p, p4_1, p4_2 );//画第四表与第五列的界线
  1258. #endregion
  1259. #region 收 银
  1260. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "收 银" );
  1261. sizef = g.MeasureString( StrValue, ft10 );
  1262. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  1263. Rectangle rec9_5 = new Rectangle( p4_1.X + (ColumnWidth5 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth5, RowContentHeight );
  1264. g.DrawString( StrValue, ft11, b, rec9_5 );//画第五列的列标题
  1265. Point p5_1 = new Point( p4_1.X + ColumnWidth5, rec9.Y );
  1266. Point p5_2 = new Point( p4_1.X + ColumnWidth5, rec9.Y + rec9.Height );
  1267. g.DrawLine( p, p5_1, p5_2 );//画第四表与第五列的界线
  1268. #endregion
  1269. #region 收款日期
  1270. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "付款日期" );
  1271. sizef = g.MeasureString( StrValue, ft10 );
  1272. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  1273. Rectangle rec9_6 = new Rectangle( p5_1.X + (ColumnWidth6 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth6, RowContentHeight );
  1274. g.DrawString( StrValue, ft11, b, rec9_6 );//画第五列的列标题
  1275. #endregion
  1276. int IntPoint_X = rec9.X;
  1277. int IntPoint_Y = rec9.Y + rec9.Height;
  1278. decimal ActualAmount = 0;//实付金额
  1279. decimal ActualOrd_Amount = 0;//实付订单金额
  1280. decimal Actualsale_Amount = 0;//实付二销金额
  1281. #region 画列表每行
  1282. int ForCount = 0;
  1283. string strRemark = "";
  1284. int PageRows = 3;//每页多少行
  1285. decimal DiscountAmount = 0;
  1286. for ( int i = 0; i < PageRows; i++ )
  1287. {
  1288. string recfor_1Value = "";
  1289. string recfor_2Value = "";
  1290. string recfor_3Value = "";
  1291. string recfor_4Value = "";
  1292. string recfor_5Value = "";
  1293. string recfor_6Value = "";
  1294. if ( ForCount < dgvData.SelectedRows.Count )
  1295. {
  1296. if ( !string.IsNullOrEmpty( dgvData.SelectedRows[ForCount].Cells["DiscountAmount"].Value.ToString().Trim() ) )
  1297. {
  1298. if ( Convert.ToDecimal( dgvData.SelectedRows[ForCount].Cells["DiscountAmount"].Value ) > 0 )
  1299. {
  1300. DiscountAmount += Convert.ToDecimal( dgvData.SelectedRows[ForCount].Cells["DiscountAmount"].Value );
  1301. }
  1302. }
  1303. 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();//收款项目
  1304. if ( recfor_1Value == "预约收款" )
  1305. {
  1306. string StrTextValue = StrPrintOtherDataJson_Traverse_ArrayList( tbl3.Rows[0]["PrintSet_PrintOtherDataJson"].ToString().Trim(), "预约收款显示名称" );
  1307. if ( !string.IsNullOrEmpty( StrTextValue ) )
  1308. {
  1309. recfor_1Value = StrTextValue;
  1310. }
  1311. }
  1312. recfor_2Value = dgvData.SelectedRows[ForCount].Cells["Pay_PaymentMethod"].Value.ToString().Trim();
  1313. recfor_3Value = dgvData.SelectedRows[ForCount].Cells["Pay_AmountOf"].Value.ToString().Trim();
  1314. recfor_4Value = dgvData.SelectedRows[ForCount].Cells["Pay_OpenSingle"].Value.ToString().Trim();
  1315. recfor_5Value = dgvData.SelectedRows[ForCount].Cells["Pay_ThePayee"].Value.ToString().Trim();
  1316. recfor_6Value = LYFZ.Command.Command_Validate.DateTimeToString( dgvData.SelectedRows[ForCount].Cells["Pay_CreateDatetime"].Value );
  1317. if ( dgvData.SelectedRows[ForCount].Cells["Pay_Remark"].Value != null )
  1318. {
  1319. strRemark += dgvData.SelectedRows[ForCount].Cells["Pay_Remark"].Value.ToString().Trim() + ";";
  1320. }
  1321. if ( recfor_1Value.Trim() == LYFZ.EnumPublic.PaymentCategoryEnum.全款.ToString() || recfor_1Value.Trim() == LYFZ.EnumPublic.PaymentCategoryEnum.后期收款.ToString() ||
  1322. recfor_1Value.Trim() == LYFZ.EnumPublic.PaymentCategoryEnum.预约补款.ToString() || recfor_1Value.Trim() == LYFZ.EnumPublic.PaymentCategoryEnum.预约收款.ToString() )
  1323. {
  1324. ActualOrd_Amount += Convert.ToDecimal( dgvData.SelectedRows[ForCount].Cells["Pay_AmountOf"].Value );
  1325. }
  1326. else
  1327. {
  1328. Actualsale_Amount += Convert.ToDecimal( dgvData.SelectedRows[ForCount].Cells["Pay_AmountOf"].Value );
  1329. }
  1330. ForCount++;
  1331. }
  1332. int forHeightCount = RowHeight;
  1333. if ( Convert.ToInt32( g.MeasureString( recfor_1Value, ft10, ColumnWidth1 ).Height ) > Convert.ToInt32( g.MeasureString( "项目", ft10, ColumnWidth1 ).Height ) )
  1334. {
  1335. if ( i < PageRows )
  1336. {
  1337. forHeightCount = RowContentHeight * 2 + 7;
  1338. i++;
  1339. }
  1340. }
  1341. Rectangle recfor = new Rectangle( IntPoint_X, IntPoint_Y, TableWidth, forHeightCount );
  1342. g.DrawRectangle( p, recfor );//画标题矩形
  1343. Rectangle recfor_1 = new Rectangle( recfor.X + AddLeft, recfor.Y + AddTop, ColumnWidth1, recfor.Height - AddTop * 2 );
  1344. g.DrawString( recfor_1Value, ft10, b, recfor_1 );//画第一列的列标题
  1345. Point pfor1_1 = new Point( recfor_1.X + ColumnWidth1 - 3, recfor.Y );
  1346. Point pfor1_2 = new Point( recfor_1.X + ColumnWidth1 - 3, recfor.Y + recfor.Height );
  1347. g.DrawLine( p, pfor1_1, pfor1_2 );//画第一表与第二列的界线
  1348. Rectangle recfor_2 = new Rectangle( pfor1_1.X + AddLeft, recfor_1.Y, ColumnWidth2, recfor_1.Height );
  1349. g.DrawString( recfor_2Value, ft10, b, recfor_2 );//画第二列的列标题
  1350. Point pfor2_1 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y );
  1351. Point pfor2_2 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y + recfor.Height );
  1352. g.DrawLine( p, pfor2_1, pfor2_2 );//画第二表与第三列的界线
  1353. StrValue = recfor_3Value;
  1354. sizef = g.MeasureString( StrValue, ft10 );
  1355. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  1356. Rectangle recfor_3 = new Rectangle( pfor2_1.X + ColumnWidth3 - FtWidth - AddLeft * 2, recfor_1.Y, ColumnWidth3, recfor_1.Height );
  1357. g.DrawString( StrValue, ft10, b, recfor_3 );//画第三列的列标题
  1358. Point pfor3_1 = new Point( pfor2_1.X + ColumnWidth3, recfor.Y );
  1359. Point pfor3_2 = new Point( pfor2_1.X + ColumnWidth3, recfor.Y + recfor.Height );
  1360. g.DrawLine( p, pfor3_1, pfor3_2 );//画第三表与第四列的界线
  1361. Rectangle recfor_4 = new Rectangle( pfor3_1.X + AddLeft, recfor_1.Y, ColumnWidth4, recfor_1.Height );
  1362. g.DrawString( recfor_4Value, ft10, b, recfor_4 );//画第四列的列标题
  1363. Point pfor4_1 = new Point( pfor3_1.X + ColumnWidth4, recfor.Y );
  1364. Point pfor4_2 = new Point( pfor3_1.X + ColumnWidth4, recfor.Y + recfor.Height );
  1365. g.DrawLine( p, pfor4_1, pfor4_2 );//画第四表与第五列的界线
  1366. Rectangle recfor_5 = new Rectangle( pfor4_1.X + AddLeft, recfor_1.Y, ColumnWidth5, recfor_1.Height );
  1367. g.DrawString( recfor_5Value, ft10, b, recfor_5 );//画第五列的列标题
  1368. Point pfor5_1 = new Point( pfor4_1.X + ColumnWidth5, recfor.Y );
  1369. Point pfor5_2 = new Point( pfor4_1.X + ColumnWidth5, recfor.Y + recfor.Height );
  1370. g.DrawLine( p, pfor5_1, pfor5_2 );//画第四表与第五列的界线
  1371. Rectangle recfor_6 = new Rectangle( pfor5_1.X + AddLeft, recfor_1.Y, ColumnWidth6, recfor_1.Height );
  1372. g.DrawString( recfor_6Value, ft10, b, recfor_6 );//画第五列的列标题
  1373. IntPoint_X = recfor.X;
  1374. IntPoint_Y = recfor.Y + recfor.Height;
  1375. }
  1376. #endregion
  1377. ActualAmount = (ActualOrd_Amount + Actualsale_Amount);
  1378. Rectangle rec9_A = new Rectangle( rec9.X, IntPoint_Y, TableWidth, RowHeight );
  1379. g.DrawRectangle( p, rec9_A );//画标题矩形
  1380. sizef = g.MeasureString( "说 明:", ft11 );
  1381. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  1382. Rectangle rec9_A1 = new Rectangle( rec9.X + AddLeft, rec9_A.Y + AddTop2, FtWidth, RowContentHeight );
  1383. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "说 明:" ), ft11, b, rec9_A1 );//画第三列的列标题
  1384. Rectangle rec9_A2 = new Rectangle( rec9_A1.Location.X + FtWidth, rec9_A1.Location.Y, rec9_A1.Width - FtWidth, rec9_A1.Height );
  1385. g.DrawString( strRemark.TrimEnd( ';' ) + memberDisInfo, ft10, b, rec9_A2 );//画第三列的列标题
  1386. Rectangle rec10 = new Rectangle( rec9.X, rec9_A.Y + rec9_A.Height, TableWidth, RowHeight );
  1387. g.DrawRectangle( p, rec10 );//画标题矩形
  1388. #region 付款情况
  1389. string rec10_1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "付款情况" );
  1390. sizef = g.MeasureString( rec10_1Value, ft11 );
  1391. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  1392. FtHeight = Convert.ToInt32( sizef.Height );
  1393. Rectangle rec10_1 = new Rectangle( rec10.X + AddLeft, rec10.Y + AddTop2, FtWidth, RowContentHeight );
  1394. g.DrawString( rec10_1Value, ft11, b, rec10_1 );//付款情况
  1395. #endregion
  1396. #region 应付
  1397. int FocCount = 4;
  1398. if ( DiscountAmount > 0 )
  1399. {
  1400. FocCount = 5;
  1401. }
  1402. Rectangle rec10_2 = new Rectangle( rec10_1.X + (TableWidth / FocCount), rec10.Y + AddTop2, TableWidth / FocCount, RowContentHeight );
  1403. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "应付:" ) + htData["CopeAmount"].ToString().Trim(), ft11, b, rec10_2 );//应付
  1404. #endregion
  1405. #region 实付
  1406. Rectangle rec10_3 = new Rectangle( rec10_2.X + (TableWidth / FocCount), rec10.Y + AddTop2, TableWidth / FocCount, RowContentHeight );
  1407. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "实付:" ) + (ActualAmount - DiscountAmount).ToString(), ft11, b, rec10_3 );//实付
  1408. #endregion
  1409. #region 欠款
  1410. Rectangle rec10_4 = new Rectangle( rec10_3.X + (TableWidth / FocCount), rec10.Y + AddTop2, TableWidth / FocCount, RowContentHeight );
  1411. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "欠款:" ) + htData["Arrear"].ToString().Trim(), ft11, b, rec10_4 );//欠款
  1412. #endregion
  1413. #region 优惠
  1414. if ( DiscountAmount > 0 )
  1415. {
  1416. Rectangle rec10_5 = new Rectangle( rec10_4.X + (TableWidth / FocCount), rec10.Y + AddTop2, TableWidth / FocCount, RowContentHeight );
  1417. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "优惠:" ) + DiscountAmount, ft11, b, rec10_5 );//欠款
  1418. }
  1419. #endregion
  1420. Rectangle rec11 = new Rectangle( rec10.X, rec10.Y + rec10.Height, TableWidth, RowHeight );
  1421. g.DrawRectangle( p, rec11 );//画标题矩形
  1422. #region 合计
  1423. Rectangle rec11_1 = new Rectangle( rec11.X + AddLeft, rec11.Y + AddTop2, TableWidth - 300, RowContentHeight );
  1424. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "合计人民币(大写):" ) + " " + LYFZ.Software.MainBusiness.ReportPrint.ReportPrintDataClass.ConversionAmount( ActualAmount.ToString() ), ft11, b, rec11_1 );//合计人民币
  1425. #endregion
  1426. #region 顾客签字
  1427. Rectangle rec11_2 = new Rectangle( rec11_1.X + rec11_1.Width + 100, rec11_1.Y, 300, RowContentHeight );
  1428. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "顾客签字:" ), ft11, b, rec11_2 );//画消费法规
  1429. #endregion
  1430. #region 说明
  1431. Rectangle rec12 = new Rectangle( rec11.X, rec11.Y + rec11.Height + 3, rec9.Width, Convert.ToInt32( g.MeasureString( "说明", ft9 ).Height ) + 1 );
  1432. string PaymentExplain = "";
  1433. if ( PrintOtherData.ContainsKey( "收款单说明" ) && PrintOtherData["收款单说明"].ToString().Trim().Length > 0 )
  1434. {
  1435. PaymentExplain = PrintOtherData["收款单说明"].ToString().Trim();
  1436. }
  1437. g.DrawString( PaymentExplain, ft9, b, rec12 );//画消费法规
  1438. #endregion
  1439. }
  1440. #endregion
  1441. #region 散客消费
  1442. /// <summary>
  1443. /// 其他二销
  1444. /// </summary>
  1445. /// <param name="panl"></param>
  1446. public static void PaymentPrint_OtherConsumption_Print( object objValue, Graphics g, Size size, bool IsPrintSerialNo )
  1447. {
  1448. Hashtable htData = (Hashtable)objValue;
  1449. DataGridViewEx dgvData = (DataGridViewEx)htData["dgvData"];
  1450. string strText = htData["strText"].ToString().Trim();
  1451. string[] ObjStr = strText.Split( '|' );
  1452. string ExecuteSql = orbll.GetView_CustomReturnExecuteSql( "tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Address,Company_Telephone,Company_UpdateDatetime" );
  1453. ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql( "tb_ErpTwoSalesOrder", StrWhere: "Tsorder_Number = '" + ObjStr[0].Trim() + "'" );
  1454. DataSet dtSet = orbll.GetView_Custom( ExecuteSql );
  1455. DataTable tbl = dtSet.Tables["ds"];
  1456. if ( tbl.Rows.Count <= 0 )
  1457. {
  1458. MessageBoxCustom.Show( "未设置影楼信息" ); return;
  1459. }
  1460. //获取订单信息
  1461. DataTable tbl2 = dtSet.Tables["ds1"];
  1462. if ( tbl2.Rows.Count == 0 )
  1463. {
  1464. MessageBoxCustom.Show( "订单不存在" ); return;
  1465. }
  1466. Brush b = Brushes.Black;
  1467. Pen p = GetPen;
  1468. Font ft16 = new Font( "宋体", 16 );
  1469. Font ft11 = new Font( "宋体", 10 );
  1470. Font ft10 = new Font( "宋体", 9 );
  1471. Font ft9 = new Font( "宋体", 9 );
  1472. // 二维码
  1473. Image img = CachePhoto( PhotoLogType.DimensionalCode, tbl.Rows[0]["Company_UpdateDatetime"] );
  1474. Rectangle rec1 = new Rectangle( 50, 25, 90, 90 );
  1475. if ( img != null )
  1476. {
  1477. g.DrawImage( img, rec1 );
  1478. }
  1479. int TableWidth = size.Width - rec1.X * 2 - 14;
  1480. // 金色童年收据凭据
  1481. SizeF sizef = g.MeasureString( DefaultPrintTitle, ft16 );
  1482. int FtWidth = Convert.ToInt32( sizef.Width );
  1483. int FtHeight = Convert.ToInt32( sizef.Height );
  1484. Rectangle rec2 = new Rectangle( (size.Width / 2) - (FtWidth / 2), 30, FtWidth + 5, FtHeight );
  1485. g.DrawString( DefaultPrintTitle, ft16, b, rec2 );
  1486. // NO.
  1487. string rec3Value = "NO." + StrRandom( tbl2.Rows[0]["Tsorder_Number"].ToString().Trim() );
  1488. sizef = g.MeasureString( rec3Value, ft11 );
  1489. FtWidth = Convert.ToInt32( sizef.Width ) + 3;
  1490. FtHeight = Convert.ToInt32( sizef.Height );
  1491. Rectangle rec3 = new Rectangle( size.Width - rec1.X - FtWidth, rec2.Y + 35, FtWidth, FtHeight );
  1492. g.DrawString( rec3Value, ft11, b, rec3 );
  1493. if ( IsPrintSerialNo )
  1494. {
  1495. string SerialNo = PrintReceiptSerial();
  1496. if ( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition )
  1497. {
  1498. SerialNo = PrintReceiptSerial( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.CurrentCompanyInfoID );
  1499. }
  1500. if ( string.IsNullOrEmpty( SerialNo ) )
  1501. {
  1502. MessageBoxCustom.Show( "获取流水单号失败!" ); return;
  1503. }
  1504. rec3Value = "SerialNo." + SerialNo;
  1505. sizef = g.MeasureString( rec3Value, ft11 );
  1506. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  1507. FtHeight = Convert.ToInt32( sizef.Height );
  1508. Rectangle rec3A = new Rectangle( size.Width - rec1.X - FtWidth, rec3.Y - FtHeight + 2, FtWidth, FtHeight );
  1509. g.DrawString( rec3Value, ft11, b, rec3A );
  1510. }
  1511. // 地址
  1512. string StrAddress = LYFZ.BLL.OtherCommonModel.FontConversion( "地址:" ) + tbl.Rows[0]["Company_Address"].ToString().Trim();
  1513. sizef = g.MeasureString( StrAddress, ft10 );
  1514. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  1515. FtHeight = Convert.ToInt32( sizef.Height );
  1516. Rectangle rec4 = new Rectangle( rec1.X + rec1.Width - 5, rec3.Y + rec3.Height + FtHeight - 15, TableWidth - rec1.Width + 14, FtHeight );
  1517. g.DrawString( StrAddress, ft10, b, rec4 );
  1518. string StrTelephone = LYFZ.BLL.OtherCommonModel.FontConversion( "电话:" ) + tbl.Rows[0]["Company_Telephone"].ToString().Trim();
  1519. Rectangle rec4A = new Rectangle( rec4.X, rec4.Y + rec4.Height - FtHeight * 2 + 2, TableWidth - rec1.Width - 10, FtHeight );
  1520. g.DrawString( StrTelephone, ft10, b, rec4A );
  1521. // 客户姓名
  1522. string StrName = "";
  1523. // 联系电话
  1524. string StrPhone = "";
  1525. if ( tbl2.Rows[0]["Tsorder_CustomerName"].ToString().Trim() != "" )
  1526. {
  1527. StrName = tbl2.Rows[0]["Tsorder_CustomerName"].ToString().Trim();
  1528. sizef = g.MeasureString( StrName, ft10 );
  1529. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  1530. FtHeight = Convert.ToInt32( sizef.Height );
  1531. if ( tbl2.Rows[0]["Tsorder_Telephone"].ToString().Trim() != "" )
  1532. {
  1533. StrPhone = tbl2.Rows[0]["Tsorder_Telephone"].ToString().Trim();
  1534. }
  1535. }
  1536. else
  1537. {
  1538. DataTable tblClient = orbll.GetView_Custom( "tb_ErpCustomer", StrWhere: "Cus_CustomerNumber = '" + tbl2.Rows[0]["Tsorder_CustomerNumber"].ToString().Trim() + "'", ShowColumnName: "Cus_Name,Cus_Telephone" ).Tables[0];
  1539. if ( tblClient.Rows.Count > 0 )
  1540. {
  1541. StrName = tblClient.Rows[0]["Cus_Name"].ToString().Trim();
  1542. sizef = g.MeasureString( StrName, ft10 );
  1543. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  1544. FtHeight = Convert.ToInt32( sizef.Height );
  1545. StrPhone = tblClient.Rows[0]["Cus_Telephone"].ToString().Trim();
  1546. }
  1547. }
  1548. StrName = LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名:" ) + StrName + " " + LYFZ.BLL.OtherCommonModel.FontConversion( "联系电话:" ) + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( StrPhone );
  1549. sizef = g.MeasureString( StrName, ft10 );
  1550. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  1551. FtHeight = Convert.ToInt32( sizef.Height );
  1552. Rectangle rec6 = new Rectangle( rec4.X, rec4.Y + rec4.Height - 2, FtWidth, FtHeight );
  1553. g.DrawString( StrName, ft10, b, rec6 );
  1554. // 日期
  1555. string StrDate = LYFZ.BLL.OtherCommonModel.FontConversion( "打印日期:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy年MM月dd日" );
  1556. sizef = g.MeasureString( StrDate, ft10 );
  1557. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  1558. FtHeight = Convert.ToInt32( sizef.Height );
  1559. Rectangle rec8 = new Rectangle( TableWidth + rec1.X - FtWidth + 14, rec6.Y, FtWidth, FtHeight );
  1560. g.DrawString( StrDate, ft10, b, rec8 );
  1561. int AddLeft = 3;
  1562. int AddTop2 = 6;
  1563. int AddTop = 6;
  1564. int RowHeight = 26;
  1565. int RowContentHeight = 18;
  1566. int ColumnWidth2 = 90;
  1567. int ColumnWidth3 = 70;
  1568. int ColumnWidth4 = 90;
  1569. int ColumnWidth5 = 60;
  1570. int ColumnWidth6 = 75;
  1571. int ColumnWidth1 = TableWidth - ColumnWidth5 - ColumnWidth2 - ColumnWidth3 - ColumnWidth4 - ColumnWidth6;
  1572. Rectangle rec9 = new Rectangle( rec1.X + 7, rec6.Y + rec6.Height + 1, TableWidth, RowHeight );
  1573. g.DrawRectangle( p, rec9 );//画标题矩形
  1574. // 收款项目
  1575. string StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "收款项目" );
  1576. sizef = g.MeasureString( StrValue, ft10 );
  1577. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  1578. Rectangle rec9_1 = new Rectangle( rec9.X + (ColumnWidth1 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth1, RowContentHeight );
  1579. g.DrawString( StrValue, ft11, b, rec9_1 );//画第一列的列标题
  1580. Point p1_1 = new Point( rec9.X + ColumnWidth1, rec9.Y );
  1581. Point p1_2 = new Point( rec9.X + ColumnWidth1, rec9.Y + rec9.Height );
  1582. g.DrawLine( p, p1_1, p1_2 );//画第一表与第二列的界线
  1583. // 支付方式
  1584. Rectangle rec9_2 = new Rectangle( p1_1.X + (ColumnWidth2 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth2, RowContentHeight );
  1585. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "支付方式" ), ft11, b, rec9_2 );//画第二列的列标题
  1586. Point p2_1 = new Point( p1_1.X + ColumnWidth2, rec9.Y );
  1587. Point p2_2 = new Point( p1_1.X + ColumnWidth2, rec9.Y + rec9.Height );
  1588. g.DrawLine( p, p2_1, p2_2 );//画第二表与第三列的界线
  1589. // 金 额
  1590. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "金 额" );
  1591. sizef = g.MeasureString( StrValue, ft10 );
  1592. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  1593. Rectangle rec9_3 = new Rectangle( p2_1.X + (ColumnWidth3 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth3, RowContentHeight );
  1594. g.DrawString( StrValue, ft11, b, rec9_3 );//画第三列的列标题
  1595. Point p3_1 = new Point( p2_1.X + ColumnWidth3, rec9.Y );
  1596. Point p3_2 = new Point( p2_1.X + ColumnWidth3, rec9.Y + rec9.Height );
  1597. g.DrawLine( p, p3_1, p3_2 );//画第三表与第四列的界线
  1598. // 接单人
  1599. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "接单人" );
  1600. sizef = g.MeasureString( StrValue, ft10 );
  1601. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  1602. Rectangle rec9_4 = new Rectangle( p3_1.X + (ColumnWidth4 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth4, RowContentHeight );
  1603. g.DrawString( StrValue, ft11, b, rec9_4 );//画第四列的列标题
  1604. Point p4_1 = new Point( p3_1.X + ColumnWidth4, rec9.Y );
  1605. Point p4_2 = new Point( p3_1.X + ColumnWidth4, rec9.Y + rec9.Height );
  1606. g.DrawLine( p, p4_1, p4_2 );//画第四表与第五列的界线
  1607. // 收 银
  1608. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "收 银" );
  1609. sizef = g.MeasureString( StrValue, ft10 );
  1610. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  1611. Rectangle rec9_5 = new Rectangle( p4_1.X + (ColumnWidth5 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth5, RowContentHeight );
  1612. g.DrawString( StrValue, ft11, b, rec9_5 );//画第五列的列标题
  1613. Point p5_1 = new Point( p4_1.X + ColumnWidth5, rec9.Y );
  1614. Point p5_2 = new Point( p4_1.X + ColumnWidth5, rec9.Y + rec9.Height );
  1615. g.DrawLine( p, p5_1, p5_2 );//画第四表与第五列的界线
  1616. // 收款日期
  1617. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "付款日期" );
  1618. sizef = g.MeasureString( StrValue, ft10 );
  1619. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  1620. Rectangle rec9_6 = new Rectangle( p5_1.X + (ColumnWidth6 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth6, RowContentHeight );
  1621. g.DrawString( StrValue, ft11, b, rec9_6 );//画第五列的列标题
  1622. int IntPoint_X = rec9.X;
  1623. int IntPoint_Y = rec9.Y + rec9.Height;
  1624. decimal Uppercase = 0;
  1625. int ForCount = 0;
  1626. int PageRows = 3;//每页多少行
  1627. decimal DiscountAmount = 0;
  1628. string strRemark = "";
  1629. #region 画列表每行
  1630. for ( int i = 0; i < PageRows; i++ )
  1631. {
  1632. Rectangle recfor = new Rectangle( IntPoint_X, IntPoint_Y, TableWidth, RowHeight );
  1633. g.DrawRectangle( p, recfor );//画标题矩形
  1634. string recfor_1Value = "";
  1635. string recfor_2Value = "";
  1636. string recfor_3Value = "";
  1637. string recfor_4Value = "";
  1638. string recfor_5Value = "";
  1639. string recfor_6Value = "";
  1640. if ( ForCount < dgvData.SelectedRows.Count )
  1641. {
  1642. if ( !string.IsNullOrEmpty( dgvData.SelectedRows[ForCount].Cells["DiscountAmount"].Value.ToString().Trim() ) )
  1643. {
  1644. if ( Convert.ToDecimal( dgvData.SelectedRows[ForCount].Cells["DiscountAmount"].Value ) > 0 )
  1645. {
  1646. DiscountAmount += Convert.ToDecimal( dgvData.SelectedRows[ForCount].Cells["DiscountAmount"].Value );
  1647. }
  1648. }
  1649. 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();//收款项目
  1650. recfor_2Value = dgvData.SelectedRows[ForCount].Cells["Pay_PaymentMethod"].Value.ToString().Trim();
  1651. recfor_3Value = Convert.ToDecimal( dgvData.SelectedRows[ForCount].Cells["Pay_AmountOf"].Value ).ToString( "0.00" ).Trim();
  1652. recfor_4Value = dgvData.SelectedRows[ForCount].Cells["Pay_OpenSingle"].Value.ToString().Trim();
  1653. recfor_5Value = dgvData.SelectedRows[ForCount].Cells["Pay_ThePayee"].Value.ToString().Trim();
  1654. recfor_6Value = LYFZ.Command.Command_Validate.DateTimeToString( dgvData.SelectedRows[ForCount].Cells["Pay_CreateDatetime"].Value );
  1655. Uppercase += Convert.ToDecimal( dgvData.SelectedRows[ForCount].Cells["Pay_AmountOf"].Value );
  1656. strRemark += dgvData.SelectedRows[ForCount].Cells["Pay_Remark"].Value.ToString().Trim() + ";";
  1657. ForCount++;
  1658. }
  1659. Rectangle recfor_1 = new Rectangle( recfor.X + AddLeft, recfor.Y + AddTop, ColumnWidth1, RowContentHeight );
  1660. g.DrawString( recfor_1Value, ft10, b, recfor_1 );//画第一列的列标题
  1661. Point pfor1_1 = new Point( recfor_1.X + ColumnWidth1 - 3, recfor.Y );
  1662. Point pfor1_2 = new Point( recfor_1.X + ColumnWidth1 - 3, recfor.Y + recfor.Height );
  1663. g.DrawLine( p, pfor1_1, pfor1_2 );//画第一表与第二列的界线
  1664. Rectangle recfor_2 = new Rectangle( pfor1_1.X + AddLeft, pfor1_1.Y + AddTop, ColumnWidth2, RowContentHeight );
  1665. g.DrawString( recfor_2Value, ft10, b, recfor_2 );//画第二列的列标题
  1666. Point pfor2_1 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y );
  1667. Point pfor2_2 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y + recfor.Height );
  1668. g.DrawLine( p, pfor2_1, pfor2_2 );//画第二表与第三列的界线
  1669. StrValue = recfor_3Value;
  1670. sizef = g.MeasureString( StrValue, ft10 );
  1671. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  1672. Rectangle recfor_3 = new Rectangle( pfor2_1.X + ColumnWidth3 - FtWidth - AddLeft * 2, pfor2_1.Y + AddTop, ColumnWidth3, RowContentHeight );
  1673. g.DrawString( recfor_3Value, ft10, b, recfor_3 );//画第三列的列标题
  1674. Point pfor3_1 = new Point( pfor2_1.X + ColumnWidth3, recfor.Y );
  1675. Point pfor3_2 = new Point( pfor2_1.X + ColumnWidth3, recfor.Y + recfor.Height );
  1676. g.DrawLine( p, pfor3_1, pfor3_2 );//画第三表与第四列的界线
  1677. Rectangle recfor_4 = new Rectangle( pfor3_1.X + AddLeft, pfor3_1.Y + AddTop, ColumnWidth4, RowContentHeight );
  1678. g.DrawString( recfor_4Value, ft10, b, recfor_4 );//画第四列的列标题
  1679. Point pfor4_1 = new Point( pfor3_1.X + ColumnWidth4, recfor.Y );
  1680. Point pfor4_2 = new Point( pfor3_1.X + ColumnWidth4, recfor.Y + recfor.Height );
  1681. g.DrawLine( p, pfor4_1, pfor4_2 );//画第四表与第五列的界线
  1682. Rectangle recfor_5 = new Rectangle( pfor4_1.X + AddLeft, pfor4_1.Y + AddTop, ColumnWidth5, RowContentHeight );
  1683. g.DrawString( recfor_5Value, ft10, b, recfor_5 );//画第五列的列标题
  1684. Point pfor5_1 = new Point( pfor4_1.X + ColumnWidth5, recfor.Y );
  1685. Point pfor5_2 = new Point( pfor4_1.X + ColumnWidth5, recfor.Y + recfor.Height );
  1686. g.DrawLine( p, pfor5_1, pfor5_2 );//画第四表与第五列的界线
  1687. Rectangle recfor_6 = new Rectangle( pfor5_1.X + AddLeft, pfor4_1.Y + AddTop, ColumnWidth6, RowContentHeight );
  1688. g.DrawString( recfor_6Value, ft10, b, recfor_6 );//画第五列的列标题
  1689. IntPoint_X = recfor.X;
  1690. IntPoint_Y = recfor.Y + recfor.Height;
  1691. }
  1692. #endregion
  1693. Rectangle rec9_A = new Rectangle( rec9.X, IntPoint_Y, TableWidth, RowHeight );
  1694. g.DrawRectangle( p, rec9_A );//画标题矩形
  1695. sizef = g.MeasureString( "说 明:", ft11 );
  1696. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  1697. Rectangle rec9_A1 = new Rectangle( rec9.X + AddLeft, rec9_A.Y + AddTop2, FtWidth, RowContentHeight );
  1698. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "说 明:" ), ft11, b, rec9_A1 );//画第三列的列标题
  1699. Rectangle rec9_A2 = new Rectangle( rec9_A1.Location.X + FtWidth, rec9_A1.Location.Y, rec9_A1.Width - FtWidth, rec9_A1.Height );
  1700. g.DrawString( strRemark.TrimEnd( ';' ), ft10, b, rec9_A2 );//画第三列的列标题
  1701. Rectangle rec10 = new Rectangle( rec9_A.X, rec9_A.Y + rec9_A.Height, TableWidth, RowHeight );
  1702. g.DrawRectangle( p, rec10 );//画标题矩形
  1703. // 付款情况
  1704. string rec10_1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "付款情况" );
  1705. sizef = g.MeasureString( rec10_1Value, ft11 );
  1706. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  1707. FtHeight = Convert.ToInt32( sizef.Height );
  1708. Rectangle rec10_1 = new Rectangle( rec10.X + AddLeft, rec10.Y + AddTop2, FtWidth, RowContentHeight );
  1709. g.DrawString( rec10_1Value, ft11, b, rec10_1 );//付款情况
  1710. // 应付
  1711. int FocCount = 4;
  1712. if ( DiscountAmount > 0 )
  1713. {
  1714. FocCount = 5;
  1715. }
  1716. Rectangle rec10_2 = new Rectangle( rec10_1.X + (TableWidth / FocCount), rec10.Y + AddTop2, TableWidth / FocCount, RowContentHeight );
  1717. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "应付:" ) + ObjStr[1].Trim(), ft11, b, rec10_2 );//应付
  1718. // 实付
  1719. Rectangle rec10_3 = new Rectangle( rec10_2.X + (TableWidth / FocCount), rec10.Y + AddTop2, TableWidth / FocCount, RowContentHeight );
  1720. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "实付:" ) + Convert.ToDecimal( Uppercase ).ToString( "0.00" ), ft11, b, rec10_3 );//实付//ObjStr[2].Trim()
  1721. // 欠款
  1722. Rectangle rec10_4 = new Rectangle( rec10_3.X + (TableWidth / FocCount), rec10.Y + AddTop2, TableWidth / FocCount, RowContentHeight );
  1723. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "欠款:" ) + ObjStr[3].Trim(), ft11, b, rec10_4 );//欠款
  1724. // 优惠
  1725. if ( DiscountAmount > 0 )
  1726. {
  1727. Rectangle rec10_5 = new Rectangle( rec10_4.X + (TableWidth / FocCount), rec10.Y + AddTop2, TableWidth / FocCount, RowContentHeight );
  1728. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "优惠:" ) + DiscountAmount, ft11, b, rec10_5 );//欠款
  1729. }
  1730. Rectangle rec11 = new Rectangle( rec10.X, rec10.Y + rec10.Height, TableWidth, RowHeight );
  1731. g.DrawRectangle( p, rec11 );//画标题矩形
  1732. // 合计
  1733. Rectangle rec11_1 = new Rectangle( rec11.X + AddLeft, rec11.Y + AddTop2, TableWidth - 300, RowContentHeight );
  1734. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "合计人民币(大写):" ) + " " + LYFZ.Software.MainBusiness.ReportPrint.ReportPrintDataClass.ConversionAmount( Uppercase.ToString() ), ft11, b, rec11_1 );//合计人民币
  1735. // 顾客签字
  1736. Rectangle rec11_2 = new Rectangle( rec11_1.X + rec11_1.Width + 100, rec11_1.Y, 300, RowContentHeight );
  1737. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "顾客签字:" ), ft11, b, rec11_2 );//画消费法规
  1738. // 说明
  1739. Rectangle rec12 = new Rectangle( rec11.X, rec11.Y + rec11.Height + 3, rec9.Width, Convert.ToInt32( g.MeasureString( "说明", ft9 ).Height ) + 1 );
  1740. string PaymentExplain = "";
  1741. if ( PrintOtherData.ContainsKey( "收款单说明" ) && PrintOtherData["收款单说明"].ToString().Trim().Length > 0 )
  1742. {
  1743. PaymentExplain = PrintOtherData["收款单说明"].ToString().Trim();
  1744. }
  1745. g.DrawString( PaymentExplain, ft9, b, rec12 );//画消费法规
  1746. }
  1747. #endregion
  1748. #region 店面、现金支出
  1749. /// <summary>
  1750. /// 店面、现金支出
  1751. /// </summary>
  1752. /// <param name="panl"></param>
  1753. public static void PaymentPrint_CashOutlay_Print( object objValue, Graphics g, Size size, bool IsPrintSerialNo )
  1754. {
  1755. Hashtable htData = (Hashtable)objValue;
  1756. DataGridViewEc dgvData = (DataGridViewEc)htData["dgvData"];
  1757. List<Image> imglist = new List<Image>();
  1758. //获取影楼信息
  1759. DataTable tbl = orbll.GetView_Custom( "tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Address,Company_Telephone,Company_UpdateDatetime" ).Tables[0];
  1760. if ( tbl.Rows.Count <= 0 )
  1761. {
  1762. MessageBoxCustom.Show( "未设置影楼信息" ); return;
  1763. }
  1764. Brush b = Brushes.Black;
  1765. Pen p = GetPen;
  1766. Font ft16 = new Font( "宋体", 16 );
  1767. Font ft11 = new Font( "宋体", 10 );
  1768. Font ft10 = new Font( "宋体", 9 );
  1769. Font ft9 = new Font( "宋体", 9 );
  1770. #region 二维码
  1771. Image img = CachePhoto( PhotoLogType.DimensionalCode, tbl.Rows[0]["Company_UpdateDatetime"] );
  1772. Rectangle rec1 = new Rectangle( 50, 25, 90, 90 );
  1773. if ( img != null )
  1774. {
  1775. g.DrawImage( img, rec1 );
  1776. }
  1777. #endregion
  1778. int TableWidth = size.Width - rec1.X * 2 - 14;
  1779. #region 金色童年支出单
  1780. SizeF sizef = g.MeasureString( DefaultPrintTitle, ft16 );
  1781. int FtWidth = Convert.ToInt32( sizef.Width ) + 30;
  1782. int FtHeight = Convert.ToInt32( sizef.Height );
  1783. Rectangle rec2 = new Rectangle( (size.Width / 2) - (FtWidth / 2), 30, FtWidth + 5, FtHeight );
  1784. g.DrawString( DefaultPrintTitle, ft16, b, rec2 );
  1785. #endregion
  1786. #region NO.
  1787. string rec3Value = "";
  1788. if ( IsPrintSerialNo )
  1789. {
  1790. string SerialNo = PrintReceiptSerial();
  1791. if ( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition )
  1792. {
  1793. SerialNo = PrintReceiptSerial( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.CurrentCompanyInfoID );
  1794. }
  1795. if ( string.IsNullOrEmpty( SerialNo ) )
  1796. {
  1797. MessageBoxCustom.Show( "获取流水单号失败!" ); return;
  1798. }
  1799. rec3Value = "SerialNo." + SerialNo;
  1800. sizef = g.MeasureString( rec3Value, ft11 );
  1801. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  1802. FtHeight = Convert.ToInt32( sizef.Height );
  1803. Rectangle rec3A = new Rectangle( size.Width - rec1.X - FtWidth, rec2.Y + 35, FtWidth, FtHeight );
  1804. g.DrawString( rec3Value, ft11, b, rec3A );
  1805. }
  1806. #endregion
  1807. #region 地址
  1808. string StrAddress = LYFZ.BLL.OtherCommonModel.FontConversion( "地址:" ) + tbl.Rows[0]["Company_Address"].ToString().Trim();
  1809. sizef = g.MeasureString( StrAddress, ft10 );
  1810. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  1811. FtHeight = Convert.ToInt32( sizef.Height );
  1812. Rectangle rec4 = new Rectangle( rec1.X + rec1.Width - 5, rec1.Y + rec1.Height + FtHeight - 47, TableWidth - rec1.Width + 14, FtHeight );
  1813. g.DrawString( StrAddress, ft10, b, rec4 );
  1814. string StrTelephone = LYFZ.BLL.OtherCommonModel.FontConversion( "电话:" ) + tbl.Rows[0]["Company_Telephone"].ToString().Trim();
  1815. Rectangle rec4A = new Rectangle( rec4.X, rec4.Y + rec4.Height - FtHeight * 2 + 2, TableWidth - rec1.Width - 10, FtHeight );
  1816. g.DrawString( StrTelephone, ft10, b, rec4A );
  1817. #endregion
  1818. #region 支付人
  1819. string StrName = LYFZ.BLL.OtherCommonModel.FontConversion( "支付人:" ) + dgvData.SelectedRows[0].Cells["取款人"].Value.ToString().Trim();
  1820. sizef = g.MeasureString( StrName, ft10 );
  1821. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  1822. FtHeight = Convert.ToInt32( sizef.Height );
  1823. Rectangle rec6 = new Rectangle( rec4.X, rec4.Y + rec4.Height - 2, FtWidth, FtHeight );
  1824. g.DrawString( StrName, ft10, b, rec6 );
  1825. #endregion
  1826. #region 日期
  1827. string StrDate = LYFZ.BLL.OtherCommonModel.FontConversion( "打印日期:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy年MM月dd日" );
  1828. sizef = g.MeasureString( StrDate, ft10 );
  1829. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  1830. FtHeight = Convert.ToInt32( sizef.Height );
  1831. Rectangle rec8 = new Rectangle( TableWidth + rec1.X - FtWidth + 14, rec6.Y, FtWidth, FtHeight );
  1832. g.DrawString( StrDate, ft10, b, rec8 );
  1833. #endregion
  1834. int AddLeft = 3;
  1835. int AddTop2 = 6;
  1836. int AddTop = 6;
  1837. int RowHeight = 26;
  1838. int RowContentHeight = 18;
  1839. int ColumnWidth2 = 120;
  1840. int ColumnWidth3 = 90;
  1841. int ColumnWidth5 = 80;
  1842. int ColumnWidth6 = 120;
  1843. int ColumnWidth1 = TableWidth - ColumnWidth2 - ColumnWidth3 - ColumnWidth5 - ColumnWidth6;
  1844. Rectangle rec9 = new Rectangle( rec1.X + 7, rec6.Y + rec6.Height + 1, TableWidth, RowHeight );
  1845. g.DrawRectangle( p, rec9 );//画标题矩形
  1846. #region 支出项目
  1847. string StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "支出项目" );
  1848. sizef = g.MeasureString( StrValue, ft10 );
  1849. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  1850. Rectangle rec9_1 = new Rectangle( rec9.X + (ColumnWidth1 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth1, RowContentHeight );
  1851. g.DrawString( StrValue, ft11, b, rec9_1 );//画第一列的列标题
  1852. Point p1_1 = new Point( rec9.X + ColumnWidth1, rec9.Y );
  1853. Point p1_2 = new Point( rec9.X + ColumnWidth1, rec9.Y + rec9.Height );
  1854. g.DrawLine( p, p1_1, p1_2 );//画第一表与第二列的界线
  1855. #endregion
  1856. #region 支付方式
  1857. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "支付方式" );
  1858. sizef = g.MeasureString( StrValue, ft10 );
  1859. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  1860. Rectangle rec9_2 = new Rectangle( p1_1.X + (ColumnWidth2 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth2, RowContentHeight );
  1861. g.DrawString( StrValue, ft11, b, rec9_2 );//画第三列的列标题
  1862. Point p2_1 = new Point( p1_1.X + ColumnWidth2, rec9.Y );
  1863. Point p2_2 = new Point( p1_1.X + ColumnWidth2, rec9.Y + rec9.Height );
  1864. g.DrawLine( p, p2_1, p2_2 );//画第三表与第四列的界线
  1865. #endregion
  1866. #region 金 额
  1867. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "金 额" );
  1868. sizef = g.MeasureString( StrValue, ft10 );
  1869. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  1870. Rectangle rec9_3 = new Rectangle( p2_1.X + (ColumnWidth3 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth3, RowContentHeight );
  1871. g.DrawString( StrValue, ft11, b, rec9_3 );//画第三列的列标题
  1872. Point p3_1 = new Point( p2_1.X + ColumnWidth3, rec9.Y );
  1873. Point p3_2 = new Point( p2_1.X + ColumnWidth3, rec9.Y + rec9.Height );
  1874. g.DrawLine( p, p3_1, p3_2 );//画第三表与第四列的界线
  1875. #endregion
  1876. #region 经手人
  1877. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "经手人" );
  1878. sizef = g.MeasureString( StrValue, ft10 );
  1879. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  1880. Rectangle rec9_5 = new Rectangle( p3_1.X + (ColumnWidth5 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth5, RowContentHeight );
  1881. g.DrawString( StrValue, ft11, b, rec9_5 );//画第五列的列标题
  1882. Point p4_1 = new Point( p3_1.X + ColumnWidth5, rec9.Y );
  1883. Point p4_2 = new Point( p3_1.X + ColumnWidth5, rec9.Y + rec9.Height );
  1884. g.DrawLine( p, p4_1, p4_2 );//画第三表与第四列的界线
  1885. #endregion
  1886. #region 支出日期
  1887. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "支出日期" );
  1888. sizef = g.MeasureString( StrValue, ft10 );
  1889. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  1890. Rectangle rec9_6 = new Rectangle( p4_1.X + (ColumnWidth6 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth6, RowContentHeight );
  1891. g.DrawString( StrValue, ft11, b, rec9_6 );//画第五列的列标题
  1892. #endregion
  1893. int IntPoint_X = rec9.X;
  1894. int IntPoint_Y = rec9.Y + rec9.Height;
  1895. decimal ActualAmount = 0;//实付金额
  1896. #region 画列表每行
  1897. int ForCount = 0;
  1898. int PageRows = 4;//每页多少行
  1899. for ( int i = 0; i < PageRows; i++ )
  1900. {
  1901. Rectangle recfor = new Rectangle( IntPoint_X, IntPoint_Y, TableWidth, RowHeight );
  1902. g.DrawRectangle( p, recfor );//画标题矩形
  1903. string recfor_1Value = "";
  1904. string recfor_2Value = "";
  1905. string recfor_3Value = "";
  1906. string recfor_5Value = "";
  1907. string recfor_6Value = "";
  1908. if ( ForCount < dgvData.SelectedRows.Count )
  1909. {
  1910. recfor_1Value = dgvData.SelectedRows[ForCount].Cells["费用项目"].Value.ToString().Trim() +
  1911. (dgvData.SelectedRows[ForCount].Cells["支出说明"].Value.ToString().Trim() == "" ? "" : "(" + dgvData.SelectedRows[ForCount].Cells["支出说明"].Value.ToString().Trim() + ")");//收款项目
  1912. recfor_2Value = dgvData.SelectedRows[ForCount].Cells["支出方式"].Value.ToString().Trim();//收款项目
  1913. recfor_3Value = Convert.ToDecimal( dgvData.SelectedRows[ForCount].Cells["费用金额"].Value ).ToString( "0.00" ).Trim();
  1914. recfor_5Value = dgvData.SelectedRows[ForCount].Cells["录单人"].Value.ToString().Trim();
  1915. recfor_6Value = LYFZ.Command.Command_Validate.DateTimeToString2( dgvData.SelectedRows[ForCount].Cells["支出日期"].Value );
  1916. ActualAmount += Convert.ToDecimal( dgvData.SelectedRows[ForCount].Cells["费用金额"].Value );
  1917. ForCount++;
  1918. }
  1919. Rectangle recfor_1 = new Rectangle( recfor.X + AddLeft, recfor.Y + AddTop, ColumnWidth1, RowContentHeight );
  1920. g.DrawString( recfor_1Value, ft10, b, recfor_1 );//画第一列的列标题
  1921. Point pfor1_1 = new Point( recfor_1.X + ColumnWidth1 - 3, recfor.Y );
  1922. Point pfor1_2 = new Point( recfor_1.X + ColumnWidth1 - 3, recfor.Y + recfor.Height );
  1923. g.DrawLine( p, pfor1_1, pfor1_2 );//画第一表与第二列的界线
  1924. Rectangle recfor_2 = new Rectangle( pfor1_1.X + ColumnWidth2 - FtWidth - AddLeft * 2, pfor1_1.Y + AddTop, ColumnWidth2, RowContentHeight );
  1925. g.DrawString( recfor_2Value, ft10, b, recfor_2 );//画第三列的列标题
  1926. Point pfor2_1 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y );
  1927. Point pfor2_2 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y + recfor.Height );
  1928. g.DrawLine( p, pfor2_1, pfor2_2 );//画第三表与第四列的界线
  1929. sizef = g.MeasureString( recfor_3Value, ft10 );
  1930. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  1931. Rectangle recfor_3 = new Rectangle( pfor2_1.X + ColumnWidth3 - FtWidth - AddLeft * 2, pfor2_1.Y + AddTop, ColumnWidth3, RowContentHeight );
  1932. g.DrawString( recfor_3Value, ft10, b, recfor_3 );//画第三列的列标题
  1933. Point pfor3_1 = new Point( pfor2_1.X + ColumnWidth3, recfor.Y );
  1934. Point pfor3_2 = new Point( pfor2_1.X + ColumnWidth3, recfor.Y + recfor.Height );
  1935. g.DrawLine( p, pfor3_1, pfor3_2 );//画第三表与第四列的界线
  1936. Rectangle recfor_5 = new Rectangle( pfor3_1.X + AddLeft, pfor3_1.Y + AddTop, ColumnWidth5, RowContentHeight );
  1937. g.DrawString( recfor_5Value, ft10, b, recfor_5 );//画第五列的列标题
  1938. Point pfor4_1 = new Point( pfor3_1.X + ColumnWidth5, recfor.Y );
  1939. Point pfor4_2 = new Point( pfor3_1.X + ColumnWidth5, recfor.Y + recfor.Height );
  1940. g.DrawLine( p, pfor4_1, pfor4_2 );//画第三表与第四列的界线
  1941. Rectangle recfor_6 = new Rectangle( pfor4_1.X + AddLeft, pfor3_1.Y + AddTop, ColumnWidth6, RowContentHeight );
  1942. g.DrawString( recfor_6Value, ft10, b, recfor_6 );//画第五列的列标题
  1943. IntPoint_X = recfor.X;
  1944. IntPoint_Y = recfor.Y + recfor.Height;
  1945. }
  1946. #endregion
  1947. decimal CopeAmount = ActualAmount;//总额
  1948. Rectangle rec10 = new Rectangle( IntPoint_X, IntPoint_Y, TableWidth, RowHeight );
  1949. g.DrawRectangle( p, rec10 );//画标题矩形
  1950. #region 付款情况
  1951. string rec10_1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "支出情况" );
  1952. sizef = g.MeasureString( rec10_1Value, ft11 );
  1953. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  1954. FtHeight = Convert.ToInt32( sizef.Height );
  1955. Rectangle rec10_1 = new Rectangle( rec10.X + AddLeft, rec10.Y + AddTop2, FtWidth, RowContentHeight );
  1956. g.DrawString( rec10_1Value, ft11, b, rec10_1 );//付款情况
  1957. #endregion
  1958. #region 应付
  1959. Rectangle rec10_2 = new Rectangle( rec10_1.X + (TableWidth / 4), rec10.Y + AddTop2, TableWidth / 4, RowContentHeight );
  1960. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "总额:" ) + CopeAmount.ToString(), ft11, b, rec10_2 );//应付
  1961. #endregion
  1962. #region 实付
  1963. Rectangle rec10_3 = new Rectangle( rec10_2.X + (TableWidth / 4), rec10.Y + AddTop2, TableWidth / 4, RowContentHeight );
  1964. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "实付:" ) + ActualAmount.ToString(), ft11, b, rec10_3 );//实付
  1965. #endregion
  1966. Rectangle rec11 = new Rectangle( rec10.X, rec10.Y + rec10.Height, TableWidth, RowHeight );
  1967. g.DrawRectangle( p, rec11 );//画标题矩形
  1968. #region 合计
  1969. Rectangle rec11_1 = new Rectangle( rec11.X + AddLeft, rec11.Y + AddTop2, TableWidth - 300, RowContentHeight );
  1970. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "合计人民币(大写):" ) + " " + LYFZ.Software.MainBusiness.ReportPrint.ReportPrintDataClass.ConversionAmount( ActualAmount.ToString() ), ft11, b, rec11_1 );//合计人民币
  1971. #endregion
  1972. #region 顾客签字
  1973. Rectangle rec11_2 = new Rectangle( rec11_1.X + rec11_1.Width + 100, rec11_1.Y, 300, RowContentHeight );
  1974. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "支款人签字:" ), ft11, b, rec11_2 );//画消费法规
  1975. #endregion
  1976. #region 说明
  1977. Rectangle rec12 = new Rectangle( rec11.X, rec11.Y + rec11.Height + 3, rec9.Width, Convert.ToInt32( g.MeasureString( "说明", ft9 ).Height ) + 1 );
  1978. string PaymentExplain = "";
  1979. if ( PrintOtherData.ContainsKey( "收款单说明" ) && PrintOtherData["收款单说明"].ToString().Trim().Length > 0 )
  1980. {
  1981. PaymentExplain = PrintOtherData["收款单说明"].ToString().Trim();
  1982. }
  1983. g.DrawString( PaymentExplain, ft9, b, rec12 );//画消费法规
  1984. #endregion
  1985. }
  1986. #endregion
  1987. #region 其它收入
  1988. /// <summary>
  1989. /// 其它收入
  1990. /// </summary>
  1991. /// <param name="panl"></param>
  1992. #if IGNORE
  1993. public static void PaymentPrint_OtherIncome_Print(object objValue, Graphics g, Size size, bool IsPrintSerialNo)
  1994. {
  1995. Hashtable htData = (Hashtable)objValue;
  1996. DataGridViewEc dgvData = (DataGridViewEc)htData["dgvData"];
  1997. //获取影楼信息
  1998. DataTable tbl = orbll.GetView_Custom("tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Address,Company_Telephone,Company_UpdateDatetime").Tables[0];
  1999. if (tbl.Rows.Count <= 0)
  2000. { MessageBoxCustom.Show("未设置影楼信息"); return; }
  2001. Brush b = Brushes.Black;
  2002. Pen p = GetPen;
  2003. Font ft16 = new Font("宋体", 16);
  2004. Font ft11 = new Font("宋体", 10);
  2005. Font ft10 = new Font("宋体", 9);
  2006. Font ft9 = new Font("宋体", 9);
  2007. #region LOG
  2008. // 二维码
  2009. Image img = CachePhoto(PhotoLogType.DimensionalCode, tbl.Rows[0]["Company_UpdateDatetime"]);
  2010. Rectangle rec1 = new Rectangle(50, 25, 90, 90);
  2011. if (img != null)
  2012. { g.DrawImage(img, rec1); }
  2013. int TableWidth = size.Width - rec1.X * 2 - 14;
  2014. // 金色童年收据凭据
  2015. SizeF sizef = g.MeasureString(DefaultPrintTitle, ft16);
  2016. int FtWidth = Convert.ToInt32(sizef.Width) + 1;
  2017. int FtHeight = Convert.ToInt32(sizef.Height);
  2018. Rectangle rec2 = new Rectangle((size.Width / 2) - (FtWidth / 2), 30, FtWidth + 5, FtHeight);
  2019. g.DrawString(DefaultPrintTitle, ft16, b, rec2);
  2020. #region NO.
  2021. string rec3Value = "";
  2022. if (IsPrintSerialNo)
  2023. {
  2024. string SerialNo = PrintReceiptSerial();
  2025. if (LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition)
  2026. {
  2027. SerialNo = PrintReceiptSerial(LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.CurrentCompanyInfoID);
  2028. }
  2029. if (string.IsNullOrEmpty(SerialNo))
  2030. { MessageBoxCustom.Show("获取流水单号失败!"); return; }
  2031. rec3Value = "SerialNo." + SerialNo;
  2032. sizef = g.MeasureString(rec3Value, ft11);
  2033. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  2034. FtHeight = Convert.ToInt32(sizef.Height);
  2035. Rectangle rec3A = new Rectangle(size.Width - rec1.X - FtWidth, rec2.Y + 35, FtWidth, FtHeight);
  2036. g.DrawString(rec3Value, ft11, b, rec3A);
  2037. }
  2038. #endregion
  2039. // 地址
  2040. string StrAddress = LYFZ.BLL.OtherCommonModel.FontConversion("地址:") + tbl.Rows[0]["Company_Address"].ToString().Trim();
  2041. sizef = g.MeasureString(StrAddress, ft10);
  2042. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  2043. FtHeight = Convert.ToInt32(sizef.Height);
  2044. Rectangle rec4 = new Rectangle(rec1.X + rec1.Width - 5, rec1.Y + rec1.Height + FtHeight - 47, TableWidth - rec1.Width + 14, FtHeight);
  2045. g.DrawString(StrAddress, ft10, b, rec4);
  2046. string StrTelephone = LYFZ.BLL.OtherCommonModel.FontConversion("电话:") + tbl.Rows[0]["Company_Telephone"].ToString().Trim();
  2047. Rectangle rec4A = new Rectangle(rec4.X, rec4.Y + rec4.Height - FtHeight * 2 + 2, TableWidth - rec1.Width - 10, FtHeight);
  2048. g.DrawString(StrTelephone, ft10, b, rec4A);
  2049. // 客户姓名
  2050. string StrName = LYFZ.BLL.OtherCommonModel.FontConversion("客户姓名:") + dgvData.CurrentRow.Cells["付款人"].Value.ToString().Trim();
  2051. sizef = g.MeasureString(StrName, ft10);
  2052. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  2053. FtHeight = Convert.ToInt32(sizef.Height);
  2054. Rectangle rec6 = new Rectangle(rec4.X, rec4.Y + rec4.Height - 2, FtWidth, FtHeight);
  2055. g.DrawString(StrName, ft10, b, rec6);
  2056. // 日期
  2057. string StrDate = LYFZ.BLL.OtherCommonModel.FontConversion("打印日期:") + LYFZ.Command.Command_Validate.DateTimeToString(SDateTime.Now, "yyyy年MM月dd日");
  2058. sizef = g.MeasureString(StrDate, ft10);
  2059. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  2060. FtHeight = Convert.ToInt32(sizef.Height);
  2061. Rectangle rec8 = new Rectangle(TableWidth + rec1.X - FtWidth + 14, rec6.Y, FtWidth, FtHeight);
  2062. g.DrawString(StrDate, ft10, b, rec8);
  2063. #endregion
  2064. int AddLeft = 3;
  2065. int AddTop2 = 6;
  2066. int AddTop = 6;
  2067. int RowHeight = 26;
  2068. int RowContentHeight = 18;
  2069. int ColumnWidth3 = 120;
  2070. int ColumnWidth5 = 120;
  2071. int ColumnWidth6 = 100;
  2072. int ColumnWidth1 = TableWidth - ColumnWidth3 - ColumnWidth5 - ColumnWidth6;
  2073. Rectangle rec9 = new Rectangle(rec1.X + 7, rec6.Y + rec6.Height + 1, TableWidth, RowHeight);
  2074. g.DrawRectangle(p, rec9);//画标题矩形
  2075. #region 标题
  2076. // 收款项目
  2077. string StrValue = LYFZ.BLL.OtherCommonModel.FontConversion("收款项目");
  2078. sizef = g.MeasureString(StrValue, ft10);
  2079. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  2080. Rectangle rec9_1 = new Rectangle(rec9.X + (ColumnWidth1 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth1, RowContentHeight);
  2081. g.DrawString(StrValue, ft11, b, rec9_1);//画第一列的列标题
  2082. Point p1_1 = new Point(rec9.X + ColumnWidth1, rec9.Y);
  2083. Point p1_2 = new Point(rec9.X + ColumnWidth1, rec9.Y + rec9.Height);
  2084. g.DrawLine(p, p1_1, p1_2);//画第一表与第二列的界线
  2085. // 金 额
  2086. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion("金 额");
  2087. sizef = g.MeasureString(StrValue, ft10);
  2088. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  2089. Rectangle rec9_3 = new Rectangle(p1_1.X + (ColumnWidth3 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth3, RowContentHeight);
  2090. g.DrawString(StrValue, ft11, b, rec9_3);//画第三列的列标题
  2091. Point p3_1 = new Point(p1_1.X + ColumnWidth3, rec9.Y);
  2092. Point p3_2 = new Point(p1_1.X + ColumnWidth3, rec9.Y + rec9.Height);
  2093. g.DrawLine(p, p3_1, p3_2);//画第三表与第四列的界线
  2094. // 收 银
  2095. Rectangle rec9_5 = new Rectangle(p3_1.X + (ColumnWidth5 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth5, RowContentHeight);
  2096. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("收 银"), ft11, b, rec9_5);//画第五列的列标题
  2097. Point p4_1 = new Point(p3_1.X + ColumnWidth5, rec9.Y);
  2098. Point p4_2 = new Point(p3_1.X + ColumnWidth5, rec9.Y + rec9.Height);
  2099. g.DrawLine(p, p4_1, p4_2);//画第三表与第四列的界线
  2100. // 收款日期
  2101. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion("付款日期");
  2102. sizef = g.MeasureString(StrValue, ft10);
  2103. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  2104. Rectangle rec9_6 = new Rectangle(p4_1.X + (ColumnWidth6 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth6, RowContentHeight);
  2105. g.DrawString(StrValue, ft11, b, rec9_6);//画第五列的列标题
  2106. int IntPoint_X = rec9.X;
  2107. int IntPoint_Y = rec9.Y + rec9.Height;
  2108. decimal CopeAmount = 0;//应付金额
  2109. decimal ActualAmount = 0;//实付金额
  2110. #endregion
  2111. #region 画内容
  2112. int ForCount = 0;
  2113. int PageRows = 4;//每页多少行
  2114. // 画列表每行
  2115. for (int i = 0; i < PageRows; i++)
  2116. {
  2117. string recfor_1Value = "";
  2118. string recfor_3Value = "";
  2119. string recfor_5Value = "";
  2120. string recfor_6Value = "";
  2121. if (ForCount < dgvData.SelectedRows.Count)
  2122. {
  2123. recfor_1Value = dgvData.SelectedRows[i].Cells["项目名称"].Value.ToString().Trim();//收款项目
  2124. recfor_3Value = Convert.ToDecimal(dgvData.SelectedRows[i].Cells["项目金额"].Value).ToString("0.00").Trim();
  2125. recfor_5Value = dgvData.SelectedRows[i].Cells["录单人"].Value.ToString().Trim();
  2126. recfor_6Value = LYFZ.Command.Command_Validate.DateTimeToString(dgvData.SelectedRows[i].Cells["收入时间"].Value);
  2127. ActualAmount += Convert.ToDecimal(dgvData.SelectedRows[i].Cells["项目金额"].Value);
  2128. ForCount++;
  2129. }
  2130. int forHeightCount = RowHeight;
  2131. int Height1 = Convert.ToInt32(g.MeasureString(recfor_1Value, ft10, ColumnWidth1).Height);
  2132. int Height2 = Convert.ToInt32(g.MeasureString("项目", ft10, ColumnWidth1).Height);
  2133. int HeightCount = Height1 / Height2;
  2134. if ((Height1 % Height2) > 0)
  2135. { HeightCount++; }
  2136. if (HeightCount > 1)
  2137. {
  2138. if (i < PageRows)
  2139. {
  2140. forHeightCount = Height1 + AddTop + 3;
  2141. i = i + (HeightCount - 1);
  2142. }
  2143. }
  2144. Rectangle recfor = new Rectangle(IntPoint_X, IntPoint_Y, TableWidth, forHeightCount);
  2145. g.DrawRectangle(p, recfor);//画标题矩形
  2146. Rectangle recfor_1 = new Rectangle(recfor.X + AddLeft, recfor.Y + AddTop, ColumnWidth1, Height1);
  2147. g.DrawString(recfor_1Value, ft10, b, recfor_1);//画第一列的列标题
  2148. Point pfor1_1 = new Point(recfor_1.X + ColumnWidth1 - 3, recfor.Y);
  2149. Point pfor1_2 = new Point(recfor_1.X + ColumnWidth1 - 3, recfor.Y + recfor.Height);
  2150. g.DrawLine(p, pfor1_1, pfor1_2);//画第一表与第二列的界线
  2151. StrValue = recfor_3Value;
  2152. sizef = g.MeasureString(StrValue, ft10);
  2153. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  2154. Rectangle recfor_3 = new Rectangle(pfor1_1.X + ColumnWidth3 - FtWidth - AddLeft * 2, pfor1_1.Y + AddTop, ColumnWidth3, recfor_1.Height);
  2155. g.DrawString(recfor_3Value, ft10, b, recfor_3);//画第三列的列标题
  2156. Point pfor3_1 = new Point(pfor1_1.X + ColumnWidth3, recfor.Y);
  2157. Point pfor3_2 = new Point(pfor1_1.X + ColumnWidth3, recfor.Y + recfor.Height);
  2158. g.DrawLine(p, pfor3_1, pfor3_2);//画第三表与第四列的界线
  2159. Rectangle recfor_5 = new Rectangle(pfor3_1.X + AddLeft, pfor3_1.Y + AddTop, ColumnWidth5, recfor_1.Height);
  2160. g.DrawString(recfor_5Value, ft10, b, recfor_5);//画第五列的列标题
  2161. Point pfor4_1 = new Point(pfor3_1.X + ColumnWidth5, recfor.Y);
  2162. Point pfor4_2 = new Point(pfor3_1.X + ColumnWidth5, recfor.Y + recfor.Height);
  2163. g.DrawLine(p, pfor4_1, pfor4_2);//画第三表与第四列的界线
  2164. Rectangle recfor_6 = new Rectangle(pfor4_1.X + AddLeft, pfor4_1.Y + AddTop, ColumnWidth5, recfor_1.Height);
  2165. g.DrawString(recfor_6Value, ft10, b, recfor_6);//画第五列的列标题
  2166. IntPoint_X = recfor.X;
  2167. IntPoint_Y = recfor.Y + recfor.Height;
  2168. }
  2169. #endregion
  2170. #region 尾
  2171. CopeAmount = ActualAmount;
  2172. Rectangle rec10 = new Rectangle(IntPoint_X, IntPoint_Y, TableWidth, RowHeight);
  2173. g.DrawRectangle(p, rec10);//画标题矩形
  2174. // 付款情况
  2175. string rec10_1Value = LYFZ.BLL.OtherCommonModel.FontConversion("付款情况");
  2176. sizef = g.MeasureString(rec10_1Value, ft11);
  2177. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  2178. FtHeight = Convert.ToInt32(sizef.Height);
  2179. Rectangle rec10_1 = new Rectangle(rec10.X + AddLeft, rec10.Y + AddTop2, FtWidth, RowContentHeight);
  2180. g.DrawString(rec10_1Value, ft11, b, rec10_1);//付款情况
  2181. // 应付
  2182. Rectangle rec10_2 = new Rectangle(rec10_1.X + (TableWidth / 4), rec10.Y + AddTop2, TableWidth / 4, RowContentHeight);
  2183. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("应付:") + CopeAmount.ToString(), ft11, b, rec10_2);//应付
  2184. // 实付
  2185. Rectangle rec10_3 = new Rectangle(rec10_2.X + (TableWidth / 4), rec10.Y + AddTop2, TableWidth / 4, RowContentHeight);
  2186. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("实付:") + ActualAmount.ToString(), ft11, b, rec10_3);//实付
  2187. // 欠款
  2188. Rectangle rec10_4 = new Rectangle(rec10_3.X + (TableWidth / 4), rec10.Y + AddTop2, TableWidth / 4, RowContentHeight);
  2189. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("欠款:") + "0", ft11, b, rec10_4);//欠款
  2190. Rectangle rec11 = new Rectangle(rec10.X, rec10.Y + rec10.Height, TableWidth, RowHeight);
  2191. g.DrawRectangle(p, rec11);//画标题矩形
  2192. // 合计
  2193. Rectangle rec11_1 = new Rectangle(rec11.X + AddLeft, rec11.Y + AddTop2, TableWidth - 300, RowContentHeight);
  2194. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("合计人民币(大写):") + " " + LYFZ.Software.MainBusiness.ReportPrint.ReportPrintDataClass.ConversionAmount(ActualAmount.ToString()), ft11, b, rec11_1);//合计人民币
  2195. // 顾客签字
  2196. Rectangle rec11_2 = new Rectangle(rec11_1.X + rec11_1.Width + 100, rec11_1.Y, 300, RowContentHeight);
  2197. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("顾客签字:"), ft11, b, rec11_2);//画消费法规
  2198. // 说明
  2199. Rectangle rec12 = new Rectangle(rec11.X, rec11.Y + rec11.Height + 3, rec9.Width, Convert.ToInt32(g.MeasureString("说明", ft9).Height) + 1);
  2200. string PaymentExplain = "";
  2201. if (PrintOtherData.ContainsKey("收款单说明") && PrintOtherData["收款单说明"].ToString().Trim().Length > 0)
  2202. { PaymentExplain = PrintOtherData["收款单说明"].ToString().Trim(); }
  2203. g.DrawString(PaymentExplain, ft9, b, rec12);//画消费法规
  2204. #endregion
  2205. }
  2206. #else
  2207. public static void PaymentPrint_OtherIncome_Print( object objValue, Graphics g, Size size, bool IsPrintSerialNo )
  2208. {
  2209. Hashtable htData = (Hashtable)objValue;
  2210. DataGridViewEc dgvData = (DataGridViewEc)htData["dgvData"];
  2211. //获取影楼信息
  2212. DataTable tbl = orbll.GetView_Custom( "tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Address,Company_Telephone,Company_UpdateDatetime" ).Tables[0];
  2213. if ( tbl.Rows.Count <= 0 )
  2214. {
  2215. MessageBoxCustom.Show( "未设置影楼信息" );
  2216. return;
  2217. }
  2218. Brush b = Brushes.Black;
  2219. Pen p = GetPen;
  2220. Font ft16 = new Font( "宋体", 16 );
  2221. Font ft11 = new Font( "宋体", 10 );
  2222. Font ft10 = new Font( "宋体", 9 );
  2223. Font ft9 = new Font( "宋体", 9 );
  2224. #region LOG
  2225. // 二维码
  2226. Image img = CachePhoto( PhotoLogType.DimensionalCode, tbl.Rows[0]["Company_UpdateDatetime"] );
  2227. Rectangle rec1 = new Rectangle( 50, 25, 90, 90 );
  2228. if ( img != null )
  2229. {
  2230. g.DrawImage( img, rec1 );
  2231. }
  2232. int TableWidth = size.Width - rec1.X * 2 - 14;
  2233. // 金色童年收据凭据
  2234. SizeF sizef = g.MeasureString( DefaultPrintTitle, ft16 );
  2235. int FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  2236. int FtHeight = Convert.ToInt32( sizef.Height );
  2237. Rectangle rec2 = new Rectangle( (size.Width / 2) - (FtWidth / 2), 30, FtWidth + 5, FtHeight );
  2238. g.DrawString( DefaultPrintTitle, ft16, b, rec2 );
  2239. #region NO.
  2240. string rec3Value = "";
  2241. if ( IsPrintSerialNo )
  2242. {
  2243. string SerialNo = PrintReceiptSerial();
  2244. if ( string.IsNullOrEmpty( SerialNo ) )
  2245. {
  2246. MessageBoxCustom.Show( "获取流水单号失败!" );
  2247. return;
  2248. }
  2249. rec3Value = "SerialNo." + SerialNo;
  2250. sizef = g.MeasureString( rec3Value, ft11 );
  2251. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  2252. FtHeight = Convert.ToInt32( sizef.Height );
  2253. Rectangle rec3A = new Rectangle( size.Width - rec1.X - FtWidth, rec2.Y + 35, FtWidth, FtHeight );
  2254. g.DrawString( rec3Value, ft11, b, rec3A );
  2255. }
  2256. #endregion
  2257. // 地址
  2258. string StrAddress = LYFZ.BLL.OtherCommonModel.FontConversion( "地址:" ) + tbl.Rows[0]["Company_Address"].ToString().Trim();
  2259. sizef = g.MeasureString( StrAddress, ft10 );
  2260. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  2261. FtHeight = Convert.ToInt32( sizef.Height );
  2262. Rectangle rec4 = new Rectangle( rec1.X + rec1.Width - 5, rec1.Y + rec1.Height + FtHeight - 47, TableWidth - rec1.Width + 14, FtHeight );
  2263. g.DrawString( StrAddress, ft10, b, rec4 );
  2264. string StrTelephone = LYFZ.BLL.OtherCommonModel.FontConversion( "电话:" ) + tbl.Rows[0]["Company_Telephone"].ToString().Trim();
  2265. Rectangle rec4A = new Rectangle( rec4.X, rec4.Y + rec4.Height - FtHeight * 2 + 2, TableWidth - rec1.Width - 10, FtHeight );
  2266. g.DrawString( StrTelephone, ft10, b, rec4A );
  2267. // 客户姓名
  2268. string StrName = LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名:" ) + dgvData.CurrentRow.Cells["付款人"].Value.ToString().Trim();
  2269. sizef = g.MeasureString( StrName, ft10 );
  2270. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  2271. FtHeight = Convert.ToInt32( sizef.Height );
  2272. Rectangle rec6 = new Rectangle( rec4.X, rec4.Y + rec4.Height - 2, FtWidth, FtHeight );
  2273. g.DrawString( StrName, ft10, b, rec6 );
  2274. // 日期
  2275. string StrDate = LYFZ.BLL.OtherCommonModel.FontConversion( "打印日期:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy年MM月dd日" );
  2276. sizef = g.MeasureString( StrDate, ft10 );
  2277. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  2278. FtHeight = Convert.ToInt32( sizef.Height );
  2279. Rectangle rec8 = new Rectangle( TableWidth + rec1.X - FtWidth + 14, rec6.Y, FtWidth, FtHeight );
  2280. g.DrawString( StrDate, ft10, b, rec8 );
  2281. #endregion
  2282. int AddLeft = 3;
  2283. int AddTop2 = 6;
  2284. int AddTop = 6;
  2285. int RowHeight = 26;
  2286. int RowContentHeight = 18;
  2287. int ColumnWidth3 = 120;
  2288. int ColumnWidth5 = 120;
  2289. int ColumnWidth6 = 100;
  2290. int ColumnWidth1 = TableWidth - ColumnWidth3 - ColumnWidth5 - ColumnWidth6;
  2291. int nUnitColumnWidth = (TableWidth + 10) / 15;
  2292. Rectangle rec9 = new Rectangle( rec1.X + 7, rec6.Y + rec6.Height + 1, nUnitColumnWidth * 15, RowHeight );
  2293. g.DrawRectangle( p, rec9 );//画标题矩形
  2294. #region 标题
  2295. // 收款项目
  2296. string StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "收款项目" );
  2297. sizef = g.MeasureString( StrValue, ft10 );
  2298. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  2299. Rectangle rec9_1 = new Rectangle( rec9.X, rec9.Y + AddTop2, nUnitColumnWidth * 7, RowContentHeight );
  2300. g.DrawString( StrValue, ft11, b, rec9_1 );//画第一列的列标题
  2301. Point p1_1 = new Point( rec9_1.Right, rec9.Y );
  2302. Point p1_2 = new Point( rec9_1.Right, rec9.Y + rec9.Height );
  2303. g.DrawLine( p, p1_1, p1_2 );//画第一表与第二列的界线
  2304. // 支付方式;
  2305. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "进帐方式" );
  2306. sizef = g.MeasureString( StrValue, ft10 );
  2307. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  2308. Rectangle rec9_2 = new Rectangle( rec9_1.Right, rec9.Y + AddTop2, nUnitColumnWidth * 2, RowContentHeight );
  2309. g.DrawString( StrValue, ft11, b, rec9_2 );//画第一列的列标题
  2310. Point p2_1 = new Point( rec9_2.Right, rec9.Y );
  2311. Point p2_2 = new Point( rec9_2.Right, rec9.Y + rec9.Height );
  2312. g.DrawLine( p, p2_1, p2_2 );//画第一表与第二列的界线
  2313. // 金 额
  2314. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "金 额" );
  2315. sizef = g.MeasureString( StrValue, ft10 );
  2316. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  2317. Rectangle rec9_3 = new Rectangle( rec9_2.Right, rec9.Y + AddTop2, nUnitColumnWidth * 2, RowContentHeight );
  2318. g.DrawString( StrValue, ft11, b, rec9_3 );//画第三列的列标题
  2319. Point p3_1 = new Point( rec9_3.Right, rec9.Y );
  2320. Point p3_2 = new Point( rec9_3.Right, rec9.Y + rec9.Height );
  2321. g.DrawLine( p, p3_1, p3_2 );//画第三表与第四列的界线
  2322. // 收 银
  2323. Rectangle rec9_5 = new Rectangle( rec9_3.Right, rec9.Y + AddTop2, nUnitColumnWidth * 2, RowContentHeight );
  2324. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "收 银" ), ft11, b, rec9_5 );//画第五列的列标题
  2325. Point p4_1 = new Point( rec9_5.Right, rec9.Y );
  2326. Point p4_2 = new Point( rec9_5.Right, rec9.Y + rec9.Height );
  2327. g.DrawLine( p, p4_1, p4_2 );//画第三表与第四列的界线
  2328. // 收款日期
  2329. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "付款日期" );
  2330. sizef = g.MeasureString( StrValue, ft10 );
  2331. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  2332. Rectangle rec9_6 = new Rectangle( rec9_5.Right, rec9.Y + AddTop2, nUnitColumnWidth * 2, RowContentHeight );
  2333. g.DrawString( StrValue, ft11, b, rec9_6 );//画第五列的列标题
  2334. int IntPoint_X = rec9.X;
  2335. int IntPoint_Y = rec9.Y + rec9.Height;
  2336. decimal CopeAmount = 0;//应付金额
  2337. decimal ActualAmount = 0;//实付金额
  2338. #endregion
  2339. #region 画内容
  2340. int ForCount = 0;
  2341. int PageRows = 4;//每页多少行
  2342. // 画列表每行
  2343. for ( int i = 0; i < PageRows; i++ )
  2344. {
  2345. string recfor_1Value = "";
  2346. string recfor_2Value = "";
  2347. string recfor_3Value = "";
  2348. string recfor_5Value = "";
  2349. string recfor_6Value = "";
  2350. if ( ForCount < dgvData.SelectedRows.Count )
  2351. {
  2352. recfor_1Value = dgvData.SelectedRows[i].Cells["项目名称"].Value.ToString().Trim();//收款项目
  2353. recfor_2Value = dgvData.SelectedRows[i].Cells["进帐方式"].Value.ToString().Trim();//进账方式
  2354. recfor_3Value = Convert.ToDecimal( dgvData.SelectedRows[i].Cells["项目金额"].Value ).ToString( "0.00" ).Trim();
  2355. recfor_5Value = dgvData.SelectedRows[i].Cells["录单人"].Value.ToString().Trim();
  2356. recfor_6Value = LYFZ.Command.Command_Validate.DateTimeToString( dgvData.SelectedRows[i].Cells["收入时间"].Value );
  2357. ActualAmount += Convert.ToDecimal( dgvData.SelectedRows[i].Cells["项目金额"].Value );
  2358. ForCount++;
  2359. }
  2360. int forHeightCount = RowHeight;
  2361. int Height1 = Convert.ToInt32( g.MeasureString( recfor_1Value, ft10, rec9_1.Width ).Height );
  2362. int Height2 = Convert.ToInt32( g.MeasureString( "项目", ft10, rec9_1.Width ).Height );
  2363. int HeightCount = Height1 / Height2;
  2364. if ( (Height1 % Height2) > 0 )
  2365. {
  2366. HeightCount++;
  2367. }
  2368. if ( HeightCount > 1 )
  2369. {
  2370. if ( i < PageRows )
  2371. {
  2372. forHeightCount = Height1 + AddTop + 3;
  2373. i = i + (HeightCount - 1);
  2374. }
  2375. }
  2376. Rectangle recfor = new Rectangle( IntPoint_X, IntPoint_Y, nUnitColumnWidth * 15, forHeightCount );
  2377. g.DrawRectangle( p, recfor );//画标题矩形
  2378. rec9_1.Y += RowHeight;
  2379. g.DrawString( recfor_1Value, ft10, b, rec9_1 );//画第一列的列标题
  2380. p1_1.Y += RowHeight;
  2381. p1_2.Y += RowHeight;
  2382. g.DrawLine( p, p1_1, p1_2 );//画第一表与第二列的界线
  2383. //StrValue = recfor_2Value;
  2384. sizef = g.MeasureString( recfor_2Value, ft10 );
  2385. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  2386. rec9_2.Y += RowHeight;
  2387. g.DrawString( recfor_2Value, ft10, b, rec9_2 );//画第三列的列标题
  2388. p2_1.Y += RowHeight;
  2389. p2_2.Y += RowHeight;
  2390. g.DrawLine( p, p2_1, p2_2 );//画第三表与第四列的界线
  2391. //StrValue = recfor_3Value;
  2392. sizef = g.MeasureString( recfor_3Value, ft10 );
  2393. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  2394. rec9_3.Y += RowHeight;
  2395. g.DrawString( recfor_3Value, ft10, b, rec9_3 );//画第三列的列标题
  2396. p3_1.Y += RowHeight;
  2397. p3_2.Y += RowHeight;
  2398. g.DrawLine( p, p3_1, p3_2 );//画第三表与第四列的界线
  2399. rec9_5.Y += RowHeight;
  2400. g.DrawString( recfor_5Value, ft10, b, rec9_5 );//画第五列的列标题
  2401. p4_1.Y += RowHeight;
  2402. p4_2.Y += RowHeight;
  2403. g.DrawLine( p, p4_1, p4_2 );//画第三表与第四列的界线
  2404. rec9_6.Y += RowHeight;
  2405. g.DrawString( recfor_6Value, ft10, b, rec9_6 );//画第五列的列标题
  2406. IntPoint_X = recfor.X;
  2407. IntPoint_Y = recfor.Y + recfor.Height;
  2408. }
  2409. #endregion
  2410. #region 尾
  2411. CopeAmount = ActualAmount;
  2412. Rectangle rec10 = new Rectangle( IntPoint_X, IntPoint_Y, nUnitColumnWidth * 15, RowHeight );
  2413. g.DrawRectangle( p, rec10 );//画标题矩形
  2414. // 付款情况
  2415. string rec10_1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "付款情况" );
  2416. sizef = g.MeasureString( rec10_1Value, ft11 );
  2417. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  2418. FtHeight = Convert.ToInt32( sizef.Height );
  2419. Rectangle rec10_1 = new Rectangle( rec10.X + AddLeft, rec10.Y + AddTop2, FtWidth, RowContentHeight );
  2420. g.DrawString( rec10_1Value, ft11, b, rec10_1 );//付款情况
  2421. // 应付
  2422. Rectangle rec10_2 = new Rectangle( rec10_1.X + (TableWidth / 4), rec10.Y + AddTop2, TableWidth / 4, RowContentHeight );
  2423. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "应付:" ) + CopeAmount.ToString(), ft11, b, rec10_2 );//应付
  2424. // 实付
  2425. Rectangle rec10_3 = new Rectangle( rec10_2.X + (TableWidth / 4), rec10.Y + AddTop2, TableWidth / 4, RowContentHeight );
  2426. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "实付:" ) + ActualAmount.ToString(), ft11, b, rec10_3 );//实付
  2427. // 欠款
  2428. Rectangle rec10_4 = new Rectangle( rec10_3.X + (TableWidth / 4), rec10.Y + AddTop2, TableWidth / 4, RowContentHeight );
  2429. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "欠款:" ) + "0", ft11, b, rec10_4 );//欠款
  2430. // 合计
  2431. Rectangle rec11 = new Rectangle( rec10.X, rec10.Y + rec10.Height, nUnitColumnWidth * 15, RowHeight );
  2432. g.DrawRectangle( p, rec11 );//画标题矩形
  2433. Rectangle rec11_1 = new Rectangle( rec11.X + AddLeft, rec11.Y + AddTop2, TableWidth - 300, RowContentHeight );
  2434. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "合计人民币(大写):" ) + " " + LYFZ.Software.MainBusiness.ReportPrint.ReportPrintDataClass.ConversionAmount( ActualAmount.ToString() ), ft11, b, rec11_1 );//合计人民币
  2435. // 顾客签字
  2436. Rectangle rec11_2 = new Rectangle( rec11_1.X + rec11_1.Width + 100, rec11_1.Y, 300, RowContentHeight );
  2437. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "顾客签字:" ), ft11, b, rec11_2 );//画消费法规
  2438. // 说明
  2439. Rectangle rec12 = new Rectangle( rec11.X, rec11.Y + rec11.Height + 3, rec9.Width, Convert.ToInt32( g.MeasureString( "说明", ft9 ).Height ) + 1 );
  2440. string PaymentExplain = "";
  2441. if ( PrintOtherData.ContainsKey( "收款单说明" ) && PrintOtherData["收款单说明"].ToString().Trim().Length > 0 )
  2442. {
  2443. PaymentExplain = PrintOtherData["收款单说明"].ToString().Trim();
  2444. }
  2445. g.DrawString( PaymentExplain, ft9, b, rec12 );//画消费法规
  2446. #endregion
  2447. }
  2448. #endif
  2449. #endregion
  2450. #region 会员充值收款
  2451. /// <summary>
  2452. /// 会员充值收款
  2453. /// </summary>
  2454. /// <param name="panl"></param>
  2455. public static void PaymentPrint_MemberRecharge_Print( object objData, Graphics g, Size size, bool IsPrintSerialNo )
  2456. {
  2457. Hashtable htDataObj = (Hashtable)objData;
  2458. List<dynamic> dyObjList = htDataObj["PrintDataList"] as List<dynamic>;
  2459. //
  2460. List<Image> imglist = new List<Image>();
  2461. string ExecuteSql = orbll.GetView_CustomReturnExecuteSql( "tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Address,Company_Telephone,Company_UpdateDatetime" );
  2462. ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql( "BView_MemberMain_GoldMember", StrWhere: "Mc_Number = '" + htDataObj["McNumber"] + "'" );
  2463. DataSet dtSet = orbll.GetView_Custom( ExecuteSql );
  2464. DataTable tbl = dtSet.Tables["ds"];//获取影楼信息
  2465. if ( tbl.Rows.Count <= 0 )
  2466. {
  2467. MessageBoxCustom.Show( "未设置影楼信息" ); return;
  2468. }
  2469. DataTable tbl2 = dtSet.Tables["ds1"];//会员卡
  2470. #region 每页循环
  2471. Brush b = Brushes.Black;
  2472. Pen p = GetPen;
  2473. Font ft16 = new Font( "宋体", 16 );
  2474. Font ft11 = new Font( "宋体", 10 );
  2475. Font ft10 = new Font( "宋体", 9 );
  2476. Font ft9 = new Font( "宋体", 9 );
  2477. #region 二维码
  2478. Image img = CachePhoto( PhotoLogType.DimensionalCode, tbl.Rows[0]["Company_UpdateDatetime"] );
  2479. Rectangle rec1 = new Rectangle( 50, 25, 90, 90 );
  2480. if ( img != null )
  2481. {
  2482. g.DrawImage( img, rec1 );
  2483. }
  2484. #endregion
  2485. int TableWidth = size.Width - rec1.X * 2 - 14;
  2486. #region 金色童年收据凭据
  2487. SizeF sizef = g.MeasureString( DefaultPrintTitle, ft16 );
  2488. int FtWidth = Convert.ToInt32( sizef.Width );
  2489. int FtHeight = Convert.ToInt32( sizef.Height );
  2490. Rectangle rec2 = new Rectangle( (size.Width / 2) - (FtWidth / 2), 30, FtWidth + 5, FtHeight );
  2491. g.DrawString( DefaultPrintTitle, ft16, b, rec2 );
  2492. #endregion
  2493. #region NO.
  2494. string rec3Value = LYFZ.BLL.OtherCommonModel.FontConversion( "卡号." ) + StrRandom( tbl2.Rows[0]["会员卡号"].ToString().Trim() );
  2495. sizef = g.MeasureString( rec3Value, ft11 );
  2496. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  2497. FtHeight = Convert.ToInt32( sizef.Height );
  2498. Rectangle rec3 = new Rectangle( size.Width - rec1.X - FtWidth, rec2.Y + 35, FtWidth, FtHeight );
  2499. g.DrawString( rec3Value, ft11, b, rec3 );
  2500. if ( IsPrintSerialNo )
  2501. {
  2502. string SerialNo = PrintReceiptSerial();
  2503. if ( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition )
  2504. {
  2505. SerialNo = PrintReceiptSerial( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.CurrentCompanyInfoID );
  2506. }
  2507. if ( string.IsNullOrEmpty( SerialNo ) )
  2508. {
  2509. MessageBoxCustom.Show( "获取流水单号失败!" ); return;
  2510. }
  2511. rec3Value = "SerialNo." + SerialNo;
  2512. sizef = g.MeasureString( rec3Value, ft11 );
  2513. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  2514. FtHeight = Convert.ToInt32( sizef.Height );
  2515. Rectangle rec3A = new Rectangle( size.Width - rec1.X - FtWidth, rec3.Y - FtHeight + 2, FtWidth, FtHeight );
  2516. g.DrawString( rec3Value, ft11, b, rec3A );
  2517. }
  2518. #endregion
  2519. #region 地址
  2520. string StrAddress = LYFZ.BLL.OtherCommonModel.FontConversion( "地址:" ) + tbl.Rows[0]["Company_Address"].ToString().Trim();
  2521. sizef = g.MeasureString( StrAddress, ft10 );
  2522. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  2523. FtHeight = Convert.ToInt32( sizef.Height );
  2524. Rectangle rec4 = new Rectangle( rec1.X + rec1.Width - 5, rec3.Y + rec3.Height + FtHeight - 15, TableWidth - rec1.Width + 14, FtHeight );
  2525. g.DrawString( StrAddress, ft10, b, rec4 );
  2526. string StrTelephone = LYFZ.BLL.OtherCommonModel.FontConversion( "电话:" ) + tbl.Rows[0]["Company_Telephone"].ToString().Trim();
  2527. Rectangle rec4A = new Rectangle( rec4.X, rec4.Y + rec4.Height - FtHeight * 2 + 2, TableWidth - rec1.Width - 10, FtHeight );
  2528. g.DrawString( StrTelephone, ft10, b, rec4A );
  2529. #endregion
  2530. #region 客户姓名
  2531. string StrName = LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名:" ) + tbl2.Rows[0]["姓名"].ToString().Trim() + " " + LYFZ.BLL.OtherCommonModel.FontConversion( "联系电话:" ) + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( tbl2.Rows[0]["电话"] );
  2532. sizef = g.MeasureString( StrName, ft10 );
  2533. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  2534. FtHeight = Convert.ToInt32( sizef.Height );
  2535. Rectangle rec6 = new Rectangle( rec4.X, rec4.Y + rec4.Height - 2, FtWidth, FtHeight );
  2536. g.DrawString( StrName, ft10, b, rec6 );
  2537. #endregion
  2538. #region 日期
  2539. string StrDate = LYFZ.BLL.OtherCommonModel.FontConversion( "打印日期:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy年MM月dd日" );
  2540. sizef = g.MeasureString( StrDate, ft10 );
  2541. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  2542. FtHeight = Convert.ToInt32( sizef.Height );
  2543. Rectangle rec8 = new Rectangle( TableWidth + rec1.X - FtWidth + 14, rec6.Y, FtWidth, FtHeight );
  2544. g.DrawString( StrDate, ft10, b, rec8 );
  2545. #endregion
  2546. int AddLeft = 3;
  2547. int AddTop2 = 6;
  2548. int AddTop = 6;
  2549. int RowHeight = 26;
  2550. int RowContentHeight = 18;
  2551. int ColumnWidth2 = 110;
  2552. int ColumnWidth3 = 90;
  2553. int ColumnWidth4 = 80;
  2554. int ColumnWidth5 = 90;
  2555. int ColumnWidth6 = 100;
  2556. int ColumnWidth1 = TableWidth - ColumnWidth2 - ColumnWidth3 - ColumnWidth4 - ColumnWidth5 - ColumnWidth6;
  2557. Rectangle rec9 = new Rectangle( rec1.X + 7, rec6.Y + rec6.Height + 1, TableWidth, RowHeight );
  2558. g.DrawRectangle( p, rec9 );//画标题矩形
  2559. #region 收款项目
  2560. string StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "收款项目" );
  2561. FtWidth = Convert.ToInt32( g.MeasureString( StrValue, ft10 ).Width ) + 1;
  2562. Rectangle rec9_1 = new Rectangle( rec9.X + (ColumnWidth1 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth1, RowContentHeight );
  2563. g.DrawString( StrValue, ft11, b, rec9_1 );//画第一列的列标题
  2564. Point p1_1 = new Point( rec9.X + ColumnWidth1, rec9.Y );
  2565. Point p1_2 = new Point( rec9.X + ColumnWidth1, rec9.Y + rec9.Height );
  2566. g.DrawLine( p, p1_1, p1_2 );//画第一表与第二列的界线
  2567. #endregion
  2568. #region 支付方式
  2569. Rectangle rec9_2 = new Rectangle( p1_1.X + (ColumnWidth2 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth2, RowContentHeight );
  2570. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "支付方式" ), ft11, b, rec9_2 );//画第二列的列标题
  2571. Point p2_1 = new Point( p1_1.X + ColumnWidth2, rec9.Y );
  2572. Point p2_2 = new Point( p1_2.X + ColumnWidth2, rec9.Y + rec9.Height );
  2573. g.DrawLine( p, p2_1, p2_2 );//画第二表与第三列的界线
  2574. #endregion
  2575. #region 金 额
  2576. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "金 额" );
  2577. FtWidth = Convert.ToInt32( g.MeasureString( StrValue, ft10 ).Width ) + 1;
  2578. Rectangle rec9_3 = new Rectangle( p2_1.X + (ColumnWidth3 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth3, RowContentHeight );
  2579. g.DrawString( StrValue, ft11, b, rec9_3 );//画第三列的列标题
  2580. Point p3_1 = new Point( p2_1.X + ColumnWidth3, rec9.Y );
  2581. Point p3_2 = new Point( p2_1.X + ColumnWidth3, rec9.Y + rec9.Height );
  2582. g.DrawLine( p, p3_1, p3_2 );//画第三表与第四列的界线
  2583. #endregion
  2584. #region 收 银
  2585. Rectangle rec9_4 = new Rectangle( p3_1.X + (ColumnWidth4 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth4, RowContentHeight );
  2586. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "收 银" ), ft11, b, rec9_4 );//画第四列的列标题
  2587. Point p4_1 = new Point( p3_1.X + ColumnWidth4, rec9.Y );
  2588. Point p4_2 = new Point( p3_1.X + ColumnWidth4, rec9.Y + rec9.Height );
  2589. g.DrawLine( p, p4_1, p4_2 );//画第三表与第四列的界线
  2590. #endregion
  2591. #region 充值日期
  2592. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "充值日期" );
  2593. FtWidth = Convert.ToInt32( g.MeasureString( StrValue, ft10 ).Width ) + 1;
  2594. Rectangle rec9_5 = new Rectangle( p4_1.X + (ColumnWidth5 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth5, RowContentHeight );
  2595. g.DrawString( StrValue, ft11, b, rec9_5 );//画第四列的列标题
  2596. Point p5_1 = new Point( p4_1.X + ColumnWidth5, rec9.Y );
  2597. Point p5_2 = new Point( p4_1.X + ColumnWidth5, rec9.Y + rec9.Height );
  2598. g.DrawLine( p, p5_1, p5_2 );//画第三表与第四列的界线
  2599. #endregion
  2600. #region 接单人
  2601. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "接单人" );
  2602. FtWidth = Convert.ToInt32( g.MeasureString( StrValue, ft10 ).Width ) + 1;
  2603. Rectangle rec9_6 = new Rectangle( p5_1.X + (ColumnWidth6 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth6, RowContentHeight );
  2604. g.DrawString( StrValue, ft11, b, rec9_6 );//画第四列的列标题
  2605. #endregion
  2606. int IntPoint_X = rec9.X;
  2607. int IntPoint_Y = rec9.Y + rec9.Height;
  2608. decimal totalValue = 0;
  2609. decimal totalSerAmoun =0;
  2610. decimal totalPaymentAmount = 0;
  2611. string RechargeType = "";
  2612. #region 画列表每行
  2613. int PageRows = 4;//每页多少行
  2614. for ( int i = 0; i < PageRows; i++ )
  2615. {
  2616. IDictionary<string ,object> htData = null;
  2617. if(dyObjList.Count>i)
  2618. {
  2619. htData = dyObjList[i];
  2620. RechargeType = htData["RechargeType"].ToString_s();
  2621. }
  2622. Rectangle recfor = new Rectangle( IntPoint_X, IntPoint_Y, TableWidth, RowHeight );
  2623. g.DrawRectangle( p, recfor );//画标题矩形
  2624. string Values1 = "";
  2625. string Values2 = "";
  2626. string Values3 = "";
  2627. string Values4 = "";
  2628. string Values5 = "";
  2629. string Values6 = "";
  2630. if (htData != null)
  2631. {
  2632. Values1 = htData["PaymentItem"].ToString().Trim().Split('(')[0];
  2633. Values2 = htData["PaymentMethod"].ToString().Trim();
  2634. Values3 = Convert.ToDecimal(htData["PaymentAmount"]).ToString("0.00").Trim();
  2635. Values4 = htData["PaymentPeople"].ToString().Trim();
  2636. Values5 = LYFZ.Command.Command_Validate.DateTimeToString(htData["PaymentDate"].ToString().Trim());
  2637. Values6 = htData["SinglePerson"].ToString().Trim();
  2638. //totalPaymentAmount += Convert.ToDecimal(htData["PaymentAmount"]);
  2639. if (RechargeType.Equals("会员充值定金"))
  2640. {
  2641. totalSerAmoun += Convert.ToDecimal(htData["TotalSerAmoun"]);
  2642. }
  2643. else
  2644. {
  2645. totalPaymentAmount += Convert.ToDecimal(htData["PaymentAmount"]);
  2646. }
  2647. }
  2648. if (RechargeType.Equals( "会员充值定金" ) && i == 1 )
  2649. {
  2650. totalValue = (decimal)htData["TotalRechargeAmoun"];
  2651. if ( (totalValue - Convert.ToDecimal( htData["PaymentAmount"] )) > 0 )
  2652. {
  2653. Values1 = "已缴纳金额(定金)";
  2654. Values2 = "";
  2655. Values3 = (totalValue - Convert.ToDecimal( htData["PaymentAmount"] )).ToString( "0.00" ).Trim();
  2656. Values4 = "";
  2657. Values5 = "";
  2658. Values6 = "";
  2659. }
  2660. }
  2661. //收款项目
  2662. Rectangle recfor_1 = new Rectangle( recfor.X + AddLeft, recfor.Y + AddTop, ColumnWidth1, RowContentHeight );
  2663. g.DrawString( Values1, ft10, b, recfor_1 );//画第一列的列标题
  2664. Point pfor1_1 = new Point( recfor_1.X + ColumnWidth1 - 3, recfor.Y );
  2665. Point pfor1_2 = new Point( recfor_1.X + ColumnWidth1 - 3, recfor.Y + recfor.Height );
  2666. g.DrawLine( p, pfor1_1, pfor1_2 );//画第一表与第二列的界线
  2667. //支付方式
  2668. Rectangle recfor_2 = new Rectangle( pfor1_1.X + AddLeft, pfor1_1.Y + AddTop, ColumnWidth2, RowContentHeight );
  2669. g.DrawString( Values2, ft10, b, recfor_2 );//画第二列的列标题
  2670. Point pfor2_1 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y );
  2671. Point pfor2_2 = new Point( pfor1_2.X + ColumnWidth2, recfor.Y + recfor.Height );
  2672. g.DrawLine( p, pfor2_1, pfor2_2 );//画第二表与第三列的界线
  2673. //金额
  2674. StrValue = Values3;
  2675. FtWidth = Convert.ToInt32( g.MeasureString( StrValue, ft10 ).Width ) + 1;
  2676. Rectangle recfor_3 = new Rectangle( pfor2_1.X + ColumnWidth3 - FtWidth - AddLeft * 2, pfor1_1.Y + AddTop, ColumnWidth3, RowContentHeight );
  2677. g.DrawString( Values3, ft10, b, recfor_3 );//画第三列的列标题
  2678. Point pfor3_1 = new Point( pfor2_1.X + ColumnWidth3, recfor.Y );
  2679. Point pfor3_2 = new Point( pfor2_2.X + ColumnWidth3, recfor.Y + recfor.Height );
  2680. g.DrawLine( p, pfor3_1, pfor3_2 );//画第三表与第四列的界线
  2681. //收银
  2682. Rectangle recfor_4 = new Rectangle( pfor3_1.X + AddLeft, pfor1_1.Y + AddTop, ColumnWidth4, RowContentHeight );
  2683. g.DrawString( Values4, ft10, b, recfor_4 );//画第四列的列标题
  2684. Point pfor4_1 = new Point( pfor3_1.X + ColumnWidth4, recfor.Y );
  2685. Point pfor4_2 = new Point( pfor3_1.X + ColumnWidth4, recfor.Y + recfor.Height );
  2686. g.DrawLine( p, pfor4_1, pfor4_2 );//画第三表与第四列的界线
  2687. //充值日期
  2688. Rectangle recfor_5 = new Rectangle( pfor4_1.X + AddLeft, pfor1_1.Y + AddTop, ColumnWidth5, RowContentHeight );
  2689. g.DrawString( Values5, ft10, b, recfor_5 );//画第四列的列标题
  2690. Point pfor5_1 = new Point( pfor4_1.X + ColumnWidth5, recfor.Y );
  2691. Point pfor5_2 = new Point( pfor4_1.X + ColumnWidth5, recfor.Y + recfor.Height );
  2692. g.DrawLine( p, pfor5_1, pfor5_2 );//画第三表与第四列的界线
  2693. //接单人
  2694. Rectangle recfor_6 = new Rectangle( pfor5_1.X + AddLeft, pfor1_1.Y + AddTop, ColumnWidth6, RowContentHeight );
  2695. g.DrawString( Values6, ft10, b, recfor_6 );//画第四列的列标题
  2696. IntPoint_X = recfor.X;
  2697. IntPoint_Y = recfor.Y + recfor.Height;
  2698. }
  2699. #endregion
  2700. Rectangle rec10 = new Rectangle( IntPoint_X, IntPoint_Y, TableWidth, RowHeight );
  2701. g.DrawRectangle( p, rec10 );//画标题矩形
  2702. #region 付款情况
  2703. string rec10_1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "付款情况:" );
  2704. sizef = g.MeasureString( rec10_1Value, ft11 );
  2705. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  2706. FtHeight = Convert.ToInt32( sizef.Height );
  2707. Rectangle rec10_1 = new Rectangle( rec10.X + AddLeft, rec10.Y + AddTop2, FtWidth, RowContentHeight );
  2708. g.DrawString( rec10_1Value, ft11, b, rec10_1 );//付款情况
  2709. #endregion
  2710. #region 应付
  2711. Rectangle rec10_2 = new Rectangle( rec10_1.X + FtWidth + 10, rec10.Y + AddTop2, TableWidth / 4, RowContentHeight );
  2712. if (RechargeType.Equals( "会员充值定金" ) )
  2713. {
  2714. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "应付:" ) + totalSerAmoun.ToString().Trim(), ft11, b, rec10_2 );//应付
  2715. }
  2716. else
  2717. {
  2718. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "应付:" ) + totalPaymentAmount.ToString().Trim(), ft11, b, rec10_2 );//应付
  2719. }
  2720. #endregion
  2721. #region 实付
  2722. Rectangle rec10_3 = new Rectangle( rec10_2.X + (TableWidth / 3), rec10.Y + AddTop2, TableWidth / 4, RowContentHeight );
  2723. if ( RechargeType.Equals( "会员充值定金" ) )
  2724. {
  2725. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "实付:" ) + totalValue.ToString().Trim(), ft11, b, rec10_3 );//实付
  2726. }
  2727. else
  2728. {
  2729. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "实付:" ) + totalPaymentAmount.ToString().Trim(), ft11, b, rec10_3 );//实付
  2730. }
  2731. #endregion
  2732. #region 余额;
  2733. Rectangle rec10_4 = new Rectangle( rec10_3.X + (TableWidth / 3), rec10.Y + AddTop2, TableWidth / 4, RowContentHeight );
  2734. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "余额:" ) + tbl2.Rows[0]["金额"].ToString().Trim(), ft11, b, rec10_4 );//实付
  2735. #endregion
  2736. Rectangle rec11 = new Rectangle( rec10.X, rec10.Y + rec10.Height, TableWidth, RowHeight );
  2737. g.DrawRectangle( p, rec11 );//画标题矩形
  2738. #region 合计
  2739. Rectangle rec11_1 = new Rectangle( rec11.X + AddLeft, rec11.Y + AddTop2, TableWidth - 300, RowContentHeight );
  2740. if (RechargeType.Equals( "会员充值定金" ) )
  2741. {
  2742. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "合计人民币(大写):" ) + " " + LYFZ.Software.MainBusiness.ReportPrint.ReportPrintDataClass.ConversionAmount( (totalValue).ToString().Trim() ), ft11, b, rec11_1 );//合计人民币
  2743. }
  2744. else
  2745. {
  2746. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "合计人民币(大写):" ) + " " + LYFZ.Software.MainBusiness.ReportPrint.ReportPrintDataClass.ConversionAmount(totalPaymentAmount.ToString().Trim() ), ft11, b, rec11_1 );//合计人民币
  2747. }
  2748. #endregion
  2749. #region 顾客签字
  2750. Rectangle rec11_2 = new Rectangle( rec11_1.X + rec11_1.Width + 100, rec11_1.Y, 300, RowContentHeight );
  2751. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "顾客签字:" ), ft11, b, rec11_2 );//画消费法规
  2752. #endregion
  2753. #region 说明
  2754. Rectangle rec12 = new Rectangle( rec11.X, rec11.Y + rec11.Height + 3, rec9.Width, Convert.ToInt32( g.MeasureString( "说明", ft9 ).Height ) + 1 );
  2755. string PaymentExplain = "";
  2756. if ( PrintOtherData.ContainsKey( "收款单说明" ) && PrintOtherData["收款单说明"].ToString().Trim().Length > 0 )
  2757. {
  2758. PaymentExplain = PrintOtherData["收款单说明"].ToString().Trim();
  2759. }
  2760. g.DrawString( PaymentExplain, ft9, b, rec12 );//画消费法规
  2761. #endregion
  2762. #endregion
  2763. }
  2764. #endregion
  2765. #region 会员充值A4纸打印
  2766. /// <summary>
  2767. /// 会员充值收款
  2768. /// </summary>
  2769. /// <param name="panl"></param>
  2770. public static void PaymentPrint_MemberRechargeA4_Print( object objData, Graphics g, Size size, bool IsPrintSerialNo )
  2771. {
  2772. //Hashtable htData = (Hashtable)objData;
  2773. Hashtable htDataObj = (Hashtable)objData;
  2774. List<dynamic> dyObjList = htDataObj["PrintDataList"] as List<dynamic>;
  2775. string McNumber = htDataObj["McNumber"].ToString_s();
  2776. List<Image> imglist = new List<Image>();
  2777. string ExecuteSql = orbll.GetView_CustomReturnExecuteSql( "tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Address,Company_Telephone,Company_UpdateDatetime" );
  2778. ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql( "BView_MemberMain_GoldMember", StrWhere: "Mc_Number = '" + McNumber + "'" );
  2779. DataSet dtSet = orbll.GetView_Custom( ExecuteSql );
  2780. DataTable tbl = dtSet.Tables["ds"];//获取影楼信息
  2781. if ( tbl.Rows.Count <= 0 )
  2782. {
  2783. MessageBoxCustom.Show( "未设置影楼信息" ); return;
  2784. }
  2785. DataTable tbl2 = dtSet.Tables["ds1"];//会员卡
  2786. Brush b = Brushes.Black;
  2787. Pen p = GetPen;
  2788. Font ft16 = new Font( "宋体", 16 );
  2789. Font ft11b = new Font( "宋体", 10, FontStyle.Bold );
  2790. Font ft11 = new Font( "宋体", 10 );
  2791. Font ft10 = new Font( "宋体", 9 );
  2792. Font ft9 = new Font( "宋体", 9 );
  2793. int AddTop = 8;
  2794. int AddLeft = 5;
  2795. int RowHeight = 30;
  2796. int LeftWidth = 50;
  2797. int TableWidth = size.Width - LeftWidth * 2 - 14;
  2798. int ColumnWidth2 = 120;
  2799. int ColumnWidth3 = 100;
  2800. int ColumnWidth4 = 100;
  2801. int ColumnWidth5 = 100;
  2802. int ColumnWidth1 = TableWidth - ColumnWidth2 - ColumnWidth3 - ColumnWidth4 - ColumnWidth5;
  2803. #region 标题
  2804. string StrValue = DefaultPrintTitle;
  2805. SizeF sizef = g.MeasureString( StrValue, ft16 );
  2806. int FtWidth = Convert.ToInt32( sizef.Width );
  2807. int FtHeight = Convert.ToInt32( sizef.Height );
  2808. Rectangle rec = new Rectangle( (size.Width - FtWidth) / 2, 30, FtWidth, FtHeight );
  2809. g.DrawString( StrValue, ft16, b, rec );
  2810. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "会员卡:" ) + StrRandom( tbl2.Rows[0]["会员卡号"].ToString().Trim() );
  2811. sizef = g.MeasureString( StrValue, ft10 );
  2812. FtWidth = Convert.ToInt32( sizef.Width );
  2813. FtHeight = Convert.ToInt32( sizef.Height );
  2814. Rectangle rec1A = new Rectangle( LeftWidth, rec.Location.Y + rec.Height, FtWidth, FtHeight );
  2815. g.DrawString( StrValue, ft10, b, rec1A );
  2816. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "打印时间:" ) + SDateTime.Now.ToString( "yyyy-MM-dd HH:mm" );
  2817. sizef = g.MeasureString( StrValue, ft10 );
  2818. FtWidth = Convert.ToInt32( sizef.Width );
  2819. FtHeight = Convert.ToInt32( sizef.Height );
  2820. Rectangle rec1B = new Rectangle( size.Width - FtWidth - LeftWidth - 10, rec1A.Location.Y, FtWidth, FtHeight );
  2821. g.DrawString( StrValue, ft10, b, rec1B );
  2822. #endregion
  2823. #region 姓名、电话
  2824. Rectangle rec2 = new Rectangle( rec1A.X, rec1A.Y + rec1A.Height, TableWidth, RowHeight );
  2825. g.DrawRectangle( p, rec2 );//画标题矩形
  2826. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "姓名:" );
  2827. FtWidth = Convert.ToInt32( g.MeasureString( StrValue, ft11 ).Width ) + 1;
  2828. FtHeight = Convert.ToInt32( sizef.Height );
  2829. Rectangle rec2A = new Rectangle( rec2.X + AddLeft, rec2.Y + AddTop, FtWidth, FtHeight );
  2830. g.DrawString( StrValue, ft11, b, rec2A );//画第一列的列标题
  2831. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( tbl2.Rows[0]["姓名"].ToString().Trim() );
  2832. FtWidth = Convert.ToInt32( g.MeasureString( StrValue, ft10 ).Width ) + 1;
  2833. FtHeight = Convert.ToInt32( sizef.Height );
  2834. Rectangle rec2B = new Rectangle( rec2A.X + rec2A.Width, rec2A.Y, FtWidth, FtHeight );
  2835. g.DrawString( StrValue, ft10, b, rec2B );//画第一列的列标题
  2836. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "电话:" );
  2837. FtWidth = Convert.ToInt32( g.MeasureString( StrValue, ft11 ).Width ) + 1;
  2838. FtHeight = Convert.ToInt32( sizef.Height );
  2839. Rectangle rec2C = new Rectangle( rec1A.X + (TableWidth / 2), rec2A.Y, FtWidth, FtHeight );
  2840. g.DrawString( StrValue, ft11, b, rec2C );//画第一列的列标题
  2841. StrValue = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( tbl2.Rows[0]["电话"] );
  2842. FtWidth = Convert.ToInt32( g.MeasureString( StrValue, ft10 ).Width ) + 1;
  2843. FtHeight = Convert.ToInt32( sizef.Height );
  2844. Rectangle rec2D = new Rectangle( rec2C.X + rec2C.Width, rec2A.Y, FtWidth, FtHeight );
  2845. g.DrawString( StrValue, ft10, b, rec2D );//画第一列的列标题
  2846. #endregion
  2847. #region 列表标题
  2848. Rectangle rec3 = new Rectangle( rec1A.X, rec2.Y + rec2.Height, TableWidth, RowHeight );
  2849. g.DrawRectangle( p, rec3 );//画标题矩形
  2850. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "收款项目" );
  2851. FtWidth = Convert.ToInt32( g.MeasureString( StrValue, ft11 ).Width );
  2852. FtHeight = Convert.ToInt32( sizef.Height );
  2853. Rectangle rec3A = new Rectangle( rec3.X + (ColumnWidth1 / 2 - FtWidth / 2), rec3.Y + AddTop, ColumnWidth1, FtHeight );
  2854. g.DrawString( StrValue, ft11, b, rec3A );//画第一列的列标题
  2855. Point rec3A_1 = new Point( rec3.X + ColumnWidth1, rec3.Y );
  2856. Point rec3A_2 = new Point( rec3.X + ColumnWidth1, rec3.Y + rec3.Height );
  2857. g.DrawLine( p, rec3A_1, rec3A_2 );//画第一表与第二列的界线
  2858. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "支付方式" );
  2859. FtWidth = Convert.ToInt32( g.MeasureString( StrValue, ft11 ).Width );
  2860. FtHeight = Convert.ToInt32( sizef.Height );
  2861. Rectangle rec3B = new Rectangle( rec3A_1.X + (ColumnWidth2 / 2 - FtWidth / 2), rec3A.Y, ColumnWidth2, FtHeight );
  2862. g.DrawString( StrValue, ft11, b, rec3B );//画第二列的列标题
  2863. Point rec3B_1 = new Point( rec3A_1.X + ColumnWidth2, rec3.Y );
  2864. Point rec3B_2 = new Point( rec3A_1.X + ColumnWidth2, rec3.Y + rec3.Height );
  2865. g.DrawLine( p, rec3B_1, rec3B_2 );//画第二表与第三列的界线
  2866. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "金 额" );
  2867. FtWidth = Convert.ToInt32( g.MeasureString( StrValue, ft11 ).Width );
  2868. FtHeight = Convert.ToInt32( sizef.Height );
  2869. Rectangle rec3C = new Rectangle( rec3B_1.X + (ColumnWidth3 / 2 - FtWidth / 2), rec3A.Y, ColumnWidth3, FtHeight );
  2870. g.DrawString( StrValue, ft11, b, rec3C );//画第三列的列标题
  2871. Point rec3C_1 = new Point( rec3B_1.X + ColumnWidth3, rec3.Y );
  2872. Point rec3C_2 = new Point( rec3B_1.X + ColumnWidth3, rec3.Y + rec3.Height );
  2873. g.DrawLine( p, rec3C_1, rec3C_2 );//画第三表与第四列的界线
  2874. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "收 银" );
  2875. FtWidth = Convert.ToInt32( g.MeasureString( StrValue, ft11 ).Width );
  2876. FtHeight = Convert.ToInt32( sizef.Height );
  2877. Rectangle rec3D = new Rectangle( rec3C_1.X + (ColumnWidth4 / 2 - FtWidth / 2), rec3A.Y, ColumnWidth4, FtHeight );
  2878. g.DrawString( StrValue, ft11, b, rec3D );//画第四列的列标题
  2879. Point rec3D_1 = new Point( rec3C_1.X + ColumnWidth3, rec3.Y );
  2880. Point rec3D_2 = new Point( rec3C_1.X + ColumnWidth3, rec3.Y + rec3.Height );
  2881. g.DrawLine( p, rec3D_1, rec3D_2 );//画第三表与第四列的界线
  2882. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "充值日期" );
  2883. FtWidth = Convert.ToInt32( g.MeasureString( StrValue, ft11 ).Width ) + 1;
  2884. Rectangle rec3E = new Rectangle( rec3D_1.X + (ColumnWidth5 / 2 - FtWidth / 2), rec3A.Y, ColumnWidth5, FtHeight );
  2885. g.DrawString( StrValue, ft11, b, rec3E );//画第四列的列标题
  2886. #endregion
  2887. decimal totalValue = 0;
  2888. decimal totalSerAmoun = 0;
  2889. decimal paymentAmount = 0;
  2890. string RechargeType = "";
  2891. IDictionary<string, object> htData = null;
  2892. Rectangle rec4 = new Rectangle(rec3.X, rec3.Y + rec3.Height, TableWidth, RowHeight);
  2893. foreach (dynamic dyObj in dyObjList)
  2894. {
  2895. htData = dyObj;
  2896. RechargeType = htData["RechargeType"].ToString_s();
  2897. #region 充值记录
  2898. g.DrawRectangle(p, rec4);//画标题矩形
  2899. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion(htData["PaymentItem"].ToString().Trim().Split('(')[0]);
  2900. FtWidth = Convert.ToInt32(g.MeasureString(StrValue, ft10).Width);
  2901. FtHeight = Convert.ToInt32(sizef.Height);
  2902. Rectangle rec4A = new Rectangle(rec4.X + AddLeft, rec4.Y + AddTop, ColumnWidth1, FtHeight);
  2903. g.DrawString(StrValue, ft10, b, rec4A);//画第一列的列标题
  2904. Point rec4A_1 = new Point(rec4.X + ColumnWidth1, rec4.Y);
  2905. Point rec4A_2 = new Point(rec4.X + ColumnWidth1, rec4.Y + rec4.Height);
  2906. g.DrawLine(p, rec4A_1, rec4A_2);//画第一表与第二列的界线
  2907. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion(htData["PaymentMethod"].ToString().Trim());
  2908. FtWidth = Convert.ToInt32(g.MeasureString(StrValue, ft10).Width);
  2909. FtHeight = Convert.ToInt32(sizef.Height);
  2910. Rectangle rec4B = new Rectangle(rec4A_1.X + AddLeft, rec4A.Y, ColumnWidth2, FtHeight);
  2911. g.DrawString(StrValue, ft10, b, rec4B);//画第二列的列标题
  2912. Point rec4B_1 = new Point(rec4A_1.X + ColumnWidth2, rec4.Y);
  2913. Point rec4B_2 = new Point(rec4A_1.X + ColumnWidth2, rec4.Y + rec4.Height);
  2914. g.DrawLine(p, rec4B_1, rec4B_2);//画第二表与第三列的界线
  2915. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion(Convert.ToDecimal(htData["PaymentAmount"]).ToString("0.00").Trim());
  2916. FtWidth = Convert.ToInt32(g.MeasureString(StrValue, ft10).Width);
  2917. FtHeight = Convert.ToInt32(sizef.Height);
  2918. Rectangle rec4C = new Rectangle(rec4B_1.X + AddLeft, rec4A.Y, ColumnWidth3, FtHeight);
  2919. g.DrawString(StrValue, ft10, b, rec4C);//画第三列的列标题
  2920. Point rec4C_1 = new Point(rec4B_1.X + ColumnWidth3, rec4.Y);
  2921. Point rec4C_2 = new Point(rec4B_1.X + ColumnWidth3, rec4.Y + rec4.Height);
  2922. g.DrawLine(p, rec4C_1, rec4C_2);//画第三表与第四列的界线
  2923. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion(htData["PaymentPeople"].ToString().Trim());
  2924. FtWidth = Convert.ToInt32(g.MeasureString(StrValue, ft10).Width);
  2925. FtHeight = Convert.ToInt32(sizef.Height);
  2926. Rectangle rec4D = new Rectangle(rec4C_1.X + AddLeft, rec4A.Y, ColumnWidth4, FtHeight);
  2927. g.DrawString(StrValue, ft10, b, rec4D);//画第四列的列标题
  2928. Point rec4D_1 = new Point(rec4C_1.X + ColumnWidth3, rec4.Y);
  2929. Point rec4D_2 = new Point(rec4C_1.X + ColumnWidth3, rec4.Y + rec4.Height);
  2930. g.DrawLine(p, rec4D_1, rec4D_2);//画第三表与第四列的界线
  2931. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion(LYFZ.Command.Command_Validate.DateTimeToString(htData["PaymentDate"].ToString().Trim()));
  2932. FtWidth = Convert.ToInt32(g.MeasureString(StrValue, ft10).Width) + 1;
  2933. Rectangle rec4E = new Rectangle(rec4D_1.X + AddLeft, rec4A.Y, ColumnWidth5, FtHeight);
  2934. g.DrawString(StrValue, ft10, b, rec4E);//画第四列的列标题
  2935. #endregion
  2936. paymentAmount += Convert.ToDecimal(htData["PaymentAmount"]);
  2937. if (RechargeType.Equals("会员充值定金"))
  2938. {
  2939. totalValue += (decimal)htData["TotalRechargeAmoun"];
  2940. totalSerAmoun += Convert.ToDecimal(htData["TotalSerAmoun"]);
  2941. }
  2942. if(dyObjList.IndexOf(dyObj)!= dyObjList.Count-1)
  2943. {
  2944. rec4 = new Rectangle(rec4.X, rec4.Y + rec4.Height, rec4.Width, rec4.Height);
  2945. }
  2946. }
  2947. #region 空行
  2948. /*
  2949. Values1 = "已缴纳定金";
  2950. Values2 = "定金";
  2951. Values3 = (totalValue - Convert.ToDecimal(htData["PaymentAmount"])).ToString("0.00").Trim();
  2952. */
  2953. //if (RechargeType.Equals("会员充值定金"))
  2954. //{
  2955. // totalValue = (decimal)htData["TotalRechargeAmoun"];
  2956. // totalSerAmoun = Convert.ToDecimal(htData["TotalSerAmoun"]);
  2957. //}
  2958. Rectangle rec5 = new Rectangle( rec4.X, rec4.Y + rec4.Height, TableWidth, RowHeight );
  2959. g.DrawRectangle( p, rec5 );//画标题矩形
  2960. StrValue = "";
  2961. if (RechargeType.Equals( "会员充值定金" ) && (totalValue - paymentAmount) > 0 )
  2962. {
  2963. StrValue = "已缴纳金额(定金)";
  2964. }
  2965. FtWidth = Convert.ToInt32( g.MeasureString( StrValue, ft10 ).Width );
  2966. FtHeight = Convert.ToInt32( sizef.Height );
  2967. Rectangle rec5A = new Rectangle( rec5.X + AddLeft, rec5.Y + AddTop, ColumnWidth1, FtHeight );
  2968. g.DrawString( StrValue, ft10, b, rec5A );//画第一列的列标题
  2969. Point rec5A_1 = new Point( rec5.X + ColumnWidth1, rec5.Y );
  2970. Point rec5A_2 = new Point( rec5.X + ColumnWidth1, rec5.Y + rec5.Height );
  2971. g.DrawLine( p, rec5A_1, rec5A_2 );//画第一表与第二列的界线
  2972. if (RechargeType.Equals( "会员充值定金" ) && (totalValue - paymentAmount) > 0 )
  2973. {
  2974. StrValue = "";//LYFZ.BLL.OtherCommonModel.FontConversion( "定金" );
  2975. }
  2976. FtWidth = Convert.ToInt32( g.MeasureString( StrValue, ft10 ).Width );
  2977. FtHeight = Convert.ToInt32( sizef.Height );
  2978. Rectangle rec5B = new Rectangle( rec5A_1.X + AddLeft, rec5A.Y, ColumnWidth2, FtHeight );
  2979. g.DrawString( StrValue, ft10, b, rec5B );//画第二列的列标题
  2980. Point rec5B_1 = new Point( rec5A_1.X + ColumnWidth2, rec5.Y );
  2981. Point rec5B_2 = new Point( rec5A_1.X + ColumnWidth2, rec5.Y + rec5.Height );
  2982. g.DrawLine( p, rec5B_1, rec5B_2 );//画第二表与第三列的界线
  2983. if (RechargeType.Equals( "会员充值定金" ) && (totalValue - paymentAmount) > 0 )
  2984. {
  2985. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( (totalValue - paymentAmount).ToString( "0.00" ).Trim() );
  2986. }
  2987. FtWidth = Convert.ToInt32( g.MeasureString( StrValue, ft10 ).Width );
  2988. FtHeight = Convert.ToInt32( sizef.Height );
  2989. Rectangle rec5C = new Rectangle( rec5B_1.X + AddLeft, rec5B.Y, ColumnWidth2, FtHeight );
  2990. g.DrawString( StrValue, ft10, b, rec5C );//画第二列的列标题
  2991. Point rec5C_1 = new Point( rec5B_1.X + ColumnWidth3, rec5.Y );
  2992. Point rec5C_2 = new Point( rec5B_1.X + ColumnWidth3, rec5.Y + rec5.Height );
  2993. g.DrawLine( p, rec5C_1, rec5C_2 );//画第三表与第四列的界线
  2994. Point rec5D_1 = new Point( rec5C_1.X + ColumnWidth3, rec5.Y );
  2995. Point rec5D_2 = new Point( rec5C_1.X + ColumnWidth3, rec5.Y + rec5.Height );
  2996. g.DrawLine( p, rec5D_1, rec5D_2 );//画第三表与第四列的界线
  2997. #endregion
  2998. #region 付款详情
  2999. Rectangle rec6 = new Rectangle( rec5.X, rec5.Y + rec5.Height, TableWidth, RowHeight );
  3000. g.DrawRectangle( p, rec6 );//画标题矩形
  3001. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "付款情况" );
  3002. sizef = g.MeasureString( StrValue, ft11 );
  3003. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  3004. FtHeight = Convert.ToInt32( sizef.Height );
  3005. Rectangle rec6A = new Rectangle( rec6.X + AddLeft, rec6.Y + AddTop, FtWidth, FtHeight );
  3006. g.DrawString( StrValue, ft11, b, rec6A );//付款情况
  3007. Rectangle rec6B = new Rectangle( rec6A.X + (TableWidth / 3), rec6A.Y, TableWidth / 4, FtHeight );
  3008. if (RechargeType.Equals( "会员充值定金" ) )
  3009. {
  3010. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "应付:" ) + totalSerAmoun.ToString().Trim(), ft11, b, rec6B );//应付
  3011. }
  3012. else
  3013. {
  3014. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "应付:" ) + paymentAmount.ToString().Trim(), ft11, b, rec6B );//应付
  3015. }
  3016. Rectangle rec6C = new Rectangle( rec6B.X + (TableWidth / 3), rec6A.Y, TableWidth / 4, FtHeight );
  3017. if (RechargeType.Equals( "会员充值定金" ) )
  3018. {
  3019. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "实付:" ) + totalValue.ToString().Trim(), ft11, b, rec6C );//实付
  3020. }
  3021. else
  3022. {
  3023. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "实付:" ) + paymentAmount.ToString().Trim(), ft11, b, rec6C );//实付
  3024. }
  3025. #endregion
  3026. #region 合计、大写
  3027. Rectangle rec7 = new Rectangle( rec6.X, rec6.Y + rec6.Height, TableWidth, RowHeight );
  3028. g.DrawRectangle( p, rec7 );
  3029. if (RechargeType.Equals( "会员充值定金" ) )
  3030. {
  3031. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "合计人民币(大写):" ) + " " + LYFZ.Software.MainBusiness.ReportPrint.ReportPrintDataClass.ConversionAmount( (totalValue).ToString().Trim() );
  3032. }
  3033. else
  3034. {
  3035. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "合计人民币(大写):" ) + " " + LYFZ.Software.MainBusiness.ReportPrint.ReportPrintDataClass.ConversionAmount(paymentAmount.ToString().Trim() );
  3036. }
  3037. sizef = g.MeasureString( StrValue, ft11 );
  3038. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  3039. FtHeight = Convert.ToInt32( sizef.Height );
  3040. Rectangle rec7A = new Rectangle( rec7.X + AddLeft, rec7.Y + AddTop, TableWidth, FtHeight );
  3041. g.DrawString( StrValue, ft11, b, rec7A );
  3042. #endregion
  3043. #region 法律申明
  3044. StrValue = "法律申明:\r\n";
  3045. if ( PrintOtherData.ContainsKey( "收款单说明" ) && PrintOtherData["收款单说明"].ToString().Trim().Length > 0 )
  3046. {
  3047. StrValue += PrintOtherData["收款单说明"].ToString().Trim();
  3048. }
  3049. else
  3050. {
  3051. StrValue += "一、以上内容为充值优惠内容,超出此内容的,如需增加产品及各项服务等,请依照公司规定支付相关费用 \r\n" +
  3052. "二、本充值金额自充值之日起生效,所交金额均为定金,恕不退还。本次充值合约双方认可,已经确认进入设计生产流程,不能更改,如需更改违约方需承担相应损失及费用,并扣除20%违约金,以维护正常商业秩序。\r\n" +
  3053. "三、如因顾客单方原因导致合约不能履行,巧克力森林儿童影像有限公司有权从充值金额中扣除以上优惠金额。\r\n" +
  3054. "四、由于产品不断更新换代或升级,为保证您的权益,原定产品更新为最新等值产品。\r\n" +
  3055. "五、充值金额可转赠他人使用,充值优惠权限仅限本人使用。\r\n" +
  3056. "六、请妥善保管充值卡,并熟记密码,充值卡遗失补办需付20元工本费。\r\n" +
  3057. "七、本协议一式三份,顾客一份,存根一份,财务一份,自确认签字之日起生效。\r\n";
  3058. }
  3059. sizef = g.MeasureString( StrValue, ft11, TableWidth - AddLeft * 2 );
  3060. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  3061. FtHeight = Convert.ToInt32( sizef.Height );
  3062. Rectangle rec8 = new Rectangle( rec7.X, rec7.Y + rec7.Height, TableWidth, FtHeight + AddTop );
  3063. g.DrawRectangle( p, rec8 );//画标题矩形
  3064. Rectangle rec8A = new Rectangle( rec8.X + AddLeft, rec8.Y + AddTop, TableWidth, FtHeight );
  3065. g.DrawString( StrValue, ft11, b, rec8A );//付款情况
  3066. #endregion
  3067. #region 本人签字
  3068. Rectangle rec9 = new Rectangle( rec8.X, rec8A.Y + rec8A.Height, TableWidth, RowHeight * 3 );
  3069. g.DrawRectangle( p, rec9 );//画标题矩形
  3070. StrValue = "本人证实上述资料属实,并已阅读及认同本充值金额及充值合约。";
  3071. sizef = g.MeasureString( StrValue, ft11 );
  3072. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  3073. FtHeight = Convert.ToInt32( sizef.Height );
  3074. Rectangle rec9A = new Rectangle( rec9.X + AddLeft, rec9.Y + RowHeight, TableWidth, RowHeight );
  3075. g.DrawString( StrValue, ft11, b, rec9A );//付款情况
  3076. StrValue = "本人确认签字生效:";
  3077. sizef = g.MeasureString( StrValue, ft11b );
  3078. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  3079. FtHeight = Convert.ToInt32( sizef.Height );
  3080. Rectangle rec9B = new Rectangle( LeftWidth + TableWidth - FtWidth * 2, rec9A.Y + rec9A.Height + AddTop, FtWidth, FtHeight );
  3081. g.DrawString( StrValue, ft11b, b, rec9B );//付款情况
  3082. #endregion
  3083. #region 本店信息
  3084. StrValue = "本店地址:" + tbl.Rows[0]["Company_Address"].ToString().Trim();
  3085. sizef = g.MeasureString( StrValue, ft9 );
  3086. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  3087. FtHeight = Convert.ToInt32( sizef.Height );
  3088. Rectangle rec10A = new Rectangle( rec2.X + AddLeft, rec9.Y + rec9.Height + 4, FtWidth, FtHeight );
  3089. g.DrawString( StrValue, ft9, b, rec10A );//付款情况
  3090. StrValue = "联系电话:" + tbl.Rows[0]["Company_Telephone"].ToString().Trim();
  3091. sizef = g.MeasureString( StrValue, ft9 );
  3092. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  3093. FtHeight = Convert.ToInt32( sizef.Height );
  3094. Rectangle rec10B = new Rectangle( LeftWidth + TableWidth - FtWidth, rec10A.Y, FtWidth, FtHeight );
  3095. g.DrawString( StrValue, ft9, b, rec10B );//付款情况
  3096. #endregion
  3097. }
  3098. #endregion
  3099. #region 新摄会收款单据
  3100. /// <summary>
  3101. /// 新摄会收款单据
  3102. /// </summary>
  3103. /// <param name="panl"></param>
  3104. public static void PaymentPrint_PhotographerPayment_Print( object objValue, Graphics g, Size size, bool IsPrintSerialNo )
  3105. {
  3106. Hashtable htData = (Hashtable)objValue;
  3107. DataGridViewEx dgvData = (DataGridViewEx)htData["dgvData"];
  3108. string strNumber = htData["strNumber"].ToString().Trim();
  3109. string strMyNumber = htData["strMyNumber"].ToString().Trim();
  3110. string ExecuteSql = "select Company_Address,Company_Telephone,Company_UpdateDatetime from dbo.tb_ErpCompanyInfo where Company_DividedShop = '" + StrDividedShop + "';";
  3111. ExecuteSql += "select 会员卡号,姓名,电话 from BView_MemberMain_GoldMember where Mc_Number = '" + strNumber + "' ;";
  3112. 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 + "';";
  3113. ExecuteSql += "select Mcpv_GiftName from tb_ErpMemberCardPhotographerVice where Mcpv_MyNumber = '" + strMyNumber + "';";
  3114. DataSet dsData = new BLL.BLL_ErpOrder().GetView_Custom( ExecuteSql );
  3115. DataTable tbl = dsData.Tables["ds"];
  3116. DataTable tbl2 = dsData.Tables["ds1"];
  3117. DataTable tbl3 = dsData.Tables["ds2"];
  3118. DataTable tbl4 = dsData.Tables["ds3"];
  3119. if ( tbl.Rows.Count <= 0 )
  3120. {
  3121. MessageBoxCustom.Show( "未设置影楼信息!" ); return;
  3122. }
  3123. if ( tbl2.Rows.Count == 0 )
  3124. {
  3125. MessageBoxCustom.Show( "会员卡号不存在!" ); return;
  3126. }
  3127. #region
  3128. Brush b = Brushes.Black;
  3129. Pen p = GetPen;
  3130. Font ft16 = new Font( "宋体", 16 );
  3131. Font ft11 = new Font( "宋体", 10 );
  3132. Font ft10 = new Font( "宋体", 9 );
  3133. Font ft9 = new Font( "宋体", 9 );
  3134. #region 二维码
  3135. Image img = CachePhoto( PhotoLogType.DimensionalCode, tbl.Rows[0]["Company_UpdateDatetime"] );
  3136. Rectangle rec1 = new Rectangle( 50, 25, 90, 90 );
  3137. if ( img != null )
  3138. {
  3139. g.DrawImage( img, rec1 );
  3140. }
  3141. #endregion
  3142. int TableWidth = size.Width - rec1.X * 2 - 14;
  3143. #region 金色童年收据凭据
  3144. SizeF sizef = g.MeasureString( DefaultPrintTitle, ft16 );
  3145. int FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  3146. int FtHeight = Convert.ToInt32( sizef.Height );
  3147. Rectangle rec2 = new Rectangle( (size.Width / 2) - (FtWidth / 2), 30, FtWidth + 5, FtHeight );
  3148. g.DrawString( DefaultPrintTitle, ft16, b, rec2 );
  3149. #endregion
  3150. #region NO.
  3151. string rec3Value = "NO." + StrRandom( tbl2.Rows[0]["会员卡号"].ToString().Trim() );
  3152. sizef = g.MeasureString( rec3Value, ft11 );
  3153. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  3154. FtHeight = Convert.ToInt32( sizef.Height );
  3155. Rectangle rec3 = new Rectangle( size.Width - rec1.X - FtWidth, rec2.Y + 35, FtWidth, FtHeight );
  3156. g.DrawString( rec3Value, ft11, b, rec3 );
  3157. if ( IsPrintSerialNo )
  3158. {
  3159. string SerialNo = PrintReceiptSerial();
  3160. if ( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition )
  3161. {
  3162. SerialNo = PrintReceiptSerial( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.CurrentCompanyInfoID );
  3163. }
  3164. if ( string.IsNullOrEmpty( SerialNo ) )
  3165. {
  3166. MessageBoxCustom.Show( "获取流水单号失败!" ); return;
  3167. }
  3168. rec3Value = "SerialNo." + SerialNo;
  3169. sizef = g.MeasureString( rec3Value, ft11 );
  3170. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  3171. FtHeight = Convert.ToInt32( sizef.Height );
  3172. Rectangle rec3A = new Rectangle( size.Width - rec1.X - FtWidth, rec3.Y - FtHeight + 2, FtWidth, FtHeight );
  3173. g.DrawString( rec3Value, ft11, b, rec3A );
  3174. }
  3175. #endregion
  3176. #region 地址
  3177. string StrAddress = LYFZ.BLL.OtherCommonModel.FontConversion( "地址:" ) + tbl.Rows[0]["Company_Address"].ToString().Trim();
  3178. sizef = g.MeasureString( StrAddress, ft10 );
  3179. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  3180. FtHeight = Convert.ToInt32( sizef.Height );
  3181. Rectangle rec4 = new Rectangle( rec1.X + rec1.Width - 5, rec3.Y + rec3.Height + FtHeight - 15, TableWidth - rec1.Width + 14, FtHeight );
  3182. g.DrawString( StrAddress, ft10, b, rec4 );
  3183. string StrTelephone = LYFZ.BLL.OtherCommonModel.FontConversion( "电话:" ) + tbl.Rows[0]["Company_Telephone"].ToString().Trim();
  3184. Rectangle rec4A = new Rectangle( rec4.X, rec4.Y + rec4.Height - FtHeight * 2 + 2, TableWidth - rec1.Width - 10, FtHeight );
  3185. g.DrawString( StrTelephone, ft10, b, rec4A );
  3186. #endregion
  3187. #region 客户姓名
  3188. string StrName = LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名:" ) + tbl2.Rows[0]["姓名"].ToString().Trim() + " " + LYFZ.BLL.OtherCommonModel.FontConversion( "联系电话:" ) + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( tbl2.Rows[0]["电话"] );
  3189. sizef = g.MeasureString( StrName, ft10 );
  3190. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  3191. FtHeight = Convert.ToInt32( sizef.Height );
  3192. Rectangle rec6 = new Rectangle( rec4.X, rec4.Y + rec4.Height - 2, FtWidth, FtHeight );
  3193. g.DrawString( StrName, ft10, b, rec6 );
  3194. #endregion
  3195. #region 日期
  3196. string StrDate = LYFZ.BLL.OtherCommonModel.FontConversion( "打印日期:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy年MM月dd日" );
  3197. sizef = g.MeasureString( StrDate, ft10 );
  3198. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  3199. FtHeight = Convert.ToInt32( sizef.Height );
  3200. Rectangle rec8 = new Rectangle( TableWidth + rec1.X - FtWidth + 14, rec6.Y, FtWidth, FtHeight );
  3201. g.DrawString( StrDate, ft10, b, rec8 );
  3202. #endregion
  3203. int AddLeft = 3;
  3204. int AddTop2 = 6;
  3205. int AddTop = 7;
  3206. int RowHeight = 26;
  3207. int RowContentHeight = 18;
  3208. int ColumnWidth1 = TableWidth / 5;
  3209. int ColumnWidth2 = TableWidth / 5;
  3210. int ColumnWidth3 = TableWidth / 5;
  3211. int ColumnWidth5 = TableWidth / 5;
  3212. int ColumnWidth4 = TableWidth - ColumnWidth1 - ColumnWidth2 - ColumnWidth3 - ColumnWidth5;
  3213. Rectangle rec9 = new Rectangle( rec1.X + 7, rec6.Y + rec6.Height + 1, TableWidth, RowHeight );
  3214. g.DrawRectangle( p, rec9 );//画标题矩形
  3215. #region 收款项目
  3216. string StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "收款项目" );
  3217. sizef = g.MeasureString( StrValue, ft10 );
  3218. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  3219. Rectangle rec9_1 = new Rectangle( rec9.X + (ColumnWidth1 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth1, RowContentHeight );
  3220. g.DrawString( StrValue, ft11, b, rec9_1 );//画第一列的列标题
  3221. Point p1_1 = new Point( rec9.X + ColumnWidth1, rec9.Y );
  3222. Point p1_2 = new Point( rec9.X + ColumnWidth1, rec9.Y + rec9.Height );
  3223. g.DrawLine( p, p1_1, p1_2 );//画第一表与第二列的界线
  3224. #endregion
  3225. #region 支付方式
  3226. Rectangle rec9_2 = new Rectangle( p1_1.X + (ColumnWidth2 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth2, RowContentHeight );
  3227. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "支付方式" ), ft11, b, rec9_2 );//画第二列的列标题
  3228. Point p2_1 = new Point( p1_1.X + ColumnWidth2, rec9.Y );
  3229. Point p2_2 = new Point( p1_2.X + ColumnWidth2, rec9.Y + rec9.Height );
  3230. g.DrawLine( p, p2_1, p2_2 );//画第二表与第三列的界线
  3231. #endregion
  3232. #region 金 额
  3233. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "金 额" );
  3234. sizef = g.MeasureString( StrValue, ft10 );
  3235. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  3236. Rectangle rec9_3 = new Rectangle( p2_1.X + (ColumnWidth3 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth3, RowContentHeight );
  3237. g.DrawString( StrValue, ft11, b, rec9_3 );//画第三列的列标题
  3238. Point p3_1 = new Point( p2_1.X + ColumnWidth3, rec9.Y );
  3239. Point p3_2 = new Point( p2_2.X + ColumnWidth3, rec9.Y + rec9.Height );
  3240. g.DrawLine( p, p3_1, p3_2 );//画第三表与第四列的界线
  3241. #endregion
  3242. #region 接单人
  3243. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "办理人" );
  3244. sizef = g.MeasureString( StrValue, ft10 );
  3245. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  3246. Rectangle rec9_4 = new Rectangle( p3_1.X + (ColumnWidth4 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth4, RowContentHeight );
  3247. g.DrawString( StrValue, ft11, b, rec9_4 );//画第四列的列标题
  3248. Point p4_1 = new Point( p3_1.X + ColumnWidth4, rec9.Y );
  3249. Point p4_2 = new Point( p3_2.X + ColumnWidth4, rec9.Y + rec9.Height );
  3250. g.DrawLine( p, p4_1, p4_2 );//画第四表与第五列的界线
  3251. #endregion
  3252. #region 收 银
  3253. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "收 银" );
  3254. sizef = g.MeasureString( StrValue, ft10 );
  3255. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  3256. Rectangle rec9_5 = new Rectangle( p4_1.X + (ColumnWidth5 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth5, RowContentHeight );
  3257. g.DrawString( StrValue, ft11, b, rec9_5 );//画第五列的列标题
  3258. #endregion
  3259. int IntPoint_X = rec9.X;
  3260. int IntPoint_Y = rec9.Y + rec9.Height;
  3261. decimal CopeAmount = 0;//应付金额
  3262. decimal ActualAmount = 0;//实付金额
  3263. #region 画列表每行
  3264. int PageRows = 1;//每页多少行
  3265. for ( int i = 0; i < PageRows; i++ )
  3266. {
  3267. Rectangle recfor = new Rectangle( IntPoint_X, IntPoint_Y, TableWidth, RowHeight );
  3268. g.DrawRectangle( p, recfor );//画标题矩形
  3269. string recfor_1Value = "";
  3270. string recfor_2Value = "";
  3271. string recfor_3Value = "";
  3272. string recfor_4Value = "";
  3273. string recfor_5Value = "";
  3274. if ( i == 0 )
  3275. {
  3276. recfor_1Value = tbl3.Rows[0]["Mcpm_GradeName"].ToString().Trim();
  3277. recfor_2Value = tbl3.Rows[0]["Mcpm_PaymentMethod"].ToString().Trim();
  3278. recfor_3Value = Convert.ToDecimal( tbl3.Rows[0]["Mcpm_UpgradeAoumnt"] ).ToString( "0.00" ).Trim();
  3279. recfor_4Value = tbl3.Rows[0]["Mcpm_CreateName"].ToString().Trim();
  3280. recfor_5Value = tbl3.Rows[0]["Mcpm_PaymentName"].ToString().Trim();
  3281. CopeAmount = Convert.ToDecimal( tbl3.Rows[0]["Mcpm_UpgradeAoumnt"] );
  3282. ActualAmount = Convert.ToDecimal( tbl3.Rows[0]["Mcpm_UpgradeAoumnt"] );
  3283. }
  3284. Rectangle recfor_1 = new Rectangle( recfor.X + AddLeft, recfor.Y + AddTop, ColumnWidth1, RowContentHeight );
  3285. g.DrawString( recfor_1Value, ft10, b, recfor_1 );//画第一列的列标题
  3286. Point pfor1_1 = new Point( recfor_1.X + ColumnWidth1 - 3, recfor.Y );
  3287. Point pfor1_2 = new Point( recfor_1.X + ColumnWidth1 - 3, recfor.Y + recfor.Height );
  3288. g.DrawLine( p, pfor1_1, pfor1_2 );//画第一表与第二列的界线
  3289. Rectangle recfor_2 = new Rectangle( pfor1_1.X + AddLeft, pfor1_1.Y + AddTop, ColumnWidth2, RowContentHeight );
  3290. g.DrawString( recfor_2Value, ft10, b, recfor_2 );//画第二列的列标题
  3291. Point pfor2_1 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y );
  3292. Point pfor2_2 = new Point( pfor1_2.X + ColumnWidth2, recfor.Y + recfor.Height );
  3293. g.DrawLine( p, pfor2_1, pfor2_2 );//画第二表与第三列的界线
  3294. StrValue = recfor_3Value;
  3295. sizef = g.MeasureString( StrValue, ft10 );
  3296. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  3297. Rectangle recfor_3 = new Rectangle( pfor2_1.X + ColumnWidth3 - FtWidth - AddLeft * 2, pfor2_1.Y + AddTop, ColumnWidth3, RowContentHeight );
  3298. g.DrawString( recfor_3Value, ft10, b, recfor_3 );//画第三列的列标题
  3299. Point pfor3_1 = new Point( pfor2_1.X + ColumnWidth3, recfor.Y );
  3300. Point pfor3_2 = new Point( pfor2_2.X + ColumnWidth3, recfor.Y + recfor.Height );
  3301. g.DrawLine( p, pfor3_1, pfor3_2 );//画第三表与第四列的界线
  3302. Rectangle recfor_4 = new Rectangle( pfor3_1.X + AddLeft, pfor3_1.Y + AddTop, ColumnWidth4, RowContentHeight );
  3303. g.DrawString( recfor_4Value, ft10, b, recfor_4 );//画第四列的列标题
  3304. Point pfor4_1 = new Point( pfor3_1.X + ColumnWidth4, recfor.Y );
  3305. Point pfor4_2 = new Point( pfor3_2.X + ColumnWidth4, recfor.Y + recfor.Height );
  3306. g.DrawLine( p, pfor4_1, pfor4_2 );//画第四表与第五列的界线
  3307. Rectangle recfor_5 = new Rectangle( pfor4_1.X + AddLeft, pfor4_1.Y + AddTop, ColumnWidth5, RowContentHeight );
  3308. g.DrawString( recfor_5Value, ft10, b, recfor_5 );//画第五列的列标题
  3309. IntPoint_X = recfor.X;
  3310. IntPoint_Y = recfor.Y + recfor.Height;
  3311. }
  3312. #endregion
  3313. string strReamt = "";
  3314. for ( int i = 0; i < tbl4.Rows.Count; i++ )
  3315. {
  3316. strReamt += (i + 1) + "." + tbl4.Rows[i]["Mcpv_GiftName"].ToString().Trim() + " ";
  3317. }
  3318. Rectangle rec9_A = new Rectangle( rec9.X, IntPoint_Y, TableWidth, RowHeight * 3 );
  3319. g.DrawRectangle( p, rec9_A );//画标题矩形
  3320. Rectangle rec9_A1 = new Rectangle( rec9.X + AddLeft, rec9_A.Y + AddTop2, TableWidth - (AddLeft * 2), rec9_A.Height - (AddTop * 2) );
  3321. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "赠品详情:" ) + strReamt, ft10, b, rec9_A1 );//画第三列的列标题
  3322. Rectangle rec10 = new Rectangle( rec9.X, rec9_A.Y + rec9_A.Height, TableWidth, RowHeight );
  3323. g.DrawRectangle( p, rec10 );//画标题矩形
  3324. #region 付款情况
  3325. string rec10_1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "付款情况" );
  3326. sizef = g.MeasureString( rec10_1Value, ft11 );
  3327. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  3328. FtHeight = Convert.ToInt32( sizef.Height );
  3329. Rectangle rec10_1 = new Rectangle( rec10.X + AddLeft, rec10.Y + AddTop2, FtWidth, RowContentHeight );
  3330. g.DrawString( rec10_1Value, ft11, b, rec10_1 );//付款情况
  3331. #endregion
  3332. #region 应付
  3333. Rectangle rec10_2 = new Rectangle( rec10_1.X + (TableWidth / 4), rec10.Y + AddTop2, TableWidth / 4, RowContentHeight );
  3334. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "应付:" ) + CopeAmount.ToString(), ft11, b, rec10_2 );//应付
  3335. #endregion
  3336. #region 实付
  3337. Rectangle rec10_3 = new Rectangle( rec10_2.X + (TableWidth / 4), rec10.Y + AddTop2, TableWidth / 4, RowContentHeight );
  3338. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "实付:" ) + ActualAmount.ToString(), ft11, b, rec10_3 );//实付
  3339. #endregion
  3340. Rectangle rec11 = new Rectangle( rec10.X, rec10.Y + rec10.Height, TableWidth, RowHeight );
  3341. g.DrawRectangle( p, rec11 );//画标题矩形
  3342. #region 合计
  3343. Rectangle rec11_1 = new Rectangle( rec11.X + AddLeft, rec11.Y + AddTop2, TableWidth - 300, RowContentHeight );
  3344. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "合计人民币(大写):" ) + " " + LYFZ.Software.MainBusiness.ReportPrint.ReportPrintDataClass.ConversionAmount( ActualAmount.ToString() ), ft11, b, rec11_1 );//合计人民币
  3345. #endregion
  3346. #region 顾客签字
  3347. Rectangle rec11_2 = new Rectangle( rec11_1.X + rec11_1.Width + 100, rec11_1.Y, 300, RowContentHeight );
  3348. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "顾客签字:" ), ft11, b, rec11_2 );//画消费法规
  3349. #endregion
  3350. #region 说明
  3351. Rectangle rec12 = new Rectangle( rec11.X, rec11.Y + rec11.Height + 3, rec9.Width, Convert.ToInt32( g.MeasureString( "说明", ft9 ).Height ) + 1 );
  3352. string PaymentExplain = "";
  3353. if ( PrintOtherData.ContainsKey( "收款单说明" ) && PrintOtherData["收款单说明"].ToString().Trim().Length > 0 )
  3354. {
  3355. PaymentExplain = PrintOtherData["收款单说明"].ToString().Trim();
  3356. }
  3357. g.DrawString( PaymentExplain, ft9, b, rec12 );//画消费法规
  3358. #endregion
  3359. #endregion
  3360. }
  3361. #endregion
  3362. #region 新摄会退款单据
  3363. /// <summary>
  3364. /// 新摄会退款单据
  3365. /// </summary>
  3366. /// <param name="panl"></param>
  3367. public static void PaymentPrint_PhotographerRefund_Print( object objValue, Graphics g, Size size, bool IsPrintSerialNo )
  3368. {
  3369. Hashtable htData = (Hashtable)objValue;
  3370. DataGridViewEx dgvData = (DataGridViewEx)htData["dgvData"];
  3371. string strNumber = htData["strNumber"].ToString().Trim();
  3372. string strMyNumber = htData["strMyNumber"].ToString().Trim();
  3373. string ExecuteSql = "select Company_Address,Company_Telephone,Company_UpdateDatetime from dbo.tb_ErpCompanyInfo where Company_DividedShop = '" + StrDividedShop + "';";
  3374. ExecuteSql += "select 会员卡号,姓名,电话 from BView_MemberMain_GoldMember where Mc_Number = '" + strNumber + "' ;";
  3375. ExecuteSql += "select Mcpm_GradeName,Mcpm_OKBackAoumnt,dbo.fn_CheckUserIDGetUserName(Mcpm_JingShouRen) AS Mcpm_JingShouRen,Mcpm_BackAoumnt from tb_ErpMemberCardPhotographerMain where Mcpm_MyNumber = '" + strMyNumber + "';";
  3376. DataSet dsData = new BLL.BLL_ErpOrder().GetView_Custom( ExecuteSql );
  3377. DataTable tbl = dsData.Tables["ds"];
  3378. DataTable tbl2 = dsData.Tables["ds1"];
  3379. DataTable tbl3 = dsData.Tables["ds2"];
  3380. if ( tbl.Rows.Count <= 0 )
  3381. {
  3382. MessageBoxCustom.Show( "未设置影楼信息" ); return;
  3383. }
  3384. if ( tbl2.Rows.Count == 0 )
  3385. {
  3386. MessageBoxCustom.Show( "会员卡号不存在" ); return;
  3387. }
  3388. #region
  3389. Brush b = Brushes.Black;
  3390. Pen p = GetPen;
  3391. Font ft16 = new Font( "宋体", 16 );
  3392. Font ft11 = new Font( "宋体", 10 );
  3393. Font ft10 = new Font( "宋体", 9 );
  3394. Font ft9 = new Font( "宋体", 9 );
  3395. #region 二维码
  3396. Image img = CachePhoto( PhotoLogType.DimensionalCode, tbl.Rows[0]["Company_UpdateDatetime"] );
  3397. Rectangle rec1 = new Rectangle( 50, 25, 90, 90 );
  3398. if ( img != null )
  3399. {
  3400. g.DrawImage( img, rec1 );
  3401. }
  3402. #endregion
  3403. int TableWidth = size.Width - rec1.X * 2 - 14;
  3404. #region 金色童年收据凭据
  3405. SizeF sizef = g.MeasureString( DefaultPrintTitle, ft16 );
  3406. int FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  3407. int FtHeight = Convert.ToInt32( sizef.Height );
  3408. Rectangle rec2 = new Rectangle( (size.Width / 2) - (FtWidth / 2), 30, FtWidth + 5, FtHeight );
  3409. g.DrawString( DefaultPrintTitle, ft16, b, rec2 );
  3410. #endregion
  3411. #region NO.
  3412. string rec3Value = LYFZ.BLL.OtherCommonModel.FontConversion( "会员号." ) + StrRandom( tbl2.Rows[0]["会员卡号"].ToString().Trim() );
  3413. sizef = g.MeasureString( rec3Value, ft11 );
  3414. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  3415. FtHeight = Convert.ToInt32( sizef.Height );
  3416. Rectangle rec3 = new Rectangle( size.Width - rec1.X - FtWidth, rec2.Y + 35, FtWidth, FtHeight );
  3417. g.DrawString( rec3Value, ft11, b, rec3 );
  3418. if ( IsPrintSerialNo )
  3419. {
  3420. string SerialNo = PrintReceiptSerial();
  3421. if ( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition )
  3422. {
  3423. SerialNo = PrintReceiptSerial( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.CurrentCompanyInfoID );
  3424. }
  3425. if ( string.IsNullOrEmpty( SerialNo ) )
  3426. {
  3427. MessageBoxCustom.Show( "获取流水单号失败!" ); return;
  3428. }
  3429. rec3Value = "SerialNo." + SerialNo;
  3430. sizef = g.MeasureString( rec3Value, ft11 );
  3431. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  3432. FtHeight = Convert.ToInt32( sizef.Height );
  3433. Rectangle rec3A = new Rectangle( size.Width - rec1.X - FtWidth, rec3.Y - FtHeight + 2, FtWidth, FtHeight );
  3434. g.DrawString( rec3Value, ft11, b, rec3A );
  3435. }
  3436. #endregion
  3437. #region 地址
  3438. string StrAddress = LYFZ.BLL.OtherCommonModel.FontConversion( "地址:" ) + tbl.Rows[0]["Company_Address"].ToString().Trim();
  3439. sizef = g.MeasureString( StrAddress, ft10 );
  3440. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  3441. FtHeight = Convert.ToInt32( sizef.Height );
  3442. Rectangle rec4 = new Rectangle( rec1.X + rec1.Width - 5, rec3.Y + rec3.Height + FtHeight - 15, TableWidth - rec1.Width + 14, FtHeight );
  3443. g.DrawString( StrAddress, ft10, b, rec4 );
  3444. string StrTelephone = LYFZ.BLL.OtherCommonModel.FontConversion( "电话:" ) + tbl.Rows[0]["Company_Telephone"].ToString().Trim();
  3445. Rectangle rec4A = new Rectangle( rec4.X, rec4.Y + rec4.Height - FtHeight * 2 + 2, TableWidth - rec1.Width - 10, FtHeight );
  3446. g.DrawString( StrTelephone, ft10, b, rec4A );
  3447. #endregion
  3448. #region 客户姓名
  3449. string StrName = LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名:" ) + tbl2.Rows[0]["姓名"].ToString().Trim() + " " + LYFZ.BLL.OtherCommonModel.FontConversion( "联系电话:" ) + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( tbl2.Rows[0]["电话"] );
  3450. sizef = g.MeasureString( StrName, ft10 );
  3451. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  3452. FtHeight = Convert.ToInt32( sizef.Height );
  3453. Rectangle rec6 = new Rectangle( rec4.X, rec4.Y + rec4.Height - 2, FtWidth, FtHeight );
  3454. g.DrawString( StrName, ft10, b, rec6 );
  3455. #endregion
  3456. #region 日期
  3457. string StrDate = LYFZ.BLL.OtherCommonModel.FontConversion( "打印日期:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy年MM月dd日" );
  3458. sizef = g.MeasureString( StrDate, ft10 );
  3459. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  3460. FtHeight = Convert.ToInt32( sizef.Height );
  3461. Rectangle rec8 = new Rectangle( TableWidth + rec1.X - FtWidth + 14, rec6.Y, FtWidth, FtHeight );
  3462. g.DrawString( StrDate, ft10, b, rec8 );
  3463. #endregion
  3464. int AddLeft = 3;
  3465. int AddTop2 = 6;
  3466. int AddTop = 7;
  3467. int RowHeight = 26;
  3468. int RowContentHeight = 18;
  3469. int ColumnWidth1 = TableWidth / 4;
  3470. int ColumnWidth2 = TableWidth / 4;
  3471. int ColumnWidth3 = TableWidth / 4;
  3472. int ColumnWidth4 = TableWidth - ColumnWidth1 - ColumnWidth2 - ColumnWidth3;
  3473. Rectangle rec9 = new Rectangle( rec1.X + 7, rec6.Y + rec6.Height + 1, TableWidth, RowHeight );
  3474. g.DrawRectangle( p, rec9 );//画标题矩形
  3475. #region 收款项目
  3476. string StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "收款项目" );
  3477. sizef = g.MeasureString( StrValue, ft10 );
  3478. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  3479. Rectangle rec9_1 = new Rectangle( rec9.X + (ColumnWidth1 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth1, RowContentHeight );
  3480. g.DrawString( StrValue, ft11, b, rec9_1 );//画第一列的列标题
  3481. Point p1_1 = new Point( rec9.X + ColumnWidth1, rec9.Y );
  3482. Point p1_2 = new Point( rec9.X + ColumnWidth1, rec9.Y + rec9.Height );
  3483. g.DrawLine( p, p1_1, p1_2 );//画第一表与第二列的界线
  3484. #endregion
  3485. #region 支付方式
  3486. Rectangle rec9_2 = new Rectangle( p1_1.X + (ColumnWidth2 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth2, RowContentHeight );
  3487. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "返还方式" ), ft11, b, rec9_2 );//画第二列的列标题
  3488. Point p2_1 = new Point( p1_1.X + ColumnWidth2, rec9.Y );
  3489. Point p2_2 = new Point( p1_2.X + ColumnWidth2, rec9.Y + rec9.Height );
  3490. g.DrawLine( p, p2_1, p2_2 );//画第二表与第三列的界线
  3491. #endregion
  3492. #region 金 额
  3493. Rectangle rec9_3 = new Rectangle( p2_1.X + (ColumnWidth3 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth3, RowContentHeight );
  3494. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "返还金额" ), ft11, b, rec9_3 );//画第三列的列标题
  3495. Point p3_1 = new Point( p2_1.X + ColumnWidth3, rec9.Y );
  3496. Point p3_2 = new Point( p2_2.X + ColumnWidth3, rec9.Y + rec9.Height );
  3497. g.DrawLine( p, p3_1, p3_2 );//画第三表与第四列的界线
  3498. #endregion
  3499. #region 返还人
  3500. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "返还经手人" );
  3501. sizef = g.MeasureString( StrValue, ft10 );
  3502. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  3503. Rectangle rec9_4 = new Rectangle( p3_1.X + (ColumnWidth4 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth4, RowContentHeight );
  3504. g.DrawString( StrValue, ft11, b, rec9_4 );//画第四列的列标题
  3505. #endregion
  3506. int IntPoint_X = rec9.X;
  3507. int IntPoint_Y = rec9.Y + rec9.Height;
  3508. #region 画列表每行
  3509. int PageRows = 4;//每页多少行
  3510. for ( int i = 0; i < PageRows; i++ )
  3511. {
  3512. Rectangle recfor = new Rectangle( IntPoint_X, IntPoint_Y, TableWidth, RowHeight );
  3513. g.DrawRectangle( p, recfor );//画标题矩形
  3514. string recfor_1Value = "";
  3515. string recfor_2Value = "";
  3516. string recfor_3Value = "";
  3517. string recfor_4Value = "";
  3518. if ( i == 0 )
  3519. {
  3520. recfor_1Value = tbl3.Rows[0]["Mcpm_GradeName"].ToString().Trim();
  3521. recfor_2Value = "现金";
  3522. recfor_3Value = Convert.ToDecimal( tbl3.Rows[0]["Mcpm_OKBackAoumnt"] ).ToString( "0.00" ).Trim();
  3523. recfor_4Value = tbl3.Rows[0]["Mcpm_JingShouRen"].ToString().Trim();
  3524. }
  3525. Rectangle recfor_1 = new Rectangle( recfor.X + AddLeft, recfor.Y + AddTop, ColumnWidth1, RowContentHeight );
  3526. g.DrawString( recfor_1Value, ft10, b, recfor_1 );//画第一列的列标题
  3527. Point pfor1_1 = new Point( recfor_1.X + ColumnWidth1 - 3, recfor.Y );
  3528. Point pfor1_2 = new Point( recfor_1.X + ColumnWidth1 - 3, recfor.Y + recfor.Height );
  3529. g.DrawLine( p, pfor1_1, pfor1_2 );//画第一表与第二列的界线
  3530. Rectangle recfor_2 = new Rectangle( pfor1_1.X + AddLeft, pfor1_1.Y + AddTop, ColumnWidth2, RowContentHeight );
  3531. g.DrawString( recfor_2Value, ft10, b, recfor_2 );//画第二列的列标题
  3532. Point pfor2_1 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y );
  3533. Point pfor2_2 = new Point( pfor1_2.X + ColumnWidth2, recfor.Y + recfor.Height );
  3534. g.DrawLine( p, pfor2_1, pfor2_2 );//画第二表与第三列的界线
  3535. StrValue = recfor_3Value;
  3536. sizef = g.MeasureString( StrValue, ft10 );
  3537. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  3538. Rectangle recfor_3 = new Rectangle( pfor2_1.X + ColumnWidth3 - FtWidth - AddLeft * 2, pfor2_1.Y + AddTop, ColumnWidth3, RowContentHeight );
  3539. g.DrawString( recfor_3Value, ft10, b, recfor_3 );//画第三列的列标题
  3540. Point pfor3_1 = new Point( pfor2_1.X + ColumnWidth3, recfor.Y );
  3541. Point pfor3_2 = new Point( pfor2_2.X + ColumnWidth3, recfor.Y + recfor.Height );
  3542. g.DrawLine( p, pfor3_1, pfor3_2 );//画第三表与第四列的界线
  3543. Rectangle recfor_4 = new Rectangle( pfor3_1.X + AddLeft, pfor3_1.Y + AddTop, ColumnWidth4, RowContentHeight );
  3544. g.DrawString( recfor_4Value, ft10, b, recfor_4 );//画第四列的列标题
  3545. IntPoint_X = recfor.X;
  3546. IntPoint_Y = recfor.Y + recfor.Height;
  3547. }
  3548. #endregion
  3549. Rectangle rec10 = new Rectangle( IntPoint_X, IntPoint_Y, TableWidth, RowHeight );
  3550. g.DrawRectangle( p, rec10 );//画标题矩形
  3551. #region 付款情况
  3552. string rec10_1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "返还情况" );
  3553. sizef = g.MeasureString( rec10_1Value, ft11 );
  3554. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  3555. FtHeight = Convert.ToInt32( sizef.Height );
  3556. Rectangle rec10_1 = new Rectangle( rec10.X + AddLeft, rec10.Y + AddTop2, FtWidth, RowContentHeight );
  3557. g.DrawString( rec10_1Value, ft11, b, rec10_1 );//付款情况
  3558. #endregion
  3559. #region 应退
  3560. Rectangle rec10_2 = new Rectangle( rec10_1.X + (TableWidth / 4), rec10.Y + AddTop2, TableWidth / 4, RowContentHeight );
  3561. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "应还:" ) + tbl3.Rows[0]["Mcpm_BackAoumnt"].ToString().Trim(), ft11, b, rec10_2 );//应付
  3562. #endregion
  3563. #region 实退
  3564. decimal ActualAmount = Convert.ToDecimal( tbl3.Rows[0]["Mcpm_OKBackAoumnt"] );//实付金额
  3565. Rectangle rec10_3 = new Rectangle( rec10_2.X + (TableWidth / 4), rec10.Y + AddTop2, TableWidth / 4, RowContentHeight );
  3566. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "实还:" ) + ActualAmount.ToString(), ft11, b, rec10_3 );//实付
  3567. #endregion
  3568. Rectangle rec11 = new Rectangle( rec10.X, rec10.Y + rec10.Height, TableWidth, RowHeight );
  3569. g.DrawRectangle( p, rec11 );//画标题矩形
  3570. #region 合计
  3571. Rectangle rec11_1 = new Rectangle( rec11.X + AddLeft, rec11.Y + AddTop2, TableWidth - 300, RowContentHeight );
  3572. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "合计人民币(大写):" ) + " " + LYFZ.Software.MainBusiness.ReportPrint.ReportPrintDataClass.ConversionAmount( ActualAmount.ToString() ), ft11, b, rec11_1 );//合计人民币
  3573. #endregion
  3574. #region 顾客签字
  3575. Rectangle rec11_2 = new Rectangle( rec11_1.X + rec11_1.Width + 100, rec11_1.Y, 300, RowContentHeight );
  3576. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "顾客签字:" ), ft11, b, rec11_2 );//画消费法规
  3577. #endregion
  3578. #region 说明
  3579. Rectangle rec12 = new Rectangle( rec11.X, rec11.Y + rec11.Height + 3, rec9.Width, Convert.ToInt32( g.MeasureString( "说明", ft9 ).Height ) + 1 );
  3580. string PaymentExplain = "";
  3581. if ( PrintOtherData.ContainsKey( "收款单说明" ) && PrintOtherData["收款单说明"].ToString().Trim().Length > 0 )
  3582. {
  3583. PaymentExplain = PrintOtherData["收款单说明"].ToString().Trim();
  3584. }
  3585. g.DrawString( PaymentExplain, ft9, b, rec12 );//画消费法规
  3586. #endregion
  3587. #endregion
  3588. }
  3589. #endregion
  3590. #region 会员服务收款
  3591. /// <summary>
  3592. /// 会员服务收款
  3593. /// </summary>
  3594. /// <param name="panl"></param>
  3595. public static void PaymentPrint_MemberService_Print( object objValue, Graphics g, Size size, bool IsPrintSerialNo )
  3596. {
  3597. Hashtable htData = (Hashtable)objValue;
  3598. string ExecuteSql = orbll.GetView_CustomReturnExecuteSql( "tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Address,Company_Telephone,Company_UpdateDatetime" );
  3599. ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql( "BView_MemberMain_GoldMember", StrWhere: "Mc_Number = '" + htData["strMcNumber"] + "'", ShowColumnName: "姓名,电话,会员卡号" );
  3600. 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" );
  3601. ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql( "tb_ErpMemberCardPaymentContentDetail", StrWhere: "Mcpcd_PaymentNumber = '" + htData["strNumber"] + "'", ShowColumnName: "Mcpcd_PaymentNumber,Mcpcd_ServiceNumber,Mcpcd_ServiceContent,Mcpcd_Count,Mcpcd_SalePrice" );
  3602. DataSet dtSet = orbll.GetView_Custom( ExecuteSql );
  3603. DataTable tbl = dtSet.Tables["ds"];//获取影楼信息
  3604. DataTable tblA = dtSet.Tables["ds1"];
  3605. DataTable tblB = dtSet.Tables["ds2"];
  3606. DataTable tblC = dtSet.Tables["ds3"];
  3607. DataTable tblD = LYFZ.BLL.BLL_ErpOrderView.GetData_MemberMainServiceArrears( "应付,已付,欠款", StrQueryCondition: " Where Mcpo_OrderNumber = '" + htData["strNumber"] + "'", StrQueryCondition2: "" );
  3608. if ( tbl.Rows.Count <= 0 )
  3609. {
  3610. MessageBoxCustom.Show( "未设置影楼信息" ); return;
  3611. }
  3612. if ( tblA.Rows.Count <= 0 )
  3613. {
  3614. MessageBoxCustom.Show( "此服务没有会员卡" ); return;
  3615. }
  3616. Brush b = Brushes.Black;
  3617. Pen p = GetPen;
  3618. Font ft16 = new Font( "宋体", 16 );
  3619. Font ft11 = new Font( "宋体", 10 );
  3620. Font ft10 = new Font( "宋体", 9 );
  3621. Font ft9 = new Font( "宋体", 9 );
  3622. #region 二维码
  3623. Image img = CachePhoto( PhotoLogType.DimensionalCode, tbl.Rows[0]["Company_UpdateDatetime"] );
  3624. Rectangle rec1 = new Rectangle( 50, 25, 90, 90 );
  3625. if ( img != null )
  3626. {
  3627. g.DrawImage( img, rec1 );
  3628. }
  3629. #endregion
  3630. int TableWidth = size.Width - rec1.X * 2 - 14;
  3631. #region 金色童年收据凭据
  3632. SizeF sizef = g.MeasureString( DefaultPrintTitle, ft16 );
  3633. int FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  3634. int FtHeight = Convert.ToInt32( sizef.Height );
  3635. Rectangle rec2 = new Rectangle( (size.Width / 2) - (FtWidth / 2), 30, FtWidth + 5, FtHeight );
  3636. g.DrawString( DefaultPrintTitle, ft16, b, rec2 );
  3637. #endregion
  3638. #region NO.
  3639. string rec3Value = "NO." + StrRandom( tblA.Rows[0]["会员卡号"].ToString().Trim() );
  3640. sizef = g.MeasureString( rec3Value, ft11 );
  3641. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  3642. FtHeight = Convert.ToInt32( sizef.Height );
  3643. Rectangle rec3 = new Rectangle( size.Width - rec1.X - FtWidth, rec2.Y + 35, FtWidth, FtHeight );
  3644. g.DrawString( rec3Value, ft11, b, rec3 );
  3645. if ( IsPrintSerialNo )
  3646. {
  3647. string SerialNo = PrintReceiptSerial();
  3648. if ( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition )
  3649. {
  3650. SerialNo = PrintReceiptSerial( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.CurrentCompanyInfoID );
  3651. }
  3652. if ( string.IsNullOrEmpty( SerialNo ) )
  3653. {
  3654. MessageBoxCustom.Show( "获取流水单号失败!" ); return;
  3655. }
  3656. rec3Value = "SerialNo." + SerialNo;
  3657. sizef = g.MeasureString( rec3Value, ft11 );
  3658. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  3659. FtHeight = Convert.ToInt32( sizef.Height );
  3660. Rectangle rec3A = new Rectangle( size.Width - rec1.X - FtWidth, rec3.Y - FtHeight + 2, FtWidth, FtHeight );
  3661. g.DrawString( rec3Value, ft11, b, rec3A );
  3662. }
  3663. #endregion
  3664. #region 地址
  3665. string StrAddress = LYFZ.BLL.OtherCommonModel.FontConversion( "地址:" ) + tbl.Rows[0]["Company_Address"].ToString().Trim();
  3666. sizef = g.MeasureString( StrAddress, ft10 );
  3667. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  3668. FtHeight = Convert.ToInt32( sizef.Height );
  3669. Rectangle rec4 = new Rectangle( rec1.X + rec1.Width - 5, rec3.Y + rec3.Height + FtHeight - 15, TableWidth - rec1.Width + 14, FtHeight );
  3670. g.DrawString( StrAddress, ft10, b, rec4 );
  3671. string StrTelephone = LYFZ.BLL.OtherCommonModel.FontConversion( "电话:" ) + tbl.Rows[0]["Company_Telephone"].ToString().Trim();
  3672. Rectangle rec4A = new Rectangle( rec4.X, rec4.Y + rec4.Height - FtHeight * 2 + 2, TableWidth - rec1.Width - 10, FtHeight );
  3673. g.DrawString( StrTelephone, ft10, b, rec4A );
  3674. #endregion
  3675. #region 客户姓名
  3676. string StrName = LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名:" ) + tblA.Rows[0]["姓名"].ToString().Trim() + " " + LYFZ.BLL.OtherCommonModel.FontConversion( "联系电话:" ) + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( tblA.Rows[0]["电话"] );
  3677. sizef = g.MeasureString( StrName, ft10 );
  3678. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  3679. FtHeight = Convert.ToInt32( sizef.Height );
  3680. Rectangle rec6 = new Rectangle( rec4.X, rec4.Y + rec4.Height - 2, FtWidth, FtHeight );
  3681. g.DrawString( StrName, ft10, b, rec6 );
  3682. #endregion
  3683. #region 日期
  3684. string StrDate = LYFZ.BLL.OtherCommonModel.FontConversion( "付款日期:" ) + LYFZ.Command.Command_Validate.DateTimeToString( htData["strDate"] );
  3685. sizef = g.MeasureString( StrDate, ft10 );
  3686. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  3687. FtHeight = Convert.ToInt32( sizef.Height );
  3688. Rectangle rec8 = new Rectangle( TableWidth + rec1.X - FtWidth + 14, rec6.Y, FtWidth, FtHeight );
  3689. g.DrawString( StrDate, ft10, b, rec8 );
  3690. #endregion
  3691. int AddLeft = 3;
  3692. int AddTop2 = 6;
  3693. int AddTop = 7;
  3694. int RowHeight = 26;
  3695. int RowContentHeight = 18;
  3696. int ColumnWidth4 = TableWidth / 6;
  3697. int ColumnWidth2 = TableWidth / 6;
  3698. int ColumnWidth3 = TableWidth / 6;
  3699. int ColumnWidth5 = TableWidth / 6;
  3700. int ColumnWidth1 = TableWidth - ColumnWidth4 - ColumnWidth2 - ColumnWidth3 - ColumnWidth5;
  3701. Rectangle rec9 = new Rectangle( rec1.X + 7, rec6.Y + rec6.Height + 1, TableWidth, RowHeight );
  3702. g.DrawRectangle( p, rec9 );//画标题矩形
  3703. #region 收款项目
  3704. string StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "收款项目" );
  3705. FtWidth = Convert.ToInt32( g.MeasureString( StrValue, ft10 ).Width ) + 1;
  3706. Rectangle rec9_1 = new Rectangle( rec9.X + (ColumnWidth1 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth1, RowContentHeight );
  3707. g.DrawString( StrValue, ft11, b, rec9_1 );//画第一列的列标题
  3708. Point p1_1 = new Point( rec9.X + ColumnWidth1, rec9.Y );
  3709. Point p1_2 = new Point( rec9.X + ColumnWidth1, rec9.Y + rec9.Height );
  3710. g.DrawLine( p, p1_1, p1_2 );//画第一表与第二列的界线
  3711. #endregion
  3712. #region 支付方式
  3713. Rectangle rec9_2 = new Rectangle( p1_1.X + (ColumnWidth2 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth2, RowContentHeight );
  3714. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "支付方式" ), ft11, b, rec9_2 );//画第二列的列标题
  3715. Point p2_1 = new Point( p1_1.X + ColumnWidth2, rec9.Y );
  3716. Point p2_2 = new Point( p1_1.X + ColumnWidth2, rec9.Y + rec9.Height );
  3717. g.DrawLine( p, p2_1, p2_2 );//画第二表与第三列的界线
  3718. #endregion
  3719. #region 金 额
  3720. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "金 额" );
  3721. sizef = g.MeasureString( StrValue, ft10 );
  3722. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  3723. Rectangle rec9_3 = new Rectangle( p2_1.X + (ColumnWidth3 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth3, RowContentHeight );
  3724. g.DrawString( StrValue, ft11, b, rec9_3 );//画第三列的列标题
  3725. Point p3_1 = new Point( p2_1.X + ColumnWidth3, rec9.Y );
  3726. Point p3_2 = new Point( p2_1.X + ColumnWidth3, rec9.Y + rec9.Height );
  3727. g.DrawLine( p, p3_1, p3_2 );//画第三表与第四列的界线
  3728. #endregion
  3729. #region 次 数
  3730. Rectangle rec9_4 = new Rectangle( p3_1.X + (ColumnWidth4 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth4, RowContentHeight );
  3731. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "次 数" ), ft11, b, rec9_4 );//画第四列的列标题
  3732. Point p4_1 = new Point( p3_1.X + ColumnWidth4, rec9.Y );
  3733. Point p4_2 = new Point( p3_1.X + ColumnWidth4, rec9.Y + rec9.Height );
  3734. g.DrawLine( p, p4_1, p4_2 );//画第四表与第五列的界线
  3735. #endregion
  3736. #region 收 银
  3737. Rectangle rec9_5 = new Rectangle( p4_1.X + (ColumnWidth5 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth5, RowContentHeight );
  3738. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "收 银" ), ft11, b, rec9_5 );//画第五列的列标题
  3739. #endregion
  3740. int IntPoint_X = rec9.X;
  3741. int IntPoint_Y = rec9.Y + rec9.Height;
  3742. #region 画列表每行
  3743. int ForCount = 0;
  3744. int PageRows = 4;//每页多少行
  3745. for ( int i = 0; i < PageRows; i++ )
  3746. {
  3747. Rectangle recfor = new Rectangle( IntPoint_X, IntPoint_Y, TableWidth, RowHeight );
  3748. g.DrawRectangle( p, recfor );//画标题矩形
  3749. string recfor_1Value = "";
  3750. string recfor_2Value = "";
  3751. string recfor_3Value = "";
  3752. string recfor_4Value = "";
  3753. string recfor_5Value = "";
  3754. if ( ForCount < tblC.Rows.Count )
  3755. {
  3756. recfor_1Value = tblC.Rows[ForCount]["Mcpcd_ServiceContent"].ToString().Trim();
  3757. recfor_2Value = tblB.Rows[0]["Mcpt_PaymentMethod"].ToString().Trim();
  3758. recfor_3Value = Convert.ToDecimal( tblC.Rows[ForCount]["Mcpcd_SalePrice"] ).ToString( "0.00" ).Trim();
  3759. recfor_4Value = tblC.Rows[ForCount]["Mcpcd_Count"].ToString().Trim();
  3760. recfor_5Value = tblB.Rows[0]["Mcpt_CreateName"].ToString().Trim();
  3761. ForCount++;
  3762. }
  3763. Rectangle recfor_1 = new Rectangle( recfor.X + AddLeft, recfor.Y + AddTop, ColumnWidth1, RowContentHeight );
  3764. g.DrawString( recfor_1Value, ft10, b, recfor_1 );//画第一列的列标题
  3765. Point pfor1_1 = new Point( recfor_1.X + ColumnWidth1 - 3, recfor.Y );
  3766. Point pfor1_2 = new Point( recfor_1.X + ColumnWidth1 - 3, recfor.Y + recfor.Height );
  3767. g.DrawLine( p, pfor1_1, pfor1_2 );//画第一表与第二列的界线
  3768. Rectangle recfor_2 = new Rectangle( pfor1_1.X + AddLeft, pfor1_1.Y + AddTop, ColumnWidth2, RowContentHeight );
  3769. g.DrawString( recfor_2Value, ft10, b, recfor_2 );//画第二列的列标题
  3770. Point pfor2_1 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y );
  3771. Point pfor2_2 = new Point( pfor1_2.X + ColumnWidth2, recfor.Y + recfor.Height );
  3772. g.DrawLine( p, pfor2_1, pfor2_2 );//画第二表与第三列的界线
  3773. StrValue = recfor_3Value;
  3774. sizef = g.MeasureString( StrValue, ft10 );
  3775. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  3776. Rectangle recfor_3 = new Rectangle( pfor2_1.X + ColumnWidth3 - FtWidth - AddLeft * 2, pfor2_1.Y + AddTop, ColumnWidth3, RowContentHeight );
  3777. g.DrawString( recfor_3Value, ft10, b, recfor_3 );//画第三列的列标题
  3778. Point pfor3_1 = new Point( pfor2_1.X + ColumnWidth3, recfor.Y );
  3779. Point pfor3_2 = new Point( pfor2_2.X + ColumnWidth3, recfor.Y + recfor.Height );
  3780. g.DrawLine( p, pfor3_1, pfor3_2 );//画第三表与第四列的界线
  3781. Rectangle recfor_4 = new Rectangle( pfor3_1.X + AddLeft, pfor3_1.Y + AddTop, ColumnWidth4, RowContentHeight );
  3782. g.DrawString( recfor_4Value, ft10, b, recfor_4 );//画第四列的列标题
  3783. Point pfor4_1 = new Point( pfor3_1.X + ColumnWidth4, recfor.Y );
  3784. Point pfor4_2 = new Point( pfor3_2.X + ColumnWidth4, recfor.Y + recfor.Height );
  3785. g.DrawLine( p, pfor4_1, pfor4_2 );//画第四表与第五列的界线
  3786. Rectangle recfor_5 = new Rectangle( pfor4_1.X + AddLeft, pfor4_1.Y + AddTop, ColumnWidth5, RowContentHeight );
  3787. g.DrawString( recfor_5Value, ft10, b, recfor_5 );//画第五列的列标题
  3788. IntPoint_X = recfor.X;
  3789. IntPoint_Y = recfor.Y + recfor.Height;
  3790. }
  3791. #endregion
  3792. Rectangle rec10 = new Rectangle( IntPoint_X, IntPoint_Y, TableWidth, RowHeight );
  3793. g.DrawRectangle( p, rec10 );//画标题矩形
  3794. #region 付款情况
  3795. string rec10_1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "付款情况" );
  3796. sizef = g.MeasureString( rec10_1Value, ft10 );
  3797. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  3798. FtHeight = Convert.ToInt32( sizef.Height );
  3799. Rectangle rec10_1 = new Rectangle( rec10.X + AddLeft, rec10.Y + AddTop2, FtWidth, RowContentHeight );
  3800. g.DrawString( rec10_1Value, ft10, b, rec10_1 );//付款情况
  3801. #endregion
  3802. #region 应付
  3803. decimal CopeAmount = Convert.ToDecimal( tblD.Rows[0]["应付"] ); //应付金额
  3804. Rectangle rec10_2 = new Rectangle( rec10_1.X + (TableWidth / 4), rec10.Y + AddTop2, TableWidth / 4, RowContentHeight );
  3805. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "应付:" ) + Convert.ToDecimal( tblD.Rows[0]["应付"] ).ToString( "0.00" ), ft10, b, rec10_2 );//应付
  3806. #endregion
  3807. #region 实付
  3808. Rectangle rec10_3 = new Rectangle( rec10_2.X + (TableWidth / 4) - 50, rec10.Y + AddTop2, TableWidth / 4 + 70, RowContentHeight );
  3809. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "实付:" ) + (Convert.ToDecimal( tblB.Rows[0]["Mcpt_PaymentAmount"] )
  3810. + Convert.ToDecimal( tblB.Rows[0]["Mcpt_DiscountAmount"] )).ToString( "0.00" )
  3811. + LYFZ.BLL.OtherCommonModel.FontConversion( " 总付款:" )
  3812. + tblD.Rows[0]["已付"].ToString(), ft10, b, rec10_3 );//实付
  3813. #endregion
  3814. #region 欠款
  3815. Rectangle rec10_4 = new Rectangle( rec10_3.X + (TableWidth / 4) + 70, rec10.Y + AddTop2, TableWidth / 4, RowContentHeight );
  3816. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "欠款:" ) + Convert.ToDecimal( tblD.Rows[0]["欠款"] ).ToString( "0.00" ), ft10, b, rec10_4 );//欠款
  3817. #endregion
  3818. Rectangle rec11 = new Rectangle( rec10.X, rec10.Y + rec10.Height, TableWidth, RowHeight );
  3819. g.DrawRectangle( p, rec11 );//画标题矩形
  3820. #region 合计
  3821. Rectangle rec11_1 = new Rectangle( rec11.X + AddLeft, rec11.Y + AddTop2, TableWidth - 300, RowContentHeight );
  3822. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "合计人民币(大写):" ) + " " + LYFZ.Software.MainBusiness.ReportPrint.ReportPrintDataClass.ConversionAmount( Convert.ToDecimal( tblD.Rows[0]["已付"] ).ToString() ), ft10, b, rec11_1 );//合计人民币
  3823. #endregion
  3824. #region 顾客签字
  3825. Rectangle rec11_2 = new Rectangle( rec11_1.X + rec11_1.Width + 100, rec11_1.Y, 300, RowContentHeight );
  3826. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "顾客签字:" ), ft10, b, rec11_2 );//画消费法规
  3827. #endregion
  3828. #region 说明
  3829. Rectangle rec12 = new Rectangle( rec11.X, rec11.Y + rec11.Height + 3, rec9.Width, Convert.ToInt32( g.MeasureString( "说明", ft9 ).Height ) + 1 );
  3830. string PaymentExplain = "";
  3831. if ( PrintOtherData.ContainsKey( "收款单说明" ) && PrintOtherData["收款单说明"].ToString().Trim().Length > 0 )
  3832. {
  3833. PaymentExplain = PrintOtherData["收款单说明"].ToString().Trim();
  3834. }
  3835. g.DrawString( PaymentExplain, ft9, b, rec12 );//画消费法规
  3836. #endregion
  3837. }
  3838. #endregion
  3839. #region 会员服务消费
  3840. /// <summary>
  3841. /// 会员服务消费
  3842. /// </summary>
  3843. /// <param name="panl"></param>
  3844. public static void PaymentPrint_MemberServiceUse_Print( object objValue, Graphics g, Size size, bool IsPrintSerialNo )
  3845. {
  3846. Hashtable htData = (Hashtable)objValue;
  3847. List<Hashtable> hlist = (List<Hashtable>)htData["hlist"];
  3848. List<Image> imglist = new List<Image>();
  3849. string ExecuteSql = orbll.GetView_CustomReturnExecuteSql( "tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Address,Company_Telephone,Company_UpdateDatetime" );
  3850. ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql( "BView_MemberMain_GoldMember", StrWhere: "Mc_Number = '" + htData["strNumber"] + "'", ShowColumnName: "姓名,电话,会员卡号" );
  3851. DataSet dtSet = orbll.GetView_Custom( ExecuteSql );
  3852. DataTable tbl = dtSet.Tables["ds"];//获取影楼信息
  3853. DataTable tblA = dtSet.Tables["ds1"];//订单
  3854. if ( tbl.Rows.Count <= 0 )
  3855. {
  3856. MessageBoxCustom.Show( "未设置影楼信息" ); return;
  3857. }
  3858. if ( tblA.Rows.Count <= 0 )
  3859. {
  3860. MessageBoxCustom.Show( "此服务没有会员卡" ); return;
  3861. }
  3862. Brush b = Brushes.Black;
  3863. Pen p = GetPen;
  3864. Font ft16 = new Font( "宋体", 16 );
  3865. Font ft11 = new Font( "宋体", 10 );
  3866. Font ft10 = new Font( "宋体", 9 );
  3867. Font ft9 = new Font( "宋体", 9 );
  3868. #region 二维码
  3869. Image img = CachePhoto( PhotoLogType.DimensionalCode, tbl.Rows[0]["Company_UpdateDatetime"] );
  3870. Rectangle rec1 = new Rectangle( 50, 25, 90, 90 );
  3871. if ( img != null )
  3872. {
  3873. g.DrawImage( img, rec1 );
  3874. }
  3875. #endregion
  3876. int TableWidth = size.Width - rec1.X * 2 - 14;
  3877. #region 金色童年收据凭据
  3878. SizeF sizef = g.MeasureString( DefaultPrintTitle, ft16 );
  3879. int FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  3880. int FtHeight = Convert.ToInt32( sizef.Height );
  3881. Rectangle rec2 = new Rectangle( (size.Width / 2) - (FtWidth / 2), 30, FtWidth + 5, FtHeight );
  3882. g.DrawString( DefaultPrintTitle, ft16, b, rec2 );
  3883. #endregion
  3884. #region NO.
  3885. string rec3Value = "NO." + StrRandom( tblA.Rows[0]["会员卡号"].ToString().Trim() );
  3886. sizef = g.MeasureString( rec3Value, ft11 );
  3887. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  3888. FtHeight = Convert.ToInt32( sizef.Height );
  3889. Rectangle rec3 = new Rectangle( size.Width - rec1.X - FtWidth, rec2.Y + 35, FtWidth, FtHeight );
  3890. g.DrawString( rec3Value, ft11, b, rec3 );
  3891. if ( IsPrintSerialNo )
  3892. {
  3893. string SerialNo = PrintReceiptSerial();
  3894. if ( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition )
  3895. {
  3896. SerialNo = PrintReceiptSerial( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.CurrentCompanyInfoID );
  3897. }
  3898. if ( string.IsNullOrEmpty( SerialNo ) )
  3899. {
  3900. MessageBoxCustom.Show( "获取流水单号失败!" ); return;
  3901. }
  3902. rec3Value = "SerialNo." + SerialNo;
  3903. sizef = g.MeasureString( rec3Value, ft11 );
  3904. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  3905. FtHeight = Convert.ToInt32( sizef.Height );
  3906. Rectangle rec3A = new Rectangle( size.Width - rec1.X - FtWidth, rec3.Y - FtHeight + 2, FtWidth, FtHeight );
  3907. g.DrawString( rec3Value, ft11, b, rec3A );
  3908. }
  3909. #endregion
  3910. #region 地址
  3911. string StrAddress = LYFZ.BLL.OtherCommonModel.FontConversion( "地址:" ) + tbl.Rows[0]["Company_Address"].ToString().Trim();
  3912. sizef = g.MeasureString( StrAddress, ft10 );
  3913. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  3914. FtHeight = Convert.ToInt32( sizef.Height );
  3915. Rectangle rec4 = new Rectangle( rec1.X + rec1.Width - 5, rec3.Y + rec3.Height + FtHeight - 15, TableWidth - rec1.Width + 14, FtHeight );
  3916. g.DrawString( StrAddress, ft10, b, rec4 );
  3917. string StrTelephone = LYFZ.BLL.OtherCommonModel.FontConversion( "电话:" ) + tbl.Rows[0]["Company_Telephone"].ToString().Trim();
  3918. Rectangle rec4A = new Rectangle( rec4.X, rec4.Y + rec4.Height - FtHeight * 2 + 2, TableWidth - rec1.Width - 10, FtHeight );
  3919. g.DrawString( StrTelephone, ft10, b, rec4A );
  3920. #endregion
  3921. #region 客户姓名
  3922. string StrName = LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名:" ) + tblA.Rows[0]["姓名"].ToString().Trim() + " " + LYFZ.BLL.OtherCommonModel.FontConversion( "联系电话:" ) + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( tblA.Rows[0]["电话"] );
  3923. sizef = g.MeasureString( StrName, ft10 );
  3924. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  3925. FtHeight = Convert.ToInt32( sizef.Height );
  3926. Rectangle rec6 = new Rectangle( rec4.X, rec4.Y + rec4.Height - 2, FtWidth, FtHeight );
  3927. g.DrawString( StrName, ft10, b, rec6 );
  3928. #endregion
  3929. #region 日期
  3930. string StrDate = LYFZ.BLL.OtherCommonModel.FontConversion( "打印日期:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy年MM月dd日" );
  3931. sizef = g.MeasureString( StrDate, ft10 );
  3932. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  3933. FtHeight = Convert.ToInt32( sizef.Height );
  3934. Rectangle rec8 = new Rectangle( TableWidth + rec1.X - FtWidth + 14, rec6.Y, FtWidth, FtHeight );
  3935. g.DrawString( StrDate, ft10, b, rec8 );
  3936. #endregion
  3937. int AddLeft = 3;
  3938. int AddTop2 = 6;
  3939. int AddTop = 7;
  3940. int RowHeight = 26;
  3941. int RowContentHeight = 18;
  3942. int ColumnWidth4 = 120;
  3943. int ColumnWidth2 = 120;
  3944. int ColumnWidth3 = 120;
  3945. int ColumnWidth5 = 120;
  3946. int ColumnWidth1 = TableWidth - ColumnWidth4 - ColumnWidth2 - ColumnWidth3 - ColumnWidth5;
  3947. Rectangle rec9 = new Rectangle( rec1.X + 7, rec6.Y + rec6.Height + 1, TableWidth, RowHeight );
  3948. g.DrawRectangle( p, rec9 );//画标题矩形
  3949. #region 收款项目
  3950. string StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "收款项目" );
  3951. sizef = g.MeasureString( StrValue, ft10 );
  3952. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  3953. Rectangle rec9_1 = new Rectangle( rec9.X + (ColumnWidth1 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth1, RowContentHeight );
  3954. g.DrawString( StrValue, ft11, b, rec9_1 );//画第一列的列标题
  3955. Point p1_1 = new Point( rec9.X + ColumnWidth1, rec9.Y );
  3956. Point p1_2 = new Point( rec9.X + ColumnWidth1, rec9.Y + rec9.Height );
  3957. g.DrawLine( p, p1_1, p1_2 );//画第一表与第二列的界线
  3958. #endregion
  3959. #region 消费次数
  3960. Rectangle rec9_2 = new Rectangle( p1_1.X + (ColumnWidth2 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth2, RowContentHeight );
  3961. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "消费次数" ), ft11, b, rec9_2 );//画第二列的列标题
  3962. Point p2_1 = new Point( p1_1.X + ColumnWidth2, rec9.Y );
  3963. Point p2_2 = new Point( p1_2.X + ColumnWidth2, rec9.Y + rec9.Height );
  3964. g.DrawLine( p, p2_1, p2_2 );//画第二表与第三列的界线
  3965. #endregion
  3966. #region 消费后剩余次数
  3967. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "消费后剩余次数" );
  3968. sizef = g.MeasureString( StrValue, ft10 );
  3969. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  3970. Rectangle rec9_3 = new Rectangle( p2_1.X + (ColumnWidth3 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth3, RowContentHeight );
  3971. g.DrawString( StrValue, ft11, b, rec9_3 );//画第三列的列标题
  3972. Point p3_1 = new Point( p2_1.X + ColumnWidth3, rec9.Y );
  3973. Point p3_2 = new Point( p2_2.X + ColumnWidth3, rec9.Y + rec9.Height );
  3974. g.DrawLine( p, p3_1, p3_2 );//画第三表与第四列的界线
  3975. #endregion
  3976. #region 消费时间
  3977. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "消费时间" );
  3978. sizef = g.MeasureString( StrValue, ft10 );
  3979. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  3980. Rectangle rec9_4 = new Rectangle( p3_1.X + (ColumnWidth4 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth4, RowContentHeight );
  3981. g.DrawString( StrValue, ft11, b, rec9_4 );//画第四列的列标题
  3982. Point p4_1 = new Point( p3_1.X + ColumnWidth4, rec9.Y );
  3983. Point p4_2 = new Point( p3_2.X + ColumnWidth4, rec9.Y + rec9.Height );
  3984. g.DrawLine( p, p4_1, p4_2 );//画第四表与第五列的界线
  3985. #endregion
  3986. #region 经手人
  3987. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "经手人" );
  3988. sizef = g.MeasureString( StrValue, ft10 );
  3989. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  3990. Rectangle rec9_5 = new Rectangle( p4_1.X + (ColumnWidth5 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth5, RowContentHeight );
  3991. g.DrawString( StrValue, ft11, b, rec9_5 );//画第五列的列标题
  3992. #endregion
  3993. int IntPoint_X = rec9.X;
  3994. int IntPoint_Y = rec9.Y + rec9.Height;
  3995. #region 画列表每行
  3996. int ForCount = 0;
  3997. int PageRows = 6;//每页多少行
  3998. for ( int i = 0; i < PageRows; i++ )
  3999. {
  4000. Rectangle recfor = new Rectangle( IntPoint_X, IntPoint_Y, TableWidth, RowHeight );
  4001. g.DrawRectangle( p, recfor );//画标题矩形
  4002. string recfor_1Value = "";
  4003. string recfor_2Value = "";
  4004. string recfor_3Value = "";
  4005. string recfor_4Value = "";
  4006. string recfor_5Value = "";
  4007. if ( ForCount < hlist.Count )
  4008. {
  4009. Hashtable htData2 = (Hashtable)hlist[ForCount];
  4010. recfor_1Value = htData2["ItemName"].ToString().Trim();
  4011. recfor_2Value = htData2["UseCount"].ToString().Trim();
  4012. recfor_3Value = htData2["UseAfterCount"].ToString().Trim();
  4013. recfor_4Value = htData2["UseTime"].ToString().Trim();
  4014. recfor_5Value = htData2["JingShouRen"].ToString().Trim();
  4015. ForCount++;
  4016. }
  4017. Rectangle recfor_1 = new Rectangle( recfor.X + AddLeft, recfor.Y + AddTop, ColumnWidth1, RowContentHeight );
  4018. g.DrawString( recfor_1Value, ft10, b, recfor_1 );//画第一列的列标题
  4019. Point pfor1_1 = new Point( recfor_1.X + ColumnWidth1 - 3, recfor.Y );
  4020. Point pfor1_2 = new Point( recfor_1.X + ColumnWidth1 - 3, recfor.Y + recfor.Height );
  4021. g.DrawLine( p, pfor1_1, pfor1_2 );//画第一表与第二列的界线
  4022. Rectangle recfor_2 = new Rectangle( pfor1_1.X + AddLeft, pfor1_1.Y + AddTop, ColumnWidth2, RowContentHeight );
  4023. g.DrawString( recfor_2Value, ft10, b, recfor_2 );//画第二列的列标题
  4024. Point pfor2_1 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y );
  4025. Point pfor2_2 = new Point( pfor1_2.X + ColumnWidth2, recfor.Y + recfor.Height );
  4026. g.DrawLine( p, pfor2_1, pfor2_2 );//画第二表与第三列的界线
  4027. Rectangle recfor_3 = new Rectangle( pfor2_1.X + AddLeft, pfor2_1.Y + AddTop, ColumnWidth3, RowContentHeight );
  4028. g.DrawString( recfor_3Value, ft10, b, recfor_3 );//画第三列的列标题
  4029. Point pfor3_1 = new Point( pfor2_1.X + ColumnWidth3, recfor.Y );
  4030. Point pfor3_2 = new Point( pfor2_2.X + ColumnWidth3, recfor.Y + recfor.Height );
  4031. g.DrawLine( p, pfor3_1, pfor3_2 );//画第三表与第四列的界线
  4032. Rectangle recfor_4 = new Rectangle( pfor3_1.X + AddLeft, pfor3_1.Y + AddTop, ColumnWidth4, RowContentHeight );
  4033. g.DrawString( recfor_4Value, ft10, b, recfor_4 );//画第四列的列标题
  4034. Point pfor4_1 = new Point( pfor3_1.X + ColumnWidth4, recfor.Y );
  4035. Point pfor4_2 = new Point( pfor3_2.X + ColumnWidth4, recfor.Y + recfor.Height );
  4036. g.DrawLine( p, pfor4_1, pfor4_2 );//画第四表与第五列的界线
  4037. Rectangle recfor_5 = new Rectangle( pfor4_1.X + AddLeft, pfor4_1.Y + AddTop, ColumnWidth5, RowContentHeight );
  4038. g.DrawString( recfor_5Value, ft10, b, recfor_5 );//画第五列的列标题
  4039. IntPoint_X = recfor.X;
  4040. IntPoint_Y = recfor.Y + recfor.Height;
  4041. }
  4042. #endregion
  4043. #region 顾客签字
  4044. Rectangle rec11_2 = new Rectangle( IntPoint_X + TableWidth - 130, IntPoint_Y + AddTop2, 130, RowContentHeight + 10 );
  4045. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "顾客签字:" ), ft10, b, rec11_2 );//画消费法规
  4046. #endregion
  4047. #region 说明
  4048. Rectangle rec12 = new Rectangle( rec9.X, rec11_2.Y, rec9.Width - rec11_2.Width - 10, Convert.ToInt32( g.MeasureString( "说明", ft9 ).Height ) + 1 );
  4049. string PaymentExplain = "";
  4050. if ( PrintOtherData.ContainsKey( "收款单说明" ) && PrintOtherData["收款单说明"].ToString().Trim().Length > 0 )
  4051. {
  4052. PaymentExplain = PrintOtherData["收款单说明"].ToString().Trim();
  4053. }
  4054. g.DrawString( PaymentExplain, ft9, b, rec12 );//画消费法规
  4055. #endregion
  4056. }
  4057. #endregion
  4058. #region 礼服出租收款
  4059. /// <summary>
  4060. /// 礼服出租收款
  4061. /// </summary>
  4062. /// <param name="panl"></param>
  4063. public static void PaymentPrint_GownsPayment_Print( object objData, Graphics g, Size size, bool IsPrintSerialNo )
  4064. {
  4065. Hashtable htData = (Hashtable)objData;
  4066. DataGridViewEx dgvData = (DataGridViewEx)htData["dgvData"];
  4067. string ExecuteSql = orbll.GetView_CustomReturnExecuteSql( "tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Address,Company_Telephone,Company_UpdateDatetime" );
  4068. ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql( "tb_ErpPayment", StrWhere: "Pay_OrdNumber = '" + htData["ordNumber"].ToString().Trim() + "' and Pay_Type = '2'", ShowColumnName: "sum(Pay_AmountOf) AS Pay_AmountOf" );
  4069. DataSet dtSet = orbll.GetView_Custom( ExecuteSql );
  4070. DataTable tbl = dtSet.Tables["ds"];//获取影楼信息
  4071. DataTable tblPayment = dtSet.Tables["ds1"];//出租单
  4072. if ( tbl.Rows.Count <= 0 )
  4073. {
  4074. MessageBoxCustom.Show( "未设置影楼信息" ); return;
  4075. }
  4076. Brush b = Brushes.Black;
  4077. Pen p = GetPen;
  4078. Font ft16 = new Font( "宋体", 15 );
  4079. Font ft11 = new Font( "宋体", 10 );
  4080. Font ft10 = new Font( "宋体", 9 );
  4081. Font ft9 = new Font( "宋体", 9 );
  4082. #region 二维码
  4083. Image img = CachePhoto( PhotoLogType.DimensionalCode, tbl.Rows[0]["Company_UpdateDatetime"] );
  4084. Rectangle rec1 = new Rectangle( 50, 25, 90, 90 );
  4085. if ( img != null )
  4086. {
  4087. g.DrawImage( img, rec1 );
  4088. }
  4089. #endregion
  4090. int TableWidth = size.Width - rec1.X * 2 - 14;
  4091. #region 金色童年收据凭据
  4092. SizeF sizef = g.MeasureString( DefaultPrintTitle, ft16 );
  4093. int FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  4094. int FtHeight = Convert.ToInt32( sizef.Height );
  4095. Rectangle rec2 = new Rectangle( (size.Width / 2) - (FtWidth / 2), 30, FtWidth + 5, FtHeight );
  4096. g.DrawString( DefaultPrintTitle, ft16, b, rec2 );
  4097. #endregion
  4098. #region NO.
  4099. string rec3Value = "NO." + StrRandom( htData["ordNumber"].ToString().Trim() );
  4100. sizef = g.MeasureString( rec3Value, ft11 );
  4101. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  4102. FtHeight = Convert.ToInt32( sizef.Height );
  4103. Rectangle rec3 = new Rectangle( size.Width - rec1.X - FtWidth, rec2.Y + 35, FtWidth, FtHeight );
  4104. g.DrawString( rec3Value, ft11, b, rec3 );
  4105. if ( IsPrintSerialNo )
  4106. {
  4107. string SerialNo = PrintReceiptSerial();
  4108. if ( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition )
  4109. {
  4110. SerialNo = PrintReceiptSerial( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.CurrentCompanyInfoID );
  4111. }
  4112. if ( string.IsNullOrEmpty( SerialNo ) )
  4113. {
  4114. MessageBoxCustom.Show( "获取流水单号失败!" ); return;
  4115. }
  4116. rec3Value = "SerialNo." + SerialNo;
  4117. sizef = g.MeasureString( rec3Value, ft11 );
  4118. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  4119. FtHeight = Convert.ToInt32( sizef.Height );
  4120. Rectangle rec3A = new Rectangle( size.Width - rec1.X - FtWidth, rec3.Y - FtHeight + 2, FtWidth, FtHeight );
  4121. g.DrawString( rec3Value, ft11, b, rec3A );
  4122. }
  4123. #endregion
  4124. #region 地址
  4125. string StrAddress = LYFZ.BLL.OtherCommonModel.FontConversion( "地址:" ) + tbl.Rows[0]["Company_Address"].ToString().Trim();
  4126. sizef = g.MeasureString( StrAddress, ft10 );
  4127. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  4128. FtHeight = Convert.ToInt32( sizef.Height );
  4129. Rectangle rec4 = new Rectangle( rec1.X + rec1.Width - 5, rec3.Y + rec3.Height + FtHeight - 15, TableWidth - rec1.Width + 14, FtHeight );
  4130. g.DrawString( StrAddress, ft10, b, rec4 );
  4131. string StrTelephone = LYFZ.BLL.OtherCommonModel.FontConversion( "电话:" ) + tbl.Rows[0]["Company_Telephone"].ToString().Trim();
  4132. Rectangle rec4A = new Rectangle( rec4.X, rec4.Y + rec4.Height - FtHeight * 2 + 2, TableWidth - rec1.Width - 10, FtHeight );
  4133. g.DrawString( StrTelephone, ft10, b, rec4A );
  4134. #endregion
  4135. #region 客户姓名
  4136. string StrName = LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名:" ) + htData["CustomerName"].ToString().Trim() + " " + LYFZ.BLL.OtherCommonModel.FontConversion( "联系电话:" ) + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( htData["Telephone"] );
  4137. sizef = g.MeasureString( StrName, ft10 );
  4138. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  4139. FtHeight = Convert.ToInt32( sizef.Height );
  4140. Rectangle rec6 = new Rectangle( rec4.X, rec4.Y + rec4.Height - 2, FtWidth, FtHeight );
  4141. g.DrawString( StrName, ft10, b, rec6 );
  4142. #endregion
  4143. #region 日期
  4144. string StrDate = LYFZ.BLL.OtherCommonModel.FontConversion( "打印日期:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy年MM月dd日" );
  4145. sizef = g.MeasureString( StrDate, ft10 );
  4146. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  4147. FtHeight = Convert.ToInt32( sizef.Height );
  4148. Rectangle rec8 = new Rectangle( TableWidth + rec1.X - FtWidth + 14, rec6.Y, FtWidth, FtHeight );
  4149. g.DrawString( StrDate, ft10, b, rec8 );
  4150. #endregion
  4151. int AddLeft = 3;
  4152. int AddTop2 = 6;
  4153. int AddTop = 6;
  4154. int RowHeight = 26;
  4155. int RowContentHeight = 18;
  4156. int ColumnWidth4 = 120;
  4157. int ColumnWidth2 = 150;
  4158. int ColumnWidth3 = 120;
  4159. int ColumnWidth5 = 120;
  4160. int ColumnWidth1_1 = 120; // 2017-03-30 刘工添加 新增一列 接单人
  4161. int ColumnWidth1 = TableWidth - ColumnWidth4 - ColumnWidth2 - ColumnWidth3 - ColumnWidth5 - ColumnWidth1_1;
  4162. Rectangle rec9 = new Rectangle( rec1.X + 7, rec6.Y + rec6.Height + 1, TableWidth, RowHeight );
  4163. g.DrawRectangle( p, rec9 );//画标题矩形
  4164. #region 收款项目
  4165. string StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "收款项目" );
  4166. sizef = g.MeasureString( StrValue, ft10 );
  4167. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  4168. Rectangle rec9_1 = new Rectangle( rec9.X + (ColumnWidth1 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth1, RowContentHeight );
  4169. g.DrawString( StrValue, ft11, b, rec9_1 );//画第一列的列标题
  4170. Point p1_1 = new Point( rec9.X + ColumnWidth1, rec9.Y );
  4171. Point p1_2 = new Point( rec9.X + ColumnWidth1, rec9.Y + rec9.Height );
  4172. g.DrawLine( p, p1_1, p1_2 );//画第一表与第二列的界线
  4173. #endregion
  4174. #region 2017-03-30 刘工添加 新增一列 接单人
  4175. string SinglePersonValue = LYFZ.BLL.OtherCommonModel.FontConversion( "接单人" );
  4176. sizef = g.MeasureString( SinglePersonValue, ft10 );
  4177. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  4178. Rectangle rec9_1_1 = new Rectangle( p1_1.X + (ColumnWidth1_1 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth1_1, RowContentHeight );
  4179. g.DrawString( SinglePersonValue, ft11, b, rec9_1_1 );//画第一列的列标题
  4180. Point p1_1_1 = new Point( p1_1.X + ColumnWidth1_1, rec9.Y );
  4181. Point p1_2_1 = new Point( p1_1.X + ColumnWidth1_1, rec9.Y + rec9.Height );
  4182. g.DrawLine( p, p1_1_1, p1_2_1 );//画第一表与第二列的界线
  4183. p1_1 = p1_1_1;
  4184. p1_2 = p1_2_1;
  4185. #endregion
  4186. #region 支付方式
  4187. Rectangle rec9_2 = new Rectangle( p1_1.X + (ColumnWidth2 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth2, RowContentHeight );
  4188. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "支付方式" ), ft11, b, rec9_2 );//画第二列的列标题
  4189. Point p2_1 = new Point( p1_1.X + ColumnWidth2, rec9.Y );
  4190. Point p2_2 = new Point( p1_2.X + ColumnWidth2, rec9.Y + rec9.Height );
  4191. g.DrawLine( p, p2_1, p2_2 );//画第二表与第三列的界线
  4192. #endregion
  4193. #region 金 额
  4194. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "金 额" );
  4195. sizef = g.MeasureString( StrValue, ft10 );
  4196. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  4197. Rectangle rec9_3 = new Rectangle( p2_1.X + (ColumnWidth3 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth3, RowContentHeight );
  4198. g.DrawString( StrValue, ft11, b, rec9_3 );//画第三列的列标题
  4199. Point p3_1 = new Point( p2_1.X + ColumnWidth3, rec9.Y );
  4200. Point p3_2 = new Point( p2_2.X + ColumnWidth3, rec9.Y + rec9.Height );
  4201. g.DrawLine( p, p3_1, p3_2 );//画第三表与第四列的界线
  4202. #endregion
  4203. #region 接单人 //此处为 收款时间
  4204. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "收款时间" );
  4205. sizef = g.MeasureString( StrValue, ft10 );
  4206. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  4207. Rectangle rec9_4 = new Rectangle( p3_1.X + (ColumnWidth4 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth4, RowContentHeight );
  4208. g.DrawString( StrValue, ft11, b, rec9_4 );//画第四列的列标题
  4209. Point p4_1 = new Point( p3_1.X + ColumnWidth4, rec9.Y );
  4210. Point p4_2 = new Point( p3_2.X + ColumnWidth4, rec9.Y + rec9.Height );
  4211. g.DrawLine( p, p4_1, p4_2 );//画第四表与第五列的界线
  4212. #endregion
  4213. #region 收 银
  4214. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "收 银" );
  4215. sizef = g.MeasureString( StrValue, ft10 );
  4216. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  4217. Rectangle rec9_5 = new Rectangle( p4_1.X + (ColumnWidth5 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth5, RowContentHeight );
  4218. g.DrawString( StrValue, ft11, b, rec9_5 );//画第五列的列标题
  4219. #endregion
  4220. int IntPoint_X = rec9.X;
  4221. int IntPoint_Y = rec9.Y + rec9.Height;
  4222. decimal MortgageAmount = 0;//押金
  4223. decimal CopeAmount = 0;//租金
  4224. #region 画列表每行
  4225. for ( int i = 0; i < 4; i++ )
  4226. {
  4227. Rectangle recfor = new Rectangle( IntPoint_X, IntPoint_Y, TableWidth, RowHeight );
  4228. g.DrawRectangle( p, recfor );//画标题矩形
  4229. string recfor_1Value = "";
  4230. string recfor_2Value = "";
  4231. string recfor_3Value = "";
  4232. string recfor_4Value = "";
  4233. string recfor_5Value = "";
  4234. string SinglePerson = "";
  4235. if ( i < dgvData.SelectedRows.Count )
  4236. {
  4237. recfor_1Value = dgvData.SelectedRows[i].Cells["type"].Value.ToString().Trim();//收款项目
  4238. recfor_2Value = dgvData.SelectedRows[i].Cells["Pay_PaymentMethod"].Value.ToString().Trim();
  4239. recfor_3Value = Convert.ToDecimal( dgvData.SelectedRows[i].Cells["Pay_AmountOf"].Value ).ToString( "0.00" );
  4240. recfor_4Value = LYFZ.Command.Command_Validate.DateTimeToString( dgvData.SelectedRows[i].Cells["Pay_CreateDatetime"].Value, "yyyy-MM-dd HH:mm" );
  4241. recfor_5Value = dgvData.SelectedRows[i].Cells["Pay_ThePayee"].Value.ToString().Trim();
  4242. if ( dgvData.SelectedRows[i].Cells["type"].Value.ToString().Trim() == "押金" )
  4243. {
  4244. MortgageAmount += Convert.ToDecimal( dgvData.SelectedRows[i].Cells["Pay_AmountOf"].Value );
  4245. }
  4246. else if ( dgvData.SelectedRows[i].Cells["type"].Value.ToString().Trim() == "租金" )
  4247. {
  4248. CopeAmount += Convert.ToDecimal( dgvData.SelectedRows[i].Cells["Pay_AmountOf"].Value );
  4249. }
  4250. SinglePerson = dgvData.SelectedRows[i].Cells["Pay_OpenSingle"].Value.ToString().Trim();
  4251. }
  4252. Rectangle recfor_1 = new Rectangle( recfor.X + AddLeft, recfor.Y + AddTop, ColumnWidth1, RowContentHeight );
  4253. g.DrawString( recfor_1Value, ft10, b, recfor_1 );//画第一列的列标题
  4254. Point pfor1_1 = new Point( recfor_1.X + ColumnWidth1 - 3, recfor.Y );
  4255. Point pfor1_2 = new Point( recfor_1.X + ColumnWidth1 - 3, recfor.Y + recfor.Height );
  4256. g.DrawLine( p, pfor1_1, pfor1_2 );//画第一表与第二列的界线
  4257. #region 2017-03-30 刘工添加 接单人
  4258. Rectangle recfor_1_1 = new Rectangle( pfor1_1.X + AddLeft, pfor1_1.Y + AddTop, ColumnWidth1_1, RowContentHeight );
  4259. g.DrawString( SinglePerson, ft10, b, recfor_1_1 );
  4260. Point pfor1_1_1 = new Point( pfor1_1.X + ColumnWidth1_1, pfor1_1.Y );
  4261. Point pfor1_2_1 = new Point( pfor1_1.X + ColumnWidth1_1, pfor1_1.Y + recfor.Height );
  4262. g.DrawLine( p, pfor1_1_1, pfor1_2_1 );
  4263. pfor1_1 = pfor1_1_1;
  4264. pfor1_2 = pfor1_2_1;
  4265. #endregion
  4266. Rectangle recfor_2 = new Rectangle( pfor1_1.X + AddLeft, pfor1_1.Y + AddTop, ColumnWidth2, RowContentHeight );
  4267. g.DrawString( recfor_2Value, ft10, b, recfor_2 );//画第二列的列标题
  4268. Point pfor2_1 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y );
  4269. Point pfor2_2 = new Point( pfor1_2.X + ColumnWidth2, recfor.Y + recfor.Height );
  4270. g.DrawLine( p, pfor2_1, pfor2_2 );//画第二表与第三列的界线
  4271. StrValue = recfor_3Value;
  4272. sizef = g.MeasureString( StrValue, ft10 );
  4273. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  4274. Rectangle recfor_3 = new Rectangle( pfor2_1.X + ColumnWidth3 - FtWidth - AddLeft * 2, pfor2_1.Y + AddTop, ColumnWidth3, RowContentHeight );
  4275. g.DrawString( recfor_3Value, ft10, b, recfor_3 );//画第三列的列标题
  4276. Point pfor3_1 = new Point( pfor2_1.X + ColumnWidth3, recfor.Y );
  4277. Point pfor3_2 = new Point( pfor2_2.X + ColumnWidth3, recfor.Y + recfor.Height );
  4278. g.DrawLine( p, pfor3_1, pfor3_2 );//画第三表与第四列的界线
  4279. Rectangle recfor_4 = new Rectangle( pfor3_1.X + AddLeft, pfor3_1.Y + AddTop, ColumnWidth4, RowContentHeight );
  4280. g.DrawString( recfor_4Value, ft10, b, recfor_4 );//画第四列的列标题
  4281. Point pfor4_1 = new Point( pfor3_1.X + ColumnWidth4, recfor.Y );
  4282. Point pfor4_2 = new Point( pfor3_2.X + ColumnWidth4, recfor.Y + recfor.Height );
  4283. g.DrawLine( p, pfor4_1, pfor4_2 );//画第四表与第五列的界线
  4284. Rectangle recfor_5 = new Rectangle( pfor4_1.X + AddLeft, pfor4_1.Y + AddTop, ColumnWidth5, RowContentHeight );
  4285. g.DrawString( recfor_5Value, ft10, b, recfor_5 );//画第五列的列标题
  4286. IntPoint_X = recfor.X;
  4287. IntPoint_Y = recfor.Y + recfor.Height;
  4288. }
  4289. #endregion
  4290. Rectangle rec10 = new Rectangle( IntPoint_X, IntPoint_Y, TableWidth, RowHeight );
  4291. g.DrawRectangle( p, rec10 );//画标题矩形
  4292. #region 付款情况
  4293. string rec10_1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "付款情况" );
  4294. sizef = g.MeasureString( rec10_1Value, ft11 );
  4295. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  4296. FtHeight = Convert.ToInt32( sizef.Height );
  4297. Rectangle rec10_1 = new Rectangle( rec10.X + AddLeft, rec10.Y + AddTop2, FtWidth, RowContentHeight );
  4298. g.DrawString( rec10_1Value, ft11, b, rec10_1 );//付款情况
  4299. #endregion
  4300. #region 应付
  4301. string StrPaymentAmount = "0";
  4302. if ( tblPayment.Rows.Count > 0 )
  4303. {
  4304. if ( !string.IsNullOrEmpty( tblPayment.Rows[0]["Pay_AmountOf"].ToString().Trim() ) )
  4305. {
  4306. StrPaymentAmount = tblPayment.Rows[0]["Pay_AmountOf"].ToString().Trim();
  4307. }
  4308. }
  4309. 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" );
  4310. sizef = g.MeasureString( StrValue, ft10 );
  4311. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  4312. Rectangle rec10_2 = new Rectangle( rec10_1.X + rec10_1.Width, rec10.Y + AddTop2, TableWidth - rec10_1.Width, RowContentHeight );
  4313. g.DrawString( StrValue, ft10, b, rec10_2 );//应付
  4314. #endregion
  4315. Rectangle rec11 = new Rectangle( rec10.X, rec10.Y + rec10.Height, TableWidth, RowHeight );
  4316. g.DrawRectangle( p, rec11 );//画标题矩形
  4317. #region 合计
  4318. Rectangle rec11_1 = new Rectangle( rec11.X + AddLeft, rec11.Y + AddTop2, TableWidth - 300, RowContentHeight );
  4319. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "合计人民币(大写):" ) + " " + LYFZ.Software.MainBusiness.ReportPrint.ReportPrintDataClass.ConversionAmount( (MortgageAmount + CopeAmount).ToString() ), ft11, b, rec11_1 );//合计人民币
  4320. #endregion
  4321. #region 顾客签字
  4322. Rectangle rec11_2 = new Rectangle( rec11_1.X + rec11_1.Width + 100, rec11_1.Y, 300, RowContentHeight );
  4323. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "顾客签字:" ), ft11, b, rec11_2 );//画消费法规
  4324. #endregion
  4325. #region 说明
  4326. Rectangle rec12 = new Rectangle( rec11.X, rec11.Y + rec11.Height + 3, rec9.Width, Convert.ToInt32( g.MeasureString( "说明", ft9 ).Height ) + 1 );
  4327. string PaymentExplain = "";
  4328. if ( PrintOtherData.ContainsKey( "收款单说明" ) && PrintOtherData["收款单说明"].ToString().Trim().Length > 0 )
  4329. {
  4330. PaymentExplain = PrintOtherData["收款单说明"].ToString().Trim();
  4331. }
  4332. g.DrawString( PaymentExplain, ft9, b, rec12 );//画消费法规
  4333. #endregion
  4334. }
  4335. #endregion
  4336. #region 礼服出租退款
  4337. /// <summary>
  4338. /// 礼服出租退款
  4339. /// </summary>
  4340. /// <param name="panl"></param>
  4341. public static void PaymentPrint_SoldRefund_Print( object objData, Graphics g, Size size, bool IsPrintSerialNo )
  4342. {
  4343. Hashtable htData = (Hashtable)objData;
  4344. DataGridViewEc dgvData = (DataGridViewEc)htData["dgvData"];
  4345. if ( dgvData.SelectedRows.Count <= 0 )
  4346. {
  4347. MessageBoxCustom.Show( "未选择打印数据" ); return;
  4348. }
  4349. string ExecuteSql = orbll.GetView_CustomReturnExecuteSql( "tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Address,Company_Telephone,Company_UpdateDatetime" );
  4350. ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql( "tb_ErpCustomer", StrWhere: "Cus_CustomerNumber = '" + htData["CustomerNumber"].ToString().Trim() + "'", ShowColumnName: "Cus_Name,Cus_Telephone" );
  4351. DataSet dtSet = orbll.GetView_Custom( ExecuteSql );
  4352. DataTable tbl = dtSet.Tables["ds"];//获取影楼信息
  4353. if ( tbl.Rows.Count <= 0 )
  4354. {
  4355. MessageBoxCustom.Show( "未设置影楼信息" ); return;
  4356. }
  4357. DataTable tblClient = dtSet.Tables["ds1"];//客户
  4358. Brush b = Brushes.Black;
  4359. Pen p = GetPen;
  4360. Font ft16 = new Font( "宋体", 15 );
  4361. Font ft11 = new Font( "宋体", 10 );
  4362. Font ft10 = new Font( "宋体", 9 );
  4363. Font ft9 = new Font( "宋体", 9 );
  4364. #region 二维码
  4365. Image img = CachePhoto( PhotoLogType.DimensionalCode, tbl.Rows[0]["Company_UpdateDatetime"] );
  4366. Rectangle rec1 = new Rectangle( 50, 25, 90, 90 );
  4367. if ( img != null )
  4368. {
  4369. g.DrawImage( img, rec1 );
  4370. }
  4371. #endregion
  4372. int TableWidth = size.Width - rec1.X * 2 - 14;
  4373. #region 金色童年收据凭据
  4374. SizeF sizef = g.MeasureString( DefaultPrintTitle, ft16 );
  4375. int FtWidth = Convert.ToInt32( sizef.Width );
  4376. int FtHeight = Convert.ToInt32( sizef.Height ) + 1;
  4377. Rectangle rec2 = new Rectangle( (size.Width / 2) - (FtWidth / 2), 30, FtWidth + 5, FtHeight );
  4378. g.DrawString( DefaultPrintTitle, ft16, b, rec2 );
  4379. #endregion
  4380. #region NO.
  4381. string rec3Value = "NO." + StrRandom( htData["DressOrderNumber"].ToString().Trim() );
  4382. sizef = g.MeasureString( rec3Value, ft11 );
  4383. FtWidth = Convert.ToInt32( sizef.Width ) + 3;
  4384. FtHeight = Convert.ToInt32( sizef.Height );
  4385. Rectangle rec3 = new Rectangle( size.Width - rec1.X - FtWidth, rec2.Y + 35, FtWidth, FtHeight );
  4386. g.DrawString( rec3Value, ft11, b, rec3 );
  4387. if ( IsPrintSerialNo )
  4388. {
  4389. string SerialNo = PrintReceiptSerial();
  4390. if ( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition )
  4391. {
  4392. SerialNo = PrintReceiptSerial( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.CurrentCompanyInfoID );
  4393. }
  4394. if ( string.IsNullOrEmpty( SerialNo ) )
  4395. {
  4396. MessageBoxCustom.Show( "获取流水单号失败!" ); return;
  4397. }
  4398. rec3Value = "SerialNo." + SerialNo;
  4399. sizef = g.MeasureString( rec3Value, ft11 );
  4400. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  4401. FtHeight = Convert.ToInt32( sizef.Height );
  4402. Rectangle rec3A = new Rectangle( size.Width - rec1.X - FtWidth, rec3.Y - FtHeight + 2, FtWidth, FtHeight );
  4403. g.DrawString( rec3Value, ft11, b, rec3A );
  4404. }
  4405. #endregion
  4406. #region 地址
  4407. string StrAddress = LYFZ.BLL.OtherCommonModel.FontConversion( "地址:" ) + tbl.Rows[0]["Company_Address"].ToString().Trim();
  4408. sizef = g.MeasureString( StrAddress, ft10 );
  4409. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  4410. FtHeight = Convert.ToInt32( sizef.Height );
  4411. Rectangle rec4 = new Rectangle( rec1.X + rec1.Width - 5, rec3.Y + rec3.Height + FtHeight - 15, TableWidth - rec1.Width + 14, FtHeight );
  4412. g.DrawString( StrAddress, ft10, b, rec4 );
  4413. string StrTelephone = LYFZ.BLL.OtherCommonModel.FontConversion( "电话:" ) + tbl.Rows[0]["Company_Telephone"].ToString().Trim();
  4414. Rectangle rec4A = new Rectangle( rec4.X, rec4.Y + rec4.Height - FtHeight * 2 + 2, TableWidth - rec1.Width - 10, FtHeight );
  4415. g.DrawString( StrTelephone, ft10, b, rec4A );
  4416. #endregion
  4417. #region 客户姓名
  4418. 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"] );
  4419. sizef = g.MeasureString( StrName, ft10 );
  4420. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  4421. FtHeight = Convert.ToInt32( sizef.Height );
  4422. Rectangle rec6 = new Rectangle( rec4.X, rec4.Y + rec4.Height - 2, FtWidth, FtHeight );
  4423. g.DrawString( StrName, ft10, b, rec6 );
  4424. #endregion
  4425. #region 日期
  4426. string StrDate = LYFZ.BLL.OtherCommonModel.FontConversion( "打印日期:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy年MM月dd日" );
  4427. sizef = g.MeasureString( StrDate, ft10 );
  4428. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  4429. FtHeight = Convert.ToInt32( sizef.Height );
  4430. Rectangle rec8 = new Rectangle( TableWidth + rec1.X - FtWidth + 14, rec6.Y, FtWidth, FtHeight );
  4431. g.DrawString( StrDate, ft10, b, rec8 );
  4432. #endregion
  4433. int AddLeft = 3;
  4434. int AddTop2 = 6;
  4435. int AddTop = 6;
  4436. int RowHeight = 26;
  4437. int RowContentHeight = 18;
  4438. int ColumnWidth1 = TableWidth / 4;
  4439. int ColumnWidth2 = TableWidth / 4;
  4440. int ColumnWidth3 = TableWidth / 4;
  4441. int ColumnWidth4 = TableWidth / 4;
  4442. int ColumnWidth5 = TableWidth / 5;
  4443. Rectangle rec9 = new Rectangle( rec1.X + 7, rec6.Y + rec6.Height + 1, TableWidth, RowHeight );
  4444. g.DrawRectangle( p, rec9 );//画标题矩形
  4445. #region 金额
  4446. StrName = LYFZ.BLL.OtherCommonModel.FontConversion( "金 额" );
  4447. sizef = g.MeasureString( StrName, ft10 );
  4448. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  4449. FtHeight = Convert.ToInt32( sizef.Height );
  4450. Rectangle rec9_1 = new Rectangle( rec9.X + ((ColumnWidth1 / 2) - (FtWidth / 2)), rec9.Y + AddTop2, ColumnWidth1, RowContentHeight );
  4451. g.DrawString( StrName, ft11, b, rec9_1 );//画第一列的列标题
  4452. Point p1_1 = new Point( rec9.X + ColumnWidth1, rec9.Y );
  4453. Point p1_2 = new Point( rec9.X + ColumnWidth1, rec9.Y + rec9.Height );
  4454. g.DrawLine( p, p1_1, p1_2 );//画第一表与第二列的界线
  4455. #endregion
  4456. #region 类型
  4457. StrName = LYFZ.BLL.OtherCommonModel.FontConversion( "类 型" );
  4458. sizef = g.MeasureString( StrName, ft10 );
  4459. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  4460. FtHeight = Convert.ToInt32( sizef.Height );
  4461. Rectangle rec9_2 = new Rectangle( p1_1.X + ((ColumnWidth2 / 2) - (FtWidth / 2)), rec9.Y + AddTop2, ColumnWidth2, RowContentHeight );
  4462. g.DrawString( StrName, ft11, b, rec9_2 );//画第二列的列标题
  4463. Point p2_1 = new Point( p1_1.X + ColumnWidth2, rec9.Y );
  4464. Point p2_2 = new Point( p1_2.X + ColumnWidth2, rec9.Y + rec9.Height );
  4465. g.DrawLine( p, p2_1, p2_2 );//画第二表与第三列的界线
  4466. #endregion
  4467. #region 交易时间
  4468. StrName = LYFZ.BLL.OtherCommonModel.FontConversion( "交易时间" );
  4469. sizef = g.MeasureString( StrName, ft10 );
  4470. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  4471. FtHeight = Convert.ToInt32( sizef.Height );
  4472. Rectangle rec9_3 = new Rectangle( p2_1.X + ((ColumnWidth3 / 2) - (FtWidth / 2)), rec9.Y + AddTop2, ColumnWidth3, RowContentHeight );
  4473. g.DrawString( StrName, ft11, b, rec9_3 );//画第三列的列标题
  4474. Point p3_1 = new Point( p2_1.X + ColumnWidth3, rec9.Y );
  4475. Point p3_2 = new Point( p2_2.X + ColumnWidth3, rec9.Y + rec9.Height );
  4476. g.DrawLine( p, p3_1, p3_2 );//画第三表与第四列的界线
  4477. #endregion
  4478. #region 经手人
  4479. StrName = LYFZ.BLL.OtherCommonModel.FontConversion( "经手人" );
  4480. sizef = g.MeasureString( StrName, ft10 );
  4481. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  4482. FtHeight = Convert.ToInt32( sizef.Height );
  4483. Rectangle rec9_4 = new Rectangle( p3_1.X + ((ColumnWidth4 / 2) - (FtWidth / 2)), rec9.Y + AddTop2, ColumnWidth4, RowContentHeight );
  4484. g.DrawString( StrName, ft11, b, rec9_4 );//画第三列的列标题
  4485. #endregion
  4486. int IntPoint_Y = rec9.Y + rec9.Height;
  4487. decimal CopeAmount = 0;//退款金额
  4488. string strRemark = "";
  4489. #region 画列表每行
  4490. for ( int i = 0; i < 2; i++ )
  4491. {
  4492. Rectangle recfor = new Rectangle( rec9.X, IntPoint_Y, TableWidth, RowHeight );
  4493. g.DrawRectangle( p, recfor );//画标题矩形
  4494. string recfor_1Value = "";
  4495. string recfor_2Value = "";
  4496. string recfor_3Value = "";
  4497. string recfor_4Value = "";
  4498. if ( i < dgvData.SelectedRows.Count )
  4499. {
  4500. recfor_1Value = dgvData.SelectedRows[i].Cells["金额"].Value.ToString().Trim();//收款项目
  4501. recfor_2Value = dgvData.SelectedRows[i].Cells["退款类型"].Value.ToString().Trim();
  4502. recfor_3Value = LYFZ.Command.Command_Validate.DateTimeToString( dgvData.SelectedRows[i].Cells["录入时间"].Value, "yyyy-MM-dd HH:mm" );
  4503. recfor_4Value = dgvData.SelectedRows[i].Cells["退款人"].Value.ToString().Trim();// htData["UserName"].ToString().Trim();
  4504. strRemark += dgvData.SelectedRows[i].Cells["退款备注"].Value.ToString().Trim();
  4505. CopeAmount += Convert.ToDecimal( dgvData.SelectedRows[i].Cells["金额"].Value );
  4506. }
  4507. string StrValue = recfor_1Value;
  4508. sizef = g.MeasureString( StrValue, ft10 );
  4509. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  4510. Rectangle recfor_1 = new Rectangle( recfor.X + AddLeft, recfor.Y + AddTop, ColumnWidth1, RowContentHeight );
  4511. g.DrawString( recfor_1Value, ft10, b, recfor_1 );//画第一列的列标题
  4512. Point pfor1_1 = new Point( recfor_1.X + ColumnWidth1 - 3, recfor.Y );
  4513. Point pfor1_2 = new Point( recfor_1.X + ColumnWidth1 - 3, recfor.Y + recfor.Height );
  4514. g.DrawLine( p, pfor1_1, pfor1_2 );//画第一表与第二列的界线
  4515. Rectangle recfor_2 = new Rectangle( pfor1_1.X + AddLeft, pfor1_1.Y + AddTop, ColumnWidth2, RowContentHeight );
  4516. g.DrawString( recfor_2Value, ft10, b, recfor_2 );//画第二列的列标题
  4517. Point pfor2_1 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y );
  4518. Point pfor2_2 = new Point( pfor1_2.X + ColumnWidth2, recfor.Y + recfor.Height );
  4519. g.DrawLine( p, pfor2_1, pfor2_2 );//画第二表与第三列的界线
  4520. StrValue = recfor_3Value;
  4521. sizef = g.MeasureString( StrValue, ft10 );
  4522. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  4523. Rectangle recfor_3 = new Rectangle( pfor2_1.X + (ColumnWidth3 / 2 - FtWidth / 2), pfor2_1.Y + AddTop, ColumnWidth3, RowContentHeight );
  4524. g.DrawString( recfor_3Value, ft10, b, recfor_3 );//画第三列的列标题
  4525. Point pfor3_1 = new Point( pfor2_1.X + ColumnWidth3, recfor.Y );
  4526. Point pfor3_2 = new Point( pfor2_2.X + ColumnWidth3, recfor.Y + recfor.Height );
  4527. g.DrawLine( p, pfor3_1, pfor3_2 );//画第三表与第四列的界线
  4528. Rectangle recfor_4 = new Rectangle( pfor3_1.X + AddLeft, pfor3_1.Y + AddTop, ColumnWidth4, RowContentHeight );
  4529. g.DrawString( recfor_4Value, ft10, b, recfor_4 );//画第三列的列标题
  4530. IntPoint_Y = recfor.Y + recfor.Height;
  4531. }
  4532. #endregion
  4533. Rectangle rec9_A = new Rectangle( rec9.X, IntPoint_Y, TableWidth, RowHeight * 2 );
  4534. g.DrawRectangle( p, rec9_A );//画标题矩形
  4535. Rectangle rec9_A1 = new Rectangle( rec9.X + AddLeft, rec9_A.Y + AddTop, TableWidth - (AddLeft * 2), rec9_A.Height - (AddTop * 2) );
  4536. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "说 明:" ) + strRemark, ft10, b, rec9_A1 );//画第三列的列标题
  4537. Rectangle rec10 = new Rectangle( rec9.X, rec9_A.Y + rec9_A.Height, TableWidth, RowHeight );
  4538. g.DrawRectangle( p, rec10 );//画标题矩形
  4539. #region 押金情况
  4540. string rec10_1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "押金情况" );
  4541. sizef = g.MeasureString( rec10_1Value, ft11 );
  4542. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  4543. FtHeight = Convert.ToInt32( sizef.Height );
  4544. Rectangle rec10_1 = new Rectangle( rec10.X + AddLeft, rec10.Y + AddTop2, FtWidth, RowContentHeight );
  4545. g.DrawString( rec10_1Value, ft11, b, rec10_1 );//付款情况
  4546. #endregion
  4547. #region 原押金
  4548. Rectangle rec10_2 = new Rectangle( (TableWidth / 4), rec10.Y + AddTop2, TableWidth / 4, RowContentHeight );
  4549. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "原押金:" ) + Convert.ToDecimal( htData["DepositAmount"] ).ToString( "0.00" ), ft10, b, rec10_2 );//应付
  4550. #endregion
  4551. #region 已退
  4552. Rectangle rec10_3 = new Rectangle( rec10_2.X + (TableWidth / 4), rec10.Y + AddTop2, TableWidth / 4, RowContentHeight );
  4553. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "已退:" ) + CopeAmount.ToString( "0.00" ), ft10, b, rec10_3 );//实付
  4554. #endregion
  4555. #region 未退
  4556. Rectangle rec10_4 = new Rectangle( rec10_3.X + (TableWidth / 4), rec10.Y + AddTop2, TableWidth / 4, RowContentHeight );
  4557. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "未退:" ) + Convert.ToDecimal( htData["NotRefundAmount"] ).ToString( "0.00" ), ft10, b, rec10_4 );//实付Convert.ToDecimal(htData["DepositAmount"]) - CopeAmount
  4558. #endregion
  4559. Rectangle rec11 = new Rectangle( rec10.X, rec10.Y + rec10.Height, TableWidth, RowHeight );
  4560. g.DrawRectangle( p, rec11 );//画标题矩形
  4561. #region 合计
  4562. Rectangle rec11_1 = new Rectangle( rec11.X + AddLeft, rec11.Y + AddTop2, TableWidth - 300, RowContentHeight );
  4563. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "合计人民币(大写):" ) + " " + LYFZ.Software.MainBusiness.ReportPrint.ReportPrintDataClass.ConversionAmount( CopeAmount.ToString() ), ft11, b, rec11_1 );//合计人民币
  4564. #endregion
  4565. #region 顾客签字
  4566. Rectangle rec11_2 = new Rectangle( rec11_1.X + rec11_1.Width + 100, rec11_1.Y, 300, RowContentHeight );
  4567. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "顾客签字:" ), ft11, b, rec11_2 );//画消费法规
  4568. #endregion
  4569. #region 说明
  4570. Rectangle rec12 = new Rectangle( rec11.X, rec11.Y + rec11.Height + 3, rec9.Width, Convert.ToInt32( g.MeasureString( "说明", ft9 ).Height ) + 1 );
  4571. string PaymentExplain = "";
  4572. if ( PrintOtherData.ContainsKey( "收款单说明" ) && PrintOtherData["收款单说明"].ToString().Trim().Length > 0 )
  4573. {
  4574. PaymentExplain = PrintOtherData["收款单说明"].ToString().Trim();
  4575. }
  4576. g.DrawString( PaymentExplain, ft9, b, rec12 );//画消费法规
  4577. #endregion
  4578. }
  4579. #endregion
  4580. #region 礼服出售收款
  4581. /// <summary>
  4582. /// 礼服出租收款
  4583. /// </summary>
  4584. /// <param name="panl"></param>
  4585. public static void PaymentPrint_SoldPayment_Print( object objData, Graphics g, Size size, bool IsPrintSerialNo )
  4586. {
  4587. Hashtable htData = (Hashtable)objData;
  4588. DataGridViewEx dgvData = (DataGridViewEx)htData["dgvData"];
  4589. //获取影楼信息
  4590. DataTable tbl = new BLL.BLL_ErpOrder().GetView_Custom( "tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Address,Company_Telephone,Company_UpdateDatetime" ).Tables[0];
  4591. if ( tbl.Rows.Count <= 0 )
  4592. {
  4593. MessageBoxCustom.Show( "未设置影楼信息" ); return;
  4594. }
  4595. Brush b = Brushes.Black;
  4596. Pen p = GetPen;
  4597. Font ft16 = new Font( "宋体", 15 );
  4598. Font ft11 = new Font( "宋体", 10 );
  4599. Font ft10 = new Font( "宋体", 9 );
  4600. Font ft9 = new Font( "宋体", 9 );
  4601. #region 二维码
  4602. Image img = CachePhoto( PhotoLogType.DimensionalCode, tbl.Rows[0]["Company_UpdateDatetime"] );
  4603. Rectangle rec1 = new Rectangle( 50, 25, 90, 90 );
  4604. if ( img != null )
  4605. {
  4606. g.DrawImage( img, rec1 );
  4607. }
  4608. #endregion
  4609. int TableWidth = size.Width - rec1.X * 2 - 14;
  4610. #region 金色童年收据凭据
  4611. SizeF sizef = g.MeasureString( DefaultPrintTitle, ft16 );
  4612. int FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  4613. int FtHeight = Convert.ToInt32( sizef.Height );
  4614. Rectangle rec2 = new Rectangle( (size.Width / 2) - (FtWidth / 2), 30, FtWidth + 5, FtHeight );
  4615. g.DrawString( DefaultPrintTitle, ft16, b, rec2 );
  4616. #endregion
  4617. #region NO.
  4618. string rec3Value = "NO." + StrRandom( htData["ordNumber"].ToString().Trim() );
  4619. sizef = g.MeasureString( rec3Value, ft11 );
  4620. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  4621. FtHeight = Convert.ToInt32( sizef.Height );
  4622. Rectangle rec3 = new Rectangle( size.Width - rec1.X - FtWidth, rec2.Y + 35, FtWidth, FtHeight );
  4623. g.DrawString( rec3Value, ft11, b, rec3 );
  4624. if ( IsPrintSerialNo )
  4625. {
  4626. string SerialNo = PrintReceiptSerial();
  4627. if ( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition )
  4628. {
  4629. SerialNo = PrintReceiptSerial( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.CurrentCompanyInfoID );
  4630. }
  4631. if ( string.IsNullOrEmpty( SerialNo ) )
  4632. {
  4633. MessageBoxCustom.Show( "获取流水单号失败!" ); return;
  4634. }
  4635. rec3Value = "SerialNo." + SerialNo;
  4636. sizef = g.MeasureString( rec3Value, ft11 );
  4637. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  4638. FtHeight = Convert.ToInt32( sizef.Height );
  4639. Rectangle rec3A = new Rectangle( size.Width - rec1.X - FtWidth, rec3.Y - FtHeight + 2, FtWidth, FtHeight );
  4640. g.DrawString( rec3Value, ft11, b, rec3A );
  4641. }
  4642. #endregion
  4643. #region 地址
  4644. string StrAddress = LYFZ.BLL.OtherCommonModel.FontConversion( "地址:" ) + tbl.Rows[0]["Company_Address"].ToString().Trim();
  4645. sizef = g.MeasureString( StrAddress, ft10 );
  4646. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  4647. FtHeight = Convert.ToInt32( sizef.Height );
  4648. Rectangle rec4 = new Rectangle( rec1.X + rec1.Width - 5, rec3.Y + rec3.Height + FtHeight - 15, TableWidth - rec1.Width + 14, FtHeight );
  4649. g.DrawString( StrAddress, ft10, b, rec4 );
  4650. string StrTelephone = LYFZ.BLL.OtherCommonModel.FontConversion( "电话:" ) + tbl.Rows[0]["Company_Telephone"].ToString().Trim();
  4651. Rectangle rec4A = new Rectangle( rec4.X, rec4.Y + rec4.Height - FtHeight * 2 + 2, TableWidth - rec1.Width - 10, FtHeight );
  4652. g.DrawString( StrTelephone, ft10, b, rec4A );
  4653. #endregion
  4654. #region 客户姓名
  4655. string StrName = LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名:" ) + htData["CustomerName"].ToString().Trim() + " " + LYFZ.BLL.OtherCommonModel.FontConversion( "联系电话:" ) + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( htData["Telephone"] );
  4656. sizef = g.MeasureString( StrName, ft10 );
  4657. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  4658. FtHeight = Convert.ToInt32( sizef.Height );
  4659. Rectangle rec6 = new Rectangle( rec4.X, rec4.Y + rec4.Height - 2, FtWidth, FtHeight );
  4660. g.DrawString( StrName, ft10, b, rec6 );
  4661. #endregion
  4662. #region 日期
  4663. string StrDate = LYFZ.BLL.OtherCommonModel.FontConversion( "打印日期:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy年MM月dd日" );
  4664. sizef = g.MeasureString( StrDate, ft10 );
  4665. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  4666. FtHeight = Convert.ToInt32( sizef.Height );
  4667. Rectangle rec8 = new Rectangle( TableWidth + rec1.X - FtWidth + 14, rec6.Y, FtWidth, FtHeight );
  4668. g.DrawString( StrDate, ft10, b, rec8 );
  4669. #endregion
  4670. int AddLeft = 3;
  4671. int AddTop2 = 6;
  4672. int AddTop = 6;
  4673. int RowHeight = 26;
  4674. int RowContentHeight = 18;
  4675. int ColumnWidth4 = 120;
  4676. int ColumnWidth2 = 150;
  4677. int ColumnWidth3 = 120;
  4678. int ColumnWidth5 = 120;
  4679. int ColumnWidth1_1 = 120; // 2017-03-30 刘工添加 新增一列 接单人
  4680. int ColumnWidth1 = TableWidth - ColumnWidth4 - ColumnWidth2 - ColumnWidth3 - ColumnWidth5 - ColumnWidth1_1;
  4681. Rectangle rec9 = new Rectangle( rec1.X + 7, rec6.Y + rec6.Height + 1, TableWidth, RowHeight );
  4682. g.DrawRectangle( p, rec9 );//画标题矩形
  4683. #region 收款项目
  4684. string StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "收款项目" );
  4685. sizef = g.MeasureString( StrValue, ft10 );
  4686. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  4687. Rectangle rec9_1 = new Rectangle( rec9.X + (ColumnWidth1 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth1, RowContentHeight );
  4688. g.DrawString( StrValue, ft11, b, rec9_1 );//画第一列的列标题
  4689. Point p1_1 = new Point( rec9.X + ColumnWidth1, rec9.Y );
  4690. Point p1_2 = new Point( rec9.X + ColumnWidth1, rec9.Y + rec9.Height );
  4691. g.DrawLine( p, p1_1, p1_2 );//画第一表与第二列的界线
  4692. #endregion
  4693. #region 2017-03-30 刘工添加 新增一列 接单人
  4694. string SinglePersonValue = LYFZ.BLL.OtherCommonModel.FontConversion( "接单人" );
  4695. sizef = g.MeasureString( SinglePersonValue, ft10 );
  4696. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  4697. Rectangle rec9_1_1 = new Rectangle( p1_1.X + (ColumnWidth1_1 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth1_1, RowContentHeight );
  4698. g.DrawString( SinglePersonValue, ft11, b, rec9_1_1 );//画第一列的列标题
  4699. Point p1_1_1 = new Point( p1_1.X + ColumnWidth1_1, rec9.Y );
  4700. Point p1_2_1 = new Point( p1_1.X + ColumnWidth1_1, rec9.Y + rec9.Height );
  4701. g.DrawLine( p, p1_1_1, p1_2_1 );//画第一表与第二列的界线
  4702. p1_1 = p1_1_1;
  4703. p1_2 = p1_2_1;
  4704. #endregion
  4705. #region 支付方式
  4706. Rectangle rec9_2 = new Rectangle( p1_1.X + (ColumnWidth2 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth2, RowContentHeight );
  4707. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "支付方式" ), ft11, b, rec9_2 );//画第二列的列标题
  4708. Point p2_1 = new Point( p1_1.X + ColumnWidth2, rec9.Y );
  4709. Point p2_2 = new Point( p1_2.X + ColumnWidth2, rec9.Y + rec9.Height );
  4710. g.DrawLine( p, p2_1, p2_2 );//画第二表与第三列的界线
  4711. #endregion
  4712. #region 金 额
  4713. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "金 额" );
  4714. sizef = g.MeasureString( StrValue, ft10 );
  4715. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  4716. Rectangle rec9_3 = new Rectangle( p2_1.X + (ColumnWidth3 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth3, RowContentHeight );
  4717. g.DrawString( StrValue, ft11, b, rec9_3 );//画第三列的列标题
  4718. Point p3_1 = new Point( p2_1.X + ColumnWidth3, rec9.Y );
  4719. Point p3_2 = new Point( p2_2.X + ColumnWidth3, rec9.Y + rec9.Height );
  4720. g.DrawLine( p, p3_1, p3_2 );//画第三表与第四列的界线
  4721. #endregion
  4722. #region 接单人 //收款时间
  4723. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "收款时间" );
  4724. sizef = g.MeasureString( StrValue, ft10 );
  4725. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  4726. Rectangle rec9_4 = new Rectangle( p3_1.X + (ColumnWidth4 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth4, RowContentHeight );
  4727. g.DrawString( StrValue, ft11, b, rec9_4 );//画第四列的列标题
  4728. Point p4_1 = new Point( p3_1.X + ColumnWidth4, rec9.Y );
  4729. Point p4_2 = new Point( p3_2.X + ColumnWidth4, rec9.Y + rec9.Height );
  4730. g.DrawLine( p, p4_1, p4_2 );//画第四表与第五列的界线
  4731. #endregion
  4732. #region 收 银
  4733. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "收 银" );
  4734. sizef = g.MeasureString( StrValue, ft10 );
  4735. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  4736. Rectangle rec9_5 = new Rectangle( p4_1.X + (ColumnWidth5 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth5, RowContentHeight );
  4737. g.DrawString( StrValue, ft11, b, rec9_5 );//画第五列的列标题
  4738. #endregion
  4739. int IntPoint_X = rec9.X;
  4740. int IntPoint_Y = rec9.Y + rec9.Height;
  4741. decimal CopeAmount = 0;//租金
  4742. #region 画列表每行
  4743. for ( int i = 0; i < 4; i++ )
  4744. {
  4745. Rectangle recfor = new Rectangle( IntPoint_X, IntPoint_Y, TableWidth, RowHeight );
  4746. g.DrawRectangle( p, recfor );//画标题矩形
  4747. string recfor_1Value = "";
  4748. string recfor_2Value = "";
  4749. string recfor_3Value = "";
  4750. string recfor_4Value = "";
  4751. string recfor_5Value = "";
  4752. string SinglePerson = "";
  4753. if ( i < dgvData.SelectedRows.Count )
  4754. {
  4755. recfor_1Value = dgvData.SelectedRows[i].Cells["Pay_ReceivableProject"].Value.ToString().Trim();//收款项目
  4756. recfor_2Value = dgvData.SelectedRows[i].Cells["Pay_PaymentMethod"].Value.ToString().Trim();
  4757. recfor_3Value = Convert.ToDecimal( dgvData.SelectedRows[i].Cells["Pay_AmountOf"].Value ).ToString( "0.00" );
  4758. recfor_4Value = LYFZ.Command.Command_Validate.DateTimeToString( dgvData.SelectedRows[i].Cells["Pay_CreateDatetime"].Value, "yyyy-MM-dd HH:mm" );
  4759. recfor_5Value = dgvData.SelectedRows[i].Cells["Pay_ThePayee"].Value.ToString().Trim();
  4760. CopeAmount += Convert.ToDecimal( dgvData.SelectedRows[i].Cells["Pay_AmountOf"].Value );
  4761. SinglePerson = dgvData.SelectedRows[i].Cells["Pay_OpenSingle"].Value.ToString().Trim();
  4762. }
  4763. Rectangle recfor_1 = new Rectangle( recfor.X + AddLeft, recfor.Y + AddTop, ColumnWidth1, RowContentHeight );
  4764. g.DrawString( recfor_1Value, ft10, b, recfor_1 );//画第一列的列标题
  4765. Point pfor1_1 = new Point( recfor_1.X + ColumnWidth1 - 3, recfor.Y );
  4766. Point pfor1_2 = new Point( recfor_1.X + ColumnWidth1 - 3, recfor.Y + recfor.Height );
  4767. g.DrawLine( p, pfor1_1, pfor1_2 );//画第一表与第二列的界线
  4768. #region 2017-03-30 刘工添加 接单人
  4769. Rectangle recfor_1_1 = new Rectangle( pfor1_1.X + AddLeft, pfor1_1.Y + AddTop, ColumnWidth1_1, RowContentHeight );
  4770. g.DrawString( SinglePerson, ft10, b, recfor_1_1 );
  4771. Point pfor1_1_1 = new Point( pfor1_1.X + ColumnWidth1_1, pfor1_1.Y );
  4772. Point pfor1_2_1 = new Point( pfor1_1.X + ColumnWidth1_1, pfor1_1.Y + recfor.Height );
  4773. g.DrawLine( p, pfor1_1_1, pfor1_2_1 );
  4774. pfor1_1 = pfor1_1_1;
  4775. pfor1_2 = pfor1_2_1;
  4776. #endregion
  4777. Rectangle recfor_2 = new Rectangle( pfor1_1.X + AddLeft, pfor1_1.Y + AddTop, ColumnWidth2, RowContentHeight );
  4778. g.DrawString( recfor_2Value, ft10, b, recfor_2 );//画第二列的列标题
  4779. Point pfor2_1 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y );
  4780. Point pfor2_2 = new Point( pfor1_2.X + ColumnWidth2, recfor.Y + recfor.Height );
  4781. g.DrawLine( p, pfor2_1, pfor2_2 );//画第二表与第三列的界线
  4782. StrValue = recfor_3Value;
  4783. sizef = g.MeasureString( StrValue, ft10 );
  4784. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  4785. Rectangle recfor_3 = new Rectangle( pfor2_1.X + ColumnWidth3 - FtWidth - AddLeft * 2, pfor2_1.Y + AddTop, ColumnWidth3, RowContentHeight );
  4786. g.DrawString( recfor_3Value, ft10, b, recfor_3 );//画第三列的列标题
  4787. Point pfor3_1 = new Point( pfor2_1.X + ColumnWidth3, recfor.Y );
  4788. Point pfor3_2 = new Point( pfor2_2.X + ColumnWidth3, recfor.Y + recfor.Height );
  4789. g.DrawLine( p, pfor3_1, pfor3_2 );//画第三表与第四列的界线
  4790. Rectangle recfor_4 = new Rectangle( pfor3_1.X + AddLeft, pfor3_1.Y + AddTop, ColumnWidth4, RowContentHeight );
  4791. g.DrawString( recfor_4Value, ft10, b, recfor_4 );//画第四列的列标题
  4792. Point pfor4_1 = new Point( pfor3_1.X + ColumnWidth4, recfor.Y );
  4793. Point pfor4_2 = new Point( pfor3_2.X + ColumnWidth4, recfor.Y + recfor.Height );
  4794. g.DrawLine( p, pfor4_1, pfor4_2 );//画第四表与第五列的界线
  4795. Rectangle recfor_5 = new Rectangle( pfor4_1.X + AddLeft, pfor4_1.Y + AddTop, ColumnWidth5, RowContentHeight );
  4796. g.DrawString( recfor_5Value, ft10, b, recfor_5 );//画第五列的列标题
  4797. IntPoint_X = recfor.X;
  4798. IntPoint_Y = recfor.Y + recfor.Height;
  4799. }
  4800. #endregion
  4801. Rectangle rec10 = new Rectangle( IntPoint_X, IntPoint_Y, TableWidth, RowHeight );
  4802. g.DrawRectangle( p, rec10 );//画标题矩形
  4803. #region 付款情况
  4804. string rec10_1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "付款情况" );
  4805. sizef = g.MeasureString( rec10_1Value, ft11 );
  4806. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  4807. FtHeight = Convert.ToInt32( sizef.Height );
  4808. Rectangle rec10_1 = new Rectangle( rec10.X + AddLeft, rec10.Y + AddTop2, FtWidth, RowContentHeight );
  4809. g.DrawString( rec10_1Value, ft11, b, rec10_1 );//付款情况
  4810. #endregion
  4811. #region 应付
  4812. Rectangle rec10_2 = new Rectangle( (TableWidth / 4), rec10.Y + AddTop2, TableWidth / 4, RowContentHeight );
  4813. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "应付:" ) + (Convert.ToDecimal( htData["StrCope"] ) + Convert.ToDecimal( htData["StrDetain"] )), ft10, b, rec10_2 );//应付
  4814. #endregion
  4815. #region 实付
  4816. Rectangle rec10_3 = new Rectangle( rec10_2.X + (TableWidth / 4), rec10.Y + AddTop2, TableWidth / 4, RowContentHeight );
  4817. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "实付:" ) + CopeAmount.ToString( "0.00" ), ft10, b, rec10_3 );//实付
  4818. #endregion
  4819. #region 欠款
  4820. Rectangle rec10_4 = new Rectangle( rec10_3.X + (TableWidth / 4), rec10.Y + AddTop2, TableWidth / 4, RowContentHeight );
  4821. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "欠款:" ) + Convert.ToDecimal( htData["StrArrears"] ).ToString( "0.00" ), ft10, b, rec10_4 );//实付
  4822. #endregion
  4823. Rectangle rec11 = new Rectangle( rec10.X, rec10.Y + rec10.Height, TableWidth, RowHeight );
  4824. g.DrawRectangle( p, rec11 );//画标题矩形
  4825. #region 合计
  4826. Rectangle rec11_1 = new Rectangle( rec11.X + AddLeft, rec11.Y + AddTop2, TableWidth - 300, RowContentHeight );
  4827. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "合计人民币(大写):" ) + " " + LYFZ.Software.MainBusiness.ReportPrint.ReportPrintDataClass.ConversionAmount( CopeAmount.ToString() ), ft11, b, rec11_1 );//合计人民币
  4828. #endregion
  4829. #region 顾客签字
  4830. Rectangle rec11_2 = new Rectangle( rec11_1.X + rec11_1.Width + 100, rec11_1.Y, 300, RowContentHeight );
  4831. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "顾客签字:" ), ft11, b, rec11_2 );//画消费法规
  4832. #endregion
  4833. #region 说明
  4834. Rectangle rec12 = new Rectangle( rec11.X, rec11.Y + rec11.Height + 3, rec9.Width, Convert.ToInt32( g.MeasureString( "说明", ft9 ).Height ) + 1 );
  4835. string PaymentExplain = "";
  4836. if ( PrintOtherData.ContainsKey( "收款单说明" ) && PrintOtherData["收款单说明"].ToString().Trim().Length > 0 )
  4837. {
  4838. PaymentExplain = PrintOtherData["收款单说明"].ToString().Trim();
  4839. }
  4840. g.DrawString( PaymentExplain, ft9, b, rec12 );//画消费法规
  4841. #endregion
  4842. }
  4843. #endregion
  4844. #region 员工奖罚打印
  4845. public enum TextAlignType
  4846. {
  4847. LeftAlignment = 0, // 左对齐;
  4848. HorizontalCenter = 1, // 水平居中;
  4849. VerticalCenter = 2, // 垂直居中;
  4850. RightAlignment = 3 // 右对齐;
  4851. }
  4852. /// <summary>
  4853. ///
  4854. /// </summary>
  4855. /// <param name="grahpics"></param>
  4856. /// <param name="strText">要输出的文本</param>
  4857. /// <param name="rcText">文本显示的区域</param>
  4858. /// <param name="fText">文本输出时的字体信息</param>
  4859. /// <param name="brush">输出文本时的画刷</param>
  4860. /// <param name="AlignType">文本在区域的对齐方式</param>
  4861. /// <param name="bDrawCell">是否绘制出文本区域单元格</param>
  4862. /// <returns></returns>
  4863. public static bool DrawText( Graphics grahpics, string strText, Rectangle rcText, Font fText, Brush brush, TextAlignType AlignType, bool bDrawCell = false )
  4864. {
  4865. // 页边距;
  4866. int nPageMargine = 1;
  4867. // 参数有效性;
  4868. if ( string.IsNullOrEmpty( strText ) || grahpics == null )
  4869. return false;
  4870. // 计算字体大小;
  4871. SizeF TextSize = grahpics.MeasureString( strText, fText );
  4872. if ( TextSize.Width > rcText.Width )
  4873. return false;
  4874. // 字体高度大于区域高时;
  4875. if ( TextSize.Height > rcText.Height )
  4876. return false;
  4877. // 是否绘制表格;
  4878. if ( bDrawCell )
  4879. grahpics.DrawRectangle( new Pen( Brushes.Black, 1 ), rcText );
  4880. switch ( AlignType )
  4881. {
  4882. case TextAlignType.LeftAlignment: // 左对齐,默认
  4883. {
  4884. rcText.X += nPageMargine; // 左边距;
  4885. if ( bDrawCell ) rcText.Y += 5; // 上边距;
  4886. }
  4887. break;
  4888. case TextAlignType.HorizontalCenter: // 水平居中;
  4889. rcText.X += (rcText.Width - (int)TextSize.Width) / 2;
  4890. break;
  4891. case TextAlignType.VerticalCenter: // 垂直居中;
  4892. rcText.X += (rcText.Width - (int)TextSize.Width) / 2;
  4893. rcText.Y += (rcText.Height - (int)TextSize.Height) / 2;
  4894. break;
  4895. case TextAlignType.RightAlignment: // 右对齐;
  4896. {
  4897. rcText.X += rcText.Width - (int)TextSize.Width - 2;
  4898. if ( bDrawCell ) rcText.Y += 5; // 上边距;
  4899. }
  4900. break;
  4901. default:
  4902. break;
  4903. }
  4904. // 输出文本;
  4905. grahpics.DrawString( strText, fText, brush, rcText );
  4906. return true;
  4907. }
  4908. public static bool DrawText( out SizeF TextSize, Graphics grahpics, string strText, Rectangle rcText, Font fText, Brush brush, TextAlignType AlignType, bool bDrawCell = false )
  4909. {
  4910. TextSize = new SizeF( 0.0f, 0.0f );
  4911. // 参数有效性;
  4912. if ( string.IsNullOrEmpty( strText ) || grahpics == null )
  4913. return false;
  4914. // 计算字体大小;
  4915. TextSize = grahpics.MeasureString( strText, fText );
  4916. if ( TextSize.Width > rcText.Width )
  4917. return false;
  4918. // 字体高度大于区域高时;//换行时会产生;
  4919. if ( TextSize.Height > rcText.Height )
  4920. return false;
  4921. // 是否绘制表格;
  4922. if ( bDrawCell )
  4923. grahpics.DrawRectangle( new Pen( Brushes.Black, 1 ), rcText );
  4924. switch ( AlignType )
  4925. {
  4926. case TextAlignType.LeftAlignment: // 左对齐,默认;
  4927. break;
  4928. case TextAlignType.HorizontalCenter: // 水平居中;
  4929. rcText.X += (rcText.Width - (int)TextSize.Width) / 2;
  4930. break;
  4931. case TextAlignType.VerticalCenter: // 垂直居中;
  4932. rcText.X += (rcText.Width - (int)TextSize.Width) / 2;
  4933. rcText.Y += (rcText.Height - (int)TextSize.Height) / 2;
  4934. break;
  4935. case TextAlignType.RightAlignment: // 右对齐;
  4936. rcText.X += rcText.Width - (int)TextSize.Width;
  4937. break;
  4938. default:
  4939. break;
  4940. }
  4941. // 输出文本;
  4942. grahpics.DrawString( strText, fText, brush, rcText );
  4943. return true;
  4944. }
  4945. public static bool DrawText( out Rectangle rcResult, Graphics grahpics, string strText, Rectangle rcText, Font fText, Brush brush, TextAlignType AlignType, bool bDrawCell = false )
  4946. {
  4947. rcResult = rcText;
  4948. // 参数有效性;
  4949. if ( string.IsNullOrEmpty( strText ) || grahpics == null )
  4950. return false;
  4951. // 计算字体大小;
  4952. SizeF TextSize = grahpics.MeasureString( strText, fText );
  4953. if ( TextSize.Width > rcText.Width )
  4954. return false;
  4955. // 字体高度大于区域高时;
  4956. if ( TextSize.Height > rcText.Height )
  4957. rcText.Height = (int)TextSize.Height;
  4958. // 是否绘制表格;
  4959. if ( bDrawCell )
  4960. grahpics.DrawRectangle( new Pen( Brushes.Black, 1 ), rcText );
  4961. switch ( AlignType )
  4962. {
  4963. case TextAlignType.LeftAlignment: // 左对齐,默认;
  4964. break;
  4965. case TextAlignType.HorizontalCenter: // 水平居中;
  4966. rcText.X += (rcText.Width - (int)TextSize.Width) / 2;
  4967. break;
  4968. case TextAlignType.VerticalCenter: // 垂直居中;
  4969. rcText.X += (rcText.Width - (int)TextSize.Width) / 2;
  4970. rcText.Y += (rcText.Height - (int)TextSize.Height) / 2;
  4971. break;
  4972. case TextAlignType.RightAlignment: // 右对齐;
  4973. rcText.X += rcText.Width - (int)TextSize.Width;
  4974. break;
  4975. default:
  4976. break;
  4977. }
  4978. // 输出文本;
  4979. grahpics.DrawString( strText, fText, brush, rcText );
  4980. // 返回结果区域;
  4981. rcResult.Location = rcText.Location;
  4982. rcResult.Width = rcText.Width;
  4983. rcResult.Height = rcText.Height;
  4984. return true;
  4985. }
  4986. public static void StaffRewardAndPunishment( object objValue, Graphics g, Size size, bool IsPrintSerialNo )
  4987. {
  4988. int lastY = -1;
  4989. // 解析要打印的数据;
  4990. Hashtable hashtable = (Hashtable)objValue;
  4991. DataGridViewRow dgvr = (DataGridViewRow)hashtable["CurrentRow"];
  4992. // 画刷;
  4993. Brush b = Brushes.Black;
  4994. Pen p = GetPen;
  4995. Font ft16 = new Font( "宋体", 16 );
  4996. Font ft11 = new Font( "宋体", 10 );
  4997. Font ft10 = new Font( "宋体", 9 );
  4998. Font ft9 = new Font( "宋体", 9 );
  4999. // 获取影楼店信息;
  5000. string strQuery = orbll.GetView_CustomReturnExecuteSql( "tb_ErpCompanyInfo",
  5001. StrWhere: "Company_DividedShop = '" + StrDividedShop + "'",
  5002. ShowColumnName: "Company_Address, Company_Telephone, Company_UpdateDatetime" );
  5003. DataSet dtCompany = orbll.GetView_Custom( strQuery );
  5004. DataTable tbl = dtCompany.Tables["ds"];
  5005. #region 打印二维码
  5006. Image img = CachePhoto( PhotoLogType.DimensionalCode, tbl.Rows[0]["Company_UpdateDatetime"] );
  5007. Rectangle rcQRCode = new Rectangle( 50, 25, 90, 90 );
  5008. if ( img != null )
  5009. {
  5010. g.DrawImage( img, rcQRCode );
  5011. }
  5012. #endregion
  5013. int TableWidth = size.Width - rcQRCode.X * 2;
  5014. #region 打印票据标题
  5015. SizeF TextSize;
  5016. Rectangle rcConfig = new Rectangle( size.Width / 4, 30, size.Width / 2, 30 );
  5017. DrawText( g, DefaultPrintTitle, rcConfig, ft16, b, TextAlignType.VerticalCenter );
  5018. #endregion
  5019. #region 打印影楼地址;
  5020. string strStudioAddress = LYFZ.BLL.OtherCommonModel.FontConversion( "地址: " ) + tbl.Rows[0]["Company_Address"].ToString().Trim();
  5021. rcConfig = new Rectangle( rcQRCode.X + rcQRCode.Width + 5, rcQRCode.Y + rcQRCode.Height / 2, size.Width / 2, 30 );
  5022. DrawText( out TextSize, g, strStudioAddress, rcConfig, ft10, b, TextAlignType.LeftAlignment );
  5023. #endregion
  5024. #region 打印影楼电话;
  5025. string strStudioTelephone = LYFZ.BLL.OtherCommonModel.FontConversion( "电话: " ) + tbl.Rows[0]["Company_Telephone"].ToString().Trim();
  5026. rcConfig = new Rectangle( rcConfig.X, rcConfig.Y + (int)TextSize.Height + 2, size.Width / 2, 30 );
  5027. DrawText( out TextSize, g, strStudioTelephone, rcConfig, ft10, b, TextAlignType.LeftAlignment );
  5028. #endregion
  5029. #region 打印日期;
  5030. string strPrintDate = LYFZ.BLL.OtherCommonModel.FontConversion( "打印日期: " ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy年MM月dd日" );
  5031. rcConfig = new Rectangle( rcConfig.X + rcConfig.Width, rcConfig.Y, size.Width - rcConfig.X - rcConfig.Width - 50, 30 );
  5032. DrawText( out TextSize, g, strPrintDate, rcConfig, ft10, b, TextAlignType.RightAlignment );
  5033. #endregion
  5034. int RowHeight = 26;
  5035. int ColumnWidth = TableWidth / 6;
  5036. // 在二维码下方7个像素开始画;
  5037. Rectangle rec9 = new Rectangle( rcQRCode.X + 7, rcQRCode.Y + rcQRCode.Height + 2, ColumnWidth * 6, RowHeight );
  5038. g.DrawRectangle( p, rec9 );
  5039. #region 奖罚类型;
  5040. string strValue = LYFZ.BLL.OtherCommonModel.FontConversion( "奖罚类型" );
  5041. rcConfig = new Rectangle( rec9.X, rec9.Y, ColumnWidth, RowHeight );
  5042. DrawText( g, strValue, rcConfig, ft10, b, TextAlignType.VerticalCenter, true );
  5043. strValue = dgvr.Cells["奖罚类型"].Value.ToString();
  5044. rcConfig = new Rectangle( rcConfig.X, rcConfig.Y + rcConfig.Height, ColumnWidth, RowHeight );
  5045. DrawText( g, strValue, rcConfig, ft10, b, TextAlignType.VerticalCenter, true );
  5046. #endregion
  5047. #region 执行方式;
  5048. strValue = LYFZ.BLL.OtherCommonModel.FontConversion( "执行方式" );
  5049. rcConfig = new Rectangle( rec9.X + ColumnWidth, rec9.Y, ColumnWidth, RowHeight );
  5050. DrawText( g, strValue, rcConfig, ft10, b, TextAlignType.VerticalCenter, true );
  5051. strValue = dgvr.Cells["是否执行"].Value.ToString();
  5052. rcConfig = new Rectangle( rcConfig.X, rcConfig.Y + rcConfig.Height, ColumnWidth, RowHeight );
  5053. DrawText( g, strValue, rcConfig, ft10, b, TextAlignType.VerticalCenter, true );
  5054. #endregion
  5055. #region 金额;
  5056. strValue = LYFZ.BLL.OtherCommonModel.FontConversion( "金额" );
  5057. rcConfig = new Rectangle( rec9.X + ColumnWidth * 2, rec9.Y, ColumnWidth, RowHeight );
  5058. DrawText( g, strValue, rcConfig, ft10, b, TextAlignType.VerticalCenter, true );
  5059. strValue = dgvr.Cells["奖罚金额"].Value.ToString();
  5060. rcConfig = new Rectangle( rcConfig.X, rcConfig.Y + rcConfig.Height, ColumnWidth, RowHeight );
  5061. DrawText( g, strValue, rcConfig, ft10, b, TextAlignType.VerticalCenter, true );
  5062. #endregion
  5063. #region 相关人员;
  5064. strValue = LYFZ.BLL.OtherCommonModel.FontConversion( "相关人员" );
  5065. rcConfig = new Rectangle( rec9.X + ColumnWidth * 3, rec9.Y, ColumnWidth, RowHeight );
  5066. DrawText( g, strValue, rcConfig, ft10, b, TextAlignType.VerticalCenter, true );
  5067. strValue = dgvr.Cells["相关人员"].Value.ToString();
  5068. rcConfig = new Rectangle( rcConfig.X, rcConfig.Y + rcConfig.Height, ColumnWidth, RowHeight );
  5069. DrawText( g, strValue, rcConfig, ft10, b, TextAlignType.VerticalCenter, true );
  5070. #endregion
  5071. #region 录单人员;
  5072. strValue = LYFZ.BLL.OtherCommonModel.FontConversion( "录单人员" );
  5073. rcConfig = new Rectangle( rec9.X + ColumnWidth * 4, rec9.Y, ColumnWidth, RowHeight );
  5074. DrawText( g, strValue, rcConfig, ft10, b, TextAlignType.VerticalCenter, true );
  5075. strValue = dgvr.Cells["录单人"].Value.ToString();
  5076. rcConfig = new Rectangle( rcConfig.X, rcConfig.Y + rcConfig.Height, ColumnWidth, RowHeight );
  5077. DrawText( g, strValue, rcConfig, ft10, b, TextAlignType.VerticalCenter, true );
  5078. #endregion
  5079. #region 执行日期;
  5080. strValue = LYFZ.BLL.OtherCommonModel.FontConversion( "执行日期" );
  5081. rcConfig = new Rectangle( rec9.X + ColumnWidth * 5, rec9.Y, ColumnWidth, RowHeight );
  5082. DrawText( g, strValue, rcConfig, ft10, b, TextAlignType.VerticalCenter, true );
  5083. strValue = dgvr.Cells["执行日期"].Value.ToString();
  5084. rcConfig = new Rectangle( rcConfig.X, rcConfig.Y + rcConfig.Height, ColumnWidth, RowHeight );
  5085. DrawText( g, strValue, rcConfig, ft10, b, TextAlignType.VerticalCenter, true );
  5086. #endregion
  5087. #region 备注;
  5088. strValue = LYFZ.BLL.OtherCommonModel.FontConversion( "备注:" );
  5089. rcConfig = new Rectangle( rec9.X, rec9.Y + RowHeight * 2, ColumnWidth * 6, RowHeight * 5 );
  5090. DrawText( g, strValue, rcConfig, ft10, b, TextAlignType.LeftAlignment, true );
  5091. // 备注内容;
  5092. strValue = dgvr.Cells["备注"].Value.ToString();
  5093. rcConfig = new Rectangle( rec9.X + 30, rec9.Y + RowHeight * 3, ColumnWidth * 6, RowHeight * 5 );
  5094. DrawText( g, strValue, rcConfig, ft10, b, TextAlignType.LeftAlignment );
  5095. #endregion
  5096. #region 领导审批;
  5097. strValue = LYFZ.BLL.OtherCommonModel.FontConversion( "领导审批:" );
  5098. rcConfig = new Rectangle( rec9.X, rec9.Y + RowHeight * 7, ColumnWidth, RowHeight );
  5099. DrawText( g, strValue, rcConfig, ft10, b, TextAlignType.VerticalCenter, true );
  5100. rcConfig = new Rectangle( rec9.X + ColumnWidth, rec9.Y + RowHeight * 7, ColumnWidth * 2, RowHeight );
  5101. g.DrawRectangle( p, rcConfig );
  5102. #endregion
  5103. #region 相关人员签字;
  5104. strValue = LYFZ.BLL.OtherCommonModel.FontConversion( "相关人员签字:" );
  5105. rcConfig = new Rectangle( rec9.X + ColumnWidth * 3, rec9.Y + RowHeight * 7, ColumnWidth, RowHeight );
  5106. DrawText( g, strValue, rcConfig, ft10, b, TextAlignType.VerticalCenter, true );
  5107. rcConfig = new Rectangle( rec9.X + ColumnWidth * 4, rec9.Y + RowHeight * 7, ColumnWidth * 2, RowHeight );
  5108. g.DrawRectangle( p, rcConfig );
  5109. #endregion
  5110. }
  5111. #endregion
  5112. #endregion
  5113. #region 财务报表
  5114. #region 日报表
  5115. /// <summary>
  5116. /// 日财务报表
  5117. /// </summary>
  5118. /// <param name="dgv">数据列表</param>
  5119. /// <param name="StrOrd_Number">数据总汇:</param>
  5120. public static void FinanceReportDays( object objValue, Graphics g, Size size )
  5121. {
  5122. Hashtable htData = (Hashtable)objValue;
  5123. DataGridViewEc dgvData = (DataGridViewEc)htData["dgvData"];
  5124. string StrText = htData["StrText"].ToString().Trim();
  5125. string StrDateWeek = htData["StrDateWeek"].ToString().Trim();
  5126. DataTable tbl = orbll.GetView_Custom( "tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Name" ).Tables[0];
  5127. if ( tbl.Rows.Count <= 0 )
  5128. {
  5129. MessageBoxCustom.Show( "未设置影楼信息" ); return;
  5130. }
  5131. Brush b = Brushes.Black;
  5132. Pen p = GetPen;
  5133. Font ft16 = new Font( "宋体", 15 );
  5134. Font ft10 = new Font( "宋体", 10 );
  5135. Font ft9 = new Font( "宋体", 9 );
  5136. int LeftWidth = 30;
  5137. int TableWidth = size.Width - LeftWidth * 2;
  5138. int LeftAdd = 3;
  5139. int TopAdd = 4;
  5140. int RowHeight = 25;
  5141. int RowContentHeight = 15;
  5142. int ColumnWidth2 = 90;
  5143. int ColumnWidth3 = 90;
  5144. int ColumnWidth4 = 120;
  5145. int ColumnWidth5 = 140;
  5146. int ColumnWidth6 = 70;
  5147. int ColumnWidth1 = TableWidth - ColumnWidth2 - ColumnWidth3 - ColumnWidth4 - ColumnWidth5 - ColumnWidth6;
  5148. //金色童年收据凭据
  5149. string rec2Value = tbl.Rows[0]["Company_Name"].ToString().Trim() + StrDateWeek.Trim() + LYFZ.BLL.OtherCommonModel.FontConversion( "账务报表" ) + htData["StrTilte"].ToString().Trim();
  5150. SizeF sizef = g.MeasureString( rec2Value, ft16 );
  5151. int StrHeigth = Convert.ToInt32( sizef.Height );
  5152. int StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  5153. Rectangle rec1 = new Rectangle( (size.Width - StrWidth) / 2, 50, StrWidth, StrHeigth );
  5154. g.DrawString( rec2Value, ft16, b, rec1 );
  5155. int PageRows = 48;//每页多少行
  5156. int PageCount = dgvData.Rows.Count / PageRows;
  5157. if ( dgvData.Rows.Count % PageRows > 0 )
  5158. {
  5159. PageCount++;
  5160. }
  5161. 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;
  5162. sizef = g.MeasureString( StrValue, ft9 );
  5163. StrHeigth = Convert.ToInt32( sizef.Height );
  5164. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  5165. Rectangle rec1_1 = new Rectangle( LeftWidth + TableWidth - StrWidth, rec1.Y + rec1.Height + 3, StrWidth, StrHeigth );
  5166. g.DrawString( StrValue, ft9, b, rec1_1 );//画消费法规
  5167. #region 画列标题
  5168. Rectangle rec2 = new Rectangle( LeftWidth, rec1_1.Y + rec1_1.Height, TableWidth, RowHeight );
  5169. g.DrawRectangle( p, rec2 );//画标题矩形
  5170. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "项目名称" );
  5171. sizef = g.MeasureString( StrValue, ft10 );
  5172. int FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  5173. Rectangle rec2_1 = new Rectangle( rec2.X + (ColumnWidth1 / 2 - FtWidth / 2), rec2.Y + TopAdd + 2, ColumnWidth1, RowContentHeight );
  5174. g.DrawString( StrValue, ft10, b, rec2_1 );//画第一列的列标题
  5175. Point p21_1 = new Point( rec2.X + ColumnWidth1, rec2.Y );
  5176. Point p21_2 = new Point( rec2.X + ColumnWidth1, rec2.Y + rec2.Height );
  5177. g.DrawLine( p, p21_1, p21_2 );//画第一表与第二列的界线
  5178. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "金额" );
  5179. sizef = g.MeasureString( StrValue, ft10 );
  5180. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  5181. Rectangle rec2_2 = new Rectangle( p21_1.X + (ColumnWidth2 / 2 - FtWidth / 2), p21_1.Y + TopAdd + 2, ColumnWidth2, RowContentHeight );
  5182. g.DrawString( StrValue, ft10, b, rec2_2 );//画第一列的列标题
  5183. Point p22_1 = new Point( p21_1.X + ColumnWidth2, rec2.Y );
  5184. Point p22_2 = new Point( p21_1.X + ColumnWidth2, rec2.Y + rec2.Height );
  5185. g.DrawLine( p, p22_1, p22_2 );//画第一表与第二列的界线
  5186. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "项目类别" );
  5187. sizef = g.MeasureString( StrValue, ft10 );
  5188. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  5189. Rectangle rec2_3 = new Rectangle( p22_1.X + (ColumnWidth3 / 2 - FtWidth / 2), p22_1.Y + TopAdd + 2, ColumnWidth3, RowContentHeight );
  5190. g.DrawString( StrValue, ft10, b, rec2_3 );//画第一列的列标题
  5191. Point p23_1 = new Point( p22_1.X + ColumnWidth3, rec2.Y );
  5192. Point p23_2 = new Point( p22_1.X + ColumnWidth3, rec2.Y + rec2.Height );
  5193. g.DrawLine( p, p23_1, p23_2 );//画第一表与第二列的界线
  5194. if ( string.IsNullOrEmpty( htData["IsPrintType"].ToString().Trim() ) )
  5195. {
  5196. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "类型/支付方式" );
  5197. }
  5198. else
  5199. {
  5200. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "开单人" );
  5201. }
  5202. sizef = g.MeasureString( StrValue, ft10 );
  5203. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  5204. Rectangle rec2_4 = new Rectangle( p23_1.X + (ColumnWidth4 / 2 - FtWidth / 2), p23_1.Y + TopAdd + 2, ColumnWidth4, RowContentHeight );
  5205. g.DrawString( StrValue, ft10, b, rec2_4 );//画第一列的列标题
  5206. Point p24_1 = new Point( p23_1.X + ColumnWidth4, rec2.Y );
  5207. Point p24_2 = new Point( p23_1.X + ColumnWidth4, rec2.Y + rec2.Height );
  5208. g.DrawLine( p, p24_1, p24_2 );//画第一表与第二列的界线
  5209. if ( string.IsNullOrEmpty( htData["IsPrintType"].ToString().Trim() ) )
  5210. {
  5211. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "客户/备注" );
  5212. }
  5213. else
  5214. {
  5215. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名" );
  5216. }
  5217. sizef = g.MeasureString( StrValue, ft10 );
  5218. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  5219. Rectangle rec2_5 = new Rectangle( p24_1.X + (ColumnWidth5 / 2 - FtWidth / 2), p24_1.Y + TopAdd + 2, ColumnWidth5, RowContentHeight );
  5220. g.DrawString( StrValue, ft10, b, rec2_5 );//画第一列的列标题
  5221. if ( string.IsNullOrEmpty( htData["IsPrintType"].ToString().Trim() ) )
  5222. {
  5223. Point p25_1 = new Point( p24_1.X + ColumnWidth5, rec2.Y );
  5224. Point p25_2 = new Point( p24_1.X + ColumnWidth5, rec2.Y + rec2.Height );
  5225. g.DrawLine( p, p25_1, p25_2 );//画第一表与第二列的界线
  5226. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "门市" );
  5227. sizef = g.MeasureString( StrValue, ft10 );
  5228. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  5229. Rectangle rec2_6 = new Rectangle( p25_1.X + (ColumnWidth6 / 2 - FtWidth / 2), p25_1.Y + TopAdd + 2, ColumnWidth6, RowContentHeight );
  5230. g.DrawString( StrValue, ft10, b, rec2_6 );//画第一列的列标题
  5231. Point p26_1 = new Point( p25_1.X + ColumnWidth6, rec2.Y );
  5232. Point p26_2 = new Point( p25_1.X + ColumnWidth6, rec2.Y + rec2.Height );
  5233. g.DrawLine( p, p26_1, p26_2 );//画第一表与第二列的界线
  5234. }
  5235. #endregion
  5236. #region 画行
  5237. int RowHeight2 = 20;
  5238. int RowContentHeight2 = RowHeight2 - (TopAdd * 2);
  5239. int IntPoint_Y = rec2.Y + rec2.Height;
  5240. int ForCount = 0;
  5241. bool IsNextPage = false;
  5242. for ( int i = PrintForCount; i < dgvData.Rows.Count; i++ )
  5243. {
  5244. if ( i == dgvData.Rows.Count )
  5245. {
  5246. break;
  5247. }
  5248. Rectangle recfor = new Rectangle( rec2.X, IntPoint_Y, TableWidth, RowHeight2 );
  5249. g.DrawRectangle( p, recfor );//画标题矩形
  5250. string StrName = "";
  5251. if ( string.IsNullOrEmpty( htData["IsPrintType"].ToString().Trim() ) )
  5252. {
  5253. if ( dgvData.Rows[PrintForCount].Cells["项目名称"].Value != null )
  5254. {
  5255. StrName = dgvData.Rows[PrintForCount].Cells["项目名称"].Value.ToString().Trim();
  5256. }
  5257. if ( !string.IsNullOrEmpty( dgvData.Rows[PrintForCount].Cells["项目备注"].Value.ToString().Trim() ) && !string.IsNullOrEmpty( StrName ) )
  5258. {
  5259. StrName += "/" + dgvData.Rows[PrintForCount].Cells["项目备注"].Value.ToString().Trim();
  5260. }
  5261. }
  5262. else
  5263. {
  5264. StrName = dgvData.Rows[PrintForCount].Cells["项目名称"].Value.ToString().Trim();
  5265. }
  5266. Rectangle recfor2_1 = new Rectangle( recfor.X + LeftAdd, recfor.Y + TopAdd, ColumnWidth1 - (LeftAdd * 2), RowContentHeight2 );
  5267. g.DrawString( StrName, ft9, b, recfor2_1 );//画第一列的列标题
  5268. Point pfor1_1 = new Point( recfor.X + ColumnWidth1, recfor.Y );
  5269. Point pfor1_2 = new Point( recfor.X + ColumnWidth1, recfor.Y + recfor.Height );
  5270. g.DrawLine( p, pfor1_1, pfor1_2 );//画第一表与第二列的界线
  5271. string StrPhone = dgvData.Rows[PrintForCount].Cells["金额"].Value.ToString().Trim();
  5272. sizef = g.MeasureString( StrPhone, ft9 );
  5273. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  5274. Rectangle recfor2_2 = new Rectangle( pfor1_1.X + ColumnWidth2 - FtWidth - LeftAdd, pfor1_1.Y + TopAdd, ColumnWidth2 - (LeftAdd * 2), RowContentHeight2 );
  5275. g.DrawString( StrPhone, ft9, b, recfor2_2 );//画第一列的列标题
  5276. Point pfor2_1 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y );
  5277. Point pfor2_2 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y + recfor.Height );
  5278. g.DrawLine( p, pfor2_1, pfor2_2 );//画第一表与第二列的界线
  5279. Rectangle recfor2_3 = new Rectangle( pfor2_1.X + LeftAdd, pfor2_1.Y + TopAdd, ColumnWidth3 - (LeftAdd * 2), RowContentHeight2 );
  5280. g.DrawString( dgvData.Rows[PrintForCount].Cells["项目类别"].Value.ToString().Trim(), ft9, b, recfor2_3 );//画第一列的列标题
  5281. Point pfor3_1 = new Point( pfor2_1.X + ColumnWidth3, recfor.Y );
  5282. Point pfor3_2 = new Point( pfor2_1.X + ColumnWidth3, recfor.Y + recfor.Height );
  5283. g.DrawLine( p, pfor3_1, pfor3_2 );//画第一表与第二列的界线
  5284. Rectangle recfor2_4 = new Rectangle( pfor3_1.X + LeftAdd, pfor3_1.Y + TopAdd, ColumnWidth4 - (LeftAdd * 2), RowContentHeight2 );
  5285. if ( string.IsNullOrEmpty( htData["IsPrintType"].ToString().Trim() ) )
  5286. {
  5287. g.DrawString( dgvData.Rows[PrintForCount].Cells["收入/支出"].Value.ToString().Trim() + "/" + dgvData.Rows[PrintForCount].Cells["支付方式"].Value.ToString().Trim(), ft9, b, recfor2_4 );
  5288. }
  5289. else
  5290. {
  5291. g.DrawString( dgvData.Rows[PrintForCount].Cells["开单人"].Value.ToString().Trim(), ft9, b, recfor2_4 );
  5292. }
  5293. Point pfor4_1 = new Point( pfor3_1.X + ColumnWidth4, recfor.Y );
  5294. Point pfor4_2 = new Point( pfor3_1.X + ColumnWidth4, recfor.Y + recfor.Height );
  5295. g.DrawLine( p, pfor4_1, pfor4_2 );//画第一表与第二列的界线
  5296. Rectangle recfor2_5 = new Rectangle( pfor4_1.X + LeftAdd, pfor4_1.Y + TopAdd, ColumnWidth5 - (LeftAdd * 2), RowContentHeight2 );
  5297. g.DrawString( dgvData.Rows[PrintForCount].Cells["客户姓名"].Value.ToString().Trim(), ft9, b, recfor2_5 );//画第一列的列标题
  5298. if ( string.IsNullOrEmpty( htData["IsPrintType"].ToString().Trim() ) )
  5299. {
  5300. Point pfor5_1 = new Point( pfor4_1.X + ColumnWidth5, recfor.Y );
  5301. Point pfor5_2 = new Point( pfor4_1.X + ColumnWidth5, recfor.Y + recfor.Height );
  5302. g.DrawLine( p, pfor5_1, pfor5_2 );//画第一表与第二列的界线
  5303. Rectangle recfor2_6 = new Rectangle( pfor5_1.X + LeftAdd, pfor5_1.Y + TopAdd, ColumnWidth6 - (LeftAdd * 2), RowContentHeight2 );
  5304. g.DrawString( dgvData.Rows[PrintForCount].Cells["开单人"].Value.ToString().Trim(), ft9, b, recfor2_6 );//画第一列的列标题
  5305. Point pfor6_1 = new Point( pfor5_1.X + ColumnWidth6, recfor.Y );
  5306. Point pfor6_2 = new Point( pfor5_1.X + ColumnWidth6, recfor.Y + recfor.Height );
  5307. g.DrawLine( p, pfor6_1, pfor6_2 );//画第一表与第二列的界线
  5308. }
  5309. PrintForCount++;
  5310. ForCount++;
  5311. IntPoint_Y = recfor.Y + recfor.Height;
  5312. if ( ForCount == PageRows )
  5313. {
  5314. break;
  5315. }
  5316. }
  5317. #endregion
  5318. if ( PrintForCount < dgvData.Rows.Count )
  5319. {
  5320. PrintCurrentIndexPage++;
  5321. IsNextPage = true;
  5322. IsHasMorePages = true;
  5323. return;
  5324. }
  5325. if ( (dgvData.Rows.Count - ((PrintCurrentIndexPage - 1) * PrintForCount)) == 48 || (dgvData.Rows.Count - ((PrintCurrentIndexPage - 1) * PrintForCount)) == 47 )
  5326. {
  5327. PrintCurrentIndexPage++;
  5328. IsNextPage = true;
  5329. IsHasMorePages = true;
  5330. return;
  5331. }
  5332. if ( !IsNextPage )
  5333. {
  5334. sizef = g.MeasureString( StrText.Trim(), ft9, TableWidth );
  5335. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  5336. Rectangle rec3 = new Rectangle( rec2.X, IntPoint_Y, TableWidth, Convert.ToInt32( sizef.Height ) + 5 );
  5337. g.DrawRectangle( p, rec3 );//画标题矩形
  5338. Rectangle rec3_1 = new Rectangle( rec3.X, rec3.Y + 5, TableWidth, Convert.ToInt32( sizef.Height ) );
  5339. g.DrawString( StrText.Trim(), ft9, b, rec3_1 );//画第一列的列标题
  5340. IsHasMorePages = false;
  5341. }
  5342. }
  5343. #endregion
  5344. #region 月报表
  5345. /// <summary>
  5346. /// 月财务报表
  5347. /// </summary>
  5348. /// <param name="dgv">数据列表</param>
  5349. /// <param name="StrOrd_Number">数据总汇:</param>
  5350. public static void FinanceReportMonth( object objValue, Graphics g, Size size )
  5351. {
  5352. Hashtable htData = (Hashtable)objValue;
  5353. DataGridViewEc dgvData = (DataGridViewEc)htData["dgvData"];
  5354. string StrText = htData["StrText"].ToString().Trim();
  5355. string StrDateWeek = htData["StrDateWeek"].ToString().Trim();
  5356. DataTable tbl = orbll.GetView_Custom( "tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Name" ).Tables[0];
  5357. if ( tbl.Rows.Count <= 0 )
  5358. {
  5359. MessageBoxCustom.Show( "未设置影楼信息" ); return;
  5360. }
  5361. Brush b = Brushes.Black;
  5362. Pen p = GetPen;
  5363. Font ft16 = new Font( "宋体", 16 );
  5364. Font ft10 = new Font( "宋体", 10 );
  5365. Font ft9 = new Font( "宋体", 9 );
  5366. int LeftWidth = 30;
  5367. int TableWidth = size.Width - LeftWidth * 2;
  5368. int LeftAdd = 2;
  5369. int TopAdd = 7;
  5370. int RowHeight = 45;
  5371. int RowContentHeight = 45;
  5372. int ColumnWidth1 = 45;
  5373. int ColumnWidth2 = (TableWidth - ColumnWidth1) / 11;
  5374. //金色童年收据凭据
  5375. string rec2Value = tbl.Rows[0]["Company_Name"].ToString().Trim() + StrDateWeek + "账务报表";
  5376. SizeF sizef = g.MeasureString( rec2Value, ft16 );
  5377. int StrHeigth = Convert.ToInt32( sizef.Height );
  5378. int StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  5379. Rectangle rec1 = new Rectangle( (size.Width - StrWidth) / 2, 50, StrWidth, StrHeigth );
  5380. g.DrawString( rec2Value, ft16, b, rec1 );
  5381. 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";
  5382. sizef = g.MeasureString( StrValue, ft9 );
  5383. StrHeigth = Convert.ToInt32( sizef.Height );
  5384. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  5385. Rectangle rec1_1 = new Rectangle( LeftWidth + TableWidth - StrWidth, rec1.Y + rec1.Height + 5, StrWidth, StrHeigth );
  5386. g.DrawString( StrValue, ft9, b, rec1_1 );//画消费法规
  5387. #region 画列标题
  5388. Rectangle rec2 = new Rectangle( LeftWidth, rec1_1.Y + rec1_1.Height, TableWidth, RowHeight );
  5389. g.DrawRectangle( p, rec2 );//画标题矩形
  5390. Rectangle rec2_1 = new Rectangle( rec2.X + LeftAdd, rec2.Y + TopAdd + 10, ColumnWidth1, RowContentHeight );
  5391. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "日期" ), ft10, b, rec2_1 );//画第一列的列标题
  5392. Point p21_1 = new Point( rec2.X + rec2_1.Width, rec2.Y );
  5393. Point p21_2 = new Point( rec2.X + rec2_1.Width, rec2.Y + rec2.Height );
  5394. g.DrawLine( p, p21_1, p21_2 );//画第一表与第二列的界线
  5395. Rectangle rec2_2 = new Rectangle( p21_1.X + LeftAdd, rec2_1.Y, ColumnWidth2, RowContentHeight );
  5396. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "总收入" ), ft10, b, rec2_2 );//画第一列的列标题
  5397. Point p22_1 = new Point( p21_1.X + rec2_2.Width, rec2.Y );
  5398. Point p22_2 = new Point( p21_1.X + rec2_2.Width, rec2.Y + rec2.Height );
  5399. g.DrawLine( p, p22_1, p22_2 );//画第一表与第二列的界线
  5400. Rectangle rec2_3 = new Rectangle( p22_1.X + LeftAdd, rec2.Y + TopAdd, ColumnWidth2, RowContentHeight );
  5401. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 订单\r\n 收入" ), ft10, b, rec2_3 );//画第一列的列标题
  5402. Point p23_1 = new Point( p22_1.X + rec2_3.Width, rec2.Y );
  5403. Point p23_2 = new Point( p22_1.X + rec2_3.Width, rec2.Y + rec2.Height );
  5404. g.DrawLine( p, p23_1, p23_2 );//画第一表与第二列的界线
  5405. Rectangle rec2_4 = new Rectangle( p23_1.X + LeftAdd, rec2_3.Y, ColumnWidth2, RowContentHeight );
  5406. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 补款\r\n 收入" ), ft10, b, rec2_4 );//画第一列的列标题
  5407. Point p24_1 = new Point( p23_1.X + rec2_4.Width, rec2.Y );
  5408. Point p24_2 = new Point( p23_1.X + rec2_4.Width, rec2.Y + rec2.Height );
  5409. g.DrawLine( p, p24_1, p24_2 );//画第一表与第二列的界线
  5410. Rectangle rec2_5 = new Rectangle( p24_1.X + LeftAdd, rec2_3.Y, ColumnWidth2, RowContentHeight );
  5411. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 后期\r\n 收入" ), ft10, b, rec2_5 );//画第一列的列标题
  5412. Point p25_1 = new Point( p24_1.X + rec2_5.Width, rec2.Y );
  5413. Point p25_2 = new Point( p24_1.X + rec2_5.Width, rec2.Y + rec2.Height );
  5414. g.DrawLine( p, p25_1, p25_2 );//画第一表与第二列的界线
  5415. Rectangle rec2_6 = new Rectangle( p25_1.X + LeftAdd, rec2_3.Y, ColumnWidth2, RowContentHeight );
  5416. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 其他\r\n 收入" ), ft10, b, rec2_6 );//画第一列的列标题
  5417. Point p26_1 = new Point( p25_1.X + rec2_6.Width, rec2.Y );
  5418. Point p26_2 = new Point( p25_1.X + rec2_6.Width, rec2.Y + rec2.Height );
  5419. g.DrawLine( p, p26_1, p26_2 );//画第一表与第二列的界线
  5420. Rectangle rec2_7 = new Rectangle( p26_1.X + LeftAdd, rec2_3.Y, ColumnWidth2, RowContentHeight );
  5421. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 会员\r\n 充值" ), ft10, b, rec2_7 );//画第一列的列标题
  5422. Point p27_1 = new Point( p26_1.X + rec2_7.Width, rec2.Y );
  5423. Point p27_2 = new Point( p26_1.X + rec2_7.Width, rec2.Y + rec2.Height );
  5424. g.DrawLine( p, p27_1, p27_2 );//画第一表与第二列的界线
  5425. Rectangle rec2_8 = new Rectangle( p27_1.X + LeftAdd, rec2_3.Y, ColumnWidth2, RowContentHeight );
  5426. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 服务卡\r\n 充值" ), ft10, b, rec2_8 );//画第一列的列标题
  5427. Point p28_1 = new Point( p27_1.X + rec2_8.Width, rec2.Y );
  5428. Point p28_2 = new Point( p27_1.X + rec2_8.Width, rec2.Y + rec2.Height );
  5429. g.DrawLine( p, p28_1, p28_2 );//画第一表与第二列的界线
  5430. Rectangle rec2_9 = new Rectangle( p28_1.X + LeftAdd, rec2_3.Y, ColumnWidth2, RowContentHeight );
  5431. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 前期\r\n 业绩" ), ft10, b, rec2_9 );//画第一列的列标题
  5432. Point p29_1 = new Point( p28_1.X + rec2_9.Width, rec2.Y );
  5433. Point p29_2 = new Point( p28_1.X + rec2_9.Width, rec2.Y + rec2.Height );
  5434. g.DrawLine( p, p29_1, p29_2 );//画第一表与第二列的界线
  5435. Rectangle rec2_10 = new Rectangle( p29_1.X + LeftAdd, rec2_3.Y, ColumnWidth2, RowContentHeight );
  5436. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 后期\r\n 业绩" ), ft10, b, rec2_10 );//画第一列的列标题
  5437. Point p210_1 = new Point( p29_1.X + rec2_10.Width, rec2.Y );
  5438. Point p210_2 = new Point( p29_1.X + rec2_10.Width, rec2.Y + rec2.Height );
  5439. g.DrawLine( p, p210_1, p210_2 );//画第一表与第二列的界线
  5440. Rectangle rec2_11 = new Rectangle( p210_1.X + LeftAdd, rec2_1.Y, ColumnWidth2, RowContentHeight );
  5441. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "总业绩" ), ft10, b, rec2_11 );//画第一列的列标题
  5442. Point p211_1 = new Point( p210_1.X + rec2_11.Width, rec2.Y );
  5443. Point p211_2 = new Point( p210_1.X + rec2_11.Width, rec2.Y + rec2.Height );
  5444. g.DrawLine( p, p211_1, p211_2 );//画第一表与第二列的界线
  5445. Rectangle rec2_12 = new Rectangle( p211_1.X + LeftAdd, rec2_1.Y, ColumnWidth2, RowContentHeight );
  5446. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "总支出" ), ft10, b, rec2_12 );//画第一列的列标题
  5447. #endregion
  5448. #region 画行
  5449. int RowHeight2 = 25;
  5450. int RowContentHeight2 = RowHeight2 - (TopAdd * 2);
  5451. int IntPoint_Y = rec2.Y + rec2.Height;
  5452. for ( int i = 0; i < dgvData.Rows.Count; i++ )
  5453. {
  5454. Rectangle recfor = new Rectangle( rec2.X, IntPoint_Y, TableWidth, RowHeight2 );
  5455. g.DrawRectangle( p, recfor );//画标题矩形
  5456. string StrName = LYFZ.Command.Command_Validate.DateTimeToString( dgvData.Rows[i].Cells["日期"].Value, "MM-dd" );
  5457. Rectangle recfor2_1 = new Rectangle( recfor.X + LeftAdd, recfor.Y + TopAdd, ColumnWidth1 - (LeftAdd * 2), RowContentHeight2 );
  5458. g.DrawString( StrName, ft9, b, recfor2_1 );//画第一列的列标题
  5459. Point pfor1_1 = new Point( recfor.X + ColumnWidth1, recfor.Y );
  5460. Point pfor1_2 = new Point( recfor.X + ColumnWidth1, recfor.Y + recfor.Height );
  5461. g.DrawLine( p, pfor1_1, pfor1_2 );//画第一表与第二列的界线
  5462. string StrValue1 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero( dgvData.Rows[i].Cells["总收入"].Value );
  5463. sizef = g.MeasureString( StrValue1, ft9 );
  5464. int FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  5465. Rectangle recfor2_2 = new Rectangle( pfor1_1.X + ColumnWidth2 - FtWidth - LeftAdd, pfor1_1.Y + TopAdd, ColumnWidth2 - (LeftAdd * 2), RowContentHeight2 );
  5466. g.DrawString( StrValue1, ft9, b, recfor2_2 );//画第一列的列标题
  5467. Point pfor2_1 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y );
  5468. Point pfor2_2 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y + recfor.Height );
  5469. g.DrawLine( p, pfor2_1, pfor2_2 );//画第一表与第二列的界线
  5470. string StrValue2 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero( dgvData.Rows[i].Cells["订单定金"].Value );
  5471. sizef = g.MeasureString( StrValue2, ft9 );
  5472. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  5473. Rectangle recfor2_3 = new Rectangle( pfor2_1.X + ColumnWidth2 - FtWidth - LeftAdd, pfor2_1.Y + TopAdd, ColumnWidth2 - (LeftAdd * 2), RowContentHeight2 );
  5474. g.DrawString( StrValue2, ft9, b, recfor2_3 );//画第一列的列标题
  5475. Point pfor3_1 = new Point( pfor2_1.X + ColumnWidth2, recfor.Y );
  5476. Point pfor3_2 = new Point( pfor2_1.X + ColumnWidth2, recfor.Y + recfor.Height );
  5477. g.DrawLine( p, pfor3_1, pfor3_2 );//画第一表与第二列的界线
  5478. string StrValue3 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero( dgvData.Rows[i].Cells["订单补款"].Value );
  5479. sizef = g.MeasureString( StrValue3, ft9 );
  5480. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  5481. Rectangle recfor2_4 = new Rectangle( pfor3_1.X + ColumnWidth2 - FtWidth - LeftAdd, pfor3_1.Y + TopAdd, ColumnWidth2 - (LeftAdd * 2), RowContentHeight2 );
  5482. g.DrawString( StrValue3, ft9, b, recfor2_4 );//画第一列的列标题
  5483. Point pfor4_1 = new Point( pfor3_1.X + ColumnWidth2, recfor.Y );
  5484. Point pfor4_2 = new Point( pfor3_1.X + ColumnWidth2, recfor.Y + recfor.Height );
  5485. g.DrawLine( p, pfor4_1, pfor4_2 );//画第一表与第二列的界线
  5486. string StrValue4 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero( dgvData.Rows[i].Cells["后期收入"].Value );
  5487. sizef = g.MeasureString( StrValue4, ft9 );
  5488. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  5489. Rectangle recfor2_5 = new Rectangle( pfor4_1.X + ColumnWidth2 - FtWidth - LeftAdd, pfor4_1.Y + TopAdd, ColumnWidth2 - (LeftAdd * 2), RowContentHeight2 );
  5490. g.DrawString( StrValue4, ft9, b, recfor2_5 );//画第一列的列标题
  5491. Point pfor5_1 = new Point( pfor4_1.X + ColumnWidth2, recfor.Y );
  5492. Point pfor5_2 = new Point( pfor4_1.X + ColumnWidth2, recfor.Y + recfor.Height );
  5493. g.DrawLine( p, pfor5_1, pfor5_2 );//画第一表与第二列的界线
  5494. string StrValue5 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero( dgvData.Rows[i].Cells["其它收入"].Value );
  5495. sizef = g.MeasureString( StrValue5, ft9 );
  5496. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  5497. Rectangle recfor2_6 = new Rectangle( pfor5_1.X + ColumnWidth2 - FtWidth - LeftAdd, pfor5_1.Y + TopAdd, ColumnWidth2 - (LeftAdd * 2), RowContentHeight2 );
  5498. g.DrawString( StrValue5, ft9, b, recfor2_6 );//画第一列的列标题
  5499. Point pfor6_1 = new Point( pfor5_1.X + ColumnWidth2, recfor.Y );
  5500. Point pfor6_2 = new Point( pfor5_1.X + ColumnWidth2, recfor.Y + recfor.Height );
  5501. g.DrawLine( p, pfor6_1, pfor6_2 );//画第一表与第二列的界线
  5502. string StrValue6 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero( dgvData.Rows[i].Cells["会员充值"].Value );
  5503. sizef = g.MeasureString( StrValue6, ft9 );
  5504. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  5505. Rectangle recfor2_7 = new Rectangle( pfor6_1.X + ColumnWidth2 - FtWidth - LeftAdd, pfor6_1.Y + TopAdd, ColumnWidth2 - (LeftAdd * 2), RowContentHeight2 );
  5506. g.DrawString( StrValue6, ft9, b, recfor2_7 );//画第一列的列标题
  5507. Point pfor7_1 = new Point( pfor6_1.X + ColumnWidth2, recfor.Y );
  5508. Point pfor7_2 = new Point( pfor6_1.X + ColumnWidth2, recfor.Y + recfor.Height );
  5509. g.DrawLine( p, pfor7_1, pfor7_2 );//画第一表与第二列的界线
  5510. string StrValue7 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero( dgvData.Rows[i].Cells["服务卡充值"].Value );
  5511. sizef = g.MeasureString( StrValue7, ft9 );
  5512. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  5513. Rectangle recfor2_8 = new Rectangle( pfor7_1.X + ColumnWidth2 - FtWidth - LeftAdd, pfor7_1.Y + TopAdd, ColumnWidth2 - (LeftAdd * 2), RowContentHeight2 );
  5514. g.DrawString( StrValue7, ft9, b, recfor2_8 );//画第一列的列标题
  5515. Point pfor8_1 = new Point( pfor7_1.X + ColumnWidth2, recfor.Y );
  5516. Point pfor8_2 = new Point( pfor7_1.X + ColumnWidth2, recfor.Y + recfor.Height );
  5517. g.DrawLine( p, pfor8_1, pfor8_2 );//画第一表与第二列的界线
  5518. string StrValue8 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero( dgvData.Rows[i].Cells["前期业绩"].Value );
  5519. sizef = g.MeasureString( StrValue8, ft9 );
  5520. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  5521. Rectangle recfor2_9 = new Rectangle( pfor8_1.X + ColumnWidth2 - FtWidth - LeftAdd, pfor8_1.Y + TopAdd, ColumnWidth2 - (LeftAdd * 2), RowContentHeight2 );
  5522. g.DrawString( StrValue8, ft9, b, recfor2_9 );//画第一列的列标题
  5523. Point pfor9_1 = new Point( pfor8_1.X + ColumnWidth2, recfor.Y );
  5524. Point pfor9_2 = new Point( pfor8_1.X + ColumnWidth2, recfor.Y + recfor.Height );
  5525. g.DrawLine( p, pfor9_1, pfor9_2 );//画第一表与第二列的界线
  5526. string StrValue9 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero( dgvData.Rows[i].Cells["后期业绩"].Value );
  5527. sizef = g.MeasureString( StrValue9, ft9 );
  5528. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  5529. Rectangle recfor2_10 = new Rectangle( pfor9_1.X + ColumnWidth2 - FtWidth - LeftAdd, pfor9_1.Y + TopAdd, ColumnWidth2 - (LeftAdd * 2), RowContentHeight2 );
  5530. g.DrawString( StrValue9, ft9, b, recfor2_10 );//画第一列的列标题
  5531. Point pfor10_1 = new Point( pfor9_1.X + ColumnWidth2, recfor.Y );
  5532. Point pfor10_2 = new Point( pfor9_1.X + ColumnWidth2, recfor.Y + recfor.Height );
  5533. g.DrawLine( p, pfor10_1, pfor10_2 );//画第一表与第二列的界线
  5534. string StrValue10 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero( dgvData.Rows[i].Cells["总业绩"].Value );
  5535. sizef = g.MeasureString( StrValue10, ft9 );
  5536. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  5537. Rectangle recfor2_11 = new Rectangle( pfor10_1.X + ColumnWidth2 - FtWidth - LeftAdd, pfor10_1.Y + TopAdd, ColumnWidth2 - (LeftAdd * 2), RowContentHeight2 );
  5538. g.DrawString( StrValue10, ft9, b, recfor2_11 );//画第一列的列标题
  5539. Point pfor11_1 = new Point( pfor10_1.X + ColumnWidth2, recfor.Y );
  5540. Point pfor11_2 = new Point( pfor10_1.X + ColumnWidth2, recfor.Y + recfor.Height );
  5541. g.DrawLine( p, pfor11_1, pfor11_2 );//画第一表与第二列的界线
  5542. string StrValue11 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero( dgvData.Rows[i].Cells["总支出"].Value );
  5543. sizef = g.MeasureString( StrValue11, ft9 );
  5544. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  5545. Rectangle recfor2_12 = new Rectangle( pfor11_1.X + ColumnWidth2 - FtWidth - LeftAdd, pfor11_1.Y + TopAdd, ColumnWidth2 - (LeftAdd * 2), RowContentHeight2 );
  5546. g.DrawString( StrValue11, ft9, b, recfor2_12 );//画第一列的列标题
  5547. IntPoint_Y = recfor.Y + recfor.Height;
  5548. }
  5549. #endregion
  5550. Rectangle rec3 = new Rectangle( rec2.X, IntPoint_Y, TableWidth, RowHeight * 2 );
  5551. g.DrawRectangle( p, rec2 );//画标题矩形
  5552. Rectangle rec3_1 = new Rectangle( rec3.X, rec3.Y + 5, TableWidth, rec3.Height - TopAdd * 2 );
  5553. g.DrawString( StrText.Trim(), ft9, b, rec3_1 );//画第一列的列标题
  5554. }
  5555. #endregion
  5556. #region 年报表
  5557. /// <summary>
  5558. /// 年财务报表
  5559. /// </summary>
  5560. /// <param name="dgvData">数据列表</param>
  5561. /// <param name="StrOrd_Number">数据总汇:</param>
  5562. public static void FinanceReportYear( object objValue, Graphics g, Size size )
  5563. {
  5564. Hashtable htData = (Hashtable)objValue;
  5565. DataGridViewEc dgvData = (DataGridViewEc)htData["dgvData"];
  5566. string StrText = htData["StrText"].ToString().Trim();
  5567. string StrDateWeek = htData["StrDateWeek"].ToString().Trim();
  5568. DataTable tbl = orbll.GetView_Custom( "tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Name" ).Tables[0];
  5569. if ( tbl.Rows.Count <= 0 )
  5570. {
  5571. MessageBoxCustom.Show( "未设置影楼信息" ); return;
  5572. }
  5573. Brush b = Brushes.Black;
  5574. Pen p = GetPen;
  5575. Font ft18 = new Font( "宋体", 18 );
  5576. Font ft10 = new Font( "宋体", 10 );
  5577. Font ft9 = new Font( "宋体", 7.5f );
  5578. int LeftWidth = 30;
  5579. int TableWidth = size.Width - LeftWidth * 2 + 31;
  5580. int LeftAdd = 2;
  5581. int TopAdd = 7;
  5582. int RowHeight = 45;
  5583. int RowContentHeight = 45;
  5584. int ColumnWidth1 = 50;
  5585. int ColumnWidth2 = (TableWidth - ColumnWidth1) / 11;
  5586. //金色童年收据凭据
  5587. string rec2Value = tbl.Rows[0]["Company_Name"].ToString().Trim() + StrDateWeek + "账务报表";
  5588. SizeF sizef = g.MeasureString( rec2Value, ft18 );
  5589. int StrHeigth = Convert.ToInt32( sizef.Height );
  5590. int StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  5591. Rectangle rec1 = new Rectangle( (size.Width - StrWidth) / 2, 50, StrWidth, StrHeigth );
  5592. g.DrawString( rec2Value, ft18, b, rec1 );
  5593. 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";
  5594. sizef = g.MeasureString( StrValue, ft9 );
  5595. StrHeigth = Convert.ToInt32( sizef.Height );
  5596. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  5597. Rectangle rec1_1 = new Rectangle( LeftWidth + TableWidth - StrWidth, rec1.Y + rec1.Height + 5, StrWidth, StrHeigth );
  5598. g.DrawString( StrValue, ft9, b, rec1_1 );//画消费法规
  5599. #region 画列标题
  5600. Rectangle rec2 = new Rectangle( LeftWidth, rec1_1.Y + rec1_1.Height, TableWidth, RowHeight );
  5601. g.DrawRectangle( p, rec2 );//画标题矩形
  5602. Rectangle rec2_1 = new Rectangle( rec2.X + LeftAdd, rec2.Y + 10 + TopAdd, ColumnWidth1, RowContentHeight );
  5603. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "月份" ), ft10, b, rec2_1 );//画第一列的列标题
  5604. Point p21_1 = new Point( rec2.X + rec2_1.Width, rec2.Y );
  5605. Point p21_2 = new Point( rec2.X + rec2_1.Width, rec2.Y + rec2.Height );
  5606. g.DrawLine( p, p21_1, p21_2 );//画第一表与第二列的界线
  5607. Rectangle rec2_2 = new Rectangle( p21_1.X + LeftAdd, rec2_1.Y, ColumnWidth2, RowContentHeight );
  5608. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "总收入" ), ft10, b, rec2_2 );//画第一列的列标题
  5609. Point p22_1 = new Point( p21_1.X + rec2_2.Width, rec2.Y );
  5610. Point p22_2 = new Point( p21_1.X + rec2_2.Width, rec2.Y + rec2.Height );
  5611. g.DrawLine( p, p22_1, p22_2 );//画第一表与第二列的界线
  5612. Rectangle rec2_3 = new Rectangle( p22_1.X + LeftAdd, p22_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
  5613. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 订单\r\n 收入" ), ft10, b, rec2_3 );//画第一列的列标题
  5614. Point p23_1 = new Point( p22_1.X + rec2_3.Width, rec2.Y );
  5615. Point p23_2 = new Point( p22_1.X + rec2_3.Width, rec2.Y + rec2.Height );
  5616. g.DrawLine( p, p23_1, p23_2 );//画第一表与第二列的界线
  5617. Rectangle rec2_4 = new Rectangle( p23_1.X + LeftAdd, rec2_3.Y, ColumnWidth2, RowContentHeight );
  5618. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 补款\r\n 收入" ), ft10, b, rec2_4 );//画第一列的列标题
  5619. Point p24_1 = new Point( p23_1.X + rec2_4.Width, rec2.Y );
  5620. Point p24_2 = new Point( p23_1.X + rec2_4.Width, rec2.Y + rec2.Height );
  5621. g.DrawLine( p, p24_1, p24_2 );//画第一表与第二列的界线
  5622. Rectangle rec2_5 = new Rectangle( p24_1.X + LeftAdd, rec2_3.Y, ColumnWidth2, RowContentHeight );
  5623. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 后期\r\n 收入" ), ft10, b, rec2_5 );//画第一列的列标题
  5624. Point p25_1 = new Point( p24_1.X + rec2_5.Width, rec2.Y );
  5625. Point p25_2 = new Point( p24_1.X + rec2_5.Width, rec2.Y + rec2.Height );
  5626. g.DrawLine( p, p25_1, p25_2 );//画第一表与第二列的界线
  5627. Rectangle rec2_6 = new Rectangle( p25_1.X + LeftAdd, rec2_3.Y, ColumnWidth2, RowContentHeight );
  5628. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 其他\r\n 收入" ), ft10, b, rec2_6 );//画第一列的列标题
  5629. Point p26_1 = new Point( p25_1.X + rec2_6.Width, rec2.Y );
  5630. Point p26_2 = new Point( p25_1.X + rec2_6.Width, rec2.Y + rec2.Height );
  5631. g.DrawLine( p, p26_1, p26_2 );//画第一表与第二列的界线
  5632. Rectangle rec2_7 = new Rectangle( p26_1.X + LeftAdd, rec2_3.Y, ColumnWidth2, RowContentHeight );
  5633. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 会员\r\n 充值" ), ft10, b, rec2_7 );//画第一列的列标题
  5634. Point p27_1 = new Point( p26_1.X + rec2_7.Width, rec2.Y );
  5635. Point p27_2 = new Point( p26_1.X + rec2_7.Width, rec2.Y + rec2.Height );
  5636. g.DrawLine( p, p27_1, p27_2 );//画第一表与第二列的界线
  5637. Rectangle rec2_8 = new Rectangle( p27_1.X + LeftAdd, rec2_3.Y, ColumnWidth2, RowContentHeight );
  5638. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 服务卡\r\n 充值" ), ft10, b, rec2_8 );//画第一列的列标题
  5639. Point p28_1 = new Point( p27_1.X + rec2_8.Width, rec2.Y );
  5640. Point p28_2 = new Point( p27_1.X + rec2_8.Width, rec2.Y + rec2.Height );
  5641. g.DrawLine( p, p28_1, p28_2 );//画第一表与第二列的界线
  5642. Rectangle rec2_9 = new Rectangle( p28_1.X + LeftAdd, rec2_3.Y, ColumnWidth2, RowContentHeight );
  5643. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 前期\r\n 业绩" ), ft10, b, rec2_9 );//画第一列的列标题
  5644. Point p29_1 = new Point( p28_1.X + rec2_9.Width, rec2.Y );
  5645. Point p29_2 = new Point( p28_1.X + rec2_9.Width, rec2.Y + rec2.Height );
  5646. g.DrawLine( p, p29_1, p29_2 );//画第一表与第二列的界线
  5647. Rectangle rec2_10 = new Rectangle( p29_1.X + LeftAdd, rec2_3.Y, ColumnWidth2, RowContentHeight );
  5648. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 后期\r\n 业绩" ), ft10, b, rec2_10 );//画第一列的列标题
  5649. Point p210_1 = new Point( p29_1.X + rec2_10.Width, rec2.Y );
  5650. Point p210_2 = new Point( p29_1.X + rec2_10.Width, rec2.Y + rec2.Height );
  5651. g.DrawLine( p, p210_1, p210_2 );//画第一表与第二列的界线
  5652. Rectangle rec2_11 = new Rectangle( p210_1.X + LeftAdd, rec2_1.Y, ColumnWidth2, RowContentHeight );
  5653. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "总业绩" ), ft10, b, rec2_11 );//画第一列的列标题
  5654. Point p211_1 = new Point( p210_1.X + rec2_11.Width, rec2.Y );
  5655. Point p211_2 = new Point( p210_1.X + rec2_11.Width, rec2.Y + rec2.Height );
  5656. g.DrawLine( p, p211_1, p211_2 );//画第一表与第二列的界线
  5657. Rectangle rec2_12 = new Rectangle( p211_1.X + LeftAdd, rec2_1.Y, ColumnWidth2, RowContentHeight );
  5658. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "总支出" ), ft10, b, rec2_12 );//画第一列的列标题
  5659. #endregion
  5660. #region 画行
  5661. int RowHeight2 = 25;
  5662. int RowContentHeight2 = RowHeight2 - (TopAdd * 2);
  5663. int IntPoint_Y = rec2.Y + rec2.Height;
  5664. for ( int i = 0; i < dgvData.Rows.Count; i++ )
  5665. {
  5666. Rectangle recfor = new Rectangle( rec2.X, IntPoint_Y, TableWidth, RowHeight2 );
  5667. g.DrawRectangle( p, recfor );//画标题矩形
  5668. string StrName = LYFZ.Command.Command_Validate.DateTimeToString( dgvData.Rows[i].Cells["月份"].Value, "yyyy-MM" );
  5669. Rectangle recfor2_1 = new Rectangle( recfor.X + LeftAdd, recfor.Y + TopAdd, ColumnWidth1 - (LeftAdd * 2), RowContentHeight2 );
  5670. g.DrawString( StrName, ft9, b, recfor2_1 );//画第一列的列标题
  5671. Point pfor1_1 = new Point( recfor.X + ColumnWidth1, recfor.Y );
  5672. Point pfor1_2 = new Point( recfor.X + ColumnWidth1, recfor.Y + recfor.Height );
  5673. g.DrawLine( p, pfor1_1, pfor1_2 );//画第一表与第二列的界线
  5674. string StrValue1 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero( dgvData.Rows[i].Cells["总收入"].Value );
  5675. sizef = g.MeasureString( StrValue1, ft9 );
  5676. int FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  5677. Rectangle recfor2_2 = new Rectangle( pfor1_1.X + ColumnWidth2 - FtWidth - LeftAdd, pfor1_1.Y + TopAdd, ColumnWidth2 - (LeftAdd * 2), RowContentHeight2 );
  5678. g.DrawString( StrValue1, ft9, b, recfor2_2 );//画第一列的列标题
  5679. Point pfor2_1 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y );
  5680. Point pfor2_2 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y + recfor.Height );
  5681. g.DrawLine( p, pfor2_1, pfor2_2 );//画第一表与第二列的界线
  5682. string StrValue2 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero( dgvData.Rows[i].Cells["订单定金"].Value );
  5683. sizef = g.MeasureString( StrValue2, ft9 );
  5684. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  5685. Rectangle recfor2_3 = new Rectangle( pfor2_1.X + ColumnWidth2 - FtWidth - LeftAdd, pfor2_1.Y + TopAdd, ColumnWidth2 - (LeftAdd * 2), RowContentHeight2 );
  5686. g.DrawString( StrValue2, ft9, b, recfor2_3 );//画第一列的列标题
  5687. Point pfor3_1 = new Point( pfor2_1.X + ColumnWidth2, recfor.Y );
  5688. Point pfor3_2 = new Point( pfor2_1.X + ColumnWidth2, recfor.Y + recfor.Height );
  5689. g.DrawLine( p, pfor3_1, pfor3_2 );//画第一表与第二列的界线
  5690. string StrValue3 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero( dgvData.Rows[i].Cells["订单补款"].Value );
  5691. sizef = g.MeasureString( StrValue3, ft9 );
  5692. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  5693. Rectangle recfor2_4 = new Rectangle( pfor3_1.X + ColumnWidth2 - FtWidth - LeftAdd, pfor3_1.Y + TopAdd, ColumnWidth2 - (LeftAdd * 2), RowContentHeight2 );
  5694. g.DrawString( StrValue3, ft9, b, recfor2_4 );//画第一列的列标题
  5695. Point pfor4_1 = new Point( pfor3_1.X + ColumnWidth2, recfor.Y );
  5696. Point pfor4_2 = new Point( pfor3_1.X + ColumnWidth2, recfor.Y + recfor.Height );
  5697. g.DrawLine( p, pfor4_1, pfor4_2 );//画第一表与第二列的界线
  5698. string StrValue4 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero( dgvData.Rows[i].Cells["后期收入"].Value );
  5699. sizef = g.MeasureString( StrValue4, ft9 );
  5700. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  5701. Rectangle recfor2_5 = new Rectangle( pfor4_1.X + ColumnWidth2 - FtWidth - LeftAdd, pfor4_1.Y + TopAdd, ColumnWidth2 - (LeftAdd * 2), RowContentHeight2 );
  5702. g.DrawString( StrValue4, ft9, b, recfor2_5 );//画第一列的列标题
  5703. Point pfor5_1 = new Point( pfor4_1.X + ColumnWidth2, recfor.Y );
  5704. Point pfor5_2 = new Point( pfor4_1.X + ColumnWidth2, recfor.Y + recfor.Height );
  5705. g.DrawLine( p, pfor5_1, pfor5_2 );//画第一表与第二列的界线
  5706. string StrValue5 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero( dgvData.Rows[i].Cells["其它收入"].Value );
  5707. sizef = g.MeasureString( StrValue5, ft9 );
  5708. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  5709. Rectangle recfor2_6 = new Rectangle( pfor5_1.X + ColumnWidth2 - FtWidth - LeftAdd, pfor5_1.Y + TopAdd, ColumnWidth2 - (LeftAdd * 2), RowContentHeight2 );
  5710. g.DrawString( StrValue5, ft9, b, recfor2_6 );//画第一列的列标题
  5711. Point pfor6_1 = new Point( pfor5_1.X + ColumnWidth2, recfor.Y );
  5712. Point pfor6_2 = new Point( pfor5_1.X + ColumnWidth2, recfor.Y + recfor.Height );
  5713. g.DrawLine( p, pfor6_1, pfor6_2 );//画第一表与第二列的界线
  5714. string StrValue6 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero( dgvData.Rows[i].Cells["会员充值"].Value );
  5715. sizef = g.MeasureString( StrValue6, ft9 );
  5716. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  5717. Rectangle recfor2_7 = new Rectangle( pfor6_1.X + ColumnWidth2 - FtWidth - LeftAdd, pfor6_1.Y + TopAdd, ColumnWidth2 - (LeftAdd * 2), RowContentHeight2 );
  5718. g.DrawString( StrValue6, ft9, b, recfor2_7 );//画第一列的列标题
  5719. Point pfor7_1 = new Point( pfor6_1.X + ColumnWidth2, recfor.Y );
  5720. Point pfor7_2 = new Point( pfor6_1.X + ColumnWidth2, recfor.Y + recfor.Height );
  5721. g.DrawLine( p, pfor7_1, pfor7_2 );//画第一表与第二列的界线
  5722. string StrValue7 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero( dgvData.Rows[i].Cells["服务卡充值"].Value );
  5723. sizef = g.MeasureString( StrValue7, ft9 );
  5724. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  5725. Rectangle recfor2_8 = new Rectangle( pfor7_1.X + ColumnWidth2 - FtWidth - LeftAdd, pfor7_1.Y + TopAdd, ColumnWidth2 - (LeftAdd * 2), RowContentHeight2 );
  5726. g.DrawString( StrValue7, ft9, b, recfor2_8 );//画第一列的列标题
  5727. Point pfor8_1 = new Point( pfor7_1.X + ColumnWidth2, recfor.Y );
  5728. Point pfor8_2 = new Point( pfor7_1.X + ColumnWidth2, recfor.Y + recfor.Height );
  5729. g.DrawLine( p, pfor8_1, pfor8_2 );//画第一表与第二列的界线
  5730. string StrValue8 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero( dgvData.Rows[i].Cells["前期业绩"].Value );
  5731. sizef = g.MeasureString( StrValue8, ft9 );
  5732. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  5733. Rectangle recfor2_9 = new Rectangle( pfor8_1.X + ColumnWidth2 - FtWidth - LeftAdd, pfor8_1.Y + TopAdd, ColumnWidth2 - (LeftAdd * 2), RowContentHeight2 );
  5734. g.DrawString( StrValue8, ft9, b, recfor2_9 );//画第一列的列标题
  5735. Point pfor9_1 = new Point( pfor8_1.X + ColumnWidth2, recfor.Y );
  5736. Point pfor9_2 = new Point( pfor8_1.X + ColumnWidth2, recfor.Y + recfor.Height );
  5737. g.DrawLine( p, pfor9_1, pfor9_2 );//画第一表与第二列的界线
  5738. string StrValue9 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero( dgvData.Rows[i].Cells["后期业绩"].Value );
  5739. sizef = g.MeasureString( StrValue9, ft9 );
  5740. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  5741. Rectangle recfor2_10 = new Rectangle( pfor9_1.X + ColumnWidth2 - FtWidth - LeftAdd, pfor9_1.Y + TopAdd, ColumnWidth2 - (LeftAdd * 2), RowContentHeight2 );
  5742. g.DrawString( StrValue9, ft9, b, recfor2_10 );//画第一列的列标题
  5743. Point pfor10_1 = new Point( pfor9_1.X + ColumnWidth2, recfor.Y );
  5744. Point pfor10_2 = new Point( pfor9_1.X + ColumnWidth2, recfor.Y + recfor.Height );
  5745. g.DrawLine( p, pfor10_1, pfor10_2 );//画第一表与第二列的界线
  5746. string StrValue10 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero( dgvData.Rows[i].Cells["总业绩"].Value );
  5747. sizef = g.MeasureString( StrValue10, ft9 );
  5748. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  5749. Rectangle recfor2_11 = new Rectangle( pfor10_1.X + ColumnWidth2 - FtWidth - LeftAdd, pfor10_1.Y + TopAdd, ColumnWidth2 - (LeftAdd * 2), RowContentHeight2 );
  5750. g.DrawString( StrValue10, ft9, b, recfor2_11 );//画第一列的列标题
  5751. Point pfor11_1 = new Point( pfor10_1.X + ColumnWidth2, recfor.Y );
  5752. Point pfor11_2 = new Point( pfor10_1.X + ColumnWidth2, recfor.Y + recfor.Height );
  5753. g.DrawLine( p, pfor11_1, pfor11_2 );//画第一表与第二列的界线
  5754. string StrValue11 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero( dgvData.Rows[i].Cells["总支出"].Value );
  5755. sizef = g.MeasureString( StrValue11, ft9 );
  5756. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  5757. Rectangle recfor2_12 = new Rectangle( pfor11_1.X + ColumnWidth2 - FtWidth - LeftAdd, pfor11_1.Y + TopAdd, ColumnWidth2 - (LeftAdd * 2), RowContentHeight2 );
  5758. g.DrawString( StrValue11, ft9, b, recfor2_12 );//画第一列的列标题
  5759. IntPoint_Y = recfor.Y + recfor.Height;
  5760. }
  5761. #endregion
  5762. Rectangle rec3 = new Rectangle( rec2.X, IntPoint_Y, TableWidth, RowHeight * 2 );
  5763. g.DrawRectangle( p, rec2 );//画标题矩形
  5764. Rectangle rec3_1 = new Rectangle( rec3.X, rec3.Y + 5, TableWidth, rec3.Height - TopAdd * 2 );
  5765. g.DrawString( StrText.Trim(), ft9, b, rec3_1 );//画第一列的列标题
  5766. }
  5767. #endregion
  5768. #endregion
  5769. #region 拍照明细
  5770. /// <summary>
  5771. /// 摄控本拍照客人——明细
  5772. /// </summary>
  5773. /// <returns></returns>
  5774. public static void CameraControlBook_PhotographsGuestDetail_Print( object objValue, Graphics g, Size size )
  5775. {
  5776. Hashtable htData = (Hashtable)objValue;
  5777. ArrayList Alist = (ArrayList)htData["Alist"];
  5778. Brush b = Brushes.Black;
  5779. Pen p = GetPen;
  5780. Font ft17 = new Font( "宋体", 17 );
  5781. Font ft9 = new Font( "宋体", 9 );
  5782. Font ft9b = new Font( "宋体", 9, FontStyle.Bold );
  5783. Font ft8 = new Font( "宋体", 8 );
  5784. int LeftWidth = 30;
  5785. int TableWidth = size.Width - LeftWidth * 2;
  5786. int LeftAdd = 3;
  5787. int TopAdd = 5;
  5788. int RowHeight = 35;
  5789. int RowContentHeight = 35;
  5790. //金色童年收据凭据
  5791. SizeF sizef = g.MeasureString( DefaultPrintTitle, ft17 );
  5792. int StrHeigth = Convert.ToInt32( sizef.Height );
  5793. int StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  5794. Rectangle rec1 = new Rectangle( (size.Width - StrWidth) / 2, 50, StrWidth, StrHeigth );
  5795. g.DrawString( DefaultPrintTitle, ft17, b, rec1 );
  5796. int ColumnWidth1 = 0;
  5797. int ColumnWidth2 = 0;
  5798. int ColumnWidth4 = 0;
  5799. int ColumnWidth5 = 0;
  5800. int ColumnWidth6 = 0;
  5801. int ColumnWidth7 = 0;
  5802. int ColumnWidth8 = 0;
  5803. int ColumnWidth9 = 0;
  5804. int ColumnWidth3 = 0;
  5805. if ( htData["Ver"].ToString().Trim() == "1" || htData["Ver"].ToString().Trim() == "-1" )
  5806. {
  5807. ColumnWidth1 = 60;
  5808. ColumnWidth2 = 80;
  5809. ColumnWidth4 = 70;
  5810. ColumnWidth5 = 60;
  5811. ColumnWidth6 = 60;
  5812. ColumnWidth7 = 60;
  5813. ColumnWidth8 = 80;
  5814. ColumnWidth9 = 60;
  5815. ColumnWidth3 = TableWidth - ColumnWidth1 - ColumnWidth2 - ColumnWidth4 - ColumnWidth5 - ColumnWidth6 - ColumnWidth7 - ColumnWidth8 - ColumnWidth9;
  5816. }
  5817. else
  5818. {
  5819. ColumnWidth1 = 60;
  5820. ColumnWidth2 = 80;
  5821. ColumnWidth4 = 70;
  5822. ColumnWidth5 = 60;
  5823. ColumnWidth6 = 60;
  5824. ColumnWidth7 = 60;
  5825. ColumnWidth8 = 80;
  5826. ColumnWidth3 = TableWidth - ColumnWidth1 - ColumnWidth2 - ColumnWidth4 - ColumnWidth5 - ColumnWidth6 - ColumnWidth7 - ColumnWidth8;
  5827. }
  5828. #region 画列标题
  5829. Rectangle rec2 = new Rectangle( LeftWidth, rec1.Y + rec1.Height + 10, TableWidth, RowHeight );
  5830. g.DrawRectangle( p, rec2 );//画标题矩形
  5831. Rectangle rec2_1 = new Rectangle( rec2.X + LeftAdd + 10, rec2.Y + TopAdd + 5, ColumnWidth1, RowContentHeight );
  5832. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客人" ), ft9b, b, rec2_1 );//画第一列的列标题
  5833. Point p1_1 = new Point( rec2.X + ColumnWidth1, rec2.Y );
  5834. Point p1_2 = new Point( rec2.X + ColumnWidth1, rec2.Y + rec2.Height );
  5835. g.DrawLine( p, p1_1, p1_2 );//画第一表与第二列的界线
  5836. Rectangle rec2_2 = new Rectangle( p1_1.X + LeftAdd + 10, rec2_1.Y, ColumnWidth2, RowContentHeight );
  5837. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "电话" ), ft9b, b, rec2_2 );//画第一列的列标题
  5838. Point p2_1 = new Point( p1_1.X + ColumnWidth2, rec2.Y );
  5839. Point p2_2 = new Point( p1_1.X + ColumnWidth2, rec2.Y + rec2.Height );
  5840. g.DrawLine( p, p2_1, p2_2 );//画第一表与第二列的界线
  5841. Rectangle rec2_3 = new Rectangle( p2_1.X + LeftAdd + 30, rec2_1.Y, ColumnWidth3, RowContentHeight );
  5842. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "拍摄名称" ), ft9b, b, rec2_3 );//画第一列的列标题
  5843. Point p3_1 = new Point( p2_1.X + ColumnWidth3, rec2.Y );
  5844. Point p3_2 = new Point( p2_1.X + ColumnWidth3, rec2.Y + rec2.Height );
  5845. g.DrawLine( p, p3_1, p3_2 );//画第一表与第二列的界线
  5846. Rectangle rec2_4 = new Rectangle( p3_1.X + LeftAdd + 10, p3_1.Y + TopAdd, ColumnWidth4, RowContentHeight );
  5847. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 日期\r\n/时间" ), ft9b, b, rec2_4 );//画第一列的列标题
  5848. Point p4_1 = new Point( p3_1.X + ColumnWidth4, rec2.Y );
  5849. Point p4_2 = new Point( p3_1.X + ColumnWidth4, rec2.Y + rec2.Height );
  5850. g.DrawLine( p, p4_1, p4_2 );//画第一表与第二列的界线
  5851. Rectangle rec2_5 = new Rectangle( p4_1.X + LeftAdd + 5, rec2_4.Y, ColumnWidth5, RowContentHeight );
  5852. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "摄影师\r\n/助理" ), ft9b, b, rec2_5 );//画第一列的列标题
  5853. Point p5_1 = new Point( p4_1.X + ColumnWidth5, rec2.Y );
  5854. Point p5_2 = new Point( p4_1.X + ColumnWidth5, rec2.Y + rec2.Height );
  5855. g.DrawLine( p, p5_1, p5_2 );//画第一表与第二列的界线
  5856. Rectangle rec2_6 = new Rectangle( p5_1.X + LeftAdd + 5, rec2_4.Y, ColumnWidth6, RowContentHeight );
  5857. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "化妆师\r\n/助理" ), ft9b, b, rec2_6 );//画第一列的列标题
  5858. Point p6_1 = new Point( p5_1.X + ColumnWidth6, rec2.Y );
  5859. Point p6_2 = new Point( p5_1.X + ColumnWidth6, rec2.Y + rec2.Height );
  5860. g.DrawLine( p, p6_1, p6_2 );//画第一表与第二列的界线
  5861. Rectangle rec2_7 = new Rectangle( p6_1.X + LeftAdd + 5, rec2_4.Y, ColumnWidth7, RowContentHeight );
  5862. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "服装师\r\n/服装数" ), ft9b, b, rec2_7 );//画第一列的列标题
  5863. Point p7_1 = new Point( p6_1.X + ColumnWidth7, rec2.Y );
  5864. Point p7_2 = new Point( p6_1.X + ColumnWidth7, rec2.Y + rec2.Height );
  5865. g.DrawLine( p, p7_1, p7_2 );//画第一表与第二列的界线
  5866. Rectangle rec2_8 = new Rectangle( p7_1.X + LeftAdd + 10, rec2_1.Y, ColumnWidth8, RowContentHeight );
  5867. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "门市" ), ft9b, b, rec2_8 );//画第一列的列标题
  5868. if ( htData["Ver"].ToString().Trim() == "1" || htData["Ver"].ToString().Trim() == "-1" )
  5869. {
  5870. Point p8_1 = new Point( p7_1.X + ColumnWidth8, rec2.Y );
  5871. Point p8_2 = new Point( p7_1.X + ColumnWidth8, rec2.Y + rec2.Height );
  5872. g.DrawLine( p, p8_1, p8_2 );//画第一表与第二列的界线
  5873. Rectangle rec2_9 = new Rectangle( p8_1.X + LeftAdd + 5, rec2_4.Y, ColumnWidth9, RowContentHeight );
  5874. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "引导师\r\n/助理" ), ft9b, b, rec2_9 );//画第一列的列标题
  5875. }
  5876. #endregion
  5877. #region 画行
  5878. DataTable newTable = new DataTable();
  5879. string StrWhere = "";
  5880. for ( int i = 0; i < Alist.Count; i++ )
  5881. {
  5882. string[] StrArray = Alist[i].ToString().Trim().Split( '|' );
  5883. StrWhere += "'" + StrArray[0].Trim() + "',";
  5884. }
  5885. if ( !string.IsNullOrEmpty( StrWhere.Trim() ) )
  5886. {
  5887. StrWhere = " Where Ordv_ViceNumber in (" + StrWhere.TrimEnd( ',' ) + ")";
  5888. newTable = LYFZ.BLL.BLL_ErpOrderView.GetData_CameraControlBookPhotographed_DetailPrint( StrWhere );
  5889. newTable.PrimaryKey = new DataColumn[] { newTable.Columns["Ordv_ViceNumber"] };
  5890. }
  5891. int RowHeight2 = 34;
  5892. int RowContentHeight2 = RowHeight2 - (TopAdd * 2);
  5893. int IntPoint_X = rec2.X;
  5894. int IntPoint_Y = rec2.Y + rec2.Height;
  5895. for ( int i = 0; i < Alist.Count; i++ )
  5896. {
  5897. if ( i >= 26 )
  5898. {
  5899. break;
  5900. }
  5901. string[] StrArray = Alist[i].ToString().Trim().Split( '|' );
  5902. string StrColName = "Ordpg_ReservationPhotographyTime AS 拍摄时间,((case when Ordpg_SightsType = '0' then '内景:' else '外景:' end) + cast(Ordpg_ApparelQuantity AS varchar(10)) + '套') AS 服装数," +
  5903. "Ordpg_ReservationPhotographyName AS 摄影师,Ordpg_ReservationPhotographyAssistant AS 摄影助理," +
  5904. "Ordpg_ReservationMakeupArtist AS 化妆师,Ordpg_ReservationMakeupAssistant AS 化妆助理," +
  5905. "Ordpg_ReservationBootDivision AS 引导师,Ordpg_ReservationBootDivisionAssistant AS 引导助理 ";
  5906. DataTable ordSights = orbll.GetView_Custom( "tb_ErpOrdersPhotography", StrWhere: "Ordpg_ViceNumber = '" + StrArray[0].Trim() + "' And Ordpg_Sights = '" + StrArray[1].Trim() + "'", ShowColumnName: StrColName ).Tables[0];
  5907. if ( ordSights.Rows.Count <= 0 )
  5908. {
  5909. MessageBoxCustom.Show( "获取订单安排人员错误" ); return;
  5910. }
  5911. DataRow dtRow = newTable.Rows.Find( StrArray[0].Trim() );
  5912. Rectangle recfor = new Rectangle( IntPoint_X, IntPoint_Y, TableWidth, RowHeight2 );
  5913. g.DrawRectangle( p, recfor );//画标题矩形
  5914. string StrName = dtRow["主客户姓名"].ToString().Trim().Replace( "/", "," );
  5915. if ( dtRow["订单类型"].ToString().Trim() != "写真订单" )
  5916. {
  5917. StrName = dtRow["客户姓名"].ToString().Trim();
  5918. }
  5919. Rectangle recfor2_1 = new Rectangle( recfor.X + LeftAdd, recfor.Y + TopAdd, ColumnWidth1 - (LeftAdd * 2), RowContentHeight2 );
  5920. g.DrawString( StrName, ft8, b, recfor2_1 );//画第一列的列标题
  5921. Point pfor1_1 = new Point( recfor.X + ColumnWidth1, recfor.Y );
  5922. Point pfor1_2 = new Point( recfor.X + ColumnWidth1, recfor.Y + recfor.Height );
  5923. g.DrawLine( p, pfor1_1, pfor1_2 );//画第一表与第二列的界线
  5924. string StrPhone = dtRow["主客户电话"].ToString().Trim().Replace( "/", "," );
  5925. if ( dtRow["订单类型"].ToString().Trim() != "写真订单" )
  5926. {
  5927. StrPhone = dtRow["客户电话"].ToString().Trim();
  5928. }
  5929. Rectangle recfor2_2 = new Rectangle( pfor1_1.X + LeftAdd, pfor1_1.Y + TopAdd, ColumnWidth2 - (LeftAdd * 2), RowContentHeight2 );
  5930. g.DrawString( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( StrPhone ), ft8, b, recfor2_2 );//画第一列的列标题
  5931. Point pfor2_1 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y );
  5932. Point pfor2_2 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y + recfor.Height );
  5933. g.DrawLine( p, pfor2_1, pfor2_2 );//画第一表与第二列的界线
  5934. Rectangle recfor2_3 = new Rectangle( pfor2_1.X + LeftAdd, pfor2_1.Y + TopAdd, ColumnWidth3 - (LeftAdd * 2), RowContentHeight2 );
  5935. g.DrawString( StrArray[1].Trim(), ft8, b, recfor2_3 );//画第一列的列标题ord_tbl.Rows[0]["拍摄名称"].ToString().Trim()
  5936. Point pfor3_1 = new Point( pfor2_1.X + ColumnWidth3, recfor.Y );
  5937. Point pfor3_2 = new Point( pfor2_1.X + ColumnWidth3, recfor.Y + recfor.Height );
  5938. g.DrawLine( p, pfor3_1, pfor3_2 );//画第一表与第二列的界线
  5939. Rectangle recfor2_4 = new Rectangle( pfor3_1.X + LeftAdd, pfor3_1.Y + TopAdd, ColumnWidth4 - (LeftAdd * 2), RowContentHeight2 );
  5940. g.DrawString( LYFZ.BLL.OtherCommonModel.DateTimeToString( ordSights.Rows[0]["拍摄时间"] ), ft8, b, recfor2_4 );//画第一列的列标题
  5941. Point pfor4_1 = new Point( pfor3_1.X + ColumnWidth4, recfor.Y );
  5942. Point pfor4_2 = new Point( pfor3_1.X + ColumnWidth4, recfor.Y + recfor.Height );
  5943. g.DrawLine( p, pfor4_1, pfor4_2 );//画第一表与第二列的界线
  5944. Rectangle recfor2_5 = new Rectangle( pfor4_1.X + LeftAdd, pfor4_1.Y + TopAdd, ColumnWidth5 - (LeftAdd * 2), RowContentHeight2 );
  5945. 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 );//画第一列的列标题
  5946. Point pfor5_1 = new Point( pfor4_1.X + ColumnWidth5, recfor.Y );
  5947. Point pfor5_2 = new Point( pfor4_1.X + ColumnWidth5, recfor.Y + recfor.Height );
  5948. g.DrawLine( p, pfor5_1, pfor5_2 );//画第一表与第二列的界线
  5949. Rectangle recfor2_6 = new Rectangle( pfor5_1.X + LeftAdd, pfor5_1.Y + TopAdd, ColumnWidth6 - (LeftAdd * 2), RowContentHeight2 );
  5950. 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 );//画第一列的列标题
  5951. Point pfor6_1 = new Point( pfor5_1.X + ColumnWidth6, recfor.Y );
  5952. Point pfor6_2 = new Point( pfor5_1.X + ColumnWidth6, recfor.Y + recfor.Height );
  5953. g.DrawLine( p, pfor6_1, pfor6_2 );//画第一表与第二列的界线
  5954. Rectangle recfor2_7 = new Rectangle( pfor6_1.X + LeftAdd, pfor6_1.Y + TopAdd, ColumnWidth7 - (LeftAdd * 2), RowContentHeight2 );
  5955. string StrClothingName = "";
  5956. if ( !string.IsNullOrEmpty( dtRow["服装师"].ToString().Trim() ) )
  5957. {
  5958. StrClothingName += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetUserName( dtRow["服装师"] );
  5959. }
  5960. if ( !string.IsNullOrEmpty( StrClothingName ) )
  5961. {
  5962. StrClothingName += "\r\n";
  5963. }
  5964. StrClothingName += ordSights.Rows[0]["服装数"].ToString().Trim();
  5965. g.DrawString( StrClothingName, ft8, b, recfor2_7 );//画第一列的列标题
  5966. Point pfor7_1 = new Point( pfor6_1.X + ColumnWidth7, recfor.Y );
  5967. Point pfor7_2 = new Point( pfor6_1.X + ColumnWidth7, recfor.Y + recfor.Height );
  5968. g.DrawLine( p, pfor7_1, pfor7_2 );//画第一表与第二列的界线
  5969. Rectangle recfor2_8 = new Rectangle( pfor7_1.X + LeftAdd, pfor7_1.Y + TopAdd, ColumnWidth8 - (LeftAdd * 2), RowContentHeight2 );
  5970. string StrPan = dtRow["接单人"].ToString().Trim().Replace( ",", "\r\n" ).Trim();
  5971. g.DrawString( StrPan, ft8, b, recfor2_8 );//画第一列的列标题
  5972. if ( htData["Ver"].ToString().Trim() == "1" || htData["Ver"].ToString().Trim() == "-1" )
  5973. {
  5974. Point pfor8_1 = new Point( pfor7_1.X + ColumnWidth8, recfor.Y );
  5975. Point pfor8_2 = new Point( pfor7_1.X + ColumnWidth8, recfor.Y + recfor.Height );
  5976. g.DrawLine( p, pfor8_1, pfor8_2 );//画第一表与第二列的界线
  5977. Rectangle recfor2_9 = new Rectangle( pfor8_1.X + LeftAdd, pfor8_1.Y + TopAdd, ColumnWidth9 - (LeftAdd * 2), RowContentHeight2 );
  5978. 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 );//画第一列的列标题
  5979. }
  5980. IntPoint_X = recfor.X;
  5981. IntPoint_Y = recfor.Y + recfor.Height;
  5982. }
  5983. #endregion
  5984. 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";
  5985. sizef = g.MeasureString( StrValue, ft8 );
  5986. StrHeigth = Convert.ToInt32( sizef.Height );
  5987. StrWidth = Convert.ToInt32( sizef.Width );
  5988. Rectangle rec3 = new Rectangle( rec2.X + rec2.Width - StrWidth, IntPoint_Y + 3, StrWidth, StrHeigth );
  5989. g.DrawString( StrValue, ft8, b, rec3 );//画消费法规
  5990. }
  5991. #endregion
  5992. #region 拍照派工
  5993. /// <summary>
  5994. /// 摄控本拍照客人——派工
  5995. /// </summary>
  5996. /// <param name="objValue"></param>
  5997. /// <param name="gg"></param>
  5998. /// <param name="size"></param>
  5999. /// <returns></returns>
  6000. public static List<Image> CameraControlBook_PhotographsGuestDispatch_Print( object objValue, Graphics gg, Size size )
  6001. {
  6002. Hashtable htData = (Hashtable)objValue;
  6003. ArrayList Alist = (ArrayList)htData["Alist"];
  6004. string strDateTime = htData["StrDate"].ToString().Trim();
  6005. Font ft24 = new Font( "宋体", 24, GraphicsUnit.Pixel );
  6006. Font ft16 = new Font( "宋体", 16, GraphicsUnit.Pixel );
  6007. Font ft14 = new Font( "宋体", 14, GraphicsUnit.Pixel );
  6008. Pen p = GetPen;
  6009. int LeftWidth = 30;
  6010. int TopHeight = 50;
  6011. int RowHeight = 35;
  6012. int LeftAdd = 3;
  6013. int TopAdd = 10;
  6014. int RowContentHeight = RowHeight - TopAdd;
  6015. List<Image> imglist = new List<Image>();
  6016. int TableWidth = size.Width - LeftWidth * 2;
  6017. int ColumnWidth1 = (TableWidth / 8);
  6018. int ColumnWidth2 = (TableWidth / 2) - ColumnWidth1 - 50;
  6019. int ColumnWidth3 = (TableWidth / 8);
  6020. int ColumnWidth4 = TableWidth - ColumnWidth1 - ColumnWidth2 - ColumnWidth3;
  6021. #region 获取数据
  6022. string StrWhere = " Ordv_ViceNumber in (";
  6023. string StrWhere2 = "";
  6024. Hashtable htCount = new Hashtable();
  6025. for ( int i = 0; i < Alist.Count; i++ )
  6026. {
  6027. string[] StrArray = Alist[i].ToString().Trim().Split( '|' );
  6028. StrWhere += "'" + StrArray[0].Trim() + "',";
  6029. StrWhere2 += " (Ordpg_ViceNumber = '" + StrArray[0].Trim() + "' And Ordpg_Sights = '" + StrArray[1].Trim() + "') or";
  6030. htCount[StrArray[0].Trim()] = StrArray[0].Trim();
  6031. }
  6032. StrWhere = StrWhere.TrimEnd( ',' ) + ")";
  6033. StrWhere2 = StrWhere2.TrimEnd( 'o', 'r' );
  6034. string StrTable = " (SELECT convert(datetime,convert(varchar(10),Ordpg_ReservationPhotographyTime,120)) AS 日期,Ordpg_ReservationPhotographyName AS 人员编号,'摄影师' AS 模板 FROM tb_ErpOrdersPhotography where Ordpg_ReservationPhotographyName != '' " +
  6035. " UNION ALL " +
  6036. " SELECT convert(datetime,convert(varchar(10),Ordpg_ReservationPhotographyTime,120)) AS 日期,Ordpg_ReservationPhotographyAssistant AS 人员编号,'摄影助理' AS 模板 FROM tb_ErpOrdersPhotography where Ordpg_ReservationPhotographyAssistant != '' " +
  6037. " UNION ALL " +
  6038. " SELECT convert(datetime,convert(varchar(10),Ordpg_ReservationPhotographyTime,120)) AS 日期,Ordpg_ReservationMakeupArtist AS 人员编号,'化妆师' AS 模板 FROM tb_ErpOrdersPhotography where Ordpg_ReservationMakeupArtist != '' " +
  6039. " UNION ALL " +
  6040. " SELECT convert(datetime,convert(varchar(10),Ordpg_ReservationPhotographyTime,120)) AS 日期,Ordpg_ReservationMakeupAssistant AS 人员编号,'化妆助理' AS 模板 FROM tb_ErpOrdersPhotography where Ordpg_ReservationMakeupAssistant != '' " +
  6041. " UNION ALL " +
  6042. " SELECT convert(datetime,convert(varchar(10),Ordpg_ReservationPhotographyTime,120)) AS 日期,Ordpg_ReservationBootDivision AS 人员编号,'引导师' AS 模板 FROM tb_ErpOrdersPhotography where Ordpg_ReservationBootDivision != '' " +
  6043. " UNION ALL " +
  6044. " SELECT convert(datetime,convert(varchar(10),Ordpg_ReservationPhotographyTime,120)) AS 日期,Ordpg_ReservationBootDivisionAssistant AS 人员编号,'引导助理' AS 模板 FROM tb_ErpOrdersPhotography where Ordpg_ReservationBootDivisionAssistant != '' " +
  6045. " ) AS tb" +
  6046. " Left Join tb_ErpUser on User_EmployeeID = tb.人员编号 ";
  6047. string StrTableName = "with t AS( " +
  6048. "select Ordpg_ViceNumber,Ordpg_ApparelQuantity,Ordpg_SightsType,Ordpg_Sights,Ordpg_ReservationPhotographyTime," +
  6049. "Ordpg_ReservationPhotographyName,Ordpg_ReservationPhotographyAssistant,Ordpg_ReservationMakeupArtist,Ordpg_ReservationBootDivisionAssistant," +
  6050. "Ordpg_ReservationMakeupAssistant,Ordpg_ReservationBootDivision,Ordpg_OpenOrderSource,Ordpg_Remark " +
  6051. "from tb_ErpOrdersPhotography " +
  6052. "where " + StrWhere2 + " " +
  6053. ") " +
  6054. "select * from " +
  6055. "( " +
  6056. "select Ordv_Number," +
  6057. "Ordv_ViceNumber," +
  6058. "Ord_LovedStyle," +
  6059. "CASE Ord_SinceOrderNumber WHEN '' THEN Ord_Number ELSE Ord_SinceOrderNumber END AS 订单号," +
  6060. "dbo.fn_CheckOrderType(Ord_Type) AS 订单类型," +
  6061. "Ord_SeriesPrice AS 套系金额," +
  6062. "Cus_Name AS 客户姓名," +
  6063. "Cus_Telephone AS 客户电话," +
  6064. "M_Cus_Name AS 主客户姓名," +
  6065. "M_Cus_Telephone AS 主客户电话," +
  6066. "Ordv_ReservationClothingName AS 服装师," +
  6067. "(select stuff((select ',' + dbo.fn_CheckUserIDGetUserName(OrdPe_OrdersPerson) from tb_ErpOrdersPerson where OrdPe_OrderNumber=Ord_Number for xml path('')),1,1,'')) as 接单人," +
  6068. "(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 入底张数," +
  6069. "Ordv_IntoRegisterQuantity AS 入册张数," +
  6070. "(select sum(Ordpg_ApparelQuantity) from t where Ordpg_ViceNumber = Ordv_ViceNumber and Ordpg_SightsType = '0') AS 内景服装数," +
  6071. "(select sum(Ordpg_ApparelQuantity) from t where Ordpg_ViceNumber = Ordv_ViceNumber and Ordpg_SightsType = '1') AS 外景服装数," +
  6072. "(select stuff((select ',' + Ordpg_Sights from t where Ordpg_ViceNumber = Ordv_ViceNumber and Ordpg_Sights!= '' for xml path('')),1,1,'')) as 拍摄名称," +
  6073. "(select top 1 Ordpg_ReservationPhotographyTime from t where Ordpg_ViceNumber = Ordv_ViceNumber and Ordpg_ReservationPhotographyTime is not null order by Ordpg_ReservationPhotographyTime ASC) AS 拍摄时间," +
  6074. "(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 摄影师," +
  6075. "(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 摄影助理," +
  6076. "(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 化妆师," +
  6077. "(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 化妆助理," +
  6078. "(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 引导师," +
  6079. "(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 引导助理," +
  6080. "(select stuff((select ',' + Ordpg_Remark from t where Ordpg_ViceNumber = Ordv_ViceNumber and Ordpg_Remark!= '' for xml path('')),1,1,'')) as 备注 " +
  6081. "from dbo.tb_ErpOrder " +
  6082. "Left Join dbo.tb_ErpOrderDigital On Ord_Number = Ordv_Number " +
  6083. "Left Join tempTB_AggregationCustomer On Ord_Number = GP_OrderNumber " +
  6084. ") AS tb where " + StrWhere + " " +
  6085. "Order By Ordv_Number,Ordv_ViceNumber";
  6086. DataTable tbSights = orbll.GetView_Custom( StrTableName ).Tables[0];
  6087. tbSights.PrimaryKey = new DataColumn[] { tbSights.Columns["Ordv_ViceNumber"] };
  6088. 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,模板" );
  6089. 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" );
  6090. ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql( "tb_ErpStyle", ShowColumnName: "ID, Style_Name" );
  6091. DataSet dtSet = orbll.GetView_Custom( ExecuteSql );
  6092. DataTable tbl_Statistic = dtSet.Tables["ds"];
  6093. DataTable tbl_Person = dtSet.Tables["ds1"];
  6094. DataTable tblStyle = dtSet.Tables["ds2"];
  6095. tblStyle.PrimaryKey = new DataColumn[] { tblStyle.Columns["ID"] };
  6096. 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";
  6097. 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];
  6098. #endregion
  6099. Bitmap panlImage = null;
  6100. Graphics g = null;
  6101. int ForCount = tbSights.Rows.Count + 1;
  6102. for ( int i = 0; i < ForCount; i++ )
  6103. {
  6104. if ( (i % 2) == 0 )
  6105. {
  6106. TopHeight = 50;
  6107. panlImage = new Bitmap( size.Width, size.Height );
  6108. panlImage.SetResolution( gg.DpiX, gg.DpiY );
  6109. g = Graphics.FromImage( panlImage );
  6110. }
  6111. if ( i < tbSights.Rows.Count )
  6112. {
  6113. #region 派工单
  6114. #region 标题
  6115. string recValue = DefaultPrintTitle;
  6116. SizeF sizef = g.MeasureString( recValue, ft24 );
  6117. int StrHeigth = Convert.ToInt32( sizef.Height );
  6118. int StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  6119. Rectangle rectitle = new Rectangle( (panlImage.Width / 2) - (StrWidth / 2), TopHeight, StrWidth, StrHeigth );
  6120. g.DrawString( recValue, ft24, Brushes.Black, rectitle );
  6121. #endregion
  6122. #region 订单号
  6123. recValue = "NO." + tbSights.Rows[i]["Ordv_Number"].ToString().Trim();// "NO.20151210001";
  6124. sizef = g.MeasureString( recValue, ft16 );
  6125. StrHeigth = Convert.ToInt32( sizef.Height );
  6126. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  6127. Rectangle recNo = new Rectangle( panlImage.Width - StrWidth - LeftWidth, rectitle.Y + rectitle.Height, StrWidth, StrHeigth );
  6128. g.DrawString( recValue, ft16, Brushes.Black, recNo );
  6129. #endregion
  6130. #region 第一行
  6131. Rectangle recA = new Rectangle( LeftWidth, recNo.Y + recNo.Height, TableWidth, RowHeight );
  6132. g.DrawRectangle( Pens.Black, recA );
  6133. Rectangle recA_1 = new Rectangle( recA.X + LeftAdd, recA.Y + TopAdd, ColumnWidth1, RowContentHeight );
  6134. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "拍摄时间" ), ft16, Brushes.Black, recA_1 );
  6135. Point pA1_1 = new Point( recA.X + ColumnWidth1, recA.Y );
  6136. Point pA1_2 = new Point( recA.X + ColumnWidth1, recA.Y + recA.Height );
  6137. g.DrawLine( Pens.Black, pA1_1, pA1_2 );
  6138. Rectangle recA_2 = new Rectangle( pA1_1.X + LeftAdd, pA1_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
  6139. g.DrawString( LYFZ.Command.Command_Validate.DateTimeToString2( tbSights.Rows[i]["拍摄时间"] ), ft16, Brushes.Black, recA_2 );
  6140. Point pA2_1 = new Point( pA1_1.X + ColumnWidth2, recA.Y );
  6141. Point pA2_2 = new Point( pA1_1.X + ColumnWidth2, recA.Y + recA.Height );
  6142. g.DrawLine( Pens.Black, pA2_1, pA2_2 );
  6143. Rectangle recA_3 = new Rectangle( pA2_1.X + LeftAdd, pA2_1.Y + TopAdd, ColumnWidth3, RowContentHeight );
  6144. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "拍摄名称" ), ft16, Brushes.Black, recA_3 );
  6145. Point pA3_1 = new Point( pA2_1.X + ColumnWidth3, recA.Y );
  6146. Point pA3_2 = new Point( pA2_1.X + ColumnWidth3, recA.Y + recA.Height );
  6147. g.DrawLine( Pens.Black, pA3_1, pA3_2 );
  6148. Rectangle recA_4 = new Rectangle( pA3_1.X + LeftAdd, pA3_1.Y + TopAdd, ColumnWidth4, RowContentHeight );
  6149. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( tbSights.Rows[i]["拍摄名称"].ToString().Trim() ), ft16, Brushes.Black, recA_4 );
  6150. #endregion
  6151. #region 第二行
  6152. Rectangle recB = new Rectangle( LeftWidth, recA.Y + recA.Height, TableWidth, RowHeight );
  6153. g.DrawRectangle( Pens.Black, recB );
  6154. Rectangle recB_1 = new Rectangle( recB.X + LeftAdd, recB.Y + TopAdd, ColumnWidth1, RowContentHeight );
  6155. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "套系金额" ), ft16, Brushes.Black, recB_1 );
  6156. Point pB1_1 = new Point( recB.X + ColumnWidth1, recB.Y );
  6157. Point pB1_2 = new Point( recB.X + ColumnWidth1, recB.Y + recB.Height );
  6158. g.DrawLine( Pens.Black, pB1_1, pB1_2 );
  6159. Rectangle recB_2 = new Rectangle( pB1_1.X + LeftAdd, pB1_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
  6160. g.DrawString( tbSights.Rows[i]["套系金额"].ToString().Trim(), ft16, Brushes.Black, recB_2 );
  6161. Point pB2_1 = new Point( pB1_1.X + ColumnWidth2, recB.Y );
  6162. Point pB2_2 = new Point( pB1_1.X + ColumnWidth2, recB.Y + recB.Height );
  6163. g.DrawLine( Pens.Black, pB2_1, pB2_2 );
  6164. Rectangle recB_3 = new Rectangle( pB2_1.X + LeftAdd, pB2_1.Y + TopAdd, ColumnWidth3, RowContentHeight );
  6165. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名" ), ft16, Brushes.Black, recB_3 );
  6166. Point pB3_1 = new Point( pB2_1.X + ColumnWidth3, recB.Y );
  6167. Point pB3_2 = new Point( pB2_1.X + ColumnWidth3, recB.Y + recB.Height );
  6168. g.DrawLine( Pens.Black, pB3_1, pB3_2 );
  6169. string StrName = tbSights.Rows[i]["主客户姓名"].ToString().Trim().Replace( "/", "," );
  6170. if ( tbSights.Rows[i]["订单类型"].ToString().Trim() != "写真订单" )
  6171. {
  6172. StrName = tbSights.Rows[i]["客户姓名"].ToString().Trim();
  6173. }
  6174. Rectangle recB_4 = new Rectangle( pB3_1.X + LeftAdd, pB3_1.Y + TopAdd, ColumnWidth4, RowContentHeight );
  6175. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( StrName ), ft16, Brushes.Black, recB_4 );
  6176. #endregion
  6177. #region 第三行
  6178. Rectangle recC = new Rectangle( LeftWidth, recB.Y + recB.Height, TableWidth, RowHeight );
  6179. g.DrawRectangle( Pens.Black, recC );
  6180. Rectangle recC_1 = new Rectangle( recC.X + LeftAdd, recC.Y + TopAdd, ColumnWidth1, RowContentHeight );
  6181. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "接单人" ), ft16, Brushes.Black, recC_1 );
  6182. Point pC1_1 = new Point( recC.X + ColumnWidth1, recC.Y );
  6183. Point pC1_2 = new Point( recC.X + ColumnWidth1, recC.Y + recC.Height );
  6184. g.DrawLine( Pens.Black, pC1_1, pC1_2 );
  6185. Rectangle recC_2 = new Rectangle( pC1_1.X + LeftAdd, pC1_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
  6186. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( tbSights.Rows[i]["接单人"].ToString().Trim() ), ft16, Brushes.Black, recC_2 );
  6187. Point pC2_1 = new Point( pC1_1.X + ColumnWidth2, recC.Y );
  6188. Point pC2_2 = new Point( pC1_1.X + ColumnWidth2, recC.Y + recC.Height );
  6189. g.DrawLine( Pens.Black, pC2_1, pC2_2 );
  6190. Rectangle recC_3 = new Rectangle( pC2_1.X + LeftAdd, pC2_1.Y + TopAdd, ColumnWidth3, RowContentHeight );
  6191. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客户电话" ), ft16, Brushes.Black, recC_3 );
  6192. Point pC3_1 = new Point( pC2_1.X + ColumnWidth3, recC.Y );
  6193. Point pC3_2 = new Point( pC2_1.X + ColumnWidth3, recC.Y + recC.Height );
  6194. g.DrawLine( Pens.Black, pC3_1, pC3_2 );
  6195. string StrPhone = tbSights.Rows[i]["主客户电话"].ToString().Trim().Replace( "/", "," );
  6196. if ( tbSights.Rows[i]["订单类型"].ToString().Trim() != "写真订单" )
  6197. {
  6198. StrPhone = tbSights.Rows[i]["客户电话"].ToString().Trim();
  6199. }
  6200. Rectangle recC_4 = new Rectangle( pC3_1.X + LeftAdd, pC3_1.Y + TopAdd, ColumnWidth4, RowContentHeight );
  6201. g.DrawString( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( StrPhone ), ft16, Brushes.Black, recC_4 );
  6202. #endregion
  6203. #region 第四行
  6204. Rectangle recD = new Rectangle( LeftWidth, recC.Y + recC.Height, TableWidth, RowHeight );
  6205. g.DrawRectangle( Pens.Black, recD );
  6206. Rectangle recD_1 = new Rectangle( recA.X + LeftAdd, recD.Y + TopAdd, ColumnWidth1, RowContentHeight );
  6207. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "入册/入底" ), ft16, Brushes.Black, recD_1 );
  6208. Point pD1_1 = new Point( recD.X + ColumnWidth1, recD.Y );
  6209. Point pD1_2 = new Point( recD.X + ColumnWidth1, recD.Y + recD.Height );
  6210. g.DrawLine( Pens.Black, pD1_1, pD1_2 );
  6211. string strV = tbSights.Rows[i]["入底张数"].ToString().Trim();
  6212. if ( strV == "-1" )
  6213. {
  6214. strV = "全送";
  6215. }
  6216. else if ( strV == "0" )
  6217. {
  6218. strV = "不送";
  6219. }
  6220. Rectangle recD_2 = new Rectangle( pD1_1.X + LeftAdd, pD1_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
  6221. g.DrawString( tbSights.Rows[i]["入册张数"].ToString().Trim() + "/" + strV, ft16, Brushes.Black, recD_2 );
  6222. Point pD2_1 = new Point( pD1_1.X + ColumnWidth2, recD.Y );
  6223. Point pD2_2 = new Point( pD1_1.X + ColumnWidth2, recD.Y + recD.Height );
  6224. g.DrawLine( Pens.Black, pD2_1, pD2_2 );
  6225. if ( tbSights.Rows[i]["订单类型"].ToString().Trim() == "儿童订单" )
  6226. {
  6227. Rectangle recD_3 = new Rectangle( pD2_1.X + LeftAdd, pD2_1.Y + TopAdd, ColumnWidth3, RowContentHeight );
  6228. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "宝宝情况" ), ft16, Brushes.Black, recD_3 );
  6229. Point pD3_1 = new Point( pD2_1.X + ColumnWidth3, recD.Y );
  6230. Point pD3_2 = new Point( pD2_1.X + ColumnWidth3, recD.Y + recD.Height );
  6231. g.DrawLine( Pens.Black, pD3_1, pD3_2 );
  6232. string StrText = "";
  6233. if ( dtType.Rows.Count > 0 )
  6234. {
  6235. DataRow[] dtRowsType = dtType.Select( "Ordv_ViceNumber = '" + tbSights.Rows[i]["Ordv_ViceNumber"].ToString().Trim() + "'" );
  6236. if ( dtRowsType.Length > 0 && dtRowsType[0]["Ord_Type"].ToString().Trim() == "1" )
  6237. {
  6238. StrText = "宝宝性别(";
  6239. if ( Convert.ToBoolean( dtRowsType[0]["Cus_Sex"] ) )
  6240. {
  6241. StrText += "女";
  6242. }
  6243. else
  6244. {
  6245. StrText += "男";
  6246. }
  6247. StrText += ") 年龄(";
  6248. if ( !string.IsNullOrEmpty( dtRowsType[0]["Age_String"].ToString().Trim() ) )
  6249. {
  6250. StrText += dtRowsType[0]["Age_String"].ToString().Trim() + ")";
  6251. }
  6252. else
  6253. {
  6254. StrText += "未知)";
  6255. }
  6256. }
  6257. }
  6258. Rectangle recD_4 = new Rectangle( pD3_1.X + LeftAdd, pD3_1.Y + TopAdd, ColumnWidth4, RowContentHeight );
  6259. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( StrText ), ft16, Brushes.Black, recD_4 );
  6260. }
  6261. #endregion
  6262. #region 第五行
  6263. Rectangle recE = new Rectangle( LeftWidth, recD.Y + recD.Height, TableWidth, RowHeight );
  6264. g.DrawRectangle( Pens.Black, recE );
  6265. Rectangle recE_1 = new Rectangle( recE.X + LeftAdd, recE.Y + TopAdd, ColumnWidth1, RowContentHeight );
  6266. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "摄影师" ), ft16, Brushes.Black, recE_1 );
  6267. Point pE1_1 = new Point( recE.X + ColumnWidth1, recE.Y );
  6268. Point pE1_2 = new Point( recE.X + ColumnWidth1, recE.Y + recE.Height );
  6269. g.DrawLine( Pens.Black, pE1_1, pE1_2 );
  6270. Rectangle recE_2 = new Rectangle( pE1_1.X + LeftAdd, pE1_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
  6271. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( tbSights.Rows[i]["摄影师"].ToString().Trim() ), ft16, Brushes.Black, recE_2 );
  6272. Point pE2_1 = new Point( pE1_1.X + ColumnWidth2, recE.Y );
  6273. Point pE2_2 = new Point( pE1_1.X + ColumnWidth2, recE.Y + recE.Height );
  6274. g.DrawLine( Pens.Black, pE2_1, pE2_2 );
  6275. Rectangle recE_3 = new Rectangle( pE2_1.X + LeftAdd, pE2_1.Y + TopAdd, ColumnWidth3, RowContentHeight );
  6276. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "摄影助理" ), ft16, Brushes.Black, recE_3 );
  6277. Point pE3_1 = new Point( pE2_1.X + ColumnWidth3, recE.Y );
  6278. Point pE3_2 = new Point( pE2_1.X + ColumnWidth3, recE.Y + recE.Height );
  6279. g.DrawLine( Pens.Black, pE3_1, pE3_2 );
  6280. Rectangle recE_4 = new Rectangle( pE3_1.X + LeftAdd, pE3_1.Y + TopAdd, ColumnWidth4, RowContentHeight );
  6281. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( tbSights.Rows[i]["摄影助理"].ToString().Trim() ), ft16, Brushes.Black, recE_4 );
  6282. #endregion
  6283. #region 第六行
  6284. Rectangle recF = new Rectangle( LeftWidth, recE.Y + recE.Height, TableWidth, RowHeight );
  6285. g.DrawRectangle( Pens.Black, recF );
  6286. Rectangle recF_1 = new Rectangle( recF.X + LeftAdd, recF.Y + TopAdd, ColumnWidth1, RowContentHeight );
  6287. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "化妆师" ), ft16, Brushes.Black, recF_1 );
  6288. Point pF1_1 = new Point( recF.X + ColumnWidth1, recF.Y );
  6289. Point pF1_2 = new Point( recF.X + ColumnWidth1, recF.Y + recF.Height );
  6290. g.DrawLine( Pens.Black, pF1_1, pF1_2 );
  6291. Rectangle recF_2 = new Rectangle( pF1_1.X + LeftAdd, pF1_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
  6292. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( tbSights.Rows[i]["化妆师"].ToString().Trim() ), ft16, Brushes.Black, recF_2 );
  6293. Point pF2_1 = new Point( pF1_1.X + ColumnWidth2, recF.Y );
  6294. Point pF2_2 = new Point( pF1_1.X + ColumnWidth2, recF.Y + recF.Height );
  6295. g.DrawLine( Pens.Black, pF2_1, pF2_2 );
  6296. Rectangle recF_3 = new Rectangle( pF2_1.X + LeftAdd, pF2_1.Y + TopAdd, ColumnWidth3, RowContentHeight );
  6297. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "化妆助理" ), ft16, Brushes.Black, recF_3 );
  6298. Point pF3_1 = new Point( pF2_1.X + ColumnWidth3, recF.Y );
  6299. Point pF3_2 = new Point( pF2_1.X + ColumnWidth3, recF.Y + recF.Height );
  6300. g.DrawLine( Pens.Black, pF3_1, pF3_2 );
  6301. Rectangle recF_4 = new Rectangle( pF3_1.X + LeftAdd, pF3_1.Y + TopAdd, ColumnWidth4, RowContentHeight );
  6302. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( tbSights.Rows[i]["化妆助理"].ToString().Trim() ), ft16, Brushes.Black, recF_4 );
  6303. #endregion
  6304. #region 第七行
  6305. int Rectangle_Y = recF.Y + recF.Height;
  6306. if ( tbSights.Rows[i]["订单类型"].ToString().Trim() == "儿童订单" )
  6307. {
  6308. Rectangle recG = new Rectangle( LeftWidth, Rectangle_Y, TableWidth, RowHeight );
  6309. g.DrawRectangle( Pens.Black, recG );
  6310. Rectangle recG_1 = new Rectangle( recG.X + LeftAdd, recG.Y + TopAdd, ColumnWidth1, RowContentHeight );
  6311. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "引导师" ), ft16, Brushes.Black, recG_1 );
  6312. Point pG1_1 = new Point( recG.X + ColumnWidth1, recG.Y );
  6313. Point pG1_2 = new Point( recG.X + ColumnWidth1, recG.Y + recG.Height );
  6314. g.DrawLine( Pens.Black, pG1_1, pG1_2 );
  6315. Rectangle recG_2 = new Rectangle( pG1_1.X + LeftAdd, pG1_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
  6316. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( tbSights.Rows[i]["引导师"].ToString().Trim() ), ft16, Brushes.Black, recG_2 );
  6317. Point pG2_1 = new Point( pG1_1.X + ColumnWidth2, recG.Y );
  6318. Point pG2_2 = new Point( pG1_1.X + ColumnWidth2, recG.Y + recG.Height );
  6319. g.DrawLine( Pens.Black, pG2_1, pG2_2 );
  6320. Rectangle recG_3 = new Rectangle( pG2_1.X + LeftAdd, pG2_1.Y + TopAdd, ColumnWidth3, RowContentHeight );
  6321. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "引导助理" ), ft16, Brushes.Black, recG_3 );
  6322. Point pG3_1 = new Point( pG2_1.X + ColumnWidth3, recG.Y );
  6323. Point pG3_2 = new Point( pG2_1.X + ColumnWidth3, recG.Y + recG.Height );
  6324. g.DrawLine( Pens.Black, pG3_1, pG3_2 );
  6325. Rectangle recG_4 = new Rectangle( pG3_1.X + LeftAdd, pG3_1.Y + TopAdd, ColumnWidth4, RowContentHeight );
  6326. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( tbSights.Rows[i]["引导助理"].ToString().Trim() ), ft16, Brushes.Black, recG_4 );
  6327. Rectangle_Y = recG.Y + recG.Height;
  6328. }
  6329. #endregion
  6330. #region 第八行
  6331. Rectangle recH = new Rectangle( LeftWidth, Rectangle_Y, TableWidth, RowHeight );
  6332. g.DrawRectangle( Pens.Black, recH );
  6333. Rectangle recH_1 = new Rectangle( recH.X + LeftAdd, recH.Y + TopAdd, ColumnWidth1, RowContentHeight );
  6334. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "服装师" ), ft16, Brushes.Black, recH_1 );
  6335. Point pH1_1 = new Point( recH.X + ColumnWidth1, recH.Y );
  6336. Point pH1_2 = new Point( recH.X + ColumnWidth1, recH.Y + recH.Height );
  6337. g.DrawLine( Pens.Black, pH1_1, pH1_2 );
  6338. Rectangle recH_2 = new Rectangle( pH1_1.X + LeftAdd, pH1_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
  6339. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( tbSights.Rows[i]["服装师"].ToString().Trim() ), ft16, Brushes.Black, recH_2 );
  6340. Point pH2_1 = new Point( pH1_1.X + ColumnWidth2, recH.Y );
  6341. Point pH2_2 = new Point( pH1_1.X + ColumnWidth2, recH.Y + recH.Height );
  6342. g.DrawLine( Pens.Black, pH2_1, pH2_2 );
  6343. Rectangle recH_3 = new Rectangle( pH2_1.X + LeftAdd, pH2_1.Y + TopAdd, ColumnWidth3, RowContentHeight );
  6344. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "服装套数" ), ft16, Brushes.Black, recH_3 );
  6345. Point pH3_1 = new Point( pH2_1.X + ColumnWidth3, recH.Y );
  6346. Point pH3_2 = new Point( pH2_1.X + ColumnWidth3, recH.Y + recH.Height );
  6347. g.DrawLine( Pens.Black, pH3_1, pH3_2 );
  6348. string SDS = "";
  6349. if ( !string.IsNullOrEmpty( tbSights.Rows[i]["内景服装数"].ToString().Trim() ) )
  6350. {
  6351. SDS += "内景:" + tbSights.Rows[i]["内景服装数"].ToString().Trim() + "套 ";
  6352. }
  6353. if ( !string.IsNullOrEmpty( tbSights.Rows[i]["外景服装数"].ToString().Trim() ) )
  6354. {
  6355. SDS += "外景:" + tbSights.Rows[i]["外景服装数"].ToString().Trim() + "套";
  6356. }
  6357. Rectangle recH_4 = new Rectangle( pH3_1.X + LeftAdd, pH3_1.Y + TopAdd, ColumnWidth4, RowContentHeight );
  6358. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( SDS ), ft16, Brushes.Black, recH_4 );
  6359. #endregion
  6360. #region 第九行
  6361. Rectangle recI = new Rectangle( LeftWidth, recH.Y + recH.Height, TableWidth, RowHeight );
  6362. g.DrawRectangle( Pens.Black, recI );
  6363. Rectangle recI_1 = new Rectangle( recI.X + LeftAdd, recI.Y + TopAdd, ColumnWidth1, RowContentHeight );
  6364. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "喜爱格调" ), ft16, Brushes.Black, recI_1 );
  6365. Point pI1_1 = new Point( recI.X + ColumnWidth1, recI.Y );
  6366. Point pI1_2 = new Point( recI.X + ColumnWidth1, recI.Y + recI.Height );
  6367. g.DrawLine( Pens.Black, pI1_1, pI1_2 );
  6368. string[] OrdLovedStyle = tbSights.Rows[i]["Ord_LovedStyle"].ToString().Trim().Split( '|' );
  6369. string StrLovedStyle = "";
  6370. for ( int j = 0; j < OrdLovedStyle.Length; j++ )
  6371. {
  6372. if ( OrdLovedStyle[j].Trim() != "" )
  6373. {
  6374. string[] StrID = OrdLovedStyle[j].Trim().Split( '_' );
  6375. DataRow dtRow = tblStyle.Rows.Find( StrID[1].Trim() );
  6376. if ( dtRow != null )
  6377. {
  6378. StrLovedStyle += dtRow["Style_Name"] + ",";
  6379. }
  6380. }
  6381. }
  6382. Rectangle recI_2 = new Rectangle( pI1_1.X + LeftAdd, pI1_1.Y + TopAdd, TableWidth - ColumnWidth1, RowContentHeight );
  6383. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( StrLovedStyle.TrimEnd( ',' ) ), ft16, Brushes.Black, recI_2 );
  6384. #endregion
  6385. #region 第十行
  6386. Rectangle recJ = new Rectangle( LeftWidth, recI.Y + recI.Height, TableWidth, RowHeight * 2 );
  6387. g.DrawRectangle( Pens.Black, recJ );
  6388. Rectangle recJ_1 = new Rectangle( recJ.X + LeftAdd, recJ.Y + TopAdd, ColumnWidth1, recJ.Height - TopAdd * 2 );
  6389. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "备注" ), ft16, Brushes.Black, recJ_1 );
  6390. Point pJ1_1 = new Point( recJ.X + ColumnWidth1, recJ.Y );
  6391. Point pJ1_2 = new Point( recJ.X + ColumnWidth1, recJ.Y + recJ.Height );
  6392. g.DrawLine( Pens.Black, pJ1_1, pJ1_2 );
  6393. Rectangle recJ_2 = new Rectangle( pJ1_1.X + LeftAdd, pJ1_1.Y + TopAdd, TableWidth - ColumnWidth1, recJ.Height - TopAdd * 2 );
  6394. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( tbSights.Rows[i]["备注"].ToString().Trim() ), ft16, Brushes.Black, recJ_2 );
  6395. #endregion
  6396. TopHeight = recJ.Y + recJ.Height + 120;
  6397. #endregion
  6398. }
  6399. else
  6400. {
  6401. #region 结尾统计
  6402. if ( tbl_Statistic.Rows.Count > 0 )
  6403. {
  6404. string StrTitle = LYFZ.BLL.OtherCommonModel.FontConversion( "统计" ) + LYFZ.Command.Command_Validate.DateTimeToString( strDateTime );
  6405. SizeF sizef = g.MeasureString( StrTitle, ft14 );
  6406. int StrHeight = Convert.ToInt32( sizef.Height );
  6407. int StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  6408. Rectangle recX1 = new Rectangle( LeftWidth, TopHeight, StrWidth, StrHeight );
  6409. g.DrawString( StrTitle, ft14, Brushes.Black, recX1 );
  6410. int IntPoint_Y = recX1.Y + recX1.Height;
  6411. int ColumnsWith = 60;
  6412. for ( int k = 0; k < tbl_Person.Rows.Count; k++ )
  6413. {
  6414. DataRow[] dtRow = tbl_Statistic.Select( "人员编号 = '" + tbl_Person.Rows[k]["人员编号"].ToString().Trim() + "'" );
  6415. string StrString = "";
  6416. for ( int j = 0; j < dtRow.Length; j++ )
  6417. {
  6418. StrString += dtRow[j]["模板"].ToString().Trim() + ":" + dtRow[j]["数量"].ToString().Trim() + "组;";
  6419. }
  6420. if ( (k % 2) == 0 )
  6421. {
  6422. Rectangle recX2 = new Rectangle( LeftWidth, IntPoint_Y, TableWidth, RowHeight );
  6423. g.DrawRectangle( Pens.Black, recX2 );
  6424. Point pX2_1 = new Point( recX2.X + TableWidth / 2, recX2.Y );
  6425. Point pX2_2 = new Point( recX2.X + TableWidth / 2, recX2.Y + recX2.Height );
  6426. g.DrawLine( Pens.Black, pX2_1, pX2_2 );
  6427. Rectangle recX2_1 = new Rectangle( recX2.X + LeftAdd, recX2.Y + TopAdd + 2, ColumnsWith, RowContentHeight );
  6428. g.DrawString( tbl_Person.Rows[k]["人员"].ToString().Trim(), ft14, Brushes.Black, recX2_1 );
  6429. Point pX3_1 = new Point( recX2.X + ColumnsWith, recX2.Y );
  6430. Point pX3_2 = new Point( recX2.X + ColumnsWith, recX2.Y + recX2.Height );
  6431. g.DrawLine( Pens.Black, pX3_1, pX3_2 );
  6432. Rectangle recX3_1 = new Rectangle( pX3_1.X + LeftAdd, recX2_1.Y, TableWidth / 2 - (LeftAdd + ColumnsWith), RowContentHeight );
  6433. g.DrawString( StrString, ft14, Brushes.Black, recX3_1 );
  6434. IntPoint_Y = recX2.Y + recX2.Height;
  6435. }
  6436. else
  6437. {
  6438. Rectangle rec2_1 = new Rectangle( LeftWidth + (TableWidth / 2) + LeftAdd, IntPoint_Y - RowHeight + TopAdd + 2, ColumnWidth1, RowContentHeight );
  6439. g.DrawString( tbl_Person.Rows[k]["人员"].ToString().Trim(), ft14, Brushes.Black, rec2_1 );
  6440. Point pX3_1 = new Point( rec2_1.X + ColumnsWith, IntPoint_Y - RowHeight );
  6441. Point pX3_2 = new Point( rec2_1.X + ColumnsWith, IntPoint_Y );
  6442. g.DrawLine( Pens.Black, pX3_1, pX3_2 );
  6443. Rectangle recX3_1 = new Rectangle( pX3_1.X + LeftAdd, rec2_1.Y, TableWidth / 2 - (LeftAdd + ColumnsWith), RowContentHeight );
  6444. g.DrawString( StrString, ft14, Brushes.Black, recX3_1 );
  6445. }
  6446. }
  6447. 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;
  6448. sizef = g.MeasureString( rec2Value, ft14 );
  6449. StrHeight = Convert.ToInt32( sizef.Height );
  6450. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  6451. Rectangle recX10 = new Rectangle( LeftWidth + TableWidth - StrWidth, IntPoint_Y + 3, StrWidth, StrHeight );
  6452. g.DrawString( rec2Value, ft14, Brushes.Black, recX10 );
  6453. }
  6454. #endregion
  6455. }
  6456. if ( ((i % 2) > 0) || i == tbSights.Rows.Count )
  6457. {
  6458. imglist.Add( panlImage );
  6459. }
  6460. }
  6461. return imglist;
  6462. }
  6463. #endregion
  6464. #region 选片明细
  6465. /// <summary>
  6466. /// 摄控本选片客人——明细
  6467. /// </summary>
  6468. /// <returns></returns>
  6469. public static void CameraControlBook_FilmSelectionDetail_Print( object objValue, Graphics g, Size size )
  6470. {
  6471. Hashtable htData = (Hashtable)objValue;
  6472. ArrayList Alist = (ArrayList)htData["Alist"];
  6473. Brush b = Brushes.Black;
  6474. Pen p = GetPen;
  6475. Font ft16 = new Font( "宋体", 16 );
  6476. Font ft10 = new Font( "宋体", 10 );
  6477. Font ft8 = new Font( "宋体", 8 );
  6478. int LeftWidth = 30;
  6479. int TableWidth = size.Width - LeftWidth * 2;
  6480. int LeftAdd = 3;
  6481. int TopAdd = 5;
  6482. int RowHeight = 25;
  6483. int RowContentHeight = RowHeight - (TopAdd * 2);
  6484. //金色童年收据凭据
  6485. SizeF sizef = g.MeasureString( DefaultPrintTitle, ft16 );
  6486. int StrHeight = Convert.ToInt32( sizef.Height );
  6487. int StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  6488. Rectangle rec1 = new Rectangle( (size.Width - StrWidth) / 2, 50, StrWidth, StrHeight );
  6489. g.DrawString( DefaultPrintTitle, ft16, b, rec1 );
  6490. int Unit = TableWidth / 10;
  6491. int ColumnWidth1 = Unit * 4 - (Unit / 2 + (Unit / 4));
  6492. int ColumnWidth2 = Unit * 2 - (Unit / 2);
  6493. int ColumnWidth3 = Unit - (Unit / 4);
  6494. int ColumnWidth5 = Unit + 20;
  6495. int ColumnWidth4 = TableWidth - ColumnWidth1 - ColumnWidth2 - ColumnWidth3 - ColumnWidth5;
  6496. Rectangle rec2 = new Rectangle( LeftWidth, rec1.Y + rec1.Height, TableWidth, RowHeight );
  6497. g.DrawRectangle( p, rec2 );//画标题矩形
  6498. string StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "客人/电话" );
  6499. sizef = g.MeasureString( StrValue, ft10 );
  6500. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  6501. Rectangle rec2_1 = new Rectangle( rec2.X + (ColumnWidth1 - StrWidth) / 2, rec2.Y + TopAdd, ColumnWidth1, RowContentHeight );
  6502. g.DrawString( StrValue, ft10, b, rec2_1 );//画第一列的列标题
  6503. Point p1_1 = new Point( rec2.X + ColumnWidth1, rec2.Y );
  6504. Point p1_2 = new Point( rec2.X + ColumnWidth1, rec2.Y + rec2.Height );
  6505. g.DrawLine( p, p1_1, p1_2 );//画第一表与第二列的界线
  6506. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "选片时间" );
  6507. sizef = g.MeasureString( StrValue, ft10 );
  6508. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  6509. Rectangle rec2_2 = new Rectangle( p1_1.X + (ColumnWidth2 - StrWidth) / 2, p1_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
  6510. g.DrawString( StrValue, ft10, b, rec2_2 );//画第一列的列标题
  6511. Point p2_1 = new Point( p1_1.X + ColumnWidth2, rec2.Y );
  6512. Point p2_2 = new Point( p1_1.X + ColumnWidth2, rec2.Y + rec2.Height );
  6513. g.DrawLine( p, p2_1, p2_2 );//画第一表与第二列的界线
  6514. Rectangle rec2_3 = new Rectangle( p2_1.X + LeftAdd, p2_1.Y + TopAdd, ColumnWidth3, RowContentHeight );
  6515. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "选片人" ), ft10, b, rec2_3 );//画第一列的列标题
  6516. Point p3_1 = new Point( p2_1.X + ColumnWidth3, rec2.Y );
  6517. Point p3_2 = new Point( p2_1.X + ColumnWidth3, rec2.Y + rec2.Height );
  6518. g.DrawLine( p, p3_1, p3_2 );//画第一表与第二列的界线
  6519. Rectangle rec2_4 = new Rectangle( p3_1.X + (ColumnWidth4 - StrWidth) / 2, p3_1.Y + TopAdd, ColumnWidth4, RowContentHeight );
  6520. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "套系名称" ), ft10, b, rec2_4 );//画第一列的列标题
  6521. Point p4_1 = new Point( p3_1.X + ColumnWidth4, rec2.Y );
  6522. Point p4_2 = new Point( p3_1.X + ColumnWidth4, rec2.Y + rec2.Height );
  6523. g.DrawLine( p, p4_1, p4_2 );//画第一表与第二列的界线
  6524. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "门市" );
  6525. sizef = g.MeasureString( StrValue, ft10 );
  6526. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  6527. Rectangle rec2_5 = new Rectangle( p4_1.X + (ColumnWidth5 - StrWidth) / 2, p4_1.Y + TopAdd, ColumnWidth5, RowContentHeight );
  6528. g.DrawString( StrValue, ft10, b, rec2_5 );//画第一列的列标题
  6529. DataTable newTable = new DataTable();
  6530. string StrWhere = "";
  6531. for ( int i = 0; i < Alist.Count; i++ )
  6532. {
  6533. StrWhere += "'" + Alist[i].ToString().Trim() + "',";
  6534. }
  6535. if ( !string.IsNullOrEmpty( StrWhere.Trim() ) )
  6536. {
  6537. StrWhere = " Where Ordv_ViceNumber in (" + StrWhere.TrimEnd( ',' ) + ")";
  6538. newTable = LYFZ.BLL.BLL_ErpOrderView.GetData_CameraControlBookFilmSelection_DetailPrint( StrWhere );
  6539. newTable.PrimaryKey = new DataColumn[] { newTable.Columns["Ordv_ViceNumber"] };
  6540. }
  6541. int RowHeight2 = 20;
  6542. int RowContentHeight2 = RowHeight2 - (TopAdd * 2);
  6543. int IntPoint_Y = rec2.Y + rec2.Height;
  6544. for ( int i = 0; i < Alist.Count; i++ )
  6545. {
  6546. if ( i >= 46 )
  6547. {
  6548. break;
  6549. }
  6550. DataRow dtRow = newTable.Rows.Find( Alist[i].ToString().Trim() );
  6551. Rectangle recfor = new Rectangle( rec2.X, IntPoint_Y, TableWidth, RowHeight2 );
  6552. g.DrawRectangle( p, recfor );//画标题矩形
  6553. string StrName = dtRow["主客户姓名"].ToString().Trim().Replace( "/", "," );
  6554. if ( dtRow["订单类型"].ToString().Equals( "1" ) )
  6555. {
  6556. StrName = dtRow["客户姓名"].ToString().Trim().Replace( "/", "," );
  6557. }
  6558. if ( StrName != "" )
  6559. {
  6560. string StrPhone = dtRow["主客户电话"].ToString().Trim().Replace( "/", "," );
  6561. if ( StrPhone != "" )
  6562. {
  6563. StrName += "/" + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( StrPhone );
  6564. }
  6565. }
  6566. Rectangle recfor2_1 = new Rectangle( recfor.X + LeftAdd, recfor.Y + TopAdd, ColumnWidth1, RowContentHeight2 );
  6567. g.DrawString( StrName, ft8, b, recfor2_1 );//画第一列的列标题
  6568. Point pfor1_1 = new Point( recfor.X + ColumnWidth1, recfor.Y );
  6569. Point pfor1_2 = new Point( recfor.X + ColumnWidth1, recfor.Y + recfor.Height );
  6570. g.DrawLine( p, pfor1_1, pfor1_2 );//画第一表与第二列的界线
  6571. Rectangle recfor2_2 = new Rectangle( pfor1_1.X + LeftAdd, pfor1_1.Y + TopAdd, ColumnWidth2, RowContentHeight2 );
  6572. g.DrawString( LYFZ.BLL.OtherCommonModel.DateTimeToString( dtRow["选片时间"] ), ft8, b, recfor2_2 );//画第一列的列标题
  6573. Point pfor2_1 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y );
  6574. Point pfor2_2 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y + recfor.Height );
  6575. g.DrawLine( p, pfor2_1, pfor2_2 );//画第一表与第二列的界线
  6576. Rectangle recfor2_3 = new Rectangle( pfor2_1.X + LeftAdd, pfor2_1.Y + TopAdd, ColumnWidth3, RowContentHeight2 );
  6577. g.DrawString( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetUserName( dtRow["选片师"] ), ft8, b, recfor2_3 );//画第一列的列标题
  6578. Point pfor3_1 = new Point( pfor2_1.X + ColumnWidth3, recfor.Y );
  6579. Point pfor3_2 = new Point( pfor2_1.X + ColumnWidth3, recfor.Y + recfor.Height );
  6580. g.DrawLine( p, pfor3_1, pfor3_2 );//画第一表与第二列的界线
  6581. Rectangle recfor2_4 = new Rectangle( pfor3_1.X + LeftAdd, pfor3_1.Y + TopAdd, ColumnWidth4, RowContentHeight2 );
  6582. g.DrawString( dtRow["套系名称"].ToString().Trim(), ft8, b, recfor2_4 );//画第一列的列标题
  6583. Point pfor4_1 = new Point( pfor3_1.X + ColumnWidth4, recfor.Y );
  6584. Point pfor4_2 = new Point( pfor3_1.X + ColumnWidth4, recfor.Y + recfor.Height );
  6585. g.DrawLine( p, pfor4_1, pfor4_2 );//画第一表与第二列的界线
  6586. Rectangle recfor2_5 = new Rectangle( pfor4_1.X + LeftAdd, pfor4_1.Y + TopAdd, ColumnWidth5, RowContentHeight2 );
  6587. g.DrawString( dtRow["接单人"].ToString().Trim(), ft8, b, recfor2_5 );//画第一列的列标题
  6588. IntPoint_Y = recfor.Y + recfor.Height;
  6589. }
  6590. 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";
  6591. sizef = g.MeasureString( StrValue, ft8 );
  6592. StrHeight = Convert.ToInt32( sizef.Height );
  6593. StrWidth = Convert.ToInt32( sizef.Width );
  6594. Rectangle rec3 = new Rectangle( rec2.X + rec2.Width - StrWidth, IntPoint_Y + 3, StrWidth, StrHeight );
  6595. g.DrawString( StrValue, ft8, b, rec3 );//画消费法规
  6596. }
  6597. #endregion
  6598. #region 看设计明细
  6599. /// <summary>
  6600. /// 摄控本看设计客人——明细
  6601. /// </summary>
  6602. /// <returns></returns>
  6603. public static void CameraControlBook_LookDesignDetail_Print( object objValue, Graphics g, Size size )
  6604. {
  6605. Hashtable htData = (Hashtable)objValue;
  6606. ArrayList Alist = (ArrayList)htData["Alist"];
  6607. Brush b = Brushes.Black;
  6608. Pen p = GetPen;
  6609. Font ft16 = new Font( "宋体", 16 );
  6610. Font ft10 = new Font( "宋体", 10 );
  6611. Font ft8 = new Font( "宋体", 8 );
  6612. int LeftWidth = 30;
  6613. int TableWidth = size.Width - LeftWidth * 2;
  6614. int LeftAdd = 3;
  6615. int TopAdd = 5;
  6616. int RowHeight = 25;
  6617. int RowContentHeight = RowHeight - (TopAdd * 2);
  6618. //金色童年收据凭据
  6619. SizeF sizef = g.MeasureString( DefaultPrintTitle, ft16 );
  6620. int StrHeight = Convert.ToInt32( sizef.Height );
  6621. int StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  6622. Rectangle rec1 = new Rectangle( (size.Width - StrWidth) / 2, 50, StrWidth, StrHeight );
  6623. g.DrawString( DefaultPrintTitle, ft16, b, rec1 );
  6624. int Unit = TableWidth / 10;
  6625. int ColumnWidth1 = Unit * 4 - (Unit / 2 + (Unit / 4));
  6626. int ColumnWidth2 = Unit * 2 - (Unit / 2);
  6627. int ColumnWidth3 = Unit;
  6628. int ColumnWidth5 = Unit * 2 - 30;
  6629. int ColumnWidth4 = TableWidth - ColumnWidth1 - ColumnWidth2 - ColumnWidth3 - ColumnWidth5;
  6630. Rectangle rec2 = new Rectangle( LeftWidth, rec1.Y + rec1.Height, TableWidth, RowHeight );
  6631. g.DrawRectangle( p, rec2 );//画标题矩形
  6632. string StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "客人/电话" );
  6633. sizef = g.MeasureString( StrValue, ft10 );
  6634. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  6635. Rectangle rec2_1 = new Rectangle( rec2.X + (ColumnWidth1 - StrWidth) / 2, rec2.Y + TopAdd, ColumnWidth1, RowContentHeight );
  6636. g.DrawString( StrValue, ft10, b, rec2_1 );//画第一列的列标题
  6637. Point p1_1 = new Point( rec2.X + ColumnWidth1, rec2.Y );
  6638. Point p1_2 = new Point( rec2.X + ColumnWidth1, rec2.Y + rec2.Height );
  6639. g.DrawLine( p, p1_1, p1_2 );//画第一表与第二列的界线
  6640. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "看版时间" );
  6641. sizef = g.MeasureString( StrValue, ft10 );
  6642. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  6643. Rectangle rec2_2 = new Rectangle( p1_1.X + (ColumnWidth2 - StrWidth) / 2, p1_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
  6644. g.DrawString( StrValue, ft10, b, rec2_2 );//画第一列的列标题
  6645. Point p2_1 = new Point( p1_1.X + ColumnWidth2, rec2.Y );
  6646. Point p2_2 = new Point( p1_1.X + ColumnWidth2, rec2.Y + rec2.Height );
  6647. g.DrawLine( p, p2_1, p2_2 );//画第一表与第二列的界线
  6648. Rectangle rec2_3 = new Rectangle( p2_1.X + LeftAdd, p2_1.Y + TopAdd, ColumnWidth3, RowContentHeight );
  6649. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "看版师" ), ft10, b, rec2_3 );//画第一列的列标题
  6650. Point p3_1 = new Point( p2_1.X + ColumnWidth3, rec2.Y );
  6651. Point p3_2 = new Point( p2_1.X + ColumnWidth3, rec2.Y + rec2.Height );
  6652. g.DrawLine( p, p3_1, p3_2 );//画第一表与第二列的界线
  6653. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "套系名称" );
  6654. sizef = g.MeasureString( StrValue, ft10 );
  6655. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  6656. Rectangle rec2_4 = new Rectangle( p3_1.X + (ColumnWidth4 - StrWidth) / 2, p3_1.Y + TopAdd, ColumnWidth4, RowContentHeight );
  6657. g.DrawString( StrValue, ft10, b, rec2_4 );//画第一列的列标题
  6658. Point p4_1 = new Point( p3_1.X + ColumnWidth4, rec2.Y );
  6659. Point p4_2 = new Point( p3_1.X + ColumnWidth4, rec2.Y + rec2.Height );
  6660. g.DrawLine( p, p4_1, p4_2 );//画第一表与第二列的界线
  6661. StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "门市" );
  6662. sizef = g.MeasureString( StrValue, ft10 );
  6663. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  6664. Rectangle rec2_5 = new Rectangle( p4_1.X + (ColumnWidth5 - StrWidth) / 2, p4_1.Y + TopAdd, ColumnWidth5, RowContentHeight );
  6665. g.DrawString( StrValue, ft10, b, rec2_5 );//画第一列的列标题
  6666. DataTable newTable = new DataTable();
  6667. string StrWhere = "";
  6668. for ( int i = 0; i < Alist.Count; i++ )
  6669. {
  6670. StrWhere += "'" + Alist[i].ToString().Trim() + "',";
  6671. }
  6672. if ( !string.IsNullOrEmpty( StrWhere.Trim() ) )
  6673. {
  6674. StrWhere = " Where Ordv_ViceNumber in (" + StrWhere.TrimEnd( ',' ) + ")";
  6675. newTable = LYFZ.BLL.BLL_ErpOrderView.GetData_CameraControlBookLookDesign_DetailPrint( StrWhere );
  6676. newTable.PrimaryKey = new DataColumn[] { newTable.Columns["Ordv_ViceNumber"] };
  6677. }
  6678. int RowHeight2 = 22;
  6679. int RowContentHeight2 = RowHeight2 - (TopAdd * 2);
  6680. int IntPoint_Y = rec2.Y + rec2.Height;
  6681. for ( int i = 0; i < Alist.Count; i++ )
  6682. {
  6683. if ( i >= 43 )
  6684. {
  6685. break;
  6686. }
  6687. DataRow dtRow = newTable.Rows.Find( Alist[i].ToString().Trim() );
  6688. Rectangle recfor = new Rectangle( rec2.X, IntPoint_Y, TableWidth, RowHeight2 );
  6689. g.DrawRectangle( p, recfor );//画标题矩形
  6690. string StrName = dtRow["主客户姓名"].ToString().Trim().Replace( "/", "," );
  6691. if ( StrName != "" )
  6692. {
  6693. string StrPhone = dtRow["主客户电话"].ToString().Trim().Replace( "/", "," );
  6694. if ( StrPhone != "" )
  6695. {
  6696. StrName += "/" + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( StrPhone );
  6697. }
  6698. }
  6699. Rectangle recfor2_1 = new Rectangle( recfor.X + LeftAdd, recfor.Y + TopAdd, ColumnWidth1, RowContentHeight2 );
  6700. g.DrawString( StrName, ft8, b, recfor2_1 );//画第一列的列标题
  6701. Point pfor1_1 = new Point( recfor.X + ColumnWidth1, recfor.Y );
  6702. Point pfor1_2 = new Point( recfor.X + ColumnWidth1, recfor.Y + recfor.Height );
  6703. g.DrawLine( p, pfor1_1, pfor1_2 );//画第一表与第二列的界线
  6704. Rectangle recfor2_2 = new Rectangle( pfor1_1.X + LeftAdd, pfor1_1.Y + TopAdd, ColumnWidth2, RowContentHeight2 );
  6705. g.DrawString( LYFZ.BLL.OtherCommonModel.DateTimeToString( dtRow["看版时间"] ), ft8, b, recfor2_2 );//画第一列的列标题
  6706. Point pfor2_1 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y );
  6707. Point pfor2_2 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y + recfor.Height );
  6708. g.DrawLine( p, pfor2_1, pfor2_2 );//画第一表与第二列的界线
  6709. Rectangle recfor2_3 = new Rectangle( pfor2_1.X + LeftAdd, pfor2_1.Y + TopAdd, ColumnWidth3, RowContentHeight2 );
  6710. g.DrawString( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetUserName( dtRow["看版师"] ), ft8, b, recfor2_3 );//画第一列的列标题
  6711. Point pfor3_1 = new Point( pfor2_1.X + ColumnWidth3, recfor.Y );
  6712. Point pfor3_2 = new Point( pfor2_1.X + ColumnWidth3, recfor.Y + recfor.Height );
  6713. g.DrawLine( p, pfor3_1, pfor3_2 );//画第一表与第二列的界线
  6714. Rectangle recfor2_4 = new Rectangle( pfor3_1.X + LeftAdd, pfor3_1.Y + TopAdd, ColumnWidth4, RowContentHeight2 );
  6715. g.DrawString( dtRow["套系名称"].ToString().Trim(), ft8, b, recfor2_4 );//画第一列的列标题
  6716. Point pfor4_1 = new Point( pfor3_1.X + ColumnWidth4, recfor.Y );
  6717. Point pfor4_2 = new Point( pfor3_1.X + ColumnWidth4, recfor.Y + recfor.Height );
  6718. g.DrawLine( p, pfor4_1, pfor4_2 );//画第一表与第二列的界线
  6719. Rectangle recfor2_5 = new Rectangle( pfor4_1.X + LeftAdd, pfor4_1.Y + TopAdd, ColumnWidth5, RowContentHeight2 );
  6720. g.DrawString( dtRow["接单人"].ToString().Trim(), ft8, b, recfor2_5 );//画第一列的列标题
  6721. IntPoint_Y = recfor.Y + recfor.Height;
  6722. }
  6723. 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";
  6724. sizef = g.MeasureString( StrValue, ft8 );
  6725. StrHeight = Convert.ToInt32( sizef.Height );
  6726. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  6727. Rectangle rec3 = new Rectangle( rec2.X + rec2.Width - StrWidth, IntPoint_Y + 3, StrWidth, StrHeight );
  6728. g.DrawString( StrValue, ft8, b, rec3 );//画消费法规
  6729. }
  6730. #endregion
  6731. #region 取件明细
  6732. /// <summary>
  6733. /// 摄控本取件客人——明细
  6734. /// </summary>
  6735. /// <returns></returns>
  6736. public static void CameraControlBook_TakePiecesDetail_Print( object objValue, Graphics g, Size size )
  6737. {
  6738. Hashtable htData = (Hashtable)objValue;
  6739. ArrayList Alist = (ArrayList)htData["Alist"];
  6740. Brush b = Brushes.Black;
  6741. Pen p = GetPen;
  6742. Font ft16 = new Font( "宋体", 16 );
  6743. Font ft11 = new Font( "宋体", 11 );
  6744. Font ft10 = new Font( "宋体", 8 );
  6745. int LeftWidth = 30;
  6746. int TableWidth = size.Width - LeftWidth * 2;
  6747. int LeftAdd = 3;
  6748. int TopAdd = 5;
  6749. int RowHeight = 25;
  6750. int RowContentHeight = RowHeight - (TopAdd * 2);
  6751. //金色童年收据凭据
  6752. SizeF sizef = g.MeasureString( DefaultPrintTitle, ft16 );
  6753. int StrHeight = Convert.ToInt32( sizef.Height );
  6754. int StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  6755. Rectangle rec1 = new Rectangle( (size.Width - StrWidth) / 2, 50, StrWidth, StrHeight );
  6756. g.DrawString( DefaultPrintTitle, ft16, b, rec1 );
  6757. int Unit = TableWidth / 10;
  6758. int ColumnWidth2 = Unit * 2 - (Unit / 2);
  6759. int ColumnWidth3 = Unit + (Unit / 3);
  6760. int ColumnWidth4 = Unit;
  6761. int ColumnWidth5 = Unit * 2;
  6762. int ColumnWidth1 = TableWidth - ColumnWidth2 - ColumnWidth3 - ColumnWidth4 - ColumnWidth5;
  6763. Rectangle rec2 = new Rectangle( LeftWidth, rec1.Y + rec1.Height, TableWidth, RowHeight );
  6764. g.DrawRectangle( p, rec2 );//画标题矩形
  6765. Rectangle rec2_1 = new Rectangle( rec2.X + LeftAdd, rec2.Y + TopAdd, ColumnWidth1, RowContentHeight );
  6766. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客人/电话" ), ft11, b, rec2_1 );//画第一列的列标题
  6767. Point p1_1 = new Point( rec2.X + ColumnWidth1, rec2.Y );
  6768. Point p1_2 = new Point( rec2.X + ColumnWidth1, rec2.Y + rec2.Height );
  6769. g.DrawLine( p, p1_1, p1_2 );//画第一表与第二列的界线
  6770. Rectangle rec2_2 = new Rectangle( p1_1.X + LeftAdd, p1_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
  6771. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "取件时间" ), ft11, b, rec2_2 );//画第一列的列标题
  6772. Point p2_1 = new Point( p1_1.X + ColumnWidth2, rec2.Y );
  6773. Point p2_2 = new Point( p1_1.X + ColumnWidth2, rec2.Y + rec2.Height );
  6774. g.DrawLine( p, p2_1, p2_2 );//画第一表与第二列的界线
  6775. Rectangle rec2_3 = new Rectangle( p2_1.X + LeftAdd, p2_1.Y + TopAdd, ColumnWidth3, RowContentHeight );
  6776. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "取件人" ), ft11, b, rec2_3 );//画第一列的列标题
  6777. Point p3_1 = new Point( p2_1.X + ColumnWidth3, rec2.Y );
  6778. Point p3_2 = new Point( p2_1.X + ColumnWidth3, rec2.Y + rec2.Height );
  6779. g.DrawLine( p, p3_1, p3_2 );//画第一表与第二列的界线
  6780. Rectangle rec2_4 = new Rectangle( p3_1.X + LeftAdd, p3_1.Y + TopAdd, ColumnWidth4, RowContentHeight );
  6781. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "是否完成" ), ft11, b, rec2_4 );//画第一列的列标题
  6782. Point p4_1 = new Point( p3_1.X + ColumnWidth4, rec2.Y );
  6783. Point p4_2 = new Point( p3_1.X + ColumnWidth4, rec2.Y + rec2.Height );
  6784. g.DrawLine( p, p4_1, p4_2 );//画第一表与第二列的界线
  6785. Rectangle rec2_5 = new Rectangle( p4_1.X + LeftAdd, p4_1.Y + TopAdd, ColumnWidth5, RowContentHeight );
  6786. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "门市" ), ft11, b, rec2_5 );//画第一列的列标题
  6787. DataTable newTable = new DataTable();
  6788. string StrWhere = "";
  6789. for ( int i = 0; i < Alist.Count; i++ )
  6790. {
  6791. StrWhere += "'" + Alist[i].ToString().Trim() + "',";
  6792. }
  6793. if ( !string.IsNullOrEmpty( StrWhere.Trim() ) )
  6794. {
  6795. StrWhere = " Where Ordv_ViceNumber in (" + StrWhere.TrimEnd( ',' ) + ")";
  6796. newTable = LYFZ.BLL.BLL_ErpOrderView.GetData_CameraControlBookTotakePiece_DetailPrint( StrWhere );
  6797. newTable.PrimaryKey = new DataColumn[] { newTable.Columns["Ordv_ViceNumber"] };
  6798. }
  6799. int RowHeight2 = 20;
  6800. int RowContentHeight2 = RowHeight2 - (TopAdd * 2);
  6801. int IntPoint_Y = rec2.Y + rec2.Height;
  6802. for ( int i = 0; i < Alist.Count; i++ )
  6803. {
  6804. if ( i >= 47 )
  6805. {
  6806. break;
  6807. }
  6808. DataRow dtRow = newTable.Rows.Find( Alist[i].ToString().Trim() );
  6809. Rectangle recfor = new Rectangle( rec2.X, IntPoint_Y, rec2.Width, RowHeight2 );
  6810. g.DrawRectangle( p, recfor );//画标题矩形
  6811. string StrName = dtRow["主客户姓名"].ToString().Trim().Replace( "/", "," );
  6812. if ( StrName != "" )
  6813. {
  6814. string StrPhone = dtRow["主客户电话"].ToString().Trim().Replace( "/", "," );
  6815. if ( StrPhone != "" )
  6816. {
  6817. StrName += "/" + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( StrPhone );
  6818. }
  6819. }
  6820. Rectangle recfor2_1 = new Rectangle( recfor.X + LeftAdd, recfor.Y + TopAdd, ColumnWidth1, RowContentHeight2 );
  6821. g.DrawString( StrName, ft10, b, recfor2_1 );//画第一列的列标题
  6822. Point pfor1_1 = new Point( recfor.X + ColumnWidth1, recfor.Y );
  6823. Point pfor1_2 = new Point( recfor.X + ColumnWidth1, recfor.Y + recfor.Height );
  6824. g.DrawLine( p, pfor1_1, pfor1_2 );//画第一表与第二列的界线
  6825. Rectangle recfor2_2 = new Rectangle( pfor1_1.X + LeftAdd, pfor1_1.Y + TopAdd, ColumnWidth2, RowContentHeight2 );
  6826. g.DrawString( htData["TakePieceDate"].ToString().Trim(), ft10, b, recfor2_2 );//画第一列的列标题
  6827. Point pfor2_1 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y );
  6828. Point pfor2_2 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y + recfor.Height );
  6829. g.DrawLine( p, pfor2_1, pfor2_2 );//画第一表与第二列的界线
  6830. Rectangle recfor2_3 = new Rectangle( pfor2_1.X + LeftAdd, pfor2_1.Y + TopAdd, ColumnWidth3, RowContentHeight2 );
  6831. g.DrawString( dtRow["取件人"].ToString().Trim(), ft10, b, recfor2_3 );//画第一列的列标题
  6832. Point pfor3_1 = new Point( pfor2_1.X + ColumnWidth3, recfor.Y );
  6833. Point pfor3_2 = new Point( pfor2_1.X + ColumnWidth3, recfor.Y + recfor.Height );
  6834. g.DrawLine( p, pfor3_1, pfor3_2 );//画第一表与第二列的界线
  6835. Rectangle recfor2_4 = new Rectangle( pfor3_1.X + LeftAdd, pfor3_1.Y + TopAdd, ColumnWidth4, RowContentHeight2 );
  6836. g.DrawString( dtRow["完成状态"].ToString().Trim(), ft10, b, recfor2_4 );//画第一列的列标题
  6837. Point pfor4_1 = new Point( pfor3_1.X + ColumnWidth4, recfor.Y );
  6838. Point pfor4_2 = new Point( pfor3_1.X + ColumnWidth4, recfor.Y + recfor.Height );
  6839. g.DrawLine( p, pfor4_1, pfor4_2 );//画第一表与第二列的界线
  6840. Rectangle recfor2_5 = new Rectangle( pfor4_1.X + LeftAdd, pfor4_1.Y + TopAdd, ColumnWidth5, RowContentHeight2 );
  6841. g.DrawString( dtRow["接单人"].ToString().Trim(), ft10, b, recfor2_5 );//画第一列的列标题
  6842. IntPoint_Y = recfor.Y + recfor.Height;
  6843. }
  6844. 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";
  6845. sizef = g.MeasureString( StrValue, ft10 );
  6846. StrHeight = Convert.ToInt32( sizef.Height );
  6847. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  6848. Rectangle rec3 = new Rectangle( rec2.X + TableWidth - StrWidth, IntPoint_Y + 3, StrWidth, StrHeight );
  6849. g.DrawString( StrValue, ft10, b, rec3 );//画消费法规
  6850. }
  6851. #endregion
  6852. #region 婚庆明细
  6853. /// <summary>
  6854. /// 摄控本婚庆客人——明细
  6855. /// 分页未完成
  6856. /// </summary>
  6857. /// <returns></returns>
  6858. public static void CameraControlBook_WeddingDetail_Print( object objValue, Graphics g, Size size )
  6859. {
  6860. Hashtable htData = (Hashtable)objValue;
  6861. ArrayList Alist = (ArrayList)htData["Alist"];
  6862. Brush b = Brushes.Black;
  6863. Pen p = GetPen;
  6864. Font ft16 = new Font( "宋体", 16 );
  6865. Font ft11 = new Font( "宋体", 9 );
  6866. Font ft9 = new Font( "宋体", 9 );
  6867. int LeftWidth = 30;
  6868. int LeftAdd = 3;
  6869. int TopAdd = 5;
  6870. int RowHeight = 22;
  6871. int RowContentHeight = RowHeight - (TopAdd * 2);
  6872. int TableWidth = size.Width - LeftWidth * 2;
  6873. //金色童年收据凭据
  6874. SizeF sizef = g.MeasureString( DefaultPrintTitle, ft16 );
  6875. int StrHeight = Convert.ToInt32( sizef.Height );
  6876. int StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  6877. Rectangle rec1 = new Rectangle( (size.Width - StrWidth) / 2, 50, StrWidth, StrHeight );
  6878. g.DrawString( DefaultPrintTitle, ft16, b, rec1 );
  6879. int MUnit = TableWidth / 6;
  6880. int MColumnWidth1 = MUnit - (MUnit / 3);
  6881. int MColumnWidth2 = MUnit * 2;
  6882. int MColumnWidth3 = MUnit - (MUnit / 3);
  6883. int MColumnWidth4 = TableWidth - MColumnWidth1 - MColumnWidth2 - MColumnWidth3;
  6884. DataTable newTable = new DataTable();
  6885. string StrWhere = "";
  6886. for ( int i = 0; i < Alist.Count; i++ )
  6887. {
  6888. StrWhere += "'" + Alist[i].ToString().Trim() + "',";
  6889. }
  6890. if ( !string.IsNullOrEmpty( StrWhere.Trim() ) )
  6891. {
  6892. StrWhere = " Where Ws_ViceNumber in (" + StrWhere.TrimEnd( ',' ) + ")";
  6893. newTable = LYFZ.BLL.BLL_ErpOrderView.GetData_CameraControlBookService_DetailPrint( StrWhere );
  6894. }
  6895. int MIntPoint_Y = rec1.Y + rec1.Height;
  6896. for ( int j = 0; j < Alist.Count; j++ )
  6897. {
  6898. DataRow[] dtRows = newTable.Select( "Ws_ViceNumber = '" + Alist[j].ToString().Trim() + "'" );
  6899. Rectangle rec2 = new Rectangle( LeftWidth, MIntPoint_Y, TableWidth, RowHeight );
  6900. g.DrawRectangle( p, rec2 );//画标题矩形
  6901. sizef = g.MeasureString( "客户姓名", ft11 );
  6902. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  6903. Rectangle rec2_1 = new Rectangle( (rec2.X + LeftAdd) + (MColumnWidth1 - StrWidth) - 10, rec2.Y + TopAdd, MColumnWidth1, RowContentHeight );
  6904. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名" ), ft11, b, rec2_1 );//画第一列的列标题
  6905. Point p21_1 = new Point( rec2.X + MColumnWidth1, rec2.Y );
  6906. Point p21_2 = new Point( rec2.X + MColumnWidth1, rec2.Y + rec2.Height );
  6907. g.DrawLine( p, p21_1, p21_2 );//画第一表与第二列的界线
  6908. Rectangle rec2_2 = new Rectangle( p21_1.X + LeftAdd, p21_1.Y + TopAdd, MColumnWidth2, RowContentHeight );
  6909. g.DrawString( dtRows[0]["主客户姓名"].ToString().Trim().Replace( "/", "," ), ft11, b, rec2_2 );//画第一列的列标题
  6910. Point p22_1 = new Point( p21_1.X + MColumnWidth2, rec2.Y );
  6911. Point p22_2 = new Point( p21_1.X + MColumnWidth2, rec2.Y + rec2.Height );
  6912. g.DrawLine( p, p22_1, p22_2 );//画第一表与第二列的界线
  6913. sizef = g.MeasureString( "电话", ft11 );
  6914. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  6915. Rectangle rec2_3 = new Rectangle( (p22_1.X + LeftAdd) + (MColumnWidth3 - StrWidth) - 10, p22_1.Y + TopAdd, MColumnWidth3, RowContentHeight );
  6916. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "电话" ), ft11, b, rec2_3 );//画第一列的列标题
  6917. Point p23_1 = new Point( p22_1.X + MColumnWidth3, rec2.Y );
  6918. Point p23_2 = new Point( p22_1.X + MColumnWidth3, rec2.Y + rec2.Height );
  6919. g.DrawLine( p, p23_1, p23_2 );//画第一表与第二列的界线
  6920. Rectangle rec2_4 = new Rectangle( p23_1.X + LeftAdd, p23_1.Y + TopAdd, MColumnWidth4, RowContentHeight );
  6921. g.DrawString( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( dtRows[0]["主客户电话"].ToString().Trim().Replace( "/", "," ) ), ft11, b, rec2_4 );//画第一列的列标题
  6922. Point p24_1 = new Point( p23_1.X + MColumnWidth4, rec2.Y );
  6923. Point p24_2 = new Point( p23_1.X + MColumnWidth4, rec2.Y + rec2.Height );
  6924. g.DrawLine( p, p24_1, p24_2 );//画第一表与第二列的界线
  6925. Rectangle rec3 = new Rectangle( LeftWidth, rec2.Y + rec2.Height, TableWidth, RowHeight );
  6926. g.DrawRectangle( p, rec3 );//画标题矩形
  6927. sizef = g.MeasureString( "门市", ft11 );
  6928. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  6929. Rectangle rec3_1 = new Rectangle( (rec3.X + LeftAdd) + (MColumnWidth1 - StrWidth) - 10, rec3.Y + TopAdd, MColumnWidth1, RowContentHeight );
  6930. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "门市" ), ft11, b, rec3_1 );//画第一列的列标题
  6931. Point p31_1 = new Point( rec3.X + MColumnWidth1, rec3.Y );
  6932. Point p31_2 = new Point( rec3.X + MColumnWidth1, rec3.Y + rec3.Height );
  6933. g.DrawLine( p, p31_1, p31_2 );//画第一表与第二列的界线
  6934. Rectangle rec3_2 = new Rectangle( p31_1.X + LeftAdd, p31_1.Y + TopAdd, MColumnWidth2, RowContentHeight );
  6935. g.DrawString( dtRows[0]["接单人"].ToString().Trim(), ft11, b, rec3_2 );//画第一列的列标题
  6936. Point p32_1 = new Point( p31_1.X + MColumnWidth2, rec3.Y );
  6937. Point p32_2 = new Point( p31_1.X + MColumnWidth2, rec3.Y + rec3.Height );
  6938. g.DrawLine( p, p32_1, p32_2 );//画第一表与第二列的界线
  6939. sizef = g.MeasureString( "套系名称", ft11 );
  6940. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  6941. Rectangle rec3_3 = new Rectangle( (p32_1.X + LeftAdd) + (MColumnWidth3 - StrWidth) - 10, p32_1.Y + TopAdd, MColumnWidth3, RowContentHeight );
  6942. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "套系名称" ), ft11, b, rec3_3 );//画第一列的列标题
  6943. Point p33_1 = new Point( p32_1.X + MColumnWidth3, rec3.Y );
  6944. Point p33_2 = new Point( p32_1.X + MColumnWidth3, rec3.Y + rec3.Height );
  6945. g.DrawLine( p, p33_1, p33_2 );//画第一表与第二列的界线
  6946. Rectangle rec3_4 = new Rectangle( p33_1.X + LeftAdd, p33_1.Y + TopAdd, MColumnWidth4, RowContentHeight );
  6947. g.DrawString( dtRows[0]["套系名称"].ToString().Trim(), ft11, b, rec3_4 );//画第一列的列标题
  6948. Rectangle rec4 = new Rectangle( LeftWidth, rec3.Y + rec3.Height, TableWidth, 3 );
  6949. g.DrawRectangle( p, rec4 );//画标题矩形
  6950. int Unit = TableWidth / 6;
  6951. int ColumnWidth1 = Unit * 2 + 100;
  6952. int ColumnWidth2 = Unit * 2 - 100;
  6953. int ColumnWidth3 = Unit;
  6954. int ColumnWidth4 = TableWidth - ColumnWidth1 - ColumnWidth2 - ColumnWidth3;
  6955. Rectangle rec5 = new Rectangle( LeftWidth, rec4.Y + rec4.Height, TableWidth, RowHeight );
  6956. g.DrawRectangle( p, rec5 );//画标题矩形
  6957. sizef = g.MeasureString( "服务内容", ft11 );
  6958. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  6959. Rectangle rec5_1 = new Rectangle( rec5.X + (ColumnWidth1 - StrWidth) / 2, rec5.Y + TopAdd, ColumnWidth1, RowContentHeight );
  6960. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "服务内容" ), ft11, b, rec5_1 );//画第一列的列标题
  6961. Point p51_1 = new Point( rec5.X + ColumnWidth1, rec5.Y );
  6962. Point p51_2 = new Point( rec5.X + ColumnWidth1, rec5.Y + rec5.Height );
  6963. g.DrawLine( p, p51_1, p51_2 );//画第一表与第二列的界线
  6964. sizef = g.MeasureString( "服务时间", ft11 );
  6965. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  6966. Rectangle rec5_2 = new Rectangle( p51_1.X + (ColumnWidth2 - StrWidth) / 2, p51_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
  6967. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "服务时间" ), ft11, b, rec5_2 );//画第一列的列标题
  6968. Point p52_1 = new Point( p51_1.X + ColumnWidth2, rec5.Y );
  6969. Point p52_2 = new Point( p51_1.X + ColumnWidth2, rec5.Y + rec5.Height );
  6970. g.DrawLine( p, p52_1, p52_2 );//画第一表与第二列的界线
  6971. sizef = g.MeasureString( "服务人员1", ft11 );
  6972. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  6973. Rectangle rec5_3 = new Rectangle( p52_1.X + (ColumnWidth3 - StrWidth) / 2, p52_1.Y + TopAdd, ColumnWidth3, RowContentHeight );
  6974. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "服务人员1" ), ft11, b, rec5_3 );//画第一列的列标题
  6975. Point p53_1 = new Point( p52_1.X + ColumnWidth3, rec5.Y );
  6976. Point p53_2 = new Point( p52_1.X + ColumnWidth3, rec5.Y + rec5.Height );
  6977. g.DrawLine( p, p53_1, p53_2 );//画第一表与第二列的界线
  6978. sizef = g.MeasureString( "服务人员2", ft11 );
  6979. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  6980. Rectangle rec5_4 = new Rectangle( p53_1.X + (ColumnWidth4 - StrWidth) / 2, p53_1.Y + TopAdd, ColumnWidth4, RowContentHeight );
  6981. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "服务人员2" ), ft11, b, rec5_4 );//画第一列的列标题
  6982. int IntPoint_Y = rec5.Y + rec5.Height;
  6983. for ( int i = 0; i < dtRows.Length; i++ )
  6984. {
  6985. Rectangle recfor = new Rectangle( rec2.X, IntPoint_Y, rec2.Width, RowHeight );
  6986. g.DrawRectangle( p, recfor );//画标题矩形
  6987. Rectangle recfor3_1 = new Rectangle( recfor.X + LeftAdd, recfor.Y + TopAdd, ColumnWidth1, RowContentHeight );
  6988. g.DrawString( dtRows[i]["服务内容"].ToString().Trim(), ft9, b, recfor3_1 );//画第一列的列标题
  6989. Point pfor1_1 = new Point( recfor.X + ColumnWidth1, recfor.Y );
  6990. Point pfor1_2 = new Point( recfor.X + ColumnWidth1, recfor.Y + recfor.Height );
  6991. g.DrawLine( p, pfor1_1, pfor1_2 );//画第一表与第二列的界线
  6992. Rectangle recfor3_2 = new Rectangle( pfor1_1.X + LeftAdd, pfor1_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
  6993. g.DrawString( LYFZ.BLL.OtherCommonModel.DateTimeToString( dtRows[i]["服务时间"] ), ft9, b, recfor3_2 );//画第一列的列标题
  6994. Point pfor2_1 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y );
  6995. Point pfor2_2 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y + recfor.Height );
  6996. g.DrawLine( p, pfor2_1, pfor2_2 );//画第一表与第二列的界线
  6997. Rectangle recfor3_3 = new Rectangle( pfor2_1.X + LeftAdd, pfor2_1.Y + TopAdd, ColumnWidth3, RowContentHeight );
  6998. g.DrawString( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetUserName( dtRows[i]["服务人员1"] ), ft9, b, recfor3_3 );//画第一列的列标题
  6999. Point pfor3_1 = new Point( pfor2_1.X + ColumnWidth3, recfor.Y );
  7000. Point pfor3_2 = new Point( pfor2_1.X + ColumnWidth3, recfor.Y + recfor.Height );
  7001. g.DrawLine( p, pfor3_1, pfor3_2 );//画第一表与第二列的界线
  7002. Rectangle recfor3_4 = new Rectangle( pfor3_1.X + LeftAdd, pfor3_1.Y + TopAdd, ColumnWidth4, RowContentHeight );
  7003. g.DrawString( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetUserName( dtRows[i]["服务人员2"] ), ft9, b, recfor3_4 );//画第一列的列标题
  7004. IntPoint_Y = recfor.Y + recfor.Height;
  7005. }
  7006. MIntPoint_Y = IntPoint_Y + 3;
  7007. }
  7008. 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";
  7009. sizef = g.MeasureString( StrValue, ft9 );
  7010. StrHeight = Convert.ToInt32( sizef.Height );
  7011. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  7012. Rectangle rec6 = new Rectangle( TableWidth + LeftWidth - StrWidth, MIntPoint_Y, StrWidth, StrHeight );
  7013. g.DrawString( StrValue, ft9, b, rec6 );//画消费法规
  7014. }
  7015. #endregion
  7016. #region 选片缩略图
  7017. /// <summary>
  7018. /// 选片缩略图
  7019. /// </summary>
  7020. /// <returns></returns>
  7021. public static void DoorCity_FilmSelectionThumbnail( object objValue, Graphics g, Size size )
  7022. {
  7023. PhotoSelectSystem.EventSelectPhotoPrint spmodel = ((PhotoSelectSystem.EventSelectPhotoPrint)objValue);
  7024. string GetFileName = "Cus_Name AS 客户姓名,M_Cus_Name AS 主客户姓名";
  7025. DataTable tbl = orbll.GetView_Custom( "tempTB_AggregationCustomer", ShowColumnName: GetFileName, StrWhere: "GP_OrderNumber ='" + spmodel.CurrentModel.Ord_Number + "'" ).Tables[0];
  7026. if ( tbl.Rows.Count <= 0 )
  7027. {
  7028. MessageBoxCustom.Show( "订单错误!" ); return;
  7029. }
  7030. if ( tbl.Rows.Count > 0 )
  7031. {
  7032. if ( !IsHasMorePages )
  7033. {
  7034. if ( !GetImgList( spmodel ) )
  7035. {
  7036. MessageBoxCustom.Show( "此单未选片" ); return;
  7037. }
  7038. }
  7039. ImageList Imglist = ImgSmallMapList;
  7040. #region 把拿出的ImageList中的图片,按规则画到每一张图片上去
  7041. Brush b = Brushes.Black;
  7042. Pen p = GetPen;
  7043. int LeftWidth = 30;
  7044. Font ft16 = new Font( "宋体", 16 );
  7045. Font ft10 = new Font( "宋体", 10 );
  7046. Font ft9 = new Font( "宋体", 9 );
  7047. int PerNumber = 42;
  7048. int PageCount = Imglist.Images.Count / PerNumber;
  7049. if ( Imglist.Images.Count % PerNumber > 0 )
  7050. {
  7051. PageCount++;
  7052. }
  7053. int TableWidth = size.Width - LeftWidth * 2;
  7054. string StrName = tbl.Rows[0]["客户姓名"].ToString().Trim();
  7055. SizeF sizef = g.MeasureString( StrName, ft16 );
  7056. int StrHeight = Convert.ToInt32( sizef.Height );
  7057. int StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  7058. Rectangle rec1 = new Rectangle( LeftWidth, 50, (TableWidth / 4 * 3), StrHeight );
  7059. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客人:" ) + StrName + LYFZ.BLL.OtherCommonModel.FontConversion( " — 选片小图" ), ft16, b, rec1 );
  7060. string PageValue = LYFZ.BLL.OtherCommonModel.FontConversion( "页:" ) + PrintCurrentIndexPage + "/" + PageCount;
  7061. sizef = g.MeasureString( PageValue, ft9 );
  7062. StrHeight = Convert.ToInt32( sizef.Height );
  7063. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  7064. Rectangle rec1_1 = new Rectangle( rec1.X + TableWidth - StrWidth, rec1.Y + 2, StrWidth, StrHeight );
  7065. g.DrawString( PageValue, ft9, b, rec1_1 );
  7066. 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" );
  7067. sizef = g.MeasureString( PageValue, ft9 );
  7068. StrHeight = Convert.ToInt32( sizef.Height );
  7069. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  7070. Rectangle rec1_2 = new Rectangle( rec1.X + TableWidth - StrWidth + 5, rec1.Y + StrHeight - 2, StrWidth, StrHeight );
  7071. g.DrawString( PageValue, ft9, b, rec1_2 );
  7072. g.DrawLine( p, rec1.X, rec1.Y + rec1.Height + 2, rec1.X + TableWidth, rec1.Y + rec1.Height + 2 );
  7073. int i_Y = rec1.Y + rec1.Height + 5;
  7074. int HeightAdd = 0;
  7075. bool IsNextPage = false;
  7076. //画行
  7077. for ( int i = 1; i <= 6; i++ )
  7078. {
  7079. int l_H = 95;
  7080. int j_X = rec1.X;
  7081. //画列
  7082. for ( int j = 0; j < 7; j++ )
  7083. {
  7084. if ( PrintForCount >= Imglist.Images.Count )
  7085. {
  7086. break;
  7087. }
  7088. Rectangle rec3 = new Rectangle( j_X, i_Y, l_H, l_H );
  7089. g.DrawImage( Imglist.Images[PrintForCount], rec3 );
  7090. HeightAdd = 65;
  7091. Rectangle rec4 = new Rectangle( rec3.X, rec3.Y + rec3.Height + 3, rec3.Width, HeightAdd );
  7092. g.DrawString( Imglist.Images.Keys[PrintForCount], ft9, b, rec4 );
  7093. PrintForCount++;
  7094. j_X += rec3.Width + 10;
  7095. }
  7096. i_Y += l_H + HeightAdd;
  7097. if ( i == 6 && PrintForCount < Imglist.Images.Count )
  7098. {
  7099. PrintCurrentIndexPage++;
  7100. IsNextPage = true;
  7101. IsHasMorePages = true;
  7102. return;
  7103. }
  7104. }
  7105. if ( !IsNextPage )
  7106. {
  7107. IsHasMorePages = false;
  7108. }
  7109. #endregion
  7110. }
  7111. else
  7112. {
  7113. MessageBoxCustom.Show( "此单不存在" ); return;
  7114. }
  7115. }
  7116. private static ImageList ImgSmallMapList;
  7117. private static bool GetImgList( PhotoSelectSystem.EventSelectPhotoPrint spmodel )
  7118. {
  7119. List<LYFZ.PhotoSelectSystem.SelectPhotoInfo> list = spmodel.GetSeletedPhotoList();
  7120. if ( list.Count > 0 )
  7121. {
  7122. #region 先把所有图片拿出来放到ImageList中去
  7123. ImageList Imglist = new ImageList();
  7124. Imglist.ImageSize = new Size( 256, 256 );
  7125. Imglist.ColorDepth = ColorDepth.Depth32Bit;
  7126. for ( int listCout = 0; listCout < list.Count; listCout++ )
  7127. {
  7128. string PhotoPath = list[listCout].SmallBmpFilePath.Trim();
  7129. string OriginalPath = LYFZ.BLL.SelectPhotoHandling.SmallPathToOriginalPath( PhotoPath );//原图路径
  7130. string bb = LYFZ.BLL.SelectPhotoHandling.ServerFileNameToOriginalName( BLL.SelectPhotoHandling.PhotoType.Original, System.IO.Path.GetFileName( OriginalPath ) );
  7131. string PhotoName = GetPhotoInProductName( bb, spmodel.CurrentSelectPhotoInfo );
  7132. System.IO.FileStream fs = new System.IO.FileStream( PhotoPath, System.IO.FileMode.Open, System.IO.FileAccess.Read );
  7133. System.Drawing.Image.FromStream( fs );
  7134. Imglist.Images.Add( PhotoName, System.Drawing.Image.FromStream( fs ) );
  7135. }
  7136. ImgSmallMapList = Imglist;
  7137. return true;
  7138. #endregion
  7139. }
  7140. MessageBoxCustom.Show( "此单未选片" ); return false;
  7141. }
  7142. static string GetPhotoInProductName( string photoName, LYFZ.BLL.ProductSelectedPhotoInfo productObj )
  7143. {
  7144. string productNames = photoName;
  7145. foreach ( LYFZ.BLL.ProductSelectedInfo product in productObj.ProductSelectedList )
  7146. {
  7147. if ( product.CheckPhotoExist( photoName ) )
  7148. {
  7149. productNames += "/" + product.ProductName;
  7150. }
  7151. }
  7152. return productNames;
  7153. }
  7154. #endregion
  7155. #region 制作单明细
  7156. /// <summary>
  7157. /// 制作单明细
  7158. /// </summary>
  7159. /// <returns></returns>
  7160. 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)
  7161. {
  7162. #region 获取资料
  7163. Bitmap panlImage = null;
  7164. Brush b = Brushes.Black;
  7165. Pen p = GetPen;
  7166. int LeftWidth = 20;
  7167. int LeftAdd = 3;
  7168. int TopAdd = 4;
  7169. int RowHeight = 20;
  7170. int RowContentHeight = RowHeight - (TopAdd * 2);
  7171. Font ft18 = new Font("宋体", 16);
  7172. Font ft16 = new Font("宋体", 13);
  7173. Font ft10 = new Font("宋体", 9);
  7174. Font ft9 = new Font("宋体", 9);
  7175. PhotoSelectSystem.EventSelectPhotoPrint spmodel = ((PhotoSelectSystem.EventSelectPhotoPrint)objValue);
  7176. LYFZ.Model.Model_ErpOrder Mmdl = spmodel.CurrentModel;
  7177. LYFZ.Model.Model_ErpOrderDigital modeDig = spmodel.CurrentDigModel;
  7178. string StrTableName = "tb_ErpOrder LEFT JOIN tb_ErpOrderDigital ON Ord_Number = Ordv_Number left join tempTB_AggregationCustomer ON Ord_Number = GP_OrderNumber";
  7179. 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 选片日期," +
  7180. "(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 看设计日期," +
  7181. "(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 摄影师," +
  7182. "(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 化妆师," +
  7183. "(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 引导师," +
  7184. "(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 拍摄日期," +
  7185. "(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 欠款," +
  7186. "(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 取件日期," +
  7187. "(select top 1 dbo.fn_CheckUserIDGetUserName(OPlist_PickupName) from tb_ErpOrderProductList where OPlist_ViceNumber = Ordv_ViceNumber Order by OPlist_PickupTime ASC) AS 取件师";
  7188. string ExecuteSql = orbll.GetView_CustomReturnExecuteSql("tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Name,Company_Telephone,Company_Address");
  7189. ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql(StrTableName, StrWhere: "Ord_Number = '" + Mmdl.Ord_Number + "' and Ordv_ViceNumber = '" + modeDig.Ordv_ViceNumber + "'", ShowColumnName: StrFildeName);
  7190. ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql("tb_ErpOrdersPhotography", StrWhere: "Ordpg_ViceNumber = '" + modeDig.Ordv_ViceNumber + "'", ShowColumnName: "Ordpg_Sights");
  7191. if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintProductionOrderUseApecialTemplate)
  7192. {
  7193. ExecuteSql += ";" + String.Format(@" select Pay_OrdNumber,[Plu_OrdNumber],Plu_OrdViceNumber,
  7194. Pay_DividedShop,Pay_ViceNumber
  7195. ,Pay_Category,Pay_TwoPinsCategory,Pay_AmountOf,Pay_PaymentDiscount,Pay_DiscountAmount,Pay_OpenSingle,Pay_ThePayee,Pay_PaymentMethod,Pay_CreateDatetime
  7196. from [dbo].[tb_ErpPayment]
  7197. left join [dbo].[tb_ErpPlusPickItems]
  7198. on Pay_PlusPickNumber=Plu_Number
  7199. where [Plu_SourceType]=1 and [Plu_OrdNumber]='{0}' order by Pay_CreateDatetime ", Mmdl.Ord_Number, modeDig.Ordv_ViceNumber);
  7200. }
  7201. DataSet dtSet = orbll.GetView_Custom(ExecuteSql);
  7202. DataTable tbl = dtSet.Tables["ds"];//获取影楼信息
  7203. DataTable tb_ord = dtSet.Tables["ds1"];//订单
  7204. DataTable tb_Sights = dtSet.Tables["ds2"];//拍摄名称
  7205. if (tbl.Rows.Count <= 0)
  7206. {
  7207. MessageBoxCustom.Show("未设置影楼信息"); return null;
  7208. }
  7209. int top_TableWidth = size.Width - LeftWidth * 2 - 20;
  7210. int top_ColumnWidth1 = 70;
  7211. int top_ColumnWidth2 = 110;
  7212. int top_ColumnWidth3 = 70;
  7213. int top_ColumnWidth5 = 70;
  7214. int top_ColumnWidth6 = 140;
  7215. int top_ColumnWidth4 = top_TableWidth - top_ColumnWidth1 - top_ColumnWidth2 - top_ColumnWidth3 - top_ColumnWidth5 - top_ColumnWidth6;
  7216. #endregion
  7217. if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintProductionOrderUseApecialTemplate)
  7218. {
  7219. panlImage = GetSelectPhotoSpecialTemplate(dtSet, spmodel, size, g1, ref pListData, iPage, LeftWidth, LeftAdd, TopAdd, RowHeight, RowContentHeight, ref dicKeyList);
  7220. }
  7221. else
  7222. {
  7223. int sizeHeight = size.Height - 120;
  7224. for (int k = 0; k < 2; k++)
  7225. {
  7226. panlImage = new Bitmap(size.Width, sizeHeight);
  7227. Graphics g = g1;//Graphics.FromImage(panlImage);
  7228. #region 基本资料
  7229. string rec2Value = tbl.Rows[0]["Company_Name"].ToString().Trim() + LYFZ.BLL.OtherCommonModel.FontConversion("制作单明细");
  7230. SizeF sizef = g.MeasureString(rec2Value, ft18);
  7231. int StrHeigth = Convert.ToInt32(sizef.Height);
  7232. int StrWidth = Convert.ToInt32(sizef.Width) + 1;
  7233. Rectangle top_rec1 = new Rectangle((panlImage.Width - StrWidth) / 2, 30, StrWidth, StrHeigth);
  7234. g.DrawString(rec2Value, ft18, b, top_rec1);
  7235. #region 第一行
  7236. Rectangle top_rec2 = new Rectangle(LeftWidth, top_rec1.Y + top_rec1.Height + 5, top_TableWidth, RowHeight);
  7237. g.DrawRectangle(p, top_rec2);//画标题矩形
  7238. Rectangle top_rec2_1 = new Rectangle(top_rec2.X + LeftAdd, top_rec2.Y + TopAdd, top_ColumnWidth1, RowContentHeight);
  7239. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("订单号"), ft10, b, top_rec2_1);
  7240. Point top_p21_1 = new Point(top_rec2.X + top_ColumnWidth1, top_rec2.Y);
  7241. Point top_p21_2 = new Point(top_rec2.X + top_ColumnWidth1, top_rec2.Y + top_rec2.Height);
  7242. g.DrawLine(p, top_p21_1, top_p21_2);
  7243. string OrdNumber = "";
  7244. if (spmodel.CurrentModel.Ord_SinceOrderNumber != "")
  7245. {
  7246. OrdNumber = spmodel.CurrentModel.Ord_SinceOrderNumber;
  7247. }
  7248. else
  7249. {
  7250. OrdNumber = spmodel.CurrentModel.Ord_Number;
  7251. }
  7252. Rectangle top_rec2_2 = new Rectangle(top_p21_1.X + LeftAdd, top_p21_1.Y + TopAdd, top_ColumnWidth2, RowContentHeight);
  7253. g.DrawString(OrdNumber, ft10, b, top_rec2_2);
  7254. Point top_p22_1 = new Point(top_rec2_2.X + top_ColumnWidth2, top_rec2.Y);
  7255. Point top_p22_2 = new Point(top_rec2_2.X + top_ColumnWidth2, top_rec2.Y + top_rec2.Height);
  7256. g.DrawLine(p, top_p22_1, top_p22_2);
  7257. Rectangle top_rec2_3 = new Rectangle(top_p22_1.X + LeftAdd, top_p22_1.Y + TopAdd, top_ColumnWidth3 + top_ColumnWidth4, RowContentHeight);
  7258. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideArrears)
  7259. {
  7260. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("套系名称:") + spmodel.CurrentModel.Ord_SeriesName + LYFZ.BLL.OtherCommonModel.FontConversion(" 欠款:") + tb_ord.Rows[0]["欠款"].ToString(), ft10, b, top_rec2_3);
  7261. }
  7262. else
  7263. {
  7264. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("套系名称:") + spmodel.CurrentModel.Ord_SeriesName, ft10, b, top_rec2_3);
  7265. }
  7266. //Point top_p23_1 = new Point(top_rec2_3.X + top_ColumnWidth3, top_rec2.Y);
  7267. //Point top_p23_2 = new Point(top_rec2_3.X + top_ColumnWidth3, top_rec2.Y + top_rec2.Height);
  7268. //g.DrawLine(p, top_p23_1, top_p23_2);
  7269. //Rectangle top_rec2_4 = new Rectangle(top_p23_1.X + LeftAdd, top_p23_1.Y + TopAdd, top_ColumnWidth4, RowContentHeight);
  7270. //g.DrawString(spmodel.CurrentModel.Ord_SeriesName, ft10, b, top_rec2_4);
  7271. Point top_p24_1 = new Point(top_rec2_3.X + top_rec2_3.Width + LeftAdd, top_rec2.Y);
  7272. Point top_p24_2 = new Point(top_rec2_3.X + top_rec2_3.Width + LeftAdd, top_rec2.Y + top_rec2.Height);
  7273. g.DrawLine(p, top_p24_1, top_p24_2);
  7274. Rectangle top_rec2_5 = new Rectangle(top_p24_1.X + LeftAdd, top_p24_1.Y + TopAdd, top_ColumnWidth5 + top_ColumnWidth6, RowContentHeight);
  7275. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
  7276. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("入底加挑:") + spmodel.IntoBottomPickNumber + LYFZ.BLL.OtherCommonModel.FontConversion(" 入册加挑:") + spmodel.IntoRegisterPickNumber, ft10, b, top_rec2_5);
  7277. //Point top_p25_1 = new Point(top_rec2_5.X + top_ColumnWidth5, top_rec2.Y);
  7278. //Point top_p25_2 = new Point(top_rec2_5.X + top_ColumnWidth5, top_rec2.Y + top_rec2.Height);
  7279. //g.DrawLine(p, top_p25_1, top_p25_2);
  7280. //Rectangle top_rec2_6 = new Rectangle(top_p25_1.X + LeftAdd, top_p25_1.Y + TopAdd, top_ColumnWidth6, RowContentHeight);
  7281. //g.DrawString(spmodel.PlusPickSumCount.ToString().Trim(), ft10, b, top_rec2_6);
  7282. #endregion
  7283. #region 第二行
  7284. Rectangle top_rec3 = new Rectangle(LeftWidth, top_rec2.Y + top_rec2.Height, top_TableWidth, RowHeight);
  7285. g.DrawRectangle(p, top_rec3);//画标题矩形
  7286. Rectangle top_rec3_1 = new Rectangle(top_rec3.X + LeftAdd, top_rec3.Y + TopAdd, top_ColumnWidth1, RowContentHeight);
  7287. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("客户姓名"), ft10, b, top_rec3_1);
  7288. Point top_p31_1 = new Point(top_rec3.X + top_ColumnWidth1, top_rec3.Y);
  7289. Point top_p31_2 = new Point(top_rec3.X + top_ColumnWidth1, top_rec3.Y + top_rec3.Height);
  7290. g.DrawLine(p, top_p31_1, top_p31_2);
  7291. string StrUserName = tb_ord.Rows[0]["客户姓名"].ToString().Trim();
  7292. string StrPhone = tb_ord.Rows[0]["客户电话"].ToString().Trim();
  7293. if (tb_ord.Rows[0]["Ord_Type"].ToString().Trim() == "2")
  7294. {
  7295. StrUserName = tb_ord.Rows[0]["主客户姓名"].ToString().Trim();
  7296. StrPhone = tb_ord.Rows[0]["主客户电话"].ToString().Trim();
  7297. }
  7298. Rectangle top_rec3_2 = new Rectangle(top_p31_1.X + LeftAdd, top_p31_1.Y + TopAdd, top_ColumnWidth2, RowContentHeight);
  7299. g.DrawString(StrUserName, ft10, b, top_rec3_2);
  7300. Point top_p32_1 = new Point(top_rec3_2.X + top_ColumnWidth2, top_rec3.Y);
  7301. Point top_p32_2 = new Point(top_rec3_2.X + top_ColumnWidth2, top_rec3.Y + top_rec3.Height);
  7302. g.DrawLine(p, top_p32_1, top_p32_2);
  7303. Rectangle top_rec3_3 = new Rectangle(top_p32_1.X + LeftAdd, top_p32_1.Y + TopAdd, top_ColumnWidth3, RowContentHeight);
  7304. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("客户电话"), ft10, b, top_rec3_3);
  7305. Point top_p33_1 = new Point(top_rec3_3.X + top_ColumnWidth3, top_rec3.Y);
  7306. Point top_p33_2 = new Point(top_rec3_3.X + top_ColumnWidth3, top_rec3.Y + top_rec3.Height);
  7307. g.DrawLine(p, top_p33_1, top_p33_2);
  7308. Rectangle top_rec3_4 = new Rectangle(top_p33_1.X + LeftAdd, top_p33_1.Y + TopAdd, top_ColumnWidth4, RowContentHeight);
  7309. g.DrawString(LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls(StrPhone), ft10, b, top_rec3_4);
  7310. Point top_p34_1 = new Point(top_rec3_4.X + top_ColumnWidth4, top_rec3.Y);
  7311. Point top_p34_2 = new Point(top_rec3_4.X + top_ColumnWidth4, top_rec3.Y + top_rec3.Height);
  7312. g.DrawLine(p, top_p34_1, top_p34_2);
  7313. Rectangle top_rec3_5 = new Rectangle(top_p34_1.X + LeftAdd, top_p34_1.Y + TopAdd, top_ColumnWidth5, RowContentHeight);
  7314. if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
  7315. {
  7316. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("金额"), ft10, b, top_rec3_5);
  7317. }
  7318. else
  7319. {
  7320. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("加挑金额"), ft10, b, top_rec3_5);
  7321. }
  7322. Point top_p35_1 = new Point(top_rec3_5.X + top_ColumnWidth5, top_rec3.Y);
  7323. Point top_p35_2 = new Point(top_rec3_5.X + top_ColumnWidth5, top_rec3.Y + top_rec3.Height);
  7324. g.DrawLine(p, top_p35_1, top_p35_2);
  7325. Rectangle top_rec3_6 = new Rectangle(top_p35_1.X + LeftAdd, top_p35_1.Y + TopAdd, top_ColumnWidth6, RowContentHeight);
  7326. if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
  7327. {
  7328. g.DrawString(spmodel.CurrentModel.Ord_SeriesPrice.ToString("n2").Trim(), ft10, b, top_rec3_6);
  7329. }
  7330. else
  7331. {
  7332. g.DrawString(spmodel.PlusPickAmount.ToString().Trim(), ft10, b, top_rec3_6);
  7333. }
  7334. #endregion
  7335. #region 第三行
  7336. Rectangle top_rec4 = new Rectangle(LeftWidth, top_rec3.Y + top_rec3.Height, top_TableWidth, RowHeight);
  7337. g.DrawRectangle(p, top_rec4);//画标题矩形
  7338. Rectangle top_rec4_1 = new Rectangle(top_rec4.X + LeftAdd, top_rec4.Y + TopAdd, top_ColumnWidth1, RowContentHeight);
  7339. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("摄影师"), ft10, b, top_rec4_1);
  7340. Point top_p41_1 = new Point(top_rec4.X + top_ColumnWidth1, top_rec4.Y);
  7341. Point top_p41_2 = new Point(top_rec4.X + top_ColumnWidth1, top_rec4.Y + top_rec4.Height);
  7342. g.DrawLine(p, top_p41_1, top_p41_2);
  7343. Rectangle top_rec4_2 = new Rectangle(top_p41_1.X + LeftAdd, top_p41_1.Y + TopAdd, top_ColumnWidth2, RowContentHeight);
  7344. g.DrawString(tb_ord.Rows[0]["摄影师"].ToString().Trim(), ft10, b, top_rec4_2);
  7345. Point top_p42_1 = new Point(top_rec4_2.X + top_ColumnWidth2, top_rec4.Y);
  7346. Point top_p42_2 = new Point(top_rec4_2.X + top_ColumnWidth2, top_rec4.Y + top_rec4.Height);
  7347. g.DrawLine(p, top_p42_1, top_p42_2);
  7348. Rectangle top_rec4_3 = new Rectangle(top_p42_1.X + LeftAdd, top_p42_1.Y + TopAdd, top_ColumnWidth3, RowContentHeight);
  7349. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("门市"), ft10, b, top_rec4_3);
  7350. Point top_p43_1 = new Point(top_rec4_3.X + top_ColumnWidth3, top_rec4.Y);
  7351. Point top_p43_2 = new Point(top_rec4_3.X + top_ColumnWidth3, top_rec4.Y + top_rec4.Height);
  7352. g.DrawLine(p, top_p43_1, top_p43_2);
  7353. Rectangle top_rec4_4 = new Rectangle(top_p43_1.X + LeftAdd, top_p43_1.Y + TopAdd, top_ColumnWidth4, RowContentHeight);
  7354. g.DrawString(tb_ord.Rows[0]["接单人"].ToString().Trim(), ft10, b, top_rec4_4);
  7355. Point top_p44_1 = new Point(top_rec4_4.X + top_ColumnWidth4, top_rec4.Y);
  7356. Point top_p44_2 = new Point(top_rec4_4.X + top_ColumnWidth4, top_rec4.Y + top_rec4.Height);
  7357. g.DrawLine(p, top_p44_1, top_p44_2);
  7358. Rectangle top_rec4_5 = new Rectangle(top_p44_1.X + LeftAdd, top_p44_1.Y + TopAdd, top_ColumnWidth5, RowContentHeight);
  7359. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("预约取件"), ft10, b, top_rec4_5);
  7360. Point top_p45_1 = new Point(top_rec4_5.X + top_ColumnWidth5, top_rec4.Y);
  7361. Point top_p45_2 = new Point(top_rec4_5.X + top_ColumnWidth5, top_rec4.Y + top_rec4.Height);
  7362. g.DrawLine(p, top_p45_1, top_p45_2);
  7363. Rectangle top_rec4_6 = new Rectangle(top_p45_1.X + LeftAdd, top_p45_1.Y + TopAdd, top_ColumnWidth6, RowContentHeight);
  7364. g.DrawString(LYFZ.Command.Command_Validate.DateTimeToString2(tb_ord.Rows[0]["预约取件日期"]), ft10, b, top_rec4_6);
  7365. #endregion
  7366. #region 第四行
  7367. Rectangle top_rec5 = new Rectangle(LeftWidth, top_rec4.Y + top_rec4.Height, top_TableWidth, RowHeight);
  7368. g.DrawRectangle(p, top_rec5);//画标题矩形
  7369. Rectangle top_rec5_1 = new Rectangle(top_rec5.X + LeftAdd, top_rec5.Y + TopAdd, top_ColumnWidth1, RowContentHeight);
  7370. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("拍摄日期"), ft10, b, top_rec5_1);
  7371. Point top_p51_1 = new Point(top_rec5.X + top_ColumnWidth1, top_rec5.Y);
  7372. Point top_p51_2 = new Point(top_rec5.X + top_ColumnWidth1, top_rec5.Y + top_rec5.Height);
  7373. g.DrawLine(p, top_p51_1, top_p51_2);
  7374. Rectangle top_rec5_2 = new Rectangle(top_p51_1.X + LeftAdd, top_p51_1.Y + TopAdd, top_ColumnWidth2, RowContentHeight);
  7375. g.DrawString(LYFZ.Command.Command_Validate.DateTimeToString(tb_ord.Rows[0]["拍摄日期"]), ft10, b, top_rec5_2);
  7376. Point top_p52_1 = new Point(top_rec5_2.X + top_ColumnWidth2, top_rec5.Y);
  7377. Point top_p52_2 = new Point(top_rec5_2.X + top_ColumnWidth2, top_rec5.Y + top_rec5.Height);
  7378. g.DrawLine(p, top_p52_1, top_p52_2);
  7379. Rectangle top_rec5_3 = new Rectangle(top_p52_1.X + LeftAdd, top_p52_1.Y + TopAdd, top_ColumnWidth3, RowContentHeight);
  7380. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("化妆师"), ft10, b, top_rec5_3);
  7381. Point top_p53_1 = new Point(top_rec5_3.X + top_ColumnWidth3, top_rec5.Y);
  7382. Point top_p53_2 = new Point(top_rec5_3.X + top_ColumnWidth3, top_rec5.Y + top_rec5.Height);
  7383. g.DrawLine(p, top_p53_1, top_p53_2);
  7384. Rectangle top_rec5_4 = new Rectangle(top_p53_1.X + LeftAdd, top_p53_1.Y + TopAdd, top_ColumnWidth4, RowContentHeight);
  7385. g.DrawString(tb_ord.Rows[0]["化妆师"].ToString().Trim(), ft10, b, top_rec5_4);
  7386. Point top_p54_1 = new Point(top_rec5_4.X + top_ColumnWidth4, top_rec5.Y);
  7387. Point top_p54_2 = new Point(top_rec5_4.X + top_ColumnWidth4, top_rec5.Y + top_rec5.Height);
  7388. g.DrawLine(p, top_p54_1, top_p54_2);
  7389. string StrColumnName = "";
  7390. string StrColumnValue = "";
  7391. if (tb_ord.Rows[0]["Ord_Type"].ToString().Trim() == "1")
  7392. {
  7393. Rectangle top_rec5_5 = new Rectangle(top_p54_1.X + LeftAdd, top_p54_1.Y + TopAdd, top_ColumnWidth5, RowContentHeight);
  7394. StrColumnName = LYFZ.BLL.OtherCommonModel.FontConversion("引导师");
  7395. StrColumnValue = tb_ord.Rows[0]["引导师"].ToString().Trim();
  7396. top_rec5_5.X -= (top_ColumnWidth6 + 20);
  7397. g.DrawString(StrColumnName, ft10, b, top_rec5_5);
  7398. Point top_p55_1 = new Point(top_rec5_5.X - LeftAdd, top_rec5.Y);
  7399. Point top_p55_2 = new Point(top_rec5_5.X - LeftAdd, top_rec5.Y + top_rec5.Height);
  7400. g.DrawLine(p, top_p55_1, top_p55_2);
  7401. Rectangle top_rec5_6 = new Rectangle(top_p55_1.X + top_ColumnWidth5 + LeftAdd, top_p55_1.Y + TopAdd, top_ColumnWidth4, RowContentHeight);
  7402. g.DrawString(StrColumnValue, ft10, b, top_rec5_6);
  7403. top_p55_1 = new Point(top_rec5_6.X - LeftAdd, top_rec5.Y);
  7404. top_p55_2 = new Point(top_rec5_6.X - LeftAdd, top_rec5.Y + top_rec5.Height);
  7405. g.DrawLine(p, top_p55_1, top_p55_2);
  7406. top_rec5_5 = new Rectangle(top_p54_1.X + LeftAdd, top_p54_1.Y + TopAdd, top_ColumnWidth5, RowContentHeight);
  7407. StrColumnName = LYFZ.BLL.OtherCommonModel.FontConversion("初修师");
  7408. StrColumnValue = tb_ord.Rows[0]["初修师"].ToString().Trim();
  7409. g.DrawString(StrColumnName, ft10, b, top_rec5_5);
  7410. top_p55_1 = new Point(top_rec5_5.X + top_ColumnWidth5, top_rec5.Y);
  7411. top_p55_2 = new Point(top_rec5_5.X + top_ColumnWidth5, top_rec5.Y + top_rec5.Height);
  7412. g.DrawLine(p, top_p55_1, top_p55_2);
  7413. top_rec5_6 = new Rectangle(top_p55_1.X + LeftAdd, top_p55_1.Y + TopAdd, top_ColumnWidth6, RowContentHeight);
  7414. g.DrawString(StrColumnValue, ft10, b, top_rec5_6);
  7415. }
  7416. else
  7417. {
  7418. Rectangle top_rec5_5 = new Rectangle(top_p54_1.X + LeftAdd, top_p54_1.Y + TopAdd, top_ColumnWidth5, RowContentHeight);
  7419. StrColumnName = LYFZ.BLL.OtherCommonModel.FontConversion("初修师");
  7420. StrColumnValue = tb_ord.Rows[0]["初修师"].ToString().Trim();
  7421. g.DrawString(StrColumnName, ft10, b, top_rec5_5);
  7422. Point top_p55_1 = new Point(top_rec5_5.X + top_ColumnWidth5, top_rec5.Y);
  7423. Point top_p55_2 = new Point(top_rec5_5.X + top_ColumnWidth5, top_rec5.Y + top_rec5.Height);
  7424. g.DrawLine(p, top_p55_1, top_p55_2);
  7425. Rectangle top_rec5_6 = new Rectangle(top_p55_1.X + LeftAdd, top_p55_1.Y + TopAdd, top_ColumnWidth6, RowContentHeight);
  7426. g.DrawString(StrColumnValue, ft10, b, top_rec5_6);
  7427. }
  7428. #endregion
  7429. #region 第五行
  7430. Rectangle top_rec6 = new Rectangle(LeftWidth, top_rec5.Y + top_rec5.Height, top_TableWidth, RowHeight);
  7431. g.DrawRectangle(p, top_rec6);//画标题矩形
  7432. Rectangle top_rec6_1 = new Rectangle(top_rec6.X + LeftAdd, top_rec6.Y + TopAdd, top_ColumnWidth1, RowContentHeight);
  7433. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("统计"), ft10, b, top_rec6_1);
  7434. Point top_p61_1 = new Point(top_rec6.X + top_ColumnWidth1, top_rec6.Y);
  7435. Point top_p61_2 = new Point(top_rec6.X + top_ColumnWidth1, top_rec6.Y + top_rec6.Height);
  7436. g.DrawLine(p, top_p61_1, top_p61_2);
  7437. string StrStatistics = "";
  7438. if (tb_ord.Rows[0]["Ord_Type"].ToString().Trim() == "1")
  7439. {
  7440. //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("张");
  7441. 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("张");
  7442. }
  7443. else
  7444. {
  7445. 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("张");
  7446. }
  7447. 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);
  7448. g.DrawString(StrStatistics, ft10, b, top_rec6_2);
  7449. if (tb_ord.Rows[0]["Ord_Type"].ToString().Trim() == "1")
  7450. {
  7451. Point top_p62_1 = new Point(top_p61_1.X + top_rec6_2.Width + 9, top_rec6.Y);
  7452. Point top_p62_2 = new Point(top_p61_1.X + top_rec6_2.Width + 9, top_rec6.Y + top_rec6.Height);
  7453. g.DrawLine(p, top_p62_1, top_p62_2);
  7454. Rectangle top_rec7_1 = new Rectangle(top_p62_1.X + LeftAdd, top_p62_1.Y + TopAdd, top_ColumnWidth5, RowContentHeight);
  7455. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("拍摄名称"), ft10, b, top_rec7_1);
  7456. Point top_p71_1 = new Point(top_p62_1.X + top_ColumnWidth5 + 3, top_rec6.Y);
  7457. Point top_p71_2 = new Point(top_p62_1.X + top_ColumnWidth5 + 3, top_rec6.Y + top_rec6.Height);
  7458. g.DrawLine(p, top_p71_1, top_p71_2);
  7459. Rectangle top_rec8_1 = new Rectangle(top_p71_1.X + LeftAdd, top_p71_1.Y + TopAdd, top_ColumnWidth6, RowContentHeight);
  7460. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion(tb_Sights.Rows[0]["Ordpg_Sights"].ToString().Trim()), ft10, b, top_rec8_1);
  7461. }
  7462. #endregion
  7463. #endregion
  7464. ///定位区域
  7465. Rectangle Position_Rect = top_rec6;
  7466. //表宽
  7467. int mid_TableWidth = top_TableWidth;
  7468. //列宽
  7469. int mid_ColumnWidth1 = 110; //产品名
  7470. int mid_ColumnWidth2 = 84; //等级/加急日期
  7471. int mid_ColumnWidth3 = 30; //P数
  7472. int mid_ColumnWidth4 = 30; //数量
  7473. int mid_ColumnWidth5 = 90; //备注
  7474. int mid_ColumnWidth6 = mid_TableWidth - mid_ColumnWidth1 - mid_ColumnWidth2 - mid_ColumnWidth3 - mid_ColumnWidth4 - mid_ColumnWidth5; //所选相片编号
  7475. // LYFZ.EnumPublic.OrderType tempOrderType = (LYFZ.EnumPublic.OrderType)Enum.Parse(typeof(LYFZ.EnumPublic.OrderType), Mmdl.Ord_Type);
  7476. List<LYFZ.PhotoSelectSystem.SelectPrintProduction> SelectPrintList = new List<LYFZ.PhotoSelectSystem.SelectPrintProduction>();
  7477. if (spmodel.SelectPrintList.Count > 0)
  7478. {
  7479. SelectPrintList = spmodel.SelectPrintList;
  7480. }
  7481. else
  7482. {
  7483. SelectPrintList.Add(new LYFZ.PhotoSelectSystem.SelectPrintProduction()
  7484. {
  7485. OrderDigital = spmodel.CurrentDigModel
  7486. ,
  7487. Photography = spmodel.CurrentSelectPhotoHandling.PhotoModel
  7488. });
  7489. }
  7490. if (SelectPrintList.Count > 0)
  7491. {
  7492. foreach (LYFZ.PhotoSelectSystem.SelectPrintProduction selectItem in SelectPrintList)
  7493. {
  7494. string titleString = String.Format("指定制作");
  7495. if (selectItem.Photography != null)
  7496. {
  7497. if (!String.IsNullOrWhiteSpace(selectItem.Photography.Ordpg_Sights))
  7498. {
  7499. titleString = String.Format("【{0}】指定制作", selectItem.Photography.Ordpg_Sights);
  7500. }
  7501. }
  7502. #region 列标题
  7503. string[] columnList = new string[6] { "产品名称", "等级/加急日", "P数", "数量", "备注", "所用照片" };
  7504. int[] _ColumnWidthList = new int[6] { mid_ColumnWidth1, mid_ColumnWidth2, mid_ColumnWidth3, mid_ColumnWidth4, mid_ColumnWidth5, mid_ColumnWidth6 };
  7505. if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
  7506. {
  7507. columnList = new string[5] { "产品名称", "P数", "数量", "备注", "所用照片" };
  7508. _ColumnWidthList = new int[5] { mid_ColumnWidth1, mid_ColumnWidth3, mid_ColumnWidth4, mid_ColumnWidth5, mid_ColumnWidth6 + mid_ColumnWidth2 };
  7509. }
  7510. LYFZ.PhotoSelectSystem.EventSelectPhotoPrint eventSelectPhotoPrint = LYFZ.PhotoSelectSystem.frmSaveSelectPhotoInfo.GetStaticSelectPhotoPrint(Mmdl, selectItem.OrderDigital);
  7511. if (pListData.Count == 0)
  7512. {
  7513. pListData = GetMakeDetailListData(g1, ft9, columnList, _ColumnWidthList, eventSelectPhotoPrint, eventSelectPhotoPrint.MakingProductList, PrintOtherData, new string[] { "选片师/日期", "取件师/日期", "二次看设计师/日期", "取件师/日期" },
  7514. new DataRow[] { }, mid_TableWidth, ref dicKeyList, 740);
  7515. }
  7516. List<string> pData = pListData[iPage];
  7517. if (pData.Count > 0||(pData.Count==0 &&(dicKeyList["[=入底]"].Contains(iPage + 1)|| dicKeyList["[=入册]"].Contains(iPage + 1) || dicKeyList["[=调修要求]"].Contains(iPage + 1))))
  7518. {
  7519. sizef = g.MeasureString(titleString, ft16);
  7520. StrHeigth = Convert.ToInt32(sizef.Height);
  7521. StrWidth = Convert.ToInt32(sizef.Width) + 1;
  7522. Position_Rect = new Rectangle((mid_TableWidth - StrWidth) / 2, Position_Rect.Y + Position_Rect.Height + 7, StrWidth, StrHeigth);
  7523. g.DrawString(titleString, ft16, b, Position_Rect);
  7524. Position_Rect = new Rectangle(LeftWidth, Position_Rect.Y + Position_Rect.Height, mid_TableWidth, RowHeight);
  7525. g.DrawRectangle(p, Position_Rect);//画标题矩形
  7526. }
  7527. Rectangle columnPosition_Rect = new Rectangle(Position_Rect.X, Position_Rect.Y, 0, Position_Rect.Height);
  7528. if (pData.Count > 0)
  7529. {
  7530. for (int i = 0; i < columnList.Length; i++)
  7531. {
  7532. columnPosition_Rect = new Rectangle(columnPosition_Rect.X + columnPosition_Rect.Width, columnPosition_Rect.Y, _ColumnWidthList[i], columnPosition_Rect.Height);
  7533. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion(columnList[i]), ft10, b
  7534. , new Rectangle(columnPosition_Rect.X + LeftAdd, columnPosition_Rect.Y + TopAdd, columnPosition_Rect.Width, RowContentHeight));
  7535. g.DrawLine(p, new Point(columnPosition_Rect.X + columnPosition_Rect.Width, columnPosition_Rect.Y)
  7536. , new Point(columnPosition_Rect.X + columnPosition_Rect.Width, columnPosition_Rect.Y + columnPosition_Rect.Height));
  7537. }
  7538. }
  7539. #endregion
  7540. #region 输出产品列表和产品选片信息
  7541. LYFZ.PhotoSelectSystem.MakingProduct IntoBottom_makingItem = new PhotoSelectSystem.MakingProduct();//入底
  7542. LYFZ.PhotoSelectSystem.MakingProduct IntoBook_makingItem = new PhotoSelectSystem.MakingProduct();//入册
  7543. foreach (string strMakingItem in pData)
  7544. {
  7545. LYFZ.PhotoSelectSystem.MakingProduct makingItem = Newtonsoft.Json.JsonConvert.DeserializeObject<LYFZ.PhotoSelectSystem.MakingProduct>(strMakingItem);
  7546. LYFZ.Model.Model_ErpOrderProductList mProduct = makingItem.OrderProduct;
  7547. if (makingItem.IsEndorBook)
  7548. {
  7549. if (mProduct.OPlist_ProdName.Trim() == "入底")
  7550. {
  7551. IntoBottom_makingItem = makingItem;
  7552. }
  7553. else if (mProduct.OPlist_ProdName.Trim() == "入册")
  7554. {
  7555. IntoBook_makingItem = makingItem;
  7556. }
  7557. continue;
  7558. }
  7559. string[] ValueList = new string[6] { "", "", "", "", "", "" };
  7560. if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
  7561. {
  7562. ValueList = new string[5] { "", "", "", "", "" };
  7563. }
  7564. int lineHeight = GetLineHeight(eventSelectPhotoPrint, makingItem, mProduct, ft9, LeftAdd, _ColumnWidthList, g, ref ValueList);
  7565. Position_Rect = new Rectangle(LeftWidth, Position_Rect.Y + Position_Rect.Height, mid_TableWidth, lineHeight + TopAdd * 2);
  7566. g.DrawRectangle(p, Position_Rect);//画标题矩形
  7567. columnPosition_Rect = new Rectangle(Position_Rect.X, Position_Rect.Y, 0, Position_Rect.Height);
  7568. for (int j = 0; j < columnList.Length; j++)
  7569. {
  7570. columnPosition_Rect = new Rectangle(columnPosition_Rect.X + columnPosition_Rect.Width, columnPosition_Rect.Y, _ColumnWidthList[j], columnPosition_Rect.Height);
  7571. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion(ValueList[j]), ft9, b
  7572. , new Rectangle(columnPosition_Rect.X + LeftAdd, columnPosition_Rect.Y + TopAdd, columnPosition_Rect.Width, lineHeight));
  7573. g.DrawLine(p, new Point(columnPosition_Rect.X + columnPosition_Rect.Width, columnPosition_Rect.Y)
  7574. , new Point(columnPosition_Rect.X + columnPosition_Rect.Width, columnPosition_Rect.Y + columnPosition_Rect.Height));
  7575. }
  7576. }
  7577. //if (dicKeyList.ContainsKey("[=入底入册]") && dicKeyList["[=入底入册]"].Contains(iPage + 1))
  7578. //{
  7579. //入底/入册/调修要求 "入底","入册",
  7580. string[] subColumnList = new string[] { "入底", "入册", "调修要求" };
  7581. for (int i = 0; i < subColumnList.Length; i++)
  7582. {
  7583. if (dicKeyList.ContainsKey("[="+ subColumnList[i] + "]") && dicKeyList["[=" + subColumnList[i] + "]"].Contains(iPage + 1))
  7584. {
  7585. int lineHeight = 0;
  7586. string valueString = "-";
  7587. int photoCount = 0;
  7588. if (!string.IsNullOrEmpty(IntoBottom_makingItem.OrderProduct.OPlist_ProdName) && IntoBottom_makingItem.OrderProduct.OPlist_ProdName.Trim() == subColumnList[i])
  7589. {
  7590. valueString = eventSelectPhotoPrint.GetSelectProductPhotoNameString(IntoBottom_makingItem.OrderProduct.OPlist_UniquelyIdentity.ToString(), ref photoCount);
  7591. valueString += LYFZ.BLL.OtherCommonModel.FontConversion(" 共") + photoCount + LYFZ.BLL.OtherCommonModel.FontConversion("张");
  7592. }
  7593. else if (!string.IsNullOrEmpty(IntoBook_makingItem.OrderProduct.OPlist_ProdName) && IntoBook_makingItem.OrderProduct.OPlist_ProdName.Trim() == subColumnList[i])
  7594. {
  7595. valueString = eventSelectPhotoPrint.GetSelectProductPhotoNameString(IntoBook_makingItem.OrderProduct.OPlist_UniquelyIdentity.ToString(), ref photoCount);
  7596. valueString += LYFZ.BLL.OtherCommonModel.FontConversion(" 共") + photoCount + LYFZ.BLL.OtherCommonModel.FontConversion("张");
  7597. }
  7598. else if (subColumnList[i] == "调修要求")
  7599. {
  7600. valueString = eventSelectPhotoPrint.CustomerRequest + " " + eventSelectPhotoPrint.PhotoRequest;
  7601. }
  7602. lineHeight = Convert.ToInt32(g.MeasureString(valueString, ft9, mid_TableWidth - _ColumnWidthList[0] - LeftAdd * 2).Height) + 1;
  7603. Position_Rect = new Rectangle(LeftWidth, Position_Rect.Y + Position_Rect.Height, mid_TableWidth, lineHeight + TopAdd * 2);
  7604. g.DrawRectangle(p, Position_Rect);//画标题矩形
  7605. columnPosition_Rect = new Rectangle(Position_Rect.X, Position_Rect.Y, 0, Position_Rect.Height);
  7606. for (int j = 0; j < 2; j++)
  7607. {
  7608. string ContentText = "";
  7609. if (j == 0)
  7610. {
  7611. ContentText = subColumnList[i];
  7612. columnPosition_Rect = new Rectangle(columnPosition_Rect.X + columnPosition_Rect.Width, columnPosition_Rect.Y, _ColumnWidthList[0], columnPosition_Rect.Height);
  7613. }
  7614. else
  7615. {
  7616. columnPosition_Rect = new Rectangle(columnPosition_Rect.X + columnPosition_Rect.Width, columnPosition_Rect.Y, Position_Rect.Width - _ColumnWidthList[0], columnPosition_Rect.Height);
  7617. ContentText = valueString;
  7618. }
  7619. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion(ContentText), ft10, b
  7620. , new Rectangle(columnPosition_Rect.X + LeftAdd, columnPosition_Rect.Y + TopAdd, columnPosition_Rect.Width, lineHeight));
  7621. g.DrawLine(p, new Point(columnPosition_Rect.X + columnPosition_Rect.Width, columnPosition_Rect.Y)
  7622. , new Point(columnPosition_Rect.X + columnPosition_Rect.Width, columnPosition_Rect.Y + columnPosition_Rect.Height));
  7623. }
  7624. }
  7625. }
  7626. //}
  7627. #endregion
  7628. }
  7629. }
  7630. else
  7631. {
  7632. #region 指定制作
  7633. rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("指定制作");
  7634. sizef = g.MeasureString(rec2Value, ft16);
  7635. StrHeigth = Convert.ToInt32(sizef.Height);
  7636. StrWidth = Convert.ToInt32(sizef.Width) + 1;
  7637. Rectangle mid_rec1 = new Rectangle((top_TableWidth - StrWidth) / 2, top_rec6.Y + top_rec6.Height + 5, StrWidth, StrHeigth);
  7638. g.DrawString(rec2Value, ft16, b, mid_rec1);
  7639. #region 列标题
  7640. Rectangle mid_rec2 = new Rectangle(LeftWidth, mid_rec1.Y + mid_rec1.Height, mid_TableWidth, RowHeight);
  7641. g.DrawRectangle(p, mid_rec2);//画标题矩形
  7642. Rectangle mid_rec2_1 = new Rectangle(mid_rec2.X + LeftAdd, mid_rec2.Y + TopAdd, mid_ColumnWidth1, RowContentHeight);
  7643. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("产品名称"), ft10, b, mid_rec2_1);
  7644. Point mid_p21_1 = new Point(mid_rec2.X + mid_ColumnWidth1, mid_rec2.Y);
  7645. Point mid_p21_2 = new Point(mid_rec2.X + mid_ColumnWidth1, mid_rec2.Y + mid_rec2.Height);
  7646. g.DrawLine(p, mid_p21_1, mid_p21_2);
  7647. Rectangle mid_rec2_2 = new Rectangle(mid_p21_1.X + LeftAdd, mid_rec2_1.Y, mid_ColumnWidth2, RowContentHeight);
  7648. if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
  7649. {
  7650. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("取件日期"), ft10, b, mid_rec2_2);
  7651. }
  7652. else
  7653. {
  7654. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("等级/加急日"), ft10, b, mid_rec2_2);
  7655. }
  7656. Point mid_p22_1 = new Point(mid_rec2_2.X + mid_ColumnWidth2, mid_rec2.Y);
  7657. Point mid_p22_2 = new Point(mid_rec2_2.X + mid_ColumnWidth2, mid_rec2.Y + mid_rec2.Height);
  7658. g.DrawLine(p, mid_p22_1, mid_p22_2);
  7659. Rectangle mid_rec2_3 = new Rectangle(mid_p22_1.X + LeftAdd, mid_rec2_1.Y, mid_ColumnWidth3, RowContentHeight);
  7660. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("P数"), ft10, b, mid_rec2_3);
  7661. Point mid_p23_1 = new Point(mid_rec2_3.X + mid_ColumnWidth3, mid_rec2.Y);
  7662. Point mid_p23_2 = new Point(mid_rec2_3.X + mid_ColumnWidth3, mid_rec2.Y + mid_rec2.Height);
  7663. g.DrawLine(p, mid_p23_1, mid_p23_2);
  7664. Rectangle mid_rec2_4 = new Rectangle(mid_p23_1.X + LeftAdd, mid_rec2_1.Y, mid_ColumnWidth4, RowContentHeight);
  7665. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("数量"), ft10, b, mid_rec2_4);
  7666. Point mid_p24_1 = new Point(mid_rec2_4.X + mid_ColumnWidth4, mid_rec2.Y);
  7667. Point mid_p24_2 = new Point(mid_rec2_4.X + mid_ColumnWidth4, mid_rec2.Y + mid_rec2.Height);
  7668. g.DrawLine(p, mid_p24_1, mid_p24_2);
  7669. Rectangle mid_rec2_5 = new Rectangle(mid_p24_1.X + LeftAdd, mid_rec2_1.Y, mid_ColumnWidth5, RowContentHeight);
  7670. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("备注"), ft10, b, mid_rec2_5);
  7671. Point mid_p25_1 = new Point(mid_rec2_5.X + mid_ColumnWidth5, mid_rec2.Y);
  7672. Point mid_p25_2 = new Point(mid_rec2_5.X + mid_ColumnWidth5, mid_rec2.Y + mid_rec2.Height);
  7673. g.DrawLine(p, mid_p25_1, mid_p25_2);
  7674. Rectangle mid_rec2_6 = new Rectangle(mid_p25_1.X + LeftAdd, mid_rec2_1.Y, mid_ColumnWidth6, RowContentHeight);
  7675. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("所用照片"), ft10, b, mid_rec2_6);
  7676. #endregion
  7677. int IntoBookCount = 0;
  7678. int IntoBottomCount = 0;
  7679. // int TotalZhangCount = 0;
  7680. string StrIntoBook = "";//入册
  7681. string StrIntoBottom = "";//入底
  7682. int mid_For_Y = mid_rec2.Y + mid_rec2.Height;
  7683. #region 画内容
  7684. int tempWidth = 0;
  7685. if (pListData.Count == 0)
  7686. {
  7687. string[] columnList = new string[6] { "产品名称", "等级/加急日", "P数", "数量", "备注", "所用照片" };
  7688. int[] _ColumnWidthList = new int[6] { mid_ColumnWidth1, mid_ColumnWidth2, mid_ColumnWidth3, mid_ColumnWidth4, mid_ColumnWidth5, mid_ColumnWidth6 };
  7689. if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
  7690. {
  7691. columnList = new string[5] { "产品名称", "P数", "数量", "备注", "所用照片" };
  7692. _ColumnWidthList = new int[5] { mid_ColumnWidth1, mid_ColumnWidth3, mid_ColumnWidth4, mid_ColumnWidth5, mid_ColumnWidth6 + mid_ColumnWidth2 };
  7693. }
  7694. pListData = GetMakeDetailListData(g1, ft9, columnList, _ColumnWidthList, spmodel, spmodel.MakingProductList, PrintOtherData,
  7695. new string[] { "选片师/日期", "取件师/日期", "二次看设计师/日期", "取件师/日期" },
  7696. new DataRow[] { }, mid_TableWidth, ref dicKeyList, 740);
  7697. for (int it = 1; it < _ColumnWidthList.Length; it++)
  7698. {
  7699. tempWidth += _ColumnWidthList[it];
  7700. }
  7701. }
  7702. //List<LYFZ.PhotoSelectSystem.MakingProduct> ptlist = ;
  7703. //if (ptlist.Count > 0)
  7704. //{
  7705. List<string> pData = pListData[iPage];
  7706. foreach (string strMakingItem in pData)
  7707. {
  7708. LYFZ.PhotoSelectSystem.MakingProduct mpdt = Newtonsoft.Json.JsonConvert.DeserializeObject<LYFZ.PhotoSelectSystem.MakingProduct>(strMakingItem);
  7709. //LYFZ.PhotoSelectSystem.MakingProduct mpdt = ptlist[i];
  7710. LYFZ.Model.Model_ErpOrderProductList mdl = mpdt.OrderProduct;
  7711. if (mdl.OPlist_ProdName == "入册")
  7712. {
  7713. StrIntoBook += spmodel.GetSelectProductPhotoNameString(mdl.OPlist_UniquelyIdentity.ToString(), ref IntoBookCount) + ",";
  7714. }
  7715. else if (mdl.OPlist_ProdName == "入底")
  7716. {
  7717. StrIntoBottom += spmodel.GetSelectProductPhotoNameString(mdl.OPlist_UniquelyIdentity.ToString(), ref IntoBottomCount) + ",";
  7718. }
  7719. else
  7720. {
  7721. if (mpdt.IsEndorBook)
  7722. {
  7723. continue;
  7724. }
  7725. int ForRowContentHeight = 0;
  7726. ForRowContentHeight = Convert.ToInt32(g.MeasureString(mdl.OPlist_ProdName, ft9, mid_ColumnWidth1 - LeftAdd * 2).Height) + 1; //产品名称
  7727. sizef = g.MeasureString(mdl.OPlist_Remark, ft9, mid_ColumnWidth5 - LeftAdd * 2); //备注
  7728. if (ForRowContentHeight < Convert.ToInt32(sizef.Height) + 1)
  7729. {
  7730. ForRowContentHeight = Convert.ToInt32(sizef.Height) + 1;
  7731. }
  7732. string StrIsExp = mdl.OPlist_IsExpedited ? LYFZ.BLL.OtherCommonModel.FontConversion("加急件") : LYFZ.BLL.OtherCommonModel.FontConversion("普通件");
  7733. if (mdl.OPlist_ExpeditedTime.ToString().Trim() != "")
  7734. {
  7735. if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
  7736. {
  7737. StrIsExp = LYFZ.Command.Command_Validate.DateTimeToString(mdl.OPlist_ExpeditedTime);
  7738. }
  7739. else
  7740. {
  7741. StrIsExp += "\r\n" + LYFZ.Command.Command_Validate.DateTimeToString(mdl.OPlist_ExpeditedTime);
  7742. }
  7743. }
  7744. sizef = g.MeasureString(StrIsExp, ft9, mid_ColumnWidth5 - LeftAdd * 2); //等级
  7745. if (ForRowContentHeight < Convert.ToInt32(sizef.Height))
  7746. {
  7747. ForRowContentHeight = Convert.ToInt32(sizef.Height);
  7748. }
  7749. int photoCount = 0;
  7750. string StrPhoto = spmodel.GetSelectProductPhotoNameString(mdl.OPlist_UniquelyIdentity.ToString(), ref photoCount);//所用照片
  7751. if (!string.IsNullOrEmpty(StrPhoto))
  7752. {
  7753. StrPhoto += LYFZ.BLL.OtherCommonModel.FontConversion(" 共" + photoCount + "张");
  7754. }
  7755. else
  7756. {
  7757. StrPhoto = "测试高";
  7758. }
  7759. // TotalZhangCount += photoCount;
  7760. sizef = g.MeasureString(StrPhoto, ft9, mid_ColumnWidth6 - LeftAdd * 2);
  7761. if (ForRowContentHeight < Convert.ToInt32(sizef.Height) + 1)
  7762. {
  7763. ForRowContentHeight = Convert.ToInt32(sizef.Height) + 1;
  7764. }
  7765. Rectangle mid_rec3 = new Rectangle(LeftWidth, mid_For_Y, mid_TableWidth, ForRowContentHeight + TopAdd);
  7766. g.DrawRectangle(p, mid_rec3);//画标题矩形
  7767. //产品名称
  7768. Rectangle mid_rec3_1 = new Rectangle(mid_rec3.X + LeftAdd, mid_rec3.Y + TopAdd, mid_ColumnWidth1 - LeftAdd * 2, ForRowContentHeight);
  7769. g.DrawString(mdl.OPlist_ProdName, ft9, b, mid_rec3_1);
  7770. Point mid_p31_1 = new Point(mid_rec3.X + mid_ColumnWidth1, mid_rec3.Y);
  7771. Point mid_p31_2 = new Point(mid_rec3.X + mid_ColumnWidth1, mid_rec3.Y + mid_rec3.Height);
  7772. g.DrawLine(p, mid_p31_1, mid_p31_2);
  7773. //等级
  7774. Rectangle mid_rec3_2 = new Rectangle(mid_p31_1.X + LeftAdd, mid_p31_1.Y + TopAdd, mid_ColumnWidth2 - LeftAdd * 2, ForRowContentHeight);
  7775. g.DrawString(StrIsExp, ft9, b, mid_rec3_2);
  7776. Point mid_p32_1 = new Point(mid_rec3_2.X + mid_ColumnWidth2, mid_rec3.Y);
  7777. Point mid_p32_2 = new Point(mid_rec3_2.X + mid_ColumnWidth2, mid_rec3.Y + mid_rec3.Height);
  7778. g.DrawLine(p, mid_p32_1, mid_p32_2);
  7779. //P 数
  7780. Rectangle mid_rec3_3 = new Rectangle(mid_p32_1.X + LeftAdd, mid_p32_1.Y + TopAdd, mid_ColumnWidth3 - LeftAdd * 2, ForRowContentHeight);
  7781. g.DrawString(mdl.OPlist_Batch.ToString().Trim(), ft9, b, mid_rec3_3);
  7782. Point mid_p33_1 = new Point(mid_rec3_3.X + mid_ColumnWidth3, mid_rec3.Y);
  7783. Point mid_p33_2 = new Point(mid_rec3_3.X + mid_ColumnWidth3, mid_rec3.Y + mid_rec3.Height);
  7784. g.DrawLine(p, mid_p33_1, mid_p33_2);
  7785. //数量
  7786. Rectangle mid_rec3_4 = new Rectangle(mid_p33_1.X + LeftAdd, mid_p33_1.Y + TopAdd, mid_ColumnWidth4 - LeftAdd * 2, ForRowContentHeight);
  7787. g.DrawString(mdl.OPlist_ProdQuantity.ToString().Trim(), ft9, b, mid_rec3_4);
  7788. Point mid_p34_1 = new Point(mid_rec3_4.X + mid_ColumnWidth4, mid_rec3.Y);
  7789. Point mid_p34_2 = new Point(mid_rec3_4.X + mid_ColumnWidth4, mid_rec3.Y + mid_rec3.Height);
  7790. g.DrawLine(p, mid_p34_1, mid_p34_2);
  7791. //备注
  7792. Rectangle mid_rec3_5 = new Rectangle(mid_p34_1.X + LeftAdd, mid_p34_1.Y + TopAdd, mid_ColumnWidth5 - LeftAdd * 2, ForRowContentHeight);
  7793. g.DrawString(mdl.OPlist_Remark, ft9, b, mid_rec3_5);
  7794. Point mid_p35_1 = new Point(mid_rec3_5.X + mid_ColumnWidth5, mid_rec3.Y);
  7795. Point mid_p35_2 = new Point(mid_rec3_5.X + mid_ColumnWidth5, mid_rec3.Y + mid_rec3.Height);
  7796. g.DrawLine(p, mid_p35_1, mid_p35_2);
  7797. //所用照片
  7798. Rectangle mid_rec3_6 = new Rectangle(mid_p35_1.X + LeftAdd, mid_p35_1.Y + TopAdd, mid_ColumnWidth6 - LeftAdd * 2, ForRowContentHeight);
  7799. g.DrawString(StrPhoto == "测试高" ? "" : StrPhoto, ft9, b, mid_rec3_6);
  7800. mid_For_Y += mid_rec3.Height;
  7801. }
  7802. }
  7803. //}
  7804. #endregion
  7805. Rectangle temp_mid_rec4A = new Rectangle(LeftWidth, mid_For_Y, tempWidth, 0);
  7806. if (dicKeyList.ContainsKey("[=入册]") && dicKeyList["[=入册]"].Contains(iPage + 1))
  7807. {
  7808. #region 入册
  7809. //入册
  7810. int StrIntoBookHeigth = RowHeight;
  7811. StrIntoBook = StrIntoBook.TrimEnd(',');
  7812. if (StrIntoBook != "")
  7813. {
  7814. StrIntoBook += LYFZ.BLL.OtherCommonModel.FontConversion(" 共") + IntoBookCount + LYFZ.BLL.OtherCommonModel.FontConversion("张");
  7815. StrIntoBookHeigth = Convert.ToInt32(g.MeasureString(StrIntoBook, ft9, mid_TableWidth - mid_ColumnWidth1 - LeftAdd * 2 - LeftWidth).Height) + TopAdd;
  7816. int ddd = StrIntoBookHeigth;
  7817. string StrPhoto = "测试高";
  7818. sizef = g.MeasureString(StrPhoto, ft9, mid_ColumnWidth6 - LeftAdd * 2);
  7819. int TestHeigth = Convert.ToInt32(sizef.Height);
  7820. int forIntCount = 0;
  7821. while (ddd > TestHeigth)
  7822. {
  7823. ddd -= TestHeigth;
  7824. forIntCount++;
  7825. }
  7826. StrIntoBookHeigth = StrIntoBookHeigth - ddd + TestHeigth;
  7827. }
  7828. Rectangle mid_rec4A = new Rectangle(LeftWidth, mid_For_Y, mid_TableWidth, StrIntoBookHeigth);
  7829. g.DrawRectangle(p, mid_rec4A);//画标题矩形
  7830. Rectangle mid_rec4A_1 = new Rectangle(mid_rec4A.X + LeftAdd, mid_rec4A.Y + TopAdd, mid_ColumnWidth1, StrIntoBookHeigth);
  7831. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("入册"), ft10, b, mid_rec4A_1);
  7832. Point mid_p4A1_1 = new Point(mid_rec4A.X + mid_ColumnWidth1, mid_rec4A.Y);
  7833. Point mid_p4A1_2 = new Point(mid_rec4A.X + mid_ColumnWidth1, mid_rec4A.Y + mid_rec4A.Height);
  7834. g.DrawLine(p, mid_p4A1_1, mid_p4A1_2);
  7835. 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);
  7836. g.DrawString(StrIntoBook, ft9, b, mid_rec4A_2);
  7837. temp_mid_rec4A = mid_rec4A;
  7838. #endregion
  7839. }
  7840. if (dicKeyList.ContainsKey("[=入底]") && dicKeyList["[=入底]"].Contains(iPage + 1))
  7841. {
  7842. #region 入底
  7843. //入底
  7844. int StrIntoBottomHeigth = RowHeight;
  7845. if (StrIntoBottom.TrimEnd(',') != "")
  7846. {
  7847. StrIntoBottom += LYFZ.BLL.OtherCommonModel.FontConversion(" 共") + IntoBottomCount + LYFZ.BLL.OtherCommonModel.FontConversion("张");
  7848. StrIntoBottomHeigth = Convert.ToInt32(g.MeasureString(StrIntoBottom, ft9, tempWidth).Height) + TopAdd;
  7849. int ddd = StrIntoBottomHeigth;
  7850. string StrPhoto = "测试高";
  7851. sizef = g.MeasureString(StrPhoto, ft9, mid_ColumnWidth6 - LeftAdd * 2);
  7852. int TestHeigth = Convert.ToInt32(sizef.Height);
  7853. int forIntCount = 0;
  7854. while (ddd > TestHeigth)
  7855. {
  7856. ddd -= TestHeigth;
  7857. forIntCount++;
  7858. }
  7859. StrIntoBottomHeigth = StrIntoBottomHeigth - ddd + TestHeigth;
  7860. }
  7861. Rectangle mid_rec4B = new Rectangle(temp_mid_rec4A.X, temp_mid_rec4A.Y + temp_mid_rec4A.Height, mid_TableWidth, StrIntoBottomHeigth);
  7862. g.DrawRectangle(p, mid_rec4B);//画标题矩形
  7863. temp_mid_rec4A = mid_rec4B;
  7864. Rectangle mid_rec4B_1 = new Rectangle(mid_rec4B.X + LeftAdd, mid_rec4B.Y + TopAdd, mid_ColumnWidth1, StrIntoBottomHeigth);
  7865. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("入底"), ft10, b, mid_rec4B_1);
  7866. Point mid_p4B1_1 = new Point(mid_rec4B.X + mid_ColumnWidth1, mid_rec4B.Y);
  7867. Point mid_p4B1_2 = new Point(mid_rec4B.X + mid_ColumnWidth1, mid_rec4B.Y + mid_rec4B.Height);
  7868. g.DrawLine(p, mid_p4B1_1, mid_p4B1_2);
  7869. Rectangle mid_rec4B_2 = new Rectangle(mid_p4B1_1.X + LeftAdd, mid_p4B1_1.Y + TopAdd, tempWidth, mid_rec4B_1.Height);
  7870. g.DrawString(StrIntoBottom.TrimEnd(','), ft9, b, mid_rec4B_2);
  7871. #endregion
  7872. }
  7873. if (dicKeyList.ContainsKey("[=调修要求]") && dicKeyList["[=调修要求]"].Contains(iPage + 1))
  7874. {
  7875. #region 调修要求
  7876. int StrCustomerRequestHeigth = RowHeight;
  7877. string StrCustomerRequest = spmodel.CustomerRequest + " " + spmodel.PhotoRequest;
  7878. if (StrCustomerRequest.Trim() != "")
  7879. {
  7880. StrCustomerRequestHeigth = Convert.ToInt32(g.MeasureString(StrCustomerRequest, ft9, tempWidth).Height) + TopAdd;
  7881. }
  7882. Rectangle mid_rec4 = new Rectangle(temp_mid_rec4A.X, temp_mid_rec4A.Y + temp_mid_rec4A.Height, mid_TableWidth, StrCustomerRequestHeigth);
  7883. g.DrawRectangle(p, mid_rec4);//画标题矩形
  7884. Position_Rect = mid_rec4;
  7885. Rectangle mid_rec4_1 = new Rectangle(mid_rec4.X + LeftAdd, mid_rec4.Y + TopAdd, mid_ColumnWidth1, mid_rec4.Height);
  7886. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("调修要求"), ft10, b, mid_rec4_1);
  7887. Point mid_p41_1 = new Point(mid_rec4.X + mid_ColumnWidth1, mid_rec4.Y);
  7888. Point mid_p41_2 = new Point(mid_rec4.X + mid_ColumnWidth1, mid_rec4.Y + mid_rec4.Height);
  7889. g.DrawLine(p, mid_p41_1, mid_p41_2);
  7890. Rectangle mid_rec4_2 = new Rectangle(mid_p41_1.X + LeftAdd, mid_p41_1.Y + TopAdd, tempWidth, mid_rec4_1.Height);
  7891. g.DrawString(StrCustomerRequest.Trim(), ft9, b, mid_rec4_2);
  7892. #endregion
  7893. }
  7894. #endregion
  7895. }
  7896. if (dicKeyList.ContainsKey("[=制作单说明]") || dicKeyList.ContainsKey("[=其他数据]") || dicKeyList.ContainsKey("[=付款信息]"))
  7897. {
  7898. #region 指定确定
  7899. int end_TableWidth = top_TableWidth;
  7900. int end_ColumnWidth1 = 120;
  7901. int end_ColumnWidth2 = end_TableWidth / 2 - end_ColumnWidth1;
  7902. int end_ColumnWidth3 = 130;
  7903. int end_ColumnWidth4 = end_TableWidth / 2 - end_ColumnWidth1;
  7904. #region 始
  7905. rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("制作进度");
  7906. sizef = g.MeasureString(rec2Value, ft16);
  7907. StrHeigth = Convert.ToInt32(sizef.Height);
  7908. StrWidth = Convert.ToInt32(sizef.Width) + 1;
  7909. Rectangle end_rec1 = new Rectangle((top_TableWidth - StrWidth) / 2, Position_Rect.Y + Position_Rect.Height + 5, StrWidth, StrHeigth);
  7910. Rectangle end_rec1_1 = new Rectangle(LeftWidth, end_rec1.Y + end_rec1.Height, end_TableWidth, Convert.ToInt32(g.MeasureString(rec2Value, ft9, top_TableWidth).Height));
  7911. if (dicKeyList.ContainsKey("[=制作单说明]") && dicKeyList["[=制作单说明]"].Contains(iPage + 1))
  7912. {
  7913. g.DrawString(rec2Value, ft16, b, end_rec1);
  7914. string ProductionNotes = "";
  7915. if (PrintOtherData.ContainsKey("制作单说明") && PrintOtherData["制作单说明"].ToString().Trim().Length > 0)
  7916. {
  7917. ProductionNotes = PrintOtherData["制作单说明"].ToString().Trim();
  7918. }
  7919. //else
  7920. //{ ProductionNotes = tbl.Rows[0]["Company_ProductionNotes"].ToString().Trim().Replace("\n", "").Replace("\r", ""); }
  7921. rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("申明:") + ProductionNotes;
  7922. end_rec1_1 = new Rectangle(LeftWidth, end_rec1.Y + end_rec1.Height, end_TableWidth, Convert.ToInt32(g.MeasureString(rec2Value, ft9, top_TableWidth).Height));
  7923. g.DrawString(rec2Value, ft9, b, end_rec1_1);
  7924. }
  7925. #endregion
  7926. Rectangle end_rec5 = end_rec1_1;
  7927. if (dicKeyList.ContainsKey("[=其他数据]") && dicKeyList["[=其他数据]"].Contains(iPage + 1))
  7928. {
  7929. #region 第一行
  7930. int AddRowHeightToTwo = RowHeight / 2;
  7931. Rectangle end_rec2 = new Rectangle(LeftWidth, end_rec1_1.Y + end_rec1_1.Height, end_TableWidth, RowHeight * 2 - 2);
  7932. g.DrawRectangle(p, end_rec2);//画标题矩形
  7933. Rectangle end_rec2_1 = new Rectangle(end_rec2.X + LeftAdd, end_rec2.Y + TopAdd + AddRowHeightToTwo, end_ColumnWidth1, RowContentHeight);
  7934. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("选片师/日期"), ft10, b, end_rec2_1);
  7935. Point end_p21_1 = new Point(end_rec2.X + end_ColumnWidth1, end_rec2.Y);
  7936. Point end_p21_2 = new Point(end_rec2.X + end_ColumnWidth1, end_rec2.Y + end_rec2.Height);
  7937. g.DrawLine(p, end_p21_1, end_p21_2);
  7938. Rectangle end_rec2_2 = new Rectangle(end_p21_1.X + LeftAdd, end_p21_1.Y + TopAdd + AddRowHeightToTwo, end_ColumnWidth2, RowContentHeight);
  7939. string StrValue1 = "";
  7940. if (tb_ord.Rows[0]["选片人"].ToString().Trim() != "")
  7941. {
  7942. StrValue1 = (tb_ord.Rows[0]["选片人"].ToString().Trim() + " / " + LYFZ.Command.Command_Validate.DateTimeToString2(tb_ord.Rows[0]["选片日期"])).Trim('/');
  7943. }
  7944. g.DrawString(StrValue1, ft10, b, end_rec2_2);
  7945. Point end_p22_1 = new Point(end_rec2_2.X + end_ColumnWidth2, end_rec2.Y);
  7946. Point end_p22_2 = new Point(end_rec2_2.X + end_ColumnWidth2, end_rec2.Y + end_rec2.Height);
  7947. g.DrawLine(p, end_p22_1, end_p22_2);
  7948. Rectangle end_rec2_3 = new Rectangle(end_p22_1.X + LeftAdd, end_p22_1.Y + TopAdd + AddRowHeightToTwo, end_ColumnWidth3, RowContentHeight);
  7949. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("客户选片签名/日期"), ft10, b, end_rec2_3);
  7950. Point end_p23_1 = new Point(end_rec2_3.X + end_ColumnWidth3, end_rec2.Y);
  7951. Point end_p23_2 = new Point(end_rec2_3.X + end_ColumnWidth3, end_rec2.Y + end_rec2.Height);
  7952. g.DrawLine(p, end_p23_1, end_p23_2);
  7953. Rectangle end_rec2_4 = new Rectangle(end_p23_1.X + LeftAdd, end_p23_1.Y + TopAdd + AddRowHeightToTwo, end_ColumnWidth4, RowContentHeight);
  7954. g.DrawString("", ft10, b, end_rec2_4);
  7955. #endregion
  7956. #region 第二行
  7957. Rectangle end_rec3 = new Rectangle(LeftWidth, end_rec2.Y + end_rec2.Height, end_TableWidth, RowHeight * 2 - 2);
  7958. g.DrawRectangle(p, end_rec3);//画标题矩形
  7959. Rectangle end_rec3_1 = new Rectangle(end_rec3.X + LeftAdd, end_rec3.Y + TopAdd + AddRowHeightToTwo, end_ColumnWidth1, RowContentHeight);
  7960. if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideLookDesigner)
  7961. {
  7962. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("取件师/日期"), ft10, b, end_rec3_1);
  7963. }
  7964. else
  7965. {
  7966. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("看设计师/日期"), ft10, b, end_rec3_1);
  7967. }
  7968. Point end_p31_1 = new Point(end_rec3.X + end_ColumnWidth1, end_rec3.Y);
  7969. Point end_p31_2 = new Point(end_rec3.X + end_ColumnWidth1, end_rec3.Y + end_rec3.Height);
  7970. g.DrawLine(p, end_p31_1, end_p31_2);
  7971. Rectangle end_rec3_2 = new Rectangle(end_p31_1.X + LeftAdd, end_p31_1.Y + TopAdd + AddRowHeightToTwo, end_ColumnWidth2, RowContentHeight);
  7972. string StrValue2 = (tb_ord.Rows[0]["看设计人"].ToString().Trim() + "/" + LYFZ.Command.Command_Validate.DateTimeToString2(tb_ord.Rows[0]["看设计日期"])).Trim('/');
  7973. if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideLookDesigner)
  7974. {
  7975. g.DrawString((tb_ord.Rows[0]["取件师"].ToString().Trim() + "/" + LYFZ.Command.Command_Validate.DateTimeToString2(tb_ord.Rows[0]["取件日期"])).Trim('/'), ft10, b, end_rec3_2);
  7976. }
  7977. else
  7978. {
  7979. g.DrawString(StrValue2, ft10, b, end_rec3_2);
  7980. }
  7981. Point end_p32_1 = new Point(end_rec3_2.X + end_ColumnWidth2, end_rec3.Y);
  7982. Point end_p32_2 = new Point(end_rec3_2.X + end_ColumnWidth2, end_rec3.Y + end_rec3.Height);
  7983. g.DrawLine(p, end_p32_1, end_p32_2);
  7984. Rectangle end_rec3_3 = new Rectangle(end_p32_1.X + LeftAdd, end_p32_1.Y + TopAdd + AddRowHeightToTwo, end_ColumnWidth3, RowContentHeight);
  7985. if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideLookDesigner)
  7986. {
  7987. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("客户取件签名/日期"), ft10, b, end_rec3_3);
  7988. }
  7989. else
  7990. {
  7991. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("客户看设计签名/日期"), ft10, b, end_rec3_3);
  7992. }
  7993. Point end_p33_1 = new Point(end_rec3_3.X + end_ColumnWidth3, end_rec3.Y);
  7994. Point end_p33_2 = new Point(end_rec3_3.X + end_ColumnWidth3, end_rec3.Y + end_rec3.Height);
  7995. g.DrawLine(p, end_p33_1, end_p33_2);
  7996. Rectangle end_rec3_4 = new Rectangle(end_p33_1.X + LeftAdd, end_p33_1.Y + TopAdd + AddRowHeightToTwo, end_ColumnWidth4, RowContentHeight);
  7997. g.DrawString("", ft10, b, end_rec3_4);
  7998. #endregion
  7999. end_rec5 = end_rec3;
  8000. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideLookDesigner)
  8001. {
  8002. #region 第三行
  8003. Rectangle end_rec4 = new Rectangle(LeftWidth, end_rec3.Y + end_rec3.Height, end_TableWidth, RowHeight * 2 - 2);
  8004. g.DrawRectangle(p, end_rec4);//画标题矩形
  8005. Rectangle end_rec4_1 = new Rectangle(end_rec4.X + LeftAdd, end_rec4.Y + TopAdd + AddRowHeightToTwo, end_ColumnWidth1, RowContentHeight);
  8006. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideLookDesigner)
  8007. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("二次看设计师/日期"), ft10, b, end_rec4_1);
  8008. Point end_p41_1 = new Point(end_rec4.X + end_ColumnWidth1, end_rec4.Y);
  8009. Point end_p41_2 = new Point(end_rec4.X + end_ColumnWidth1, end_rec4.Y + end_rec4.Height);
  8010. g.DrawLine(p, end_p41_1, end_p41_2);
  8011. Rectangle end_rec4_2 = new Rectangle(end_p41_1.X + LeftAdd, end_p41_1.Y + TopAdd, end_ColumnWidth2, RowContentHeight);
  8012. g.DrawString("", ft10, b, end_rec4_2);
  8013. Point end_p42_1 = new Point(end_rec4_2.X + end_ColumnWidth2, end_rec4.Y);
  8014. Point end_p42_2 = new Point(end_rec4_2.X + end_ColumnWidth2, end_rec4.Y + end_rec4.Height);
  8015. g.DrawLine(p, end_p42_1, end_p42_2);
  8016. Rectangle end_rec4_3 = new Rectangle(end_p42_1.X + LeftAdd, end_p42_1.Y + TopAdd + 3, end_ColumnWidth3, RowContentHeight * 2 + 10);
  8017. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideLookDesigner)
  8018. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("客户二次看设计签名\r\n/日期"), ft10, b, end_rec4_3);
  8019. Point end_p43_1 = new Point(end_rec4_3.X + end_ColumnWidth3, end_rec4.Y);
  8020. Point end_p43_2 = new Point(end_rec4_3.X + end_ColumnWidth3, end_rec4.Y + end_rec4.Height);
  8021. g.DrawLine(p, end_p43_1, end_p43_2);
  8022. Rectangle end_rec4_4 = new Rectangle(end_p43_1.X + LeftAdd, end_p43_1.Y + TopAdd + AddRowHeightToTwo, end_ColumnWidth4, RowContentHeight);
  8023. g.DrawString("", ft10, b, end_rec4_4);
  8024. #endregion
  8025. #region 第四行
  8026. end_rec5 = new Rectangle(LeftWidth, end_rec4.Y + end_rec4.Height, end_TableWidth, RowHeight * 2 - 2);
  8027. g.DrawRectangle(p, end_rec5);//画标题矩形
  8028. Rectangle end_rec5_1 = new Rectangle(end_rec5.X + LeftAdd, end_rec5.Y + TopAdd + AddRowHeightToTwo, end_ColumnWidth1, RowContentHeight);
  8029. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("取件师/日期"), ft10, b, end_rec5_1);
  8030. Point tend_p51_1 = new Point(end_rec5.X + end_ColumnWidth1, end_rec5.Y);
  8031. Point end_p51_2 = new Point(end_rec5.X + end_ColumnWidth1, end_rec5.Y + end_rec5.Height);
  8032. g.DrawLine(p, tend_p51_1, end_p51_2);
  8033. Rectangle end_rec5_2 = new Rectangle(tend_p51_1.X + LeftAdd, tend_p51_1.Y + TopAdd + AddRowHeightToTwo, end_ColumnWidth2, RowContentHeight);
  8034. g.DrawString((tb_ord.Rows[0]["取件师"].ToString().Trim() + "/" + LYFZ.Command.Command_Validate.DateTimeToString2(tb_ord.Rows[0]["取件日期"])).Trim('/'), ft10, b, end_rec5_2);
  8035. Point end_p52_1 = new Point(end_rec5_2.X + end_ColumnWidth2, end_rec5.Y);
  8036. Point end_p52_2 = new Point(end_rec5_2.X + end_ColumnWidth2, end_rec5.Y + end_rec5.Height);
  8037. g.DrawLine(p, end_p52_1, end_p52_2);
  8038. Rectangle end_rec5_3 = new Rectangle(end_p52_1.X + LeftAdd, end_p52_1.Y + TopAdd + AddRowHeightToTwo, end_ColumnWidth3, RowContentHeight);
  8039. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("客户取件签名/日期"), ft10, b, end_rec5_3);
  8040. Point end_p53_1 = new Point(end_rec5_3.X + end_ColumnWidth3, end_rec5.Y);
  8041. Point end_p53_2 = new Point(end_rec5_3.X + end_ColumnWidth3, end_rec5.Y + end_rec5.Height);
  8042. g.DrawLine(p, end_p53_1, end_p53_2);
  8043. Rectangle end_rec5_4 = new Rectangle(end_p53_1.X + LeftAdd, end_p53_1.Y + TopAdd + AddRowHeightToTwo, end_ColumnWidth4, RowContentHeight);
  8044. g.DrawString("", ft10, b, end_rec5_4);
  8045. #endregion
  8046. }
  8047. }
  8048. if (dicKeyList.ContainsKey("[=付款信息]") && dicKeyList["[=付款信息]"].Contains(iPage + 1))
  8049. {
  8050. #region 尾行
  8051. rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("电话:") + tbl.Rows[0]["Company_Telephone"].ToString().Trim();
  8052. sizef = g.MeasureString(rec2Value, ft9);
  8053. StrHeigth = Convert.ToInt32(sizef.Height);
  8054. StrWidth = Convert.ToInt32(sizef.Width) + 1;
  8055. Rectangle end_rec6_1 = new Rectangle(end_TableWidth + LeftWidth - StrWidth, end_rec5.Y + end_rec5.Height + 3, StrWidth, StrHeigth);
  8056. g.DrawString(rec2Value, ft9, b, end_rec6_1);
  8057. rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("地址:") + tbl.Rows[0]["Company_Address"].ToString().Trim();
  8058. sizef = g.MeasureString(rec2Value, ft9);
  8059. StrHeigth = Convert.ToInt32(sizef.Height);
  8060. StrWidth = Convert.ToInt32(sizef.Width) + 1;
  8061. Rectangle end_rec6 = new Rectangle(LeftWidth, end_rec6_1.Y, end_TableWidth - end_rec6_1.Width - 50, StrHeigth);
  8062. g.DrawString(rec2Value, ft9, b, end_rec6);
  8063. g.DrawString(((iPage + 1) + "/" + pListData.Count), ft9, b, new Rectangle(LeftWidth, end_rec6.Y + end_rec6.Height + 5, top_TableWidth, RowHeight));
  8064. #endregion
  8065. }
  8066. //if (k == 0)
  8067. //{
  8068. // if (sizeHeight < end_rec6.Y + end_rec6.Height)
  8069. // {
  8070. // sizeHeight = end_rec6.Y + end_rec6.Height;
  8071. // }
  8072. //}
  8073. //else
  8074. //{
  8075. // break;
  8076. //}
  8077. #endregion
  8078. g.DrawString(((iPage + 1) + "/" + pListData.Count), ft9, b, new Rectangle(LeftWidth, Position_Rect.Y + Position_Rect.Height + 5, top_TableWidth, RowHeight));
  8079. }
  8080. else
  8081. {
  8082. g.DrawString(((iPage + 1) + "/" + pListData.Count), ft9, b, new Rectangle(LeftWidth, Position_Rect.Y + Position_Rect.Height + 5, top_TableWidth, RowHeight));
  8083. }
  8084. }
  8085. }
  8086. if (pListData.Count - 1 > iPage)
  8087. {
  8088. IsHasMorePages = true;
  8089. }
  8090. else
  8091. {
  8092. IsHasMorePages = false;
  8093. }
  8094. return null;
  8095. }
  8096. /// <summary>
  8097. /// 数据分页集合处理(制作单)
  8098. /// </summary>
  8099. /// <param name="g1"></param>
  8100. /// <param name="ft9"></param>
  8101. /// <param name="mid_ColumnWidth1"></param>
  8102. /// <param name="makingProducts"></param>
  8103. /// <returns></returns>
  8104. static List<List<string>> GetMakeDetailListData(Graphics g1,Font ft9, string[] columnList, int[] _ColumnWidthList, LYFZ.PhotoSelectSystem.EventSelectPhotoPrint eventSelectPhotoPrint, List<LYFZ.PhotoSelectSystem.MakingProduct> makingProducts,
  8105. Hashtable PrintOtherData,string[] strOtherList, DataRow[] PaymentRows,int totalWidth , ref Dictionary<string, List<int>> dicKeyList, int setPageHiehgt=750)
  8106. {
  8107. #region 绑定数据
  8108. List<List<string>> pListData = new List<List<string>>();
  8109. List<string> tempListData = new List<string>();
  8110. SizeF iSizef = new SizeF();
  8111. float tempDataHight = 0;
  8112. LYFZ.PhotoSelectSystem.MakingProduct IntoBottom_makingItem=null;
  8113. LYFZ.PhotoSelectSystem.MakingProduct IntoBook_makingItem=null;
  8114. for (int i = 0; i < makingProducts.Count; i++)
  8115. {
  8116. LYFZ.Model.Model_ErpOrderProductList mProduct = makingProducts[i].OrderProduct;
  8117. if (i == 0)
  8118. {
  8119. pListData.Add(tempListData);
  8120. }
  8121. //iSizef = g1.MeasureString(mProduct.OPlist_ProdName.ToString().Trim(),
  8122. // ft9, _ColumnWidthList[0]);
  8123. if (makingProducts[i].IsEndorBook && (mProduct.OPlist_ProdName.Trim() == "入底" || mProduct.OPlist_ProdName.Trim() == "入册"))
  8124. {
  8125. //continue;
  8126. }
  8127. else
  8128. {
  8129. for (int keyIndex = 0; keyIndex < columnList.Length; keyIndex++)
  8130. {
  8131. SizeF tSizef = new SizeF();
  8132. if (columnList[keyIndex] == "产品名称")
  8133. {
  8134. tSizef = g1.MeasureString(mProduct.OPlist_ProdName.ToString().Trim(), ft9, _ColumnWidthList[keyIndex]);
  8135. }
  8136. else if (columnList[keyIndex] == "等级/加急日")
  8137. {
  8138. tSizef = g1.MeasureString(mProduct.OPlist_IsExpedited ? LYFZ.BLL.OtherCommonModel.FontConversion("加急件") : LYFZ.BLL.OtherCommonModel.FontConversion("普通件"), ft9, _ColumnWidthList[keyIndex]);
  8139. }
  8140. else if (columnList[keyIndex] == "P数")
  8141. {
  8142. tSizef = g1.MeasureString(mProduct.OPlist_Batch.ToString(), ft9, _ColumnWidthList[keyIndex]);
  8143. }
  8144. else if (columnList[keyIndex] == "数量")
  8145. {
  8146. tSizef = g1.MeasureString(mProduct.OPlist_ProdQuantity.ToString(), ft9, _ColumnWidthList[keyIndex]);
  8147. }
  8148. else if (columnList[keyIndex] == "备注")
  8149. {
  8150. tSizef = g1.MeasureString(mProduct.OPlist_Remark.ToString(), ft9, _ColumnWidthList[keyIndex]);
  8151. }
  8152. else if (columnList[keyIndex] == "所用照片")
  8153. {
  8154. int photoCount = 0;
  8155. string StrPhoto = eventSelectPhotoPrint.GetSelectProductPhotoNameString(mProduct.OPlist_UniquelyIdentity.ToString(), ref photoCount);//所用照片
  8156. tSizef = g1.MeasureString(StrPhoto, ft9, _ColumnWidthList[keyIndex]);
  8157. }
  8158. if (tSizef.Height > iSizef.Height)
  8159. {
  8160. iSizef.Height = tSizef.Height;
  8161. }
  8162. }
  8163. }
  8164. iSizef.Height += 8;
  8165. if (makingProducts[i].IsEndorBook)
  8166. {
  8167. if (mProduct.OPlist_ProdName.Trim() == "入底")
  8168. {
  8169. IntoBottom_makingItem = makingProducts[i];
  8170. }
  8171. else if (mProduct.OPlist_ProdName.Trim() == "入册")
  8172. {
  8173. IntoBook_makingItem = makingProducts[i];
  8174. }
  8175. //continue;
  8176. }
  8177. if (makingProducts[i].IsEndorBook&&(mProduct.OPlist_ProdName.Trim() == "入底"|| mProduct.OPlist_ProdName.Trim() == "入册"))
  8178. {
  8179. }
  8180. else
  8181. {
  8182. tempDataHight += iSizef.Height;
  8183. if (tempDataHight > setPageHiehgt)
  8184. {
  8185. tempListData = new List<string>();
  8186. tempDataHight = iSizef.Height;
  8187. pListData.Add(tempListData);
  8188. }
  8189. iSizef = new SizeF();
  8190. tempListData.Add(Newtonsoft.Json.JsonConvert.SerializeObject(makingProducts[i]));
  8191. }
  8192. if (i == (makingProducts.Count - 1))
  8193. {
  8194. string[] subColumnList = new string[] { "入底", "入册", "调修要求" };
  8195. for (int subColumnKeyIndex = 0; subColumnKeyIndex < subColumnList.Length; subColumnKeyIndex++)
  8196. {
  8197. string valueString = "-";
  8198. int photoCount = 0;
  8199. if (!string.IsNullOrEmpty(IntoBottom_makingItem.OrderProduct.OPlist_ProdName) && IntoBottom_makingItem.OrderProduct.OPlist_ProdName.Trim() == subColumnList[subColumnKeyIndex])
  8200. {
  8201. valueString = eventSelectPhotoPrint.GetSelectProductPhotoNameString(IntoBottom_makingItem.OrderProduct.OPlist_UniquelyIdentity.ToString(), ref photoCount);
  8202. valueString += LYFZ.BLL.OtherCommonModel.FontConversion(" 共") + photoCount + LYFZ.BLL.OtherCommonModel.FontConversion("张");
  8203. }
  8204. else if (!string.IsNullOrEmpty(IntoBook_makingItem.OrderProduct.OPlist_ProdName) && IntoBook_makingItem.OrderProduct.OPlist_ProdName.Trim() == subColumnList[subColumnKeyIndex])
  8205. {
  8206. valueString = eventSelectPhotoPrint.GetSelectProductPhotoNameString(IntoBook_makingItem.OrderProduct.OPlist_UniquelyIdentity.ToString(), ref photoCount);
  8207. valueString += LYFZ.BLL.OtherCommonModel.FontConversion(" 共") + photoCount + LYFZ.BLL.OtherCommonModel.FontConversion("张");
  8208. }
  8209. else if (subColumnList[subColumnKeyIndex] == "调修要求")
  8210. {
  8211. valueString = eventSelectPhotoPrint.CustomerRequest + " " + eventSelectPhotoPrint.PhotoRequest;
  8212. }
  8213. int tempColumnWidth = 0;
  8214. for(int it =1;it< _ColumnWidthList.Length;it++)
  8215. {
  8216. tempColumnWidth += _ColumnWidthList[it];
  8217. }
  8218. iSizef = g1.MeasureString(valueString, ft9, tempColumnWidth);
  8219. iSizef.Height += 8;
  8220. tempDataHight += iSizef.Height;
  8221. if ((tempDataHight) > setPageHiehgt)
  8222. {
  8223. tempListData = new List<string>();
  8224. tempDataHight = iSizef.Height;
  8225. pListData.Add(tempListData);
  8226. }
  8227. iSizef = new SizeF();
  8228. if (subColumnList[subColumnKeyIndex]== "入底")
  8229. {
  8230. tempListData.Add(Newtonsoft.Json.JsonConvert.SerializeObject(IntoBottom_makingItem));
  8231. }
  8232. if (subColumnList[subColumnKeyIndex] == "入册")
  8233. {
  8234. tempListData.Add(Newtonsoft.Json.JsonConvert.SerializeObject(IntoBook_makingItem));
  8235. }
  8236. if (dicKeyList.ContainsKey("[="+ subColumnList[subColumnKeyIndex] + "]"))
  8237. {
  8238. List<int> intListData = dicKeyList["[=" + subColumnList[subColumnKeyIndex] + "]"];
  8239. if (!intListData.Contains(pListData.Count))
  8240. {
  8241. intListData.Add(pListData.Count);
  8242. }
  8243. }
  8244. else
  8245. {
  8246. List<int> intListData = new List<int>();
  8247. intListData.Add(pListData.Count);
  8248. dicKeyList.Add("[=" + subColumnList[subColumnKeyIndex] + "]", intListData);
  8249. }
  8250. }
  8251. if (PrintOtherData.ContainsKey("制作单说明") && PrintOtherData["制作单说明"].ToString().Trim().Length > 0)
  8252. {
  8253. string ProductionNotes = PrintOtherData["制作单说明"].ToString().Trim();
  8254. iSizef = (g1.MeasureString(ProductionNotes, ft9, totalWidth));
  8255. iSizef.Height += 8;
  8256. tempDataHight += iSizef.Height ;
  8257. if ((tempDataHight) > setPageHiehgt)
  8258. {
  8259. tempListData = new List<string>();
  8260. tempDataHight = iSizef.Height;
  8261. pListData.Add(tempListData);
  8262. }
  8263. iSizef = new SizeF();
  8264. //dicKeyList.Add("", pListData.Count);
  8265. }
  8266. if (dicKeyList.ContainsKey("[=制作单说明]"))
  8267. {
  8268. List<int> intListData = dicKeyList["[=制作单说明]"];
  8269. if (!intListData.Contains(pListData.Count))
  8270. {
  8271. intListData.Add(pListData.Count);
  8272. }
  8273. }
  8274. else
  8275. {
  8276. List<int> intListData = new List<int>();
  8277. intListData.Add(pListData.Count);
  8278. dicKeyList.Add("[=制作单说明]", intListData);
  8279. }
  8280. int tempSOL = 0;
  8281. foreach(string str in strOtherList)
  8282. {
  8283. if (tempSOL >= 2)
  8284. {
  8285. if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideLookDesigner)
  8286. {
  8287. break;
  8288. }
  8289. }
  8290. iSizef = (g1.MeasureString(str, ft9, totalWidth));
  8291. iSizef.Height += 8;
  8292. tempDataHight += iSizef.Height;
  8293. if ((tempDataHight) > setPageHiehgt)
  8294. {
  8295. tempListData = new List<string>();
  8296. tempDataHight = iSizef.Height;
  8297. pListData.Add(tempListData);
  8298. }
  8299. iSizef = new SizeF();
  8300. tempSOL++;
  8301. }
  8302. if (dicKeyList.ContainsKey("[=其他数据]"))
  8303. {
  8304. List<int> intListData = dicKeyList["[=其他数据]"];
  8305. if (!intListData.Contains(pListData.Count))
  8306. {
  8307. intListData.Add(pListData.Count);
  8308. }
  8309. }
  8310. else
  8311. {
  8312. List<int> intListData = new List<int>();
  8313. intListData.Add(pListData.Count);
  8314. dicKeyList.Add("[=其他数据]", intListData);
  8315. }
  8316. //dicKeyList.Add("[=其他数据]", pListData.Count);
  8317. foreach (DataRow dr in PaymentRows)
  8318. {
  8319. iSizef = (g1.MeasureString("收款金额(元)", ft9, totalWidth));
  8320. iSizef.Height += 8;
  8321. tempDataHight += iSizef.Height;
  8322. if ((tempDataHight) > setPageHiehgt)
  8323. {
  8324. tempListData = new List<string>();
  8325. tempDataHight = iSizef.Height;
  8326. pListData.Add(tempListData);
  8327. }
  8328. iSizef = new SizeF();
  8329. }
  8330. if (dicKeyList.ContainsKey("[=付款信息]"))
  8331. {
  8332. List<int> intListData = dicKeyList["[=付款信息]"];
  8333. if (!intListData.Contains(pListData.Count))
  8334. {
  8335. intListData.Add(pListData.Count);
  8336. }
  8337. }
  8338. else
  8339. {
  8340. List<int> intListData = new List<int>();
  8341. intListData.Add(pListData.Count);
  8342. dicKeyList.Add("[=付款信息]", intListData);
  8343. }
  8344. //dicKeyList.Add("[=付款信息]", pListData.Count);
  8345. }
  8346. }
  8347. return pListData;
  8348. #endregion
  8349. }
  8350. /// <summary>
  8351. /// 获取行高
  8352. /// </summary>
  8353. /// <param name="eventSelectPhotoPrint"></param>
  8354. /// <param name="makingItem"></param>
  8355. /// <param name="mProduct"></param>
  8356. /// <returns></returns>
  8357. 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)
  8358. {
  8359. // new string[8] { "产品名称", "备注", "P数", "数量", "单价", "应收价", "实收价", "所用照片" };
  8360. // ValueList = new string[6] { "", "", "", "", "", "" };
  8361. int lineHeight = 0;
  8362. ValueList[0] = mProduct.OPlist_ProdName;
  8363. lineHeight = Convert.ToInt32(g.MeasureString(mProduct.OPlist_ProdName, _font, _ColumnWidthList[0] - leftAdd * 2).Height) + 1; //产品名称
  8364. string StrIsExp = mProduct.OPlist_IsExpedited ? LYFZ.BLL.OtherCommonModel.FontConversion("加急件") : LYFZ.BLL.OtherCommonModel.FontConversion("普通件");
  8365. if (mProduct.OPlist_ExpeditedTime.ToString().Trim() != "")
  8366. {
  8367. if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
  8368. {
  8369. StrIsExp = LYFZ.Command.Command_Validate.DateTimeToString(mProduct.OPlist_ExpeditedTime);
  8370. }
  8371. else
  8372. {
  8373. StrIsExp += "\r\n" + LYFZ.Command.Command_Validate.DateTimeToString(mProduct.OPlist_ExpeditedTime);
  8374. }
  8375. }
  8376. ValueList[1] = StrIsExp;
  8377. SizeF sizef = g.MeasureString(StrIsExp, _font, _ColumnWidthList[1] - leftAdd * 2); //等级
  8378. if (lineHeight < Convert.ToInt32(sizef.Height))
  8379. {
  8380. lineHeight = Convert.ToInt32(sizef.Height);
  8381. }
  8382. if (ValueList.Length == 5)
  8383. {
  8384. ValueList[1] = mProduct.OPlist_Batch.ToString();
  8385. ValueList[2] = mProduct.OPlist_ProdQuantity.ToString();
  8386. ValueList[3] = mProduct.OPlist_Remark;
  8387. }
  8388. else
  8389. {
  8390. ValueList[2] = mProduct.OPlist_Batch.ToString();
  8391. ValueList[3] = mProduct.OPlist_ProdQuantity.ToString();
  8392. ValueList[4] = mProduct.OPlist_Remark;
  8393. }
  8394. sizef = g.MeasureString(mProduct.OPlist_Remark, _font, _ColumnWidthList[4] - leftAdd * 2); //备注
  8395. if (lineHeight < Convert.ToInt32(sizef.Height) + 1)
  8396. {
  8397. lineHeight = Convert.ToInt32(sizef.Height) + 1;
  8398. }
  8399. int photoCount = 0;
  8400. string StrPhoto = eventSelectPhotoPrint.GetSelectProductPhotoNameString(mProduct.OPlist_UniquelyIdentity.ToString(), ref photoCount);//所用照片
  8401. if (!string.IsNullOrEmpty(StrPhoto))
  8402. {
  8403. StrPhoto += LYFZ.BLL.OtherCommonModel.FontConversion(" 共" + photoCount + "张");
  8404. if (ValueList.Length == 5)
  8405. {
  8406. ValueList[4] = StrPhoto;
  8407. }
  8408. else
  8409. {
  8410. ValueList[5] = StrPhoto;
  8411. }
  8412. }
  8413. else
  8414. {
  8415. StrPhoto = "测试高";
  8416. }
  8417. if (ValueList.Length == 5)
  8418. {
  8419. sizef = g.MeasureString(StrPhoto, _font, _ColumnWidthList[4] - leftAdd * 2);
  8420. }
  8421. else {
  8422. sizef = g.MeasureString(StrPhoto, _font, _ColumnWidthList[5] - leftAdd * 2);
  8423. }
  8424. if (lineHeight < Convert.ToInt32(sizef.Height) + 1)
  8425. {
  8426. lineHeight = Convert.ToInt32(sizef.Height) + 1;
  8427. }
  8428. return lineHeight;
  8429. }
  8430. /// <summary>
  8431. /// 获取行高
  8432. /// </summary>
  8433. /// <param name="eventSelectPhotoPrint"></param>
  8434. /// <param name="makingItem"></param>
  8435. /// <param name="mProduct"></param>
  8436. /// <returns></returns>
  8437. 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)
  8438. {
  8439. // new string[8] { "产品名称", "备注", "P数", "数量", "单价", "应收价", "实收价", "所用照片" };
  8440. ValueList = new string[8] { "", "", "", "", "", "", "", "" };
  8441. int lineHeight = 0;
  8442. ValueList[0] = mProduct.OPlist_ProdName;
  8443. lineHeight = Convert.ToInt32(g.MeasureString(mProduct.OPlist_ProdName, _font, _ColumnWidthList[0] - leftAdd * 2).Height) + 1; //产品名称
  8444. string StrIsExp = mProduct.OPlist_IsExpedited ? LYFZ.BLL.OtherCommonModel.FontConversion("加急件") : LYFZ.BLL.OtherCommonModel.FontConversion("普通件");
  8445. if (mProduct.OPlist_ExpeditedTime.ToString().Trim() != "")
  8446. {
  8447. if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
  8448. {
  8449. StrIsExp = LYFZ.Command.Command_Validate.DateTimeToString(mProduct.OPlist_ExpeditedTime);
  8450. }
  8451. else {
  8452. StrIsExp += "\r\n" + LYFZ.Command.Command_Validate.DateTimeToString(mProduct.OPlist_ExpeditedTime);
  8453. }
  8454. }
  8455. ValueList[1] = StrIsExp;
  8456. SizeF sizef = g.MeasureString(StrIsExp, _font, _ColumnWidthList[1] - leftAdd * 2); //等级
  8457. /*if (lineHeight < Convert.ToInt32(sizef.Height))
  8458. {
  8459. lineHeight = Convert.ToInt32(sizef.Height);
  8460. }*/
  8461. ValueList[2] = mProduct.OPlist_Batch.ToString();
  8462. ValueList[3] = mProduct.OPlist_ProdQuantity.ToString();
  8463. ValueList[4] = mProduct.OPlist_ProdSoldPrice.ToString("n2");
  8464. ValueList[5] = mProduct.OPlist_ReceivablePrice.ToString("n2");
  8465. ValueList[6] = mProduct.OPlist_ActualPrice.ToString("n2");
  8466. ValueList[1] = mProduct.OPlist_Remark;
  8467. sizef = g.MeasureString(mProduct.OPlist_Remark, _font, _ColumnWidthList[1] - leftAdd * 2); //备注
  8468. if (lineHeight < Convert.ToInt32(sizef.Height) + 1)
  8469. {
  8470. lineHeight = Convert.ToInt32(sizef.Height) + 1;
  8471. }
  8472. int photoCount = 0;
  8473. string StrPhoto = eventSelectPhotoPrint.GetSelectProductPhotoNameString(mProduct.OPlist_UniquelyIdentity.ToString(), ref photoCount);//所用照片
  8474. if (!string.IsNullOrEmpty(StrPhoto))
  8475. {
  8476. StrPhoto += LYFZ.BLL.OtherCommonModel.FontConversion(" 共" + photoCount + "张");
  8477. ValueList[7] = StrPhoto;
  8478. }
  8479. else
  8480. {
  8481. StrPhoto = "测试高";
  8482. }
  8483. sizef = g.MeasureString(StrPhoto, _font, _ColumnWidthList[7] - leftAdd * 2);
  8484. if (lineHeight < Convert.ToInt32(sizef.Height) + 1)
  8485. {
  8486. lineHeight = Convert.ToInt32(sizef.Height) + 1;
  8487. }
  8488. return lineHeight;
  8489. }
  8490. /// <summary>
  8491. /// 打印特殊定制选片制作单(金色童年)
  8492. /// </summary>
  8493. /// <param name="dtSet"></param>
  8494. /// <param name="spmodel"></param>
  8495. /// <param name="size"></param>
  8496. /// <param name="LeftWidth"></param>
  8497. /// <param name="LeftAdd"></param>
  8498. /// <param name="TopAdd"></param>
  8499. /// <param name="RowHeight"></param>
  8500. /// <param name="RowContentHeight"></param>
  8501. /// <returns></returns>
  8502. static Bitmap GetSelectPhotoSpecialTemplate(DataSet dtSet, PhotoSelectSystem.EventSelectPhotoPrint spmodel, Size size,Graphics g1 ,ref List<List<string>> pListData, int iPage,
  8503. int LeftWidth, int LeftAdd, int TopAdd, int RowHeight, int RowContentHeight,ref Dictionary<string, List<int>> dicKeyList)
  8504. {
  8505. DataTable tbl = dtSet.Tables["ds"];//获取影楼信息
  8506. DataTable tb_ord = dtSet.Tables["ds1"];//订单
  8507. DataTable tb_Sights = dtSet.Tables["ds2"];//拍摄名称
  8508. DataTable tb_Payment = dtSet.Tables["ds3"];//收款记录
  8509. int top_TableWidth = size.Width - LeftWidth * 2 - 20;
  8510. int top_ColumnWidth1 = 70;
  8511. int top_ColumnWidth2 = 110;
  8512. int top_ColumnWidth3 = 70;
  8513. int top_ColumnWidth5 = 70;
  8514. int top_ColumnWidth6 = 140;
  8515. int top_ColumnWidth4 = top_TableWidth - top_ColumnWidth1 - top_ColumnWidth2 - top_ColumnWidth3 - top_ColumnWidth5 - top_ColumnWidth6;
  8516. Brush b = Brushes.Black;
  8517. Pen p = GetPen;
  8518. Font mainTitle16Font = new Font("宋体", 16);
  8519. Font subTitle13Font = new Font("宋体", 13);
  8520. Font tetxt9Font = new Font("宋体", 9);
  8521. // Font ft9 = new Font("宋体", 9);
  8522. Font title9Font = new Font("宋体", 9, FontStyle.Bold);
  8523. int sizeHeight = size.Height - 120;
  8524. Bitmap panlImage = null;
  8525. //字符对齐格式
  8526. StringFormat format = new StringFormat();
  8527. format.Alignment = StringAlignment.Near;
  8528. format.LineAlignment = StringAlignment.Center;
  8529. StringFormat titleFormat = new StringFormat();
  8530. titleFormat.Alignment = StringAlignment.Center;
  8531. titleFormat.LineAlignment = StringAlignment.Center;
  8532. //行定位
  8533. Rectangle rowLocateRectangle = new Rectangle(LeftWidth, 0, top_TableWidth, RowHeight);
  8534. //列定位
  8535. Rectangle cellLocateRectangle = new Rectangle(LeftWidth, 0, top_TableWidth, RowHeight);
  8536. //for (int z = 0; z < 2; z++)
  8537. //{
  8538. rowLocateRectangle = new Rectangle(LeftWidth, 30, top_TableWidth, RowHeight);
  8539. cellLocateRectangle = new Rectangle(LeftWidth, 0, top_TableWidth, RowHeight);
  8540. //panlImage = new Bitmap(size.Width, sizeHeight);
  8541. Graphics g = g1;// Graphics.FromImage(panlImage);
  8542. #region 画标题
  8543. string rec2Value = tbl.Rows[0]["Company_Name"].ToString().Trim() + LYFZ.BLL.OtherCommonModel.FontConversion("制作单明细");
  8544. SizeF sizef = g.MeasureString(rec2Value, mainTitle16Font);
  8545. int StrHeigth = Convert.ToInt32(sizef.Height);
  8546. int StrWidth = Convert.ToInt32(sizef.Width) + 1;
  8547. rowLocateRectangle = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y, rowLocateRectangle.Width, StrHeigth);
  8548. g.DrawString(String.Format("{0}", rec2Value), mainTitle16Font, b, rowLocateRectangle, titleFormat);
  8549. #endregion
  8550. #region 画第一行
  8551. rowLocateRectangle = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y + rowLocateRectangle.Height+10, rowLocateRectangle.Width, RowHeight);
  8552. g.DrawRectangle(p, rowLocateRectangle);//画标题矩形
  8553. cellLocateRectangle = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y, 76, rowLocateRectangle.Height);
  8554. g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
  8555. g.DrawString(String.Format(LYFZ.BLL.OtherCommonModel.FontConversion("订单号")), title9Font, b, cellLocateRectangle, titleFormat);
  8556. string OrdNumber = String.IsNullOrWhiteSpace(spmodel.CurrentModel.Ord_SinceOrderNumber) ? spmodel.CurrentModel.Ord_Number : spmodel.CurrentModel.Ord_SinceOrderNumber;
  8557. cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 120, cellLocateRectangle.Height);
  8558. g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
  8559. g.DrawString(String.Format("{0}", OrdNumber), tetxt9Font, b, cellLocateRectangle, format);
  8560. cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 76, cellLocateRectangle.Height);
  8561. g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
  8562. g.DrawString(String.Format("{0}", LYFZ.BLL.OtherCommonModel.FontConversion("套系名称")), title9Font, b, cellLocateRectangle, titleFormat);
  8563. string taoXiNameString = "";
  8564. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideArrears)
  8565. {
  8566. taoXiNameString = spmodel.CurrentModel.Ord_SeriesName + LYFZ.BLL.OtherCommonModel.FontConversion(" 欠款:") + tb_ord.Rows[0]["欠款"].ToString();
  8567. }
  8568. else
  8569. {
  8570. taoXiNameString = spmodel.CurrentModel.Ord_SeriesName;
  8571. }
  8572. cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 270, cellLocateRectangle.Height);
  8573. g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
  8574. g.DrawString(String.Format("{0}", taoXiNameString), tetxt9Font, b, cellLocateRectangle, format);
  8575. string BottomAndListedString = String.Format("入底加挑:{0} 入册加挑:{1}", spmodel.IntoBottomPickNumber, spmodel.IntoRegisterPickNumber);
  8576. cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 180, cellLocateRectangle.Height);
  8577. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
  8578. {
  8579. g.DrawString(String.Format("{0}", BottomAndListedString), tetxt9Font, b, cellLocateRectangle, format);
  8580. }
  8581. #endregion
  8582. #region 画第二行
  8583. rowLocateRectangle = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y + rowLocateRectangle.Height, rowLocateRectangle.Width, RowHeight);
  8584. g.DrawRectangle(p, rowLocateRectangle);
  8585. cellLocateRectangle = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y, 76, rowLocateRectangle.Height);
  8586. g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
  8587. g.DrawString(String.Format(LYFZ.BLL.OtherCommonModel.FontConversion("客户姓名")), title9Font, b, cellLocateRectangle, titleFormat);
  8588. string StrUserName = tb_ord.Rows[0]["客户姓名"].ToString().Trim();
  8589. string StrPhone = tb_ord.Rows[0]["客户电话"].ToString().Trim();
  8590. if (tb_ord.Rows[0]["Ord_Type"].ToString().Trim() == "2")
  8591. {
  8592. StrUserName = tb_ord.Rows[0]["主客户姓名"].ToString().Trim();
  8593. StrPhone = tb_ord.Rows[0]["主客户电话"].ToString().Trim();
  8594. }
  8595. cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 120, cellLocateRectangle.Height);
  8596. g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
  8597. g.DrawString(String.Format("{0}", StrUserName), tetxt9Font, b, cellLocateRectangle, format);
  8598. cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 76, cellLocateRectangle.Height);
  8599. g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
  8600. g.DrawString(String.Format("{0}", LYFZ.BLL.OtherCommonModel.FontConversion("客户电话")), title9Font, b, cellLocateRectangle, titleFormat);
  8601. cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 270, cellLocateRectangle.Height);
  8602. g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
  8603. g.DrawString(String.Format("{0}", StrPhone), tetxt9Font, b, cellLocateRectangle, format);
  8604. cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 76, cellLocateRectangle.Height);
  8605. g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
  8606. g.DrawString(String.Format("{0}", LYFZ.BLL.OtherCommonModel.FontConversion("是否加急")), title9Font, b, cellLocateRectangle, titleFormat);
  8607. cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 120, cellLocateRectangle.Height);
  8608. g.DrawString(String.Format("{0}", LYFZ.BLL.OtherCommonModel.FontConversion(spmodel.MakingProductList.Any(product => product.OrderProduct.OPlist_IsExpedited) ? "加急" : "")), tetxt9Font, b, cellLocateRectangle, format);
  8609. #endregion
  8610. #region 画第三行
  8611. rowLocateRectangle = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y + rowLocateRectangle.Height, rowLocateRectangle.Width, RowHeight);
  8612. g.DrawRectangle(p, rowLocateRectangle);
  8613. cellLocateRectangle = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y, 76, rowLocateRectangle.Height);
  8614. g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
  8615. g.DrawString(String.Format(LYFZ.BLL.OtherCommonModel.FontConversion("摄影师")), title9Font, b, cellLocateRectangle, titleFormat);
  8616. cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 120, cellLocateRectangle.Height);
  8617. g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
  8618. g.DrawString(String.Format("{0}", tb_ord.Rows[0]["摄影师"].ToString().Trim()), tetxt9Font, b, cellLocateRectangle, format);
  8619. cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 76, cellLocateRectangle.Height);
  8620. g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
  8621. g.DrawString(String.Format("{0}", LYFZ.BLL.OtherCommonModel.FontConversion("门市")), title9Font, b, cellLocateRectangle, titleFormat);
  8622. cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 270, cellLocateRectangle.Height);
  8623. g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
  8624. g.DrawString(String.Format("{0}", tb_ord.Rows[0]["接单人"].ToString().Trim()), tetxt9Font, b, cellLocateRectangle, format);
  8625. cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 76, cellLocateRectangle.Height);
  8626. g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
  8627. g.DrawString(String.Format("{0}", LYFZ.BLL.OtherCommonModel.FontConversion("预约取件")), title9Font, b, cellLocateRectangle, titleFormat);
  8628. cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 120, cellLocateRectangle.Height);
  8629. g.DrawString(String.Format("{0}", LYFZ.Command.Command_Validate.DateTimeToString2(tb_ord.Rows[0]["预约取件日期"])), tetxt9Font, b, cellLocateRectangle, format);
  8630. #endregion
  8631. #region 画第四行
  8632. rowLocateRectangle = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y + rowLocateRectangle.Height, rowLocateRectangle.Width, RowHeight);
  8633. g.DrawRectangle(p, rowLocateRectangle);
  8634. cellLocateRectangle = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y, 76, rowLocateRectangle.Height);
  8635. g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
  8636. g.DrawString(String.Format(LYFZ.BLL.OtherCommonModel.FontConversion("拍摄日期")), title9Font, b, cellLocateRectangle, titleFormat);
  8637. cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 120, cellLocateRectangle.Height);
  8638. g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
  8639. g.DrawString(String.Format("{0}", LYFZ.Command.Command_Validate.DateTimeToString(tb_ord.Rows[0]["拍摄日期"])), tetxt9Font, b, cellLocateRectangle, format);
  8640. cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 76, cellLocateRectangle.Height);
  8641. g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
  8642. g.DrawString(String.Format("{0}", LYFZ.BLL.OtherCommonModel.FontConversion("化妆师")), title9Font, b, cellLocateRectangle, titleFormat);
  8643. cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 100, cellLocateRectangle.Height);
  8644. g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
  8645. g.DrawString(String.Format("{0}", tb_ord.Rows[0]["化妆师"].ToString().Trim()), tetxt9Font, b, cellLocateRectangle, format);
  8646. string yingDaoShi = "";
  8647. if (tb_ord.Rows[0]["Ord_Type"].ToString().Trim() == "1")
  8648. {
  8649. yingDaoShi = tb_ord.Rows[0]["引导师"].ToString().Trim();
  8650. }
  8651. cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 70, cellLocateRectangle.Height);
  8652. g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
  8653. g.DrawString(String.Format("{0}", LYFZ.BLL.OtherCommonModel.FontConversion("引导师")), title9Font, b, cellLocateRectangle, titleFormat);
  8654. cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 100, cellLocateRectangle.Height);
  8655. g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
  8656. g.DrawString(String.Format("{0}", yingDaoShi), tetxt9Font, b, cellLocateRectangle, format);
  8657. cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 76, cellLocateRectangle.Height);
  8658. g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
  8659. g.DrawString(String.Format("{0}", LYFZ.BLL.OtherCommonModel.FontConversion("初修师")), title9Font, b, cellLocateRectangle, titleFormat);
  8660. cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 100, cellLocateRectangle.Height);
  8661. g.DrawString(String.Format("{0}", tb_ord.Rows[0]["初修师"].ToString().Trim()), tetxt9Font, b, cellLocateRectangle, format);
  8662. #endregion
  8663. #region 画第五行
  8664. rowLocateRectangle = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y + rowLocateRectangle.Height, rowLocateRectangle.Width, RowHeight);
  8665. g.DrawRectangle(p, rowLocateRectangle);
  8666. cellLocateRectangle = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y, 76, rowLocateRectangle.Height);
  8667. g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
  8668. g.DrawString(String.Format(LYFZ.BLL.OtherCommonModel.FontConversion("统计")), title9Font, b, cellLocateRectangle, titleFormat);
  8669. string StrStatistics = "";
  8670. if (tb_ord.Rows[0]["Ord_Type"].ToString().Trim() == "1")
  8671. {
  8672. 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("张");
  8673. }
  8674. else
  8675. {
  8676. 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("张");
  8677. }
  8678. cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 600, cellLocateRectangle.Height);
  8679. g.DrawString(String.Format("{0}", StrStatistics), tetxt9Font, b, cellLocateRectangle, format);
  8680. #endregion
  8681. #region 产品列表
  8682. List<LYFZ.PhotoSelectSystem.SelectPrintProduction> SelectPrintList = new List<LYFZ.PhotoSelectSystem.SelectPrintProduction>();
  8683. if (spmodel.SelectPrintList.Count > 0)
  8684. {
  8685. SelectPrintList = spmodel.SelectPrintList;
  8686. }
  8687. else
  8688. {
  8689. SelectPrintList.Add(new LYFZ.PhotoSelectSystem.SelectPrintProduction()
  8690. {
  8691. OrderDigital = spmodel.CurrentDigModel
  8692. ,
  8693. Photography = spmodel.CurrentSelectPhotoHandling.PhotoModel
  8694. });
  8695. }
  8696. decimal sumReceivablePrice = 0;
  8697. decimal sumActualPrice = 0;
  8698. foreach (LYFZ.PhotoSelectSystem.SelectPrintProduction selectItem in SelectPrintList)
  8699. {
  8700. string titleString = String.Format("指定制作");
  8701. if (selectItem.Photography != null)
  8702. {
  8703. if (!String.IsNullOrWhiteSpace(selectItem.Photography.Ordpg_Sights))
  8704. {
  8705. titleString = String.Format("【{0}】指定制作", selectItem.Photography.Ordpg_Sights);
  8706. }
  8707. }
  8708. sizef = g.MeasureString(titleString, subTitle13Font);
  8709. StrHeigth = Convert.ToInt32(sizef.Height);
  8710. StrWidth = Convert.ToInt32(sizef.Width) + 1;
  8711. rowLocateRectangle = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y + rowLocateRectangle.Height, rowLocateRectangle.Width, StrHeigth + 10);
  8712. #region 列标题
  8713. string[] columnList = new string[8] { "产品名称", "备注", "P数", "数量", "单价", "应收价", "实收价", "所用照片" };
  8714. int[] _ColumnWidthList = new int[8] { 100, 110, 45, 45, 60, 70, 70, 235 };
  8715. LYFZ.PhotoSelectSystem.EventSelectPhotoPrint eventSelectPhotoPrint = LYFZ.PhotoSelectSystem.frmSaveSelectPhotoInfo.GetStaticSelectPhotoPrint(spmodel.CurrentModel, selectItem.OrderDigital);
  8716. if (pListData.Count == 0)
  8717. {
  8718. pListData = GetMakeDetailListData(g1, tetxt9Font, columnList, _ColumnWidthList, eventSelectPhotoPrint, eventSelectPhotoPrint.MakingProductList, PrintOtherData,
  8719. new string[] { "总应收", "选片师/选片日期" },
  8720. tb_Payment.Select("Plu_OrdViceNumber='" + selectItem.OrderDigital.Ordv_ViceNumber + "'"), rowLocateRectangle.Width, ref dicKeyList, 680);
  8721. }
  8722. Rectangle columnPosition_Rect = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y, 0, rowLocateRectangle.Height);
  8723. List<string> pData = pListData[iPage];
  8724. if (pData.Count > 0)
  8725. {
  8726. g.DrawRectangle(p, rowLocateRectangle);
  8727. g.DrawString(String.Format("{0}", titleString), subTitle13Font, b, rowLocateRectangle, titleFormat);
  8728. rowLocateRectangle = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y + rowLocateRectangle.Height, rowLocateRectangle.Width, RowHeight);
  8729. g.DrawRectangle(p, rowLocateRectangle);//画标题矩形
  8730. columnPosition_Rect = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y, 0, rowLocateRectangle.Height);
  8731. for (int i = 0; i < columnList.Length; i++)
  8732. {
  8733. columnPosition_Rect = new Rectangle(columnPosition_Rect.X + columnPosition_Rect.Width, columnPosition_Rect.Y, _ColumnWidthList[i], columnPosition_Rect.Height);
  8734. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion(columnList[i]), title9Font, b
  8735. , new Rectangle(columnPosition_Rect.X + LeftAdd, columnPosition_Rect.Y + TopAdd, columnPosition_Rect.Width, RowContentHeight));
  8736. if (i < columnList.Length - 1)
  8737. {
  8738. g.DrawLine(p, new Point(columnPosition_Rect.X + columnPosition_Rect.Width, columnPosition_Rect.Y)
  8739. , new Point(columnPosition_Rect.X + columnPosition_Rect.Width, columnPosition_Rect.Y + columnPosition_Rect.Height));
  8740. }
  8741. }
  8742. }
  8743. #endregion
  8744. #region 输出产品列表和产品选片信息
  8745. LYFZ.PhotoSelectSystem.MakingProduct IntoBottom_makingItem = new PhotoSelectSystem.MakingProduct();//入底
  8746. LYFZ.PhotoSelectSystem.MakingProduct IntoBook_makingItem = new PhotoSelectSystem.MakingProduct();//入册
  8747. foreach (string strMakingItem in pData)
  8748. {
  8749. LYFZ.PhotoSelectSystem.MakingProduct makingItem = Newtonsoft.Json.JsonConvert.DeserializeObject<LYFZ.PhotoSelectSystem.MakingProduct>(strMakingItem);
  8750. LYFZ.Model.Model_ErpOrderProductList mProduct = makingItem.OrderProduct;
  8751. if (makingItem.IsEndorBook)
  8752. {
  8753. if (mProduct.OPlist_ProdName.Trim() == "入底")
  8754. {
  8755. IntoBottom_makingItem = makingItem;
  8756. }
  8757. else if (mProduct.OPlist_ProdName.Trim() == "入册")
  8758. {
  8759. IntoBook_makingItem = makingItem;
  8760. }
  8761. continue;
  8762. }
  8763. sumReceivablePrice += mProduct.OPlist_ReceivablePrice;
  8764. sumActualPrice += mProduct.OPlist_ActualPrice;
  8765. string[] ValueList = new string[8] { "", "", "", "", "", "", "", "" };
  8766. int lineHeight = GetLineHeight2(eventSelectPhotoPrint, makingItem, mProduct, tetxt9Font, LeftAdd, _ColumnWidthList, g, ref ValueList);
  8767. if (lineHeight < RowHeight)
  8768. {
  8769. lineHeight = RowHeight;
  8770. }
  8771. rowLocateRectangle = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y + rowLocateRectangle.Height, rowLocateRectangle.Width, lineHeight);
  8772. g.DrawRectangle(p, rowLocateRectangle);//画标题矩形
  8773. columnPosition_Rect = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y, 0, rowLocateRectangle.Height);
  8774. for (int j = 0; j < columnList.Length; j++)
  8775. {
  8776. columnPosition_Rect = new Rectangle(columnPosition_Rect.X + columnPosition_Rect.Width, columnPosition_Rect.Y, _ColumnWidthList[j], columnPosition_Rect.Height);
  8777. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion(ValueList[j]), tetxt9Font, b
  8778. , new Rectangle(columnPosition_Rect.X + LeftAdd, columnPosition_Rect.Y + TopAdd, columnPosition_Rect.Width, lineHeight));
  8779. if (j < columnList.Length - 1)
  8780. {
  8781. g.DrawLine(p, new Point(columnPosition_Rect.X + columnPosition_Rect.Width, columnPosition_Rect.Y)
  8782. , new Point(columnPosition_Rect.X + columnPosition_Rect.Width, columnPosition_Rect.Y + columnPosition_Rect.Height));
  8783. }
  8784. }
  8785. }
  8786. //if (pListData.Count - 1 == iPage)
  8787. //{
  8788. //入底/入册/调修要求 "入底","入册",
  8789. string[] subColumnList = new string[] { "入底", "入册", "调修要求" };
  8790. for (int i = 0; i < subColumnList.Length; i++)
  8791. {
  8792. if (dicKeyList.ContainsKey("[=" + subColumnList[i] + "]") && dicKeyList["[=" + subColumnList[i] + "]"].Contains(iPage + 1))
  8793. {
  8794. int lineHeight = 0;
  8795. string valueString = "-";
  8796. int photoCount = 0;
  8797. if (!string.IsNullOrEmpty(IntoBottom_makingItem.OrderProduct.OPlist_ProdName) && IntoBottom_makingItem.OrderProduct.OPlist_ProdName.Trim() == subColumnList[i])
  8798. {
  8799. valueString = eventSelectPhotoPrint.GetSelectProductPhotoNameString(IntoBottom_makingItem.OrderProduct.OPlist_UniquelyIdentity.ToString(), ref photoCount);
  8800. valueString += LYFZ.BLL.OtherCommonModel.FontConversion(" 共") + photoCount + LYFZ.BLL.OtherCommonModel.FontConversion("张");
  8801. }
  8802. else if (!string.IsNullOrEmpty(IntoBook_makingItem.OrderProduct.OPlist_ProdName) && IntoBook_makingItem.OrderProduct.OPlist_ProdName.Trim() == subColumnList[i])
  8803. {
  8804. valueString = eventSelectPhotoPrint.GetSelectProductPhotoNameString(IntoBook_makingItem.OrderProduct.OPlist_UniquelyIdentity.ToString(), ref photoCount);
  8805. valueString += LYFZ.BLL.OtherCommonModel.FontConversion(" 共") + photoCount + LYFZ.BLL.OtherCommonModel.FontConversion("张");
  8806. }
  8807. else if (subColumnList[i] == "调修要求")
  8808. {
  8809. valueString = eventSelectPhotoPrint.CustomerRequest + " " + eventSelectPhotoPrint.PhotoRequest;
  8810. }
  8811. lineHeight = Convert.ToInt32(g.MeasureString(valueString, tetxt9Font, rowLocateRectangle.Width - _ColumnWidthList[0] - LeftAdd * 2).Height) + 2;
  8812. if (lineHeight < RowHeight)
  8813. {
  8814. lineHeight = RowHeight;
  8815. }
  8816. // Position_Rect = new Rectangle(LeftWidth, Position_Rect.Y + Position_Rect.Height, mid_TableWidth, lineHeight + TopAdd * 2);
  8817. rowLocateRectangle = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y + rowLocateRectangle.Height, rowLocateRectangle.Width, lineHeight);
  8818. g.DrawRectangle(p, rowLocateRectangle);//画标题矩形
  8819. columnPosition_Rect = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y, 0, rowLocateRectangle.Height);
  8820. for (int j = 0; j < 2; j++)
  8821. {
  8822. string ContentText = "";
  8823. if (j == 0)
  8824. {
  8825. ContentText = subColumnList[i];
  8826. columnPosition_Rect = new Rectangle(columnPosition_Rect.X + columnPosition_Rect.Width, columnPosition_Rect.Y, _ColumnWidthList[0], columnPosition_Rect.Height);
  8827. }
  8828. else
  8829. {
  8830. columnPosition_Rect = new Rectangle(columnPosition_Rect.X + columnPosition_Rect.Width, columnPosition_Rect.Y, rowLocateRectangle.Width - _ColumnWidthList[0], columnPosition_Rect.Height);
  8831. ContentText = valueString;
  8832. }
  8833. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion(ContentText), tetxt9Font, b
  8834. , new Rectangle(columnPosition_Rect.X + LeftAdd, columnPosition_Rect.Y + TopAdd, columnPosition_Rect.Width, lineHeight));
  8835. if (j == 0)
  8836. {
  8837. g.DrawLine(p, new Point(columnPosition_Rect.X + columnPosition_Rect.Width, columnPosition_Rect.Y)
  8838. , new Point(columnPosition_Rect.X + columnPosition_Rect.Width, columnPosition_Rect.Y + columnPosition_Rect.Height));
  8839. }
  8840. }
  8841. }
  8842. }
  8843. #endregion
  8844. // }
  8845. }
  8846. #endregion
  8847. if (pListData.Count - 1 == iPage)
  8848. {
  8849. #region 申明内容
  8850. string ProductionNotes = "";
  8851. int tempRowHeight = RowHeight;
  8852. if (PrintOtherData.ContainsKey("制作单说明") && PrintOtherData["制作单说明"].ToString().Trim().Length > 0)
  8853. {
  8854. ProductionNotes = PrintOtherData["制作单说明"].ToString().Trim();
  8855. tempRowHeight = Convert.ToInt32(g.MeasureString(ProductionNotes, tetxt9Font, rowLocateRectangle.Width).Height);
  8856. }
  8857. rowLocateRectangle = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y + rowLocateRectangle.Height, rowLocateRectangle.Width, tempRowHeight + RowHeight);
  8858. cellLocateRectangle = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y, rowLocateRectangle.Width, rowLocateRectangle.Height);
  8859. g.DrawString(String.Format("{0}", ProductionNotes), tetxt9Font, b, cellLocateRectangle, format);
  8860. #endregion
  8861. #region 尾部第一行
  8862. rowLocateRectangle = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y + rowLocateRectangle.Height, rowLocateRectangle.Width, RowHeight);
  8863. g.DrawRectangle(p, rowLocateRectangle);
  8864. cellLocateRectangle = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y, 130, rowLocateRectangle.Height);
  8865. g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
  8866. g.DrawString(String.Format(LYFZ.BLL.OtherCommonModel.FontConversion("总应收")), title9Font, b, cellLocateRectangle, titleFormat);
  8867. cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 130, cellLocateRectangle.Height);
  8868. g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
  8869. g.DrawString(String.Format(" {0}", sumReceivablePrice.ToString("n2")), tetxt9Font, b, cellLocateRectangle, format);
  8870. cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 130, cellLocateRectangle.Height);
  8871. g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
  8872. g.DrawString(String.Format(LYFZ.BLL.OtherCommonModel.FontConversion("总实收")), title9Font, b, cellLocateRectangle, titleFormat);
  8873. cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 210, cellLocateRectangle.Height);
  8874. g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
  8875. g.DrawString(String.Format(" {0}", sumActualPrice.ToString("n2")), tetxt9Font, b, cellLocateRectangle, format);
  8876. cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 80, cellLocateRectangle.Height);
  8877. g.DrawString(String.Format(LYFZ.BLL.OtherCommonModel.FontConversion("客户签字")), title9Font, b, cellLocateRectangle, titleFormat);
  8878. #endregion
  8879. #region 尾部第二行
  8880. rowLocateRectangle = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y + rowLocateRectangle.Height, rowLocateRectangle.Width, RowHeight);
  8881. g.DrawRectangle(p, rowLocateRectangle);
  8882. cellLocateRectangle = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y, 130, rowLocateRectangle.Height);
  8883. g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
  8884. g.DrawString(String.Format(LYFZ.BLL.OtherCommonModel.FontConversion("选片师/选片日期")), title9Font, b, cellLocateRectangle, titleFormat);
  8885. string StrValue1 = "";
  8886. if (tb_ord.Rows[0]["选片人"].ToString().Trim() != "")
  8887. {
  8888. StrValue1 = (tb_ord.Rows[0]["选片人"].ToString().Trim() + " / " + LYFZ.Command.Command_Validate.DateTimeToString2(tb_ord.Rows[0]["选片日期"])).Trim('/');
  8889. }
  8890. cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 210 + 260, cellLocateRectangle.Height);
  8891. g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
  8892. g.DrawString(String.Format(" {0}", StrValue1), tetxt9Font, b, cellLocateRectangle, format);
  8893. #endregion
  8894. #region 收款记录
  8895. rowLocateRectangle = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y + rowLocateRectangle.Height, rowLocateRectangle.Width, RowHeight);
  8896. g.DrawRectangle(p, rowLocateRectangle);
  8897. cellLocateRectangle = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y, rowLocateRectangle.Width, rowLocateRectangle.Height);
  8898. g.DrawString(String.Format(LYFZ.BLL.OtherCommonModel.FontConversion("收款记录")), title9Font, b, cellLocateRectangle, titleFormat);
  8899. foreach (LYFZ.PhotoSelectSystem.SelectPrintProduction selectItem in SelectPrintList)
  8900. {
  8901. DataRow[] PaymentRows = tb_Payment.Select("Plu_OrdViceNumber='" + selectItem.OrderDigital.Ordv_ViceNumber + "'");
  8902. foreach (DataRow row in PaymentRows)
  8903. {
  8904. rowLocateRectangle = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y + rowLocateRectangle.Height, rowLocateRectangle.Width, RowHeight);
  8905. g.DrawRectangle(p, rowLocateRectangle);
  8906. cellLocateRectangle = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y, 90, rowLocateRectangle.Height);
  8907. g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
  8908. g.DrawString(String.Format(LYFZ.BLL.OtherCommonModel.FontConversion("收款金额(元)")), title9Font, b, cellLocateRectangle, titleFormat);
  8909. cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 100, cellLocateRectangle.Height);
  8910. g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
  8911. g.DrawString(String.Format(" {0}", Convert.ToDecimal(row["Pay_AmountOf"]).ToString("n2")), tetxt9Font, b, cellLocateRectangle, format);
  8912. cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 90, cellLocateRectangle.Height);
  8913. g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
  8914. g.DrawString(String.Format(LYFZ.BLL.OtherCommonModel.FontConversion("支付方式")), title9Font, b, cellLocateRectangle, titleFormat);
  8915. cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 100, cellLocateRectangle.Height);
  8916. g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
  8917. g.DrawString(String.Format(" {0}", GetClassCodeToCalssName(row["Pay_PaymentMethod"].ToString())), tetxt9Font, b, cellLocateRectangle, format);
  8918. cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 90, cellLocateRectangle.Height);
  8919. g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
  8920. g.DrawString(String.Format(LYFZ.BLL.OtherCommonModel.FontConversion("收款时间")), title9Font, b, cellLocateRectangle, titleFormat);
  8921. cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 210, cellLocateRectangle.Height);
  8922. g.DrawString(String.Format(" {0}", Convert.ToDateTime(row["Pay_CreateDatetime"]).ToString("yyyy-MM-dd HH:mm:ss")), tetxt9Font, b, cellLocateRectangle, format);
  8923. }
  8924. }
  8925. #endregion
  8926. #region 地址
  8927. rowLocateRectangle = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y + rowLocateRectangle.Height, rowLocateRectangle.Width, RowHeight);
  8928. cellLocateRectangle = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y, rowLocateRectangle.Width, rowLocateRectangle.Height);
  8929. 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);
  8930. #endregion
  8931. g.DrawString(((iPage + 1) + "/" + pListData.Count), tetxt9Font, b, new Rectangle(LeftWidth, cellLocateRectangle.Y + cellLocateRectangle.Height + 5, top_TableWidth, RowHeight));
  8932. }
  8933. else
  8934. {
  8935. g.DrawString(((iPage + 1) + "/" + pListData.Count), tetxt9Font, b, new Rectangle(LeftWidth, rowLocateRectangle.Y + rowLocateRectangle.Height + 5, top_TableWidth, RowHeight));
  8936. }
  8937. //g.Dispose();
  8938. //if (z == 0)
  8939. //{
  8940. // if (sizeHeight < rowLocateRectangle.Y + rowLocateRectangle.Height)
  8941. // {
  8942. // sizeHeight = rowLocateRectangle.Y + rowLocateRectangle.Height + 2;
  8943. // }
  8944. // else
  8945. // {
  8946. // break;
  8947. // }
  8948. //}
  8949. //else
  8950. //{
  8951. // break;
  8952. //}
  8953. //}
  8954. return null;
  8955. }
  8956. public static string GetClassCodeToCalssName(string classCode)
  8957. {
  8958. if (string.IsNullOrEmpty(classCode.Trim())) { return ""; }
  8959. return LYFZ.BLL.WageStatisticsProcess.GetClassCodeToCalssName(classCode);
  8960. }
  8961. #endregion
  8962. #region 加减乘除
  8963. /// <summary>
  8964. /// 加减乘除
  8965. /// </summary>
  8966. /// <param name="objValue"></param>
  8967. /// <param name="g"></param>
  8968. /// <param name="size"></param>
  8969. /// <returns></returns>
  8970. public static List<Image> DoorCity_AdditionSubtractionMultiplyDivide( object objValue, Graphics gg, Size size )
  8971. {
  8972. PhotoSelectSystem.EventCalculatedPrint e = (PhotoSelectSystem.EventCalculatedPrint)objValue;
  8973. string StrSumText = e.SumText;// 合计
  8974. List<string> OriginalProductList = e.ReserveProductList;// 原套系商品
  8975. List<PhotoSelectSystem.PrintCalculatedItem> SelectedProductList = e.AddSelectedProductList;// 商品加选
  8976. List<PhotoSelectSystem.PrintCalculatedItem> UpgradeProductList = e.UpgradeProductList;// 商品升级
  8977. List<PhotoSelectSystem.PrintCalculatedItem> BatchProductList = e.AddBatchProductList;// 商品加P
  8978. List<PhotoSelectSystem.PrintCalculatedItem> IntoRegisterIntoBottom = e.BookAndEndList;// 入底入册统计
  8979. Font ft36 = new Font( "宋体", 18 );
  8980. Font ft11 = new Font( "宋体", 11 );
  8981. Font ft11b = new Font( "宋体", 11, FontStyle.Bold );
  8982. Font ft11ic = new Font( "宋体", 11, FontStyle.Italic );
  8983. Brush b = Brushes.Black;
  8984. Brush bu = Brushes.Blue;
  8985. Pen p = GetPen;
  8986. int LeftWidth = 20;
  8987. int RowHeight = 25;
  8988. List<Image> imglist = new List<Image>();
  8989. Bitmap panlImage = new Bitmap( size.Width - LeftWidth, size.Height );
  8990. Graphics g = Graphics.FromImage( panlImage );
  8991. int TableWidth = panlImage.Width - LeftWidth * 2 - 10;
  8992. #region 标题
  8993. string recValue = "加减乘除";
  8994. SizeF sizef = g.MeasureString( recValue, ft36 );
  8995. int StrHeigth = Convert.ToInt32( sizef.Height );
  8996. int StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  8997. Rectangle rectitle = new Rectangle( (panlImage.Width / 2) - (StrWidth / 2), 30, StrWidth, 50 );
  8998. g.DrawString( recValue, ft36, Brushes.Black, rectitle );
  8999. #endregion
  9000. #region 合计
  9001. recValue = "合计";
  9002. sizef = g.MeasureString( recValue, ft11b );
  9003. StrHeigth = Convert.ToInt32( sizef.Height );
  9004. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  9005. Rectangle recA = new Rectangle( LeftWidth, rectitle.Y + rectitle.Height, StrWidth, StrHeigth );
  9006. g.DrawString( recValue, ft11b, b, recA );
  9007. recValue = StrSumText.Trim();
  9008. sizef = g.MeasureString( recValue, ft11ic );
  9009. StrHeigth = Convert.ToInt32( sizef.Height );
  9010. Rectangle recA1 = new Rectangle( recA.X, recA.Y + recA.Height, TableWidth, StrHeigth );
  9011. g.DrawString( recValue.Trim(), ft11ic, Brushes.Red, recA1 );
  9012. int rec_Y = recA1.Y + recA1.Height + RowHeight / 3;
  9013. #endregion
  9014. #region 产品加选统计
  9015. if ( SelectedProductList.Count > 0 )
  9016. {
  9017. recValue = "产品加选统计";
  9018. sizef = g.MeasureString( recValue, ft11b );
  9019. StrHeigth = Convert.ToInt32( sizef.Height );
  9020. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  9021. Rectangle recB = new Rectangle( LeftWidth, rec_Y, StrWidth, StrHeigth );
  9022. g.DrawString( recValue, ft11b, b, recB );
  9023. rec_Y = recB.Y + recB.Height;
  9024. for ( int i = 0; i < SelectedProductList.Count; i++ )
  9025. {
  9026. recValue = SelectedProductList[i].Value.ToString().Trim();
  9027. sizef = g.MeasureString( recValue, ft11, TableWidth );
  9028. StrHeigth = Convert.ToInt32( sizef.Height );
  9029. Rectangle recB1 = new Rectangle( recB.X, rec_Y, TableWidth, StrHeigth );
  9030. if ( !SelectedProductList[i].IsSum )
  9031. {
  9032. g.DrawString( recValue, ft11, b, recB1 );
  9033. }
  9034. else
  9035. {
  9036. g.DrawString( recValue, ft11ic, bu, recB1 );
  9037. }
  9038. rec_Y = recB1.Y + recB1.Height;
  9039. }
  9040. rec_Y += RowHeight / 3;
  9041. }
  9042. #endregion
  9043. #region 产品升级统计
  9044. if ( UpgradeProductList.Count > 0 )
  9045. {
  9046. recValue = "产品升级统计";
  9047. sizef = g.MeasureString( recValue, ft11b );
  9048. StrHeigth = Convert.ToInt32( sizef.Height );
  9049. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  9050. Rectangle recC = new Rectangle( LeftWidth, rec_Y, StrWidth, StrHeigth );
  9051. g.DrawString( recValue, ft11b, b, recC );
  9052. rec_Y = recC.Y + recC.Height;
  9053. for ( int i = 0; i < UpgradeProductList.Count; i++ )
  9054. {
  9055. recValue = UpgradeProductList[i].Title.ToString().Trim();
  9056. sizef = g.MeasureString( recValue, ft11, TableWidth );
  9057. StrHeigth = Convert.ToInt32( sizef.Height );
  9058. Rectangle recC1 = new Rectangle( recC.X, rec_Y, TableWidth, StrHeigth );
  9059. g.DrawString( recValue.Trim(), ft11, b, recC1 );
  9060. recValue = UpgradeProductList[i].Value.ToString().Trim();
  9061. sizef = g.MeasureString( recValue, ft11, TableWidth );
  9062. StrHeigth = Convert.ToInt32( sizef.Height );
  9063. Rectangle recC2 = new Rectangle( recC1.X, recC1.Y + recC1.Height, TableWidth, StrHeigth );
  9064. if ( !UpgradeProductList[i].IsSum )
  9065. {
  9066. g.DrawString( recValue, ft11, b, recC2 );
  9067. }
  9068. else
  9069. {
  9070. g.DrawString( recValue, ft11ic, bu, recC2 );
  9071. }
  9072. rec_Y = recC2.Y + recC2.Height;
  9073. }
  9074. rec_Y += RowHeight / 3;
  9075. }
  9076. #endregion
  9077. #region 相册加P统计
  9078. if ( BatchProductList.Count > 0 )
  9079. {
  9080. recValue = "相册加P统计";
  9081. sizef = g.MeasureString( recValue, ft11b );
  9082. StrHeigth = Convert.ToInt32( sizef.Height );
  9083. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  9084. Rectangle recD = new Rectangle( LeftWidth, rec_Y, StrWidth, StrHeigth );
  9085. g.DrawString( recValue, ft11b, b, recD );
  9086. rec_Y = recD.Y + recD.Height;
  9087. for ( int i = 0; i < BatchProductList.Count; i++ )
  9088. {
  9089. recValue = BatchProductList[i].Title.ToString().Trim();
  9090. sizef = g.MeasureString( recValue, ft11, TableWidth );
  9091. StrHeigth = Convert.ToInt32( sizef.Height );
  9092. Rectangle recD1 = new Rectangle( recD.X, rec_Y, TableWidth, StrHeigth );
  9093. g.DrawString( recValue.Trim(), ft11, b, recD1 );
  9094. recValue = BatchProductList[i].Value.ToString().Trim();
  9095. sizef = g.MeasureString( recValue, ft11, TableWidth );
  9096. StrHeigth = Convert.ToInt32( sizef.Height );
  9097. Rectangle recD2 = new Rectangle( recD1.X, recD1.Y + recD1.Height, TableWidth, StrHeigth );
  9098. if ( !BatchProductList[i].IsSum )
  9099. {
  9100. g.DrawString( recValue, ft11, b, recD2 );
  9101. }
  9102. else
  9103. {
  9104. g.DrawString( recValue, ft11ic, bu, recD2 );
  9105. }
  9106. rec_Y = recD2.Y + recD2.Height;
  9107. }
  9108. rec_Y += RowHeight / 3;
  9109. }
  9110. #endregion
  9111. #region 入册、入底加挑统计
  9112. if ( IntoRegisterIntoBottom.Count > 0 )
  9113. {
  9114. recValue = "入册、入底加挑统计";
  9115. sizef = g.MeasureString( recValue, ft11b );
  9116. StrHeigth = Convert.ToInt32( sizef.Height );
  9117. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  9118. Rectangle recE = new Rectangle( LeftWidth, rec_Y, StrWidth, StrHeigth );
  9119. g.DrawString( recValue, ft11b, b, recE );
  9120. rec_Y = recE.Y + recE.Height;
  9121. for ( int i = 0; i < IntoRegisterIntoBottom.Count; i++ )
  9122. {
  9123. recValue = IntoRegisterIntoBottom[i].Value.ToString().Trim();
  9124. sizef = g.MeasureString( recValue, ft11, TableWidth );
  9125. StrHeigth = Convert.ToInt32( sizef.Height );
  9126. Rectangle recE1 = new Rectangle( recE.X, rec_Y, TableWidth, StrHeigth );
  9127. if ( !IntoRegisterIntoBottom[i].IsSum )
  9128. {
  9129. g.DrawString( recValue, ft11, b, recE1 );
  9130. }
  9131. else
  9132. {
  9133. g.DrawString( recValue, ft11ic, bu, recE1 );
  9134. }
  9135. rec_Y = recE1.Y + recE1.Height;
  9136. }
  9137. rec_Y += RowHeight / 3;
  9138. }
  9139. #endregion
  9140. #region 原套系商品
  9141. if ( OriginalProductList.Count > 0 )
  9142. {
  9143. recValue = "原套系商品";
  9144. sizef = g.MeasureString( recValue, ft11b );
  9145. StrHeigth = Convert.ToInt32( sizef.Height );
  9146. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  9147. Rectangle recF = new Rectangle( LeftWidth, rec_Y, StrWidth, StrHeigth );
  9148. g.DrawString( recValue, ft11b, b, recF );
  9149. rec_Y = recF.Y + recF.Height;
  9150. for ( int i = 0; i < OriginalProductList.Count; i++ )
  9151. {
  9152. recValue = OriginalProductList[i].ToString().Trim();
  9153. sizef = g.MeasureString( recValue, ft11, TableWidth );
  9154. StrHeigth = Convert.ToInt32( sizef.Height );
  9155. Rectangle recF1 = new Rectangle( recF.X, rec_Y, TableWidth, StrHeigth );
  9156. g.DrawString( recValue, ft11, b, recF1 );
  9157. rec_Y = recF1.Y + recF1.Height;
  9158. }
  9159. rec_Y += RowHeight / 3;
  9160. }
  9161. #endregion
  9162. imglist.Add( panlImage );
  9163. return imglist;
  9164. }
  9165. #endregion
  9166. #region 预约单
  9167. /// <summary>
  9168. /// 预约单调用
  9169. /// </summary>
  9170. /// <param name="objValue"></param>
  9171. /// <param name="e"></param>
  9172. /// <param name="StrStyle"></param>
  9173. public static Bitmap ReservationSingle(object objValue, Graphics g, Size size, EnumPublic.PrinterPaperType EnumPaperType,
  9174. List<ReportPrint.SetSmallForm.PrintPreviewSmallForm.ScenicSpot2> ListViceNumber, ref List<List<string>> pListData, bool IsYuYueDan = true,int iPage=0)
  9175. {
  9176. try
  9177. {
  9178. Hashtable htData = (Hashtable)objValue;
  9179. string StrNumber = htData["strNumber"].ToString().Trim();
  9180. string StrOrdType = htData["strOrdType"].ToString().Trim();
  9181. string ExecuteSql = orbll.GetView_CustomReturnExecuteSql("tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Address,Company_URL,Company_Telephone,Company_UpdateDatetime");
  9182. //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 + "')) ";
  9183. ExecuteSql += ";"+orbll.GetView_CustomReturnExecuteSql("tb_ErpOrder",
  9184. StrWhere: "Ord_Number = '" + StrNumber + "'",
  9185. ShowColumnName:
  9186. "Ord_Type," +
  9187. "Ord_Number," +
  9188. "Ord_HotelInfo," +
  9189. "Ord_SinceOrderNumber," +
  9190. "Ord_CustomerListID," +
  9191. "Ord_SeriesName," +
  9192. "Ord_SeriesPrice," +
  9193. "Ord_Price," +
  9194. "Ord_IntoBottom," +
  9195. "Ord_IntoRegister," +
  9196. "Ord_Remark," +
  9197. "Ord_CreateDatetime," +
  9198. "dbo.fn_GetOrderArrears(Ord_Number) AS Ord_OrderArrears, Ord_LovedStyle");
  9199. ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql(
  9200. "tb_ErpOrderDigital",
  9201. StrWhere: "Ordv_Number = '" + StrNumber + "' and Ordv_FilmSelectionTime != null",
  9202. filedOrder: "Ordv_FilmSelectionTime DESC",
  9203. ShowColumnName: "Ordv_FilmSelectionTime");
  9204. ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql(
  9205. "tb_ErpOrdersPhotography",
  9206. StrWhere: "Ordpg_Number = '" + StrNumber + "'",
  9207. ShowColumnName:
  9208. "Ordpg_Number," +
  9209. "Ordpg_ViceNumber," +
  9210. "Ordpg_Sights," +
  9211. "Ordpg_PhotographyStatus," +
  9212. "Ordpg_SightsType," +
  9213. "Ordpg_ApparelQuantity," + // 服装套数;
  9214. "Ordpg_Photographer," +
  9215. "Ordpg_MakeupArtist," +
  9216. "Ordpg_BootDivision," +
  9217. "Ordpg_ReservationPhotographyTime," +
  9218. "((case when Ordpg_SightsRemark != '' then '('+Ordpg_SightsRemark+')' else '' end) + (case when Ordpg_OpenOrderSource != '' then '(' + Ordpg_OpenOrderSource + ')' else '' end)) AS Ordpg_SightsRemark," +
  9219. "Ordpg_OpenOrderRemark");
  9220. ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql(
  9221. "tb_ErpOrderProductList",
  9222. StrWhere: "OPlist_OrderNumber = '" + StrNumber + "' and OPlist_Type = '2'",
  9223. filedOrder: " OPlist_PickupTime DESC",
  9224. ShowColumnName: "OPlist_PickupTime");
  9225. ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql(
  9226. "tb_ErpOrderProductList",
  9227. StrWhere: "OPlist_OrderNumber = '" + StrNumber + (IsYuYueDan ? "' and (OPlist_Type = '1' or OPlist_Type = '0')" : "' and (OPlist_Type = '2' or OPlist_Type = '0')"),
  9228. filedOrder: " OPlist_OrderByNumber ASC,ID ASC",
  9229. 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");
  9230. 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");
  9231. 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");
  9232. ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql("tb_ErpStyle", ShowColumnName: "ID, Style_Name");
  9233. 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");
  9234. // 多加列副订单号;
  9235. ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql(
  9236. "tb_ErpOrderDigital",
  9237. StrWhere: "Ordv_Number = '" + StrNumber + "'",
  9238. ShowColumnName: "Ordv_IntoRegisterQuantity,Ordv_IntoBottomQuantity,Ordv_ViceNumber",
  9239. filedOrder: "Ordv_DigitalNumber");
  9240. ExecuteSql += ";" +
  9241. "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 + "')";
  9242. DataSet dtSet = orbll.GetView_Custom(ExecuteSql);
  9243. List<Bitmap> bitmapList = new List<Bitmap>();
  9244. switch ((LYFZ.EnumPublic.OrderType)Enum.Parse(typeof(LYFZ.EnumPublic.OrderType), htData["strOrdType"].ToString().Trim()))
  9245. {
  9246. case EnumPublic.OrderType.婚纱订单:
  9247. switch (EnumPaperType)
  9248. {
  9249. case EnumPublic.PrinterPaperType.A4纸:
  9250. Wedding_OrderReport_Print(dtSet, g, size, ref pListData, iPage);
  9251. if(pListData.Count-1> iPage)
  9252. {
  9253. IsHasMorePages = true;
  9254. }
  9255. else
  9256. {
  9257. IsHasMorePages = false;
  9258. }
  9259. //return bitmapList;
  9260. break;
  9261. case EnumPublic.PrinterPaperType.A4半页纸:
  9262. Wedding_OrderReport_TwoEqualPrint(dtSet, g, size, ref pListData, iPage);
  9263. if (pListData.Count - 1 > iPage)
  9264. {
  9265. IsHasMorePages = true;
  9266. }
  9267. else
  9268. {
  9269. IsHasMorePages = false;
  9270. }
  9271. //return bitmapList;
  9272. break;
  9273. }
  9274. break;
  9275. case EnumPublic.OrderType.儿童订单:
  9276. switch (EnumPaperType)
  9277. {
  9278. case EnumPublic.PrinterPaperType.A4纸:
  9279. Child_OrderReport_Print(dtSet, g, size, ListViceNumber,ref pListData,iPage);
  9280. if (pListData.Count - 1 > iPage)
  9281. {
  9282. IsHasMorePages = true;
  9283. }
  9284. else
  9285. {
  9286. IsHasMorePages = false;
  9287. }
  9288. //return bitmapList;
  9289. break;
  9290. case EnumPublic.PrinterPaperType.A4半页纸:
  9291. Child_OrderReport_TwoEqualPrint(dtSet, g, size, ListViceNumber, ref pListData, iPage);
  9292. if (pListData.Count - 1 > iPage)
  9293. {
  9294. IsHasMorePages = true;
  9295. }
  9296. else
  9297. {
  9298. IsHasMorePages = false;
  9299. }
  9300. //return bitmapList;
  9301. break;
  9302. }
  9303. break;
  9304. case EnumPublic.OrderType.写真订单:
  9305. switch (EnumPaperType)
  9306. {
  9307. case EnumPublic.PrinterPaperType.A4纸:
  9308. Portrait_OrderReport_Print(dtSet, g, size, ref pListData, iPage);
  9309. if (pListData.Count - 1 > iPage)
  9310. {
  9311. IsHasMorePages = true;
  9312. }
  9313. else
  9314. {
  9315. IsHasMorePages = false;
  9316. }
  9317. break;
  9318. case EnumPublic.PrinterPaperType.A4半页纸:
  9319. Portrait_OrderReport_TwoEqualPrint(dtSet, g, size, ref pListData, iPage);
  9320. if (pListData.Count - 1 > iPage)
  9321. {
  9322. IsHasMorePages = true;
  9323. }
  9324. else
  9325. {
  9326. IsHasMorePages = false;
  9327. }
  9328. break;
  9329. }
  9330. break;
  9331. case EnumPublic.OrderType.服务订单:
  9332. switch (EnumPaperType)
  9333. {
  9334. case EnumPublic.PrinterPaperType.A4纸:
  9335. Service_OrderReport_Print(dtSet, g, size, ref pListData, iPage);
  9336. if (pListData.Count - 1 > iPage)
  9337. {
  9338. IsHasMorePages = true;
  9339. }
  9340. else
  9341. {
  9342. IsHasMorePages = false;
  9343. }
  9344. break;
  9345. case EnumPublic.PrinterPaperType.A4半页纸:
  9346. Service_OrderReport_TwoEqualPrint(dtSet, g, size, ref pListData, iPage);
  9347. if (pListData.Count - 1 > iPage)
  9348. {
  9349. IsHasMorePages = true;
  9350. }
  9351. else
  9352. {
  9353. IsHasMorePages = false;
  9354. }
  9355. break;
  9356. }
  9357. break;
  9358. case EnumPublic.OrderType.婚庆订单:
  9359. switch (EnumPaperType)
  9360. {
  9361. case EnumPublic.PrinterPaperType.A4纸:
  9362. //List<Bitmap> webbingList = new List<Bitmap>();
  9363. WeddingCelebration_OrderReport_Print(dtSet, g, size, ref pListData, iPage);
  9364. if (pListData.Count - 1 > iPage)
  9365. {
  9366. IsHasMorePages = true;
  9367. }
  9368. else
  9369. {
  9370. IsHasMorePages = false;
  9371. }
  9372. break;
  9373. case EnumPublic.PrinterPaperType.A4半页纸:
  9374. WeddingCelebration_OrderReport_TwoEqualPrint(dtSet, g, size, ref pListData, iPage);
  9375. if (pListData.Count - 1 > iPage)
  9376. {
  9377. IsHasMorePages = true;
  9378. }
  9379. else
  9380. {
  9381. IsHasMorePages = false;
  9382. }
  9383. break;
  9384. }
  9385. break;
  9386. }
  9387. }
  9388. catch (Exception ex)
  9389. {
  9390. MessageBoxCustom.Show(ex.Message);
  9391. }
  9392. return null;
  9393. }
  9394. static Bitmap CombineMultipImage(List<Bitmap> bitmapList)
  9395. {
  9396. if(bitmapList.Count>0)
  9397. {
  9398. if(bitmapList.Count==1)
  9399. {
  9400. return bitmapList[0];
  9401. }
  9402. else
  9403. {
  9404. Bitmap lengthBitmap = new Bitmap(bitmapList[0].Width, bitmapList[0].Height * bitmapList.Count);
  9405. Graphics g = Graphics.FromImage(lengthBitmap);
  9406. for(int i=0;i< bitmapList.Count;i++)
  9407. {
  9408. g.DrawImage(bitmapList[i], 0, (bitmapList[0].Height) * i );
  9409. }
  9410. //lengthBitmap.Save("E:\\bitmap1.bmp");
  9411. return lengthBitmap;
  9412. }
  9413. }
  9414. else
  9415. {
  9416. return null;
  9417. }
  9418. }
  9419. /// <summary>
  9420. /// 获取预约单打印标题
  9421. /// </summary>
  9422. /// <returns></returns>
  9423. static string GetReservationSingleTitle( string StrValue )
  9424. {
  9425. if ( PrintOtherData.ContainsKey( StrValue ) )
  9426. {
  9427. return PrintOtherData[StrValue].ToString().Trim();
  9428. }
  9429. return "";
  9430. }
  9431. /// <summary>
  9432. /// 获取预约单打印LOG标题
  9433. /// </summary>
  9434. /// <returns></returns>
  9435. static string GetReservationSingleLOG( string StrLog )
  9436. {
  9437. if ( PrintOtherData.ContainsKey( "预约LOG" ) && PrintOtherData["预约LOG"].ToString().Trim().Length > 0 )
  9438. {
  9439. if ( PrintOtherData["预约LOG"].ToString().IndexOf( StrLog ) != -1 )
  9440. {
  9441. string[] strArray = PrintOtherData["预约LOG"].ToString().Trim().Split( '∥' );
  9442. for ( int i = 0; i < strArray.Length; i++ )
  9443. {
  9444. if ( strArray[i].Trim() != "" )
  9445. {
  9446. string[] strArray2 = strArray[i].Trim().Split( '‖' );
  9447. if ( strArray2[0].Trim() == StrLog )
  9448. {
  9449. StrLog = strArray2[1].Trim(); break;
  9450. }
  9451. }
  9452. }
  9453. }
  9454. }
  9455. else
  9456. {
  9457. StrLog = "";
  9458. }
  9459. return StrLog;
  9460. }
  9461. /// <summary>
  9462. /// 获取预约单字体大小
  9463. /// </summary>
  9464. /// <param name="StrValue"></param>
  9465. /// <returns></returns>
  9466. static Font GetFontSize( string StrValue )
  9467. {
  9468. if ( PrintOtherData.ContainsKey( StrValue ) && PrintOtherData[StrValue].ToString().Trim().Length > 0 )
  9469. {
  9470. return new Font( "宋体", Convert.ToInt32( PrintOtherData[StrValue] ) );
  9471. }
  9472. return new Font( "宋体", 9 );
  9473. }
  9474. #region 婚纱
  9475. /// <summary>
  9476. /// 订单报表婚纱版(2-加身份证号)
  9477. /// </summary>
  9478. /// <returns></returns>
  9479. private static void Wedding_OrderReport_Print(DataSet dtSet, Graphics g1, Size size, ref List<List<string>> pListData, int iPage)
  9480. {
  9481. int LeftWidth = 30;
  9482. Brush b = Brushes.Black;
  9483. Pen p = GetPen;
  9484. int TableWidth = size.Width - LeftWidth * 2;
  9485. DataTable tbl = dtSet.Tables["ds"];//获取影楼信息
  9486. DataTable tblOrder = dtSet.Tables["ds1"];//订单
  9487. DataTable tblDigital = dtSet.Tables["ds2"];//数码
  9488. DataTable tblSights = dtSet.Tables["ds3"];//景点
  9489. DataTable tblPickupTime = dtSet.Tables["ds4"];//取件时间
  9490. DataTable tblProductList = dtSet.Tables["ds5"];//订单商品
  9491. DataTable tblService = dtSet.Tables["ds7"];//服务资料
  9492. DataTable tblClient = dtSet.Tables["ds6"];//客户资料
  9493. DataTable tblStyle = dtSet.Tables["ds8"];//喜爱风格
  9494. DataTable tblPayment = dtSet.Tables["ds9"];//订单定金
  9495. DataTable tblUser = dtSet.Tables["ds11"];//主开单人信息
  9496. string OrdPrice = "0.00";
  9497. if (tblPayment.Rows.Count > 0)
  9498. {
  9499. OrdPrice = tblPayment.Rows[0]["Pay_AmountOf"].ToString().Trim();
  9500. }
  9501. tblStyle.PrimaryKey = new DataColumn[] { tblStyle.Columns["ID"] };
  9502. string strPaymentMsg = "";
  9503. foreach (DataRow dr in tblPayment.Rows)
  9504. {
  9505. if (!string.IsNullOrEmpty(strPaymentMsg))
  9506. {
  9507. strPaymentMsg += " ";
  9508. }
  9509. strPaymentMsg += dr["Sc_ClassName"] + ":" + dr["Pay_AmountOf"];
  9510. }
  9511. if (tbl.Rows.Count <= 0)
  9512. {
  9513. MessageBoxCustom.Show("未设置影楼信息"); return;
  9514. }
  9515. DataTable tblIntoRB = dtSet.Tables["ds10"];//订单定金
  9516. int IntoRegisterQuantit = 0;
  9517. int IntoBottomQuantity = 0;
  9518. for (int i = 0; i < tblIntoRB.Rows.Count; i++)
  9519. {
  9520. IntoRegisterQuantit += Convert.ToInt32(tblIntoRB.Rows[i]["Ordv_IntoRegisterQuantity"]);
  9521. IntoBottomQuantity += Convert.ToInt32(tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"]);
  9522. }
  9523. if (pListData.Count == 0)
  9524. {
  9525. pListData = GetProductOrServiceListData(g1, TableWidth, tblProductList, tblService, tblSights);
  9526. }
  9527. #region 获取数据
  9528. string MName = "";
  9529. string MTelephone = "";
  9530. string MIDNumber = "";
  9531. string MMicroSignal = "";
  9532. string MQQ = "";
  9533. string WName = "";
  9534. string WTelephone = "";
  9535. string WIDNumber = "";
  9536. string WMicroSignal = "";
  9537. string WQQ = "";
  9538. string DayForMarriage = "";
  9539. for (int i = 0; i < tblClient.Rows.Count; i++)
  9540. {
  9541. if (Convert.ToBoolean(tblClient.Rows[i]["Cus_Sex"]))
  9542. {
  9543. WName = tblClient.Rows[i]["Cus_Name"].ToString().Trim();
  9544. WTelephone = tblClient.Rows[i]["Cus_Telephone"].ToString().Trim();
  9545. WIDNumber = tblClient.Rows[i]["Cus_IDNumber"].ToString().Trim();
  9546. WMicroSignal = tblClient.Rows[i]["Cus_MicroSignal"].ToString().Trim();
  9547. WQQ = tblClient.Rows[i]["Cus_QQ"].ToString().Trim();
  9548. if (LYFZ.Command.Command_Validate.DateTimeToString(tblClient.Rows[i]["Cus_DayForMarriage"]) != "")
  9549. {
  9550. DayForMarriage = LYFZ.Command.Command_Validate.DateTimeToString(tblClient.Rows[i]["Cus_DayForMarriage"]);
  9551. if (!string.IsNullOrEmpty(tblClient.Rows[i]["Cus_DayForMarriageLunar"].ToString().Trim()) && tblClient.Rows[i]["Cus_DayForMarriageLunar"].ToString().Trim() == "1")
  9552. {
  9553. DayForMarriage += LYFZ.BLL.OtherCommonModel.FontConversion(" (农历)");
  9554. }
  9555. }
  9556. }
  9557. else
  9558. {
  9559. MName = tblClient.Rows[i]["Cus_Name"].ToString().Trim();
  9560. MTelephone = tblClient.Rows[i]["Cus_Telephone"].ToString().Trim();
  9561. MIDNumber = tblClient.Rows[i]["Cus_IDNumber"].ToString().Trim();
  9562. MMicroSignal = tblClient.Rows[i]["Cus_MicroSignal"].ToString().Trim();
  9563. MQQ = tblClient.Rows[i]["Cus_QQ"].ToString().Trim();
  9564. if (LYFZ.Command.Command_Validate.DateTimeToString(tblClient.Rows[i]["Cus_DayForMarriage"]) != "")
  9565. {
  9566. DayForMarriage = LYFZ.Command.Command_Validate.DateTimeToString(tblClient.Rows[i]["Cus_DayForMarriage"]);
  9567. if (!string.IsNullOrEmpty(tblClient.Rows[i]["Cus_DayForMarriageLunar"].ToString().Trim()) && tblClient.Rows[i]["Cus_DayForMarriageLunar"].ToString().Trim() == "1")
  9568. {
  9569. DayForMarriage += LYFZ.BLL.OtherCommonModel.FontConversion(" (农历)");
  9570. }
  9571. }
  9572. }
  9573. }
  9574. int InnerSights = 0;
  9575. int OuterSights = 0;
  9576. string StrSights = LYFZ.BLL.OtherCommonModel.FontConversion("景点:\r\n");
  9577. string StrPhotoTime = "";
  9578. string StrPhotographer = "";
  9579. string StrMakeupArtist = "";
  9580. for (int i = 0; i < tblSights.Rows.Count; i++)
  9581. {
  9582. if (tblSights.Rows[i]["Ordpg_SightsType"].ToString().Trim() == "0")
  9583. {
  9584. InnerSights += Convert.ToInt32(tblSights.Rows[i]["Ordpg_ApparelQuantity"]);
  9585. }
  9586. if (tblSights.Rows[i]["Ordpg_SightsType"].ToString().Trim() == "1")
  9587. {
  9588. OuterSights += Convert.ToInt32(tblSights.Rows[i]["Ordpg_ApparelQuantity"]);
  9589. }
  9590. StrSights += (i + 1) + "." + tblSights.Rows[i]["Ordpg_Sights"].ToString().Trim();
  9591. StrSights += tblSights.Rows[i]["Ordpg_SightsRemark"].ToString().Trim();
  9592. StrSights += "\r\n";
  9593. if (!string.IsNullOrEmpty(tblSights.Rows[i]["Ordpg_Photographer"].ToString().Trim()))
  9594. {
  9595. StrPhotographer = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetUserName(tblSights.Rows[i]["Ordpg_Photographer"]);
  9596. }
  9597. if (!string.IsNullOrEmpty(tblSights.Rows[i]["Ordpg_MakeupArtist"].ToString().Trim()))
  9598. {
  9599. StrMakeupArtist = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetUserName(tblSights.Rows[i]["Ordpg_MakeupArtist"]);
  9600. }
  9601. if (LYFZ.Command.Command_Validate.DateTimeToString(tblSights.Rows[i]["Ordpg_ReservationPhotographyTime"]) != "")
  9602. {
  9603. if (StrPhotoTime == "")
  9604. {
  9605. StrPhotoTime = LYFZ.Command.Command_Validate.DateTimeToString(tblSights.Rows[i]["Ordpg_ReservationPhotographyTime"]);
  9606. }
  9607. else if (Convert.ToDateTime(tblSights.Rows[i]["Ordpg_ReservationPhotographyTime"]) < Convert.ToDateTime(StrPhotoTime))
  9608. {
  9609. StrPhotoTime = LYFZ.Command.Command_Validate.DateTimeToString(tblSights.Rows[i]["Ordpg_ReservationPhotographyTime"]);
  9610. }
  9611. }
  9612. }
  9613. string StrFilmSelectionTime = "";
  9614. if (tblDigital.Rows.Count > 0)
  9615. {
  9616. StrFilmSelectionTime = LYFZ.Command.Command_Validate.DateTimeToString(tblDigital.Rows[0]["Ordv_FilmSelectionTime"]);
  9617. }
  9618. #endregion
  9619. #region 绑定数据
  9620. Font ft17 = new Font("宋体", 17);
  9621. Font ft12 = new Font("宋体", 12);
  9622. Font ft9 = new Font("宋体", 9);
  9623. //List<Bitmap> bitmapDataList = new List<Bitmap>();
  9624. string strShowNumber = tblOrder.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() != "" ? tblOrder.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() : tblOrder.Rows[0]["Ord_Number"].ToString().Trim();
  9625. string StrValue = "NO." + StrRandom(strShowNumber);
  9626. string strNumber = StrValue;
  9627. var data = pListData[iPage];
  9628. //Bitmap bitmap = new Bitmap(827, 1150);
  9629. Graphics g = g1;//Graphics.FromImage(bitmap);
  9630. #region LOG抬头
  9631. int Rec1Height = 0;
  9632. Rectangle rec1;
  9633. Image imgLog = CachePhoto(PhotoLogType.Wedding, tbl.Rows[0]["Company_UpdateDatetime"], GetReservationSingleLOG("预约婚纱单LOG"));
  9634. if (imgLog != null)
  9635. {
  9636. rec1 = new Rectangle(LeftWidth, 50, TableWidth, 120);
  9637. Rectangle srcRec1 = new Rectangle(0, 0, imgLog.Width, imgLog.Height);
  9638. g.DrawImage(imgLog, rec1, srcRec1, GraphicsUnit.Pixel);
  9639. }
  9640. else
  9641. {
  9642. string StrTitle = GetReservationSingleTitle("预约婚纱单标题");
  9643. SizeF srcsizef = g.MeasureString(StrTitle, ft17);
  9644. int srcFtWidth = Convert.ToInt32(srcsizef.Width);
  9645. int srcFtHeight = Convert.ToInt32(srcsizef.Height);
  9646. rec1 = new Rectangle(size.Width / 2 - srcFtWidth / 2, 50, srcFtWidth + 5, srcFtHeight);
  9647. g.DrawString(StrTitle, ft17, b, rec1);
  9648. Rec1Height = 120 - rec1.Height;
  9649. }
  9650. #endregion
  9651. int LeftAdd = 3;
  9652. int TopAdd = 6;
  9653. int RowHeight = 25;
  9654. int RowContentHeight = 18;
  9655. int Unit = TableWidth / 25;
  9656. int ColumnWidth1 = Unit * 3;
  9657. int ColumnWidth2 = Unit * 5;
  9658. int ColumnWidth3 = Unit * 3;
  9659. int ColumnWidth4 = Unit * 5;
  9660. int ColumnWidth5 = Unit * 3 - Unit / 2 + 15;
  9661. int ColumnWidth6 = TableWidth - ColumnWidth1 - ColumnWidth2 - ColumnWidth3 - ColumnWidth4 - ColumnWidth5;
  9662. #region 始行
  9663. Rectangle rec2 = new Rectangle(LeftWidth, rec1.Y + rec1.Height + 10, 1000, RowContentHeight);
  9664. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("开单日期:") + LYFZ.Command.Command_Validate.DateTimeToString(tblOrder.Rows[0]["Ord_CreateDatetime"]), ft12, b, rec2);
  9665. SizeF sizef = g.MeasureString(strNumber, ft12);
  9666. int FtWidth = Convert.ToInt32(sizef.Width) + 1;
  9667. int FtHeight = Convert.ToInt32(sizef.Height);
  9668. Rectangle rec2_1 = new Rectangle(TableWidth + LeftWidth + LeftAdd - FtWidth, rec2.Y, FtWidth, RowContentHeight);
  9669. g.DrawString(strNumber, ft12, b, rec2_1);
  9670. #endregion
  9671. #region 左排
  9672. #region 第一行
  9673. Rectangle rec3 = new Rectangle(rec2.X, rec2.Y + rec2.Height, ColumnWidth1 + ColumnWidth2 + ColumnWidth3 + ColumnWidth4, RowHeight);
  9674. g.DrawRectangle(p, rec3);//画标题矩形
  9675. Rectangle rec3_1 = new Rectangle(rec3.X + LeftAdd, rec3.Y + TopAdd, ColumnWidth1, RowContentHeight);
  9676. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("先生姓名"), ft12, b, rec3_1);//画第一列的列标题
  9677. Point p31_1 = new Point(rec3.X + ColumnWidth1, rec3.Y);
  9678. Point p31_2 = new Point(rec3.X + ColumnWidth1, rec3.Y + rec3.Height);
  9679. g.DrawLine(p, p31_1, p31_2);//画第一表与第二列的界线
  9680. Rectangle rec3_2 = new Rectangle(p31_1.X + LeftAdd, p31_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
  9681. g.DrawString(MName, ft12, b, rec3_2);//画第二列的列标题
  9682. Point p32_1 = new Point(p31_1.X + ColumnWidth2, rec3.Y);
  9683. Point p32_2 = new Point(p31_1.X + ColumnWidth2, rec3.Y + rec3.Height);
  9684. g.DrawLine(p, p32_1, p32_2);//画第二表与第三列的界线
  9685. Rectangle rec3_3 = new Rectangle(p32_1.X + LeftAdd, p32_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
  9686. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("女士姓名"), ft12, b, rec3_3);//画第三列的列标题
  9687. Point p33_1 = new Point(p32_1.X + ColumnWidth3, rec3.Y);
  9688. Point p33_2 = new Point(p32_1.X + ColumnWidth3, rec3.Y + rec3.Height);
  9689. g.DrawLine(p, p33_1, p33_2);//画第三表与第四列的界线
  9690. Rectangle rec3_4 = new Rectangle(p33_1.X + LeftAdd, p33_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
  9691. g.DrawString(WName, ft12, b, rec3_4);//画第四列的列标题
  9692. Point p34_1 = new Point(p33_1.X + ColumnWidth4, rec3.Y);
  9693. Point p34_2 = new Point(p33_1.X + ColumnWidth4, rec3.Y + rec3.Height);
  9694. g.DrawLine(p, p34_1, p34_2);//画第四表与第五列的界线
  9695. #endregion
  9696. #region 第二行
  9697. Rectangle rec4 = new Rectangle(rec3.X, rec3.Y + rec3.Height, rec3.Width, RowHeight);
  9698. g.DrawRectangle(p, rec4);//画标题矩形
  9699. Rectangle rec4_1 = new Rectangle(rec4.X + LeftAdd, rec4.Y + TopAdd, ColumnWidth1, RowContentHeight);
  9700. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("联系电话"), ft12, b, rec4_1);//画第一列的列标题
  9701. Point p41_1 = new Point(rec4.X + ColumnWidth1, rec4.Y);
  9702. Point p41_2 = new Point(rec4.X + ColumnWidth1, rec4.Y + rec4.Height);
  9703. g.DrawLine(p, p41_1, p41_2);//画第一表与第二列的界线
  9704. Rectangle rec4_2 = new Rectangle(p41_1.X + LeftAdd, p41_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
  9705. g.DrawString(LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls(MTelephone), ft12, b, rec4_2);//画第二列的列标题
  9706. Point p42_1 = new Point(p41_1.X + ColumnWidth2, rec4.Y);
  9707. Point p42_2 = new Point(p41_1.X + ColumnWidth2, rec4.Y + rec4.Height);
  9708. g.DrawLine(p, p42_1, p42_2);//画第二表与第三列的界线
  9709. Rectangle rec4_3 = new Rectangle(p42_1.X + LeftAdd, p42_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
  9710. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("联系电话"), ft12, b, rec4_3);//画第三列的列标题
  9711. Point p43_1 = new Point(p42_1.X + ColumnWidth3, rec4.Y);
  9712. Point p43_2 = new Point(p42_1.X + ColumnWidth3, rec4.Y + rec4.Height);
  9713. g.DrawLine(p, p43_1, p43_2);//画第三表与第四列的界线
  9714. Rectangle rec4_4 = new Rectangle(p43_1.X + LeftAdd, p43_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
  9715. g.DrawString(LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls(WTelephone), ft12, b, rec4_4);//画第四列的列标题
  9716. Point p44_1 = new Point(p43_1.X + ColumnWidth4, rec4.Y);
  9717. Point p44_2 = new Point(p43_1.X + ColumnWidth4, rec4.Y + rec4.Height);
  9718. g.DrawLine(p, p44_1, p44_2);//画第四表与第五列的界线
  9719. #endregion
  9720. #region 第二、三行
  9721. int rec5_Y = rec4.Y + rec4.Height;
  9722. int rec9Height = 0;
  9723. if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.EnabledIDNumber)
  9724. {
  9725. Rectangle rec4A = new Rectangle(rec4.X, rec4.Y + rec4.Height, rec4.Width, RowHeight);
  9726. g.DrawRectangle(p, rec4A);//画标题矩形
  9727. Rectangle rec4A_1 = new Rectangle(rec4A.X + LeftAdd, rec4A.Y + TopAdd, ColumnWidth1, RowContentHeight);
  9728. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("身份证号"), ft12, b, rec4A_1);//画第一列的列标题
  9729. Point p4A1_1 = new Point(rec4A.X + ColumnWidth1, rec4A.Y);
  9730. Point p4A1_2 = new Point(rec4A.X + ColumnWidth1, rec4A.Y + rec4A.Height);
  9731. g.DrawLine(p, p4A1_1, p4A1_2);//画第一表与第二列的界线
  9732. Rectangle rec4A_2 = new Rectangle(p4A1_1.X + LeftAdd, p4A1_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
  9733. g.DrawString(MIDNumber, ft12, b, rec4A_2);//画第二列的列标题
  9734. Point p4A2_1 = new Point(p4A1_1.X + ColumnWidth2, rec4A.Y);
  9735. Point p4A2_2 = new Point(p4A1_1.X + ColumnWidth2, rec4A.Y + rec4A.Height);
  9736. g.DrawLine(p, p4A2_1, p4A2_2);//画第二表与第三列的界线
  9737. Rectangle rec4A_3 = new Rectangle(p4A2_1.X + LeftAdd, p4A2_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
  9738. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("身份证号"), ft12, b, rec4A_3);//画第三列的列标题
  9739. Point p4A3_1 = new Point(p4A2_1.X + ColumnWidth3, rec4A.Y);
  9740. Point p4A3_2 = new Point(p4A2_1.X + ColumnWidth3, rec4A.Y + rec4A.Height);
  9741. g.DrawLine(p, p4A3_1, p4A3_2);//画第三表与第四列的界线
  9742. Rectangle rec4A_4 = new Rectangle(p4A3_1.X + LeftAdd, p4A3_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
  9743. g.DrawString(WIDNumber, ft12, b, rec4A_4);//画第四列的列标题
  9744. Point p4A4_1 = new Point(p4A3_1.X + ColumnWidth4, rec4A.Y);
  9745. Point p4A4_2 = new Point(p4A3_1.X + ColumnWidth4, rec4A.Y + rec4A.Height);
  9746. g.DrawLine(p, p4A4_1, p4A4_2);//画第四表与第五列的界线
  9747. rec5_Y = rec4A.Y + rec4A.Height;
  9748. rec9Height = RowHeight;
  9749. }
  9750. #endregion
  9751. #region 第三行
  9752. Rectangle rec5 = new Rectangle(rec4.X, rec5_Y, rec3.Width, RowHeight);
  9753. g.DrawRectangle(p, rec5);//画标题矩形
  9754. Rectangle rec5_1 = new Rectangle(rec5.X + LeftAdd, rec5.Y + TopAdd, ColumnWidth1, RowContentHeight);
  9755. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("微信"), ft12, b, rec5_1);//画第一列的列标题
  9756. Point p51_1 = new Point(rec5.X + ColumnWidth1, rec5.Y);
  9757. Point p51_2 = new Point(rec5.X + ColumnWidth1, rec5.Y + rec5.Height);
  9758. g.DrawLine(p, p51_1, p51_2);//画第一表与第二列的界线
  9759. Rectangle rec5_2 = new Rectangle(p51_1.X + LeftAdd, p51_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
  9760. g.DrawString(MMicroSignal, ft12, b, rec5_2);//画第二列的列标题
  9761. Point p52_1 = new Point(p51_1.X + ColumnWidth2, rec5.Y);
  9762. Point p52_2 = new Point(p51_1.X + ColumnWidth2, rec5.Y + rec5.Height);
  9763. g.DrawLine(p, p52_1, p52_2);//画第二表与第三列的界线
  9764. Rectangle rec5_3 = new Rectangle(p52_1.X + LeftAdd, p52_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
  9765. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("微信"), ft12, b, rec5_3);//画第三列的列标题
  9766. Point p53_1 = new Point(p52_1.X + ColumnWidth3, rec5.Y);
  9767. Point p53_2 = new Point(p52_1.X + ColumnWidth3, rec5.Y + rec5.Height);
  9768. g.DrawLine(p, p53_1, p53_2);//画第三表与第四列的界线
  9769. Rectangle rec5_4 = new Rectangle(p53_1.X + LeftAdd, p53_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
  9770. g.DrawString(WMicroSignal, ft12, b, rec5_4);//画第四列的列标题
  9771. Point p54_1 = new Point(p53_1.X + ColumnWidth4, rec5.Y);
  9772. Point p54_2 = new Point(p53_1.X + ColumnWidth4, rec5.Y + rec5.Height);
  9773. g.DrawLine(p, p54_1, p54_2);//画第四表与第五列的界线
  9774. #endregion
  9775. #region 第四行
  9776. Rectangle rec6 = new Rectangle(rec5.X, rec5.Y + rec5.Height, rec3.Width, RowHeight);
  9777. g.DrawRectangle(p, rec6);//画标题矩形
  9778. Rectangle rec6_1 = new Rectangle(rec6.X + LeftAdd, rec6.Y + TopAdd, ColumnWidth1, RowContentHeight);
  9779. g.DrawString("QQ", ft12, b, rec6_1);//画第一列的列标题
  9780. Point p61_1 = new Point(rec6.X + ColumnWidth1, rec6.Y);
  9781. Point p61_2 = new Point(rec6.X + ColumnWidth1, rec6.Y + rec6.Height);
  9782. g.DrawLine(p, p61_1, p61_2);//画第一表与第二列的界线
  9783. Rectangle rec6_2 = new Rectangle(p61_1.X + LeftAdd, p61_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
  9784. g.DrawString(MQQ, ft12, b, rec6_2);//画第二列的列标题
  9785. Point p62_1 = new Point(p61_1.X + ColumnWidth2, rec6.Y);
  9786. Point p62_2 = new Point(p61_1.X + ColumnWidth2, rec6.Y + rec6.Height);
  9787. g.DrawLine(p, p62_1, p62_2);//画第二表与第三列的界线
  9788. Rectangle rec6_3 = new Rectangle(p62_1.X + LeftAdd, p62_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
  9789. g.DrawString("QQ", ft12, b, rec6_3);//画第三列的列标题
  9790. Point p63_1 = new Point(p62_1.X + ColumnWidth3, rec6.Y);
  9791. Point p63_2 = new Point(p62_1.X + ColumnWidth3, rec6.Y + rec6.Height);
  9792. g.DrawLine(p, p63_1, p63_2);//画第三表与第四列的界线
  9793. Rectangle rec6_4 = new Rectangle(p63_1.X + LeftAdd, p63_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
  9794. g.DrawString(WQQ, ft12, b, rec6_4);//画第四列的列标题
  9795. Point p64_1 = new Point(p63_1.X + ColumnWidth4, rec6.Y);
  9796. Point p64_2 = new Point(p63_1.X + ColumnWidth4, rec6.Y + rec6.Height);
  9797. g.DrawLine(p, p64_1, p64_2);//画第四表与第五列的界线
  9798. #endregion
  9799. #region 第五行
  9800. Rectangle rec7 = new Rectangle(rec6.X, rec6.Y + rec6.Height, rec3.Width, RowHeight);
  9801. g.DrawRectangle(p, rec7);//画标题矩形
  9802. Rectangle rec7_1 = new Rectangle(rec7.X + LeftAdd, rec7.Y + TopAdd, ColumnWidth1, RowContentHeight);
  9803. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
  9804. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("入底"), ft12, b, rec7_1);//画第一列的列标题
  9805. Point p71_1 = new Point(rec7.X + ColumnWidth1, rec7.Y);
  9806. Point p71_2 = new Point(rec7.X + ColumnWidth1, rec7.Y + rec7.Height);
  9807. g.DrawLine(p, p71_1, p71_2);//画第一表与第二列的界线
  9808. Rectangle rec7_2 = new Rectangle(p71_1.X + LeftAdd, p71_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
  9809. string StrIntoBottom = IntoBottomQuantity.ToString().Trim();
  9810. if (StrIntoBottom == "0")
  9811. {
  9812. StrIntoBottom = LYFZ.BLL.OtherCommonModel.FontConversion("不送");
  9813. }
  9814. else if (StrIntoBottom == "-1")
  9815. {
  9816. StrIntoBottom = LYFZ.BLL.OtherCommonModel.FontConversion("全送");
  9817. }
  9818. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
  9819. g.DrawString(StrIntoBottom, ft12, b, rec7_2);//画第二列的列标题
  9820. Point p72_1 = new Point(p71_1.X + ColumnWidth2, rec7.Y);
  9821. Point p72_2 = new Point(p71_1.X + ColumnWidth2, rec7.Y + rec7.Height);
  9822. g.DrawLine(p, p72_1, p72_2);//画第二表与第三列的界线
  9823. Rectangle rec7_3 = new Rectangle(p72_1.X + LeftAdd, p72_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
  9824. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
  9825. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("入册"), ft12, b, rec7_3);//画第三列的列标题
  9826. Point p73_1 = new Point(p72_1.X + ColumnWidth3, rec7.Y);
  9827. Point p73_2 = new Point(p72_1.X + ColumnWidth3, rec7.Y + rec7.Height);
  9828. g.DrawLine(p, p73_1, p73_2);//画第三表与第四列的界线
  9829. Rectangle rec7_4 = new Rectangle(p73_1.X + LeftAdd, p73_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
  9830. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
  9831. g.DrawString(IntoRegisterQuantit.ToString().Trim(), ft12, b, rec7_4);//画第四列的列标题
  9832. Point p74_1 = new Point(p73_1.X + ColumnWidth4, rec7.Y);
  9833. Point p74_2 = new Point(p73_1.X + ColumnWidth4, rec7.Y + rec7.Height);
  9834. g.DrawLine(p, p74_1, p74_2);//画第四表与第五列的界线
  9835. #endregion
  9836. #region 第六行
  9837. Rectangle rec8 = new Rectangle(rec7.X, rec7.Y + rec7.Height, rec3.Width, RowHeight);
  9838. g.DrawRectangle(p, rec8);//画标题矩形
  9839. Rectangle rec8_1 = new Rectangle(rec8.X + LeftAdd, rec8.Y + TopAdd, ColumnWidth1, RowContentHeight);
  9840. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideClothingCount)
  9841. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("内景服装数"), ft12, b, rec8_1);//画第一列的列标题
  9842. Point p81_1 = new Point(rec8.X + ColumnWidth1, rec8.Y);
  9843. Point p81_2 = new Point(rec8.X + ColumnWidth1, rec8.Y + rec8.Height);
  9844. g.DrawLine(p, p81_1, p81_2);//画第一表与第二列的界线
  9845. Rectangle rec8_2 = new Rectangle(p81_1.X + LeftAdd, p81_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
  9846. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideClothingCount)
  9847. g.DrawString(InnerSights.ToString(), ft12, b, rec8_2);//画第二列的列标题
  9848. Point p82_1 = new Point(p81_1.X + ColumnWidth2, rec8.Y);
  9849. Point p82_2 = new Point(p81_1.X + ColumnWidth2, rec8.Y + rec8.Height);
  9850. g.DrawLine(p, p82_1, p82_2);//画第二表与第三列的界线
  9851. Rectangle rec8_3 = new Rectangle(p82_1.X + LeftAdd, p82_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
  9852. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideClothingCount)
  9853. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("外景服装数"), ft12, b, rec8_3);//画第三列的列标题
  9854. Point p83_1 = new Point(p82_1.X + ColumnWidth3, rec8.Y);
  9855. Point p83_2 = new Point(p82_1.X + ColumnWidth3, rec8.Y + rec8.Height);
  9856. g.DrawLine(p, p83_1, p83_2);//画第三表与第四列的界线
  9857. Rectangle rec8_4 = new Rectangle(p83_1.X + LeftAdd, p83_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
  9858. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideClothingCount)
  9859. g.DrawString(OuterSights.ToString(), ft12, b, rec8_4);//画第四列的列标题
  9860. Point p84_1 = new Point(p83_1.X + ColumnWidth4, rec8.Y);
  9861. Point p84_2 = new Point(p83_1.X + ColumnWidth4, rec8.Y + rec8.Height);
  9862. g.DrawLine(p, p84_1, p84_2);//画第四表与第五列的界线
  9863. #endregion
  9864. #region 第七行
  9865. Rectangle rec8A = new Rectangle(rec8.X, rec8.Y + rec8.Height, rec3.Width, RowHeight);
  9866. g.DrawRectangle(p, rec8A);//画标题矩形
  9867. Rectangle rec8A_1 = new Rectangle(rec8A.X + LeftAdd, rec8A.Y + TopAdd, ColumnWidth1, RowContentHeight);
  9868. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("喜爱风格"), ft12, b, rec8A_1);//画第一列的列标题
  9869. Point p8A1_1 = new Point(rec8A.X + ColumnWidth1, rec8A.Y);
  9870. Point p8A1_2 = new Point(rec8A.X + ColumnWidth1, rec8A.Y + rec8A.Height);
  9871. g.DrawLine(p, p8A1_1, p8A1_2);//画第一表与第二列的界线
  9872. Rectangle rec8A_2 = new Rectangle(p8A1_1.X + LeftAdd, p8A1_1.Y + TopAdd, rec8A.Width - rec8A_1.Width, RowContentHeight);
  9873. string[] OrdLovedStyle = tblOrder.Rows[0]["Ord_LovedStyle"].ToString().Trim().Split('|');
  9874. string StrLovedStyle = "";
  9875. for (int i = 0; i < OrdLovedStyle.Length; i++)
  9876. {
  9877. if (OrdLovedStyle[i].Trim() != "")
  9878. {
  9879. string[] StrID = OrdLovedStyle[i].Trim().Split('_');
  9880. DataRow dtRow = tblStyle.Rows.Find(StrID[1].Trim());
  9881. if (dtRow != null)
  9882. {
  9883. StrLovedStyle += dtRow["Style_Name"] + ",";
  9884. }
  9885. }
  9886. }
  9887. g.DrawString(StrLovedStyle.TrimEnd(','), ft12, b, rec8A_2);//画第六列的列标题
  9888. #endregion
  9889. #region 第一列
  9890. #region 第一行
  9891. Rectangle rec9 = new Rectangle(rec8A.X, rec8A.Y + rec8A.Height, rec3.Width, 510 - RowHeight + Rec1Height - rec9Height);
  9892. g.DrawRectangle(p, rec9);//画标题矩形
  9893. float _infoHeight = 0;
  9894. Rectangle rec9_1 = new Rectangle(rec9.X + LeftAdd, rec9.Y + TopAdd, rec9.Width - LeftAdd * 2, rec9.Height - TopAdd * 2);
  9895. string StrProdName = LYFZ.BLL.OtherCommonModel.FontConversion("详细内容:");
  9896. SizeF infoSizef = g.MeasureString(StrProdName,
  9897. GetFontSize("婚纱预约单内容详情字体大小"), rec9.Width);
  9898. g.DrawString(StrProdName, GetFontSize("婚纱预约单内容详情字体大小"), b, rec9_1);//画第一列的列标题
  9899. _infoHeight += infoSizef.Height;
  9900. ///此处取单位在商品删除和下架时报错 需要修改
  9901. //for (int i = 0; i < tblProductList.Rows.Count; i++)
  9902. //{
  9903. // if (i == 0)
  9904. // {
  9905. // PrintContentData("商品:", g, rec9, LeftAdd, TopAdd, b, "婚纱预约单内容详情字体大小", ref _infoHeight);
  9906. // }
  9907. // string strName = tblProductList.Rows[i]["ProdName"].ToString().Trim();
  9908. // PrintContentData(" " + strName, g, rec9, LeftAdd, TopAdd, b, "婚纱预约单内容详情字体大小", ref _infoHeight);
  9909. //}
  9910. //for (int i = 0; i < tblService.Rows.Count; i++)
  9911. //{
  9912. // if (i == 0)
  9913. // {
  9914. // PrintContentData("服务:", g, rec9, LeftAdd, TopAdd, b, "婚纱预约单内容详情字体大小", ref _infoHeight);
  9915. // }
  9916. // string strName = tblService.Rows[i]["ProdName"].ToString().Trim();
  9917. // PrintContentData(" " + strName, g, rec9, LeftAdd, TopAdd, b, "婚纱预约单内容详情字体大小", ref _infoHeight);
  9918. //}
  9919. foreach (string str in data)
  9920. {
  9921. string strName = str;
  9922. PrintContentData(" " + strName, g, rec9, LeftAdd, TopAdd, b, "婚纱预约单内容详情字体大小", ref _infoHeight);
  9923. }
  9924. //g.DrawString(StrProdName + "\r\n\r\n" + StrSights, GetFontSize("婚纱预约单内容详情字体大小"), b, rec9_1);//画第一列的列标题
  9925. //PrintContentData("\r\n\r\n" + StrSights, g, rec9, LeftAdd, TopAdd, b, "婚纱预约单内容详情字体大小", ref _infoHeight);
  9926. #endregion
  9927. #region 第二行
  9928. SizeF disSizef = g.MeasureString(
  9929. LYFZ.BLL.OtherCommonModel.FontConversion("订单备注:")
  9930. + tblOrder.Rows[0]["Ord_Remark"].ToString().Trim()
  9931. + "\r\n付款情况:" + strPaymentMsg,
  9932. ft12, rec9.Width);
  9933. int recHeight = 100;
  9934. if (disSizef.Height > 100)
  9935. {
  9936. recHeight = Convert.ToInt32(disSizef.Height) + 1;
  9937. }
  9938. rec9.Y = rec9.Y - (recHeight - 100);
  9939. Rectangle recA1 = new Rectangle(rec9.X, rec9.Y + rec9.Height, rec9.Width, recHeight);
  9940. g.FillRectangle(new SolidBrush(Color.White), recA1);
  9941. g.DrawRectangle(p, recA1);//画标题矩形
  9942. Rectangle recA1_1 = new Rectangle(recA1.X + LeftAdd, recA1.Y + TopAdd, recA1.Width - LeftAdd * 2, recA1.Height - TopAdd * 2);
  9943. string disInfo = LYFZ.BLL.OtherCommonModel.FontConversion("订单备注:") + tblOrder.Rows[0]["Ord_Remark"].ToString().Trim() ;
  9944. if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintOrderShowPayment)
  9945. {
  9946. disInfo += "\r\n付款情况:" + strPaymentMsg;
  9947. }
  9948. g.DrawString(disInfo, ft12, b, recA1_1);//画第一列的列标题
  9949. #endregion
  9950. #region 第三行
  9951. Rectangle recA2 = new Rectangle(recA1.X, recA1.Y + recA1.Height, rec3.Width, RowHeight);
  9952. g.DrawRectangle(p, recA2);//画标题矩形
  9953. Rectangle recA2_1 = new Rectangle(recA2.X + LeftAdd, recA2.Y + TopAdd, ColumnWidth1, RowContentHeight);
  9954. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("摄影师"), ft12, b, recA2_1);//画第一列的列标题
  9955. Point pA21_1 = new Point(recA2.X + ColumnWidth1, recA2.Y);
  9956. Point pA21_2 = new Point(recA2.X + ColumnWidth1, recA2.Y + recA2.Height);
  9957. g.DrawLine(p, pA21_1, pA21_2);//画第一表与第二列的界线
  9958. Rectangle recA2_2 = new Rectangle(pA21_1.X + LeftAdd, pA21_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
  9959. g.DrawString(StrPhotographer, ft12, b, recA2_2);//画第二列的列标题
  9960. Point pA22_1 = new Point(pA21_1.X + ColumnWidth2, recA2.Y);
  9961. Point pA22_2 = new Point(pA21_1.X + ColumnWidth2, recA2.Y + recA2.Height);
  9962. g.DrawLine(p, pA22_1, pA22_2);//画第二表与第三列的界线
  9963. Rectangle recA2_3 = new Rectangle(pA22_1.X + LeftAdd, pA22_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
  9964. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("化妆师"), ft12, b, recA2_3);//画第三列的列标题
  9965. Point pA23_1 = new Point(pA22_1.X + ColumnWidth3, recA2.Y);
  9966. Point pA23_2 = new Point(pA22_1.X + ColumnWidth3, recA2.Y + recA2.Height);
  9967. g.DrawLine(p, pA23_1, pA23_2);//画第三表与第四列的界线
  9968. Rectangle recA2_4 = new Rectangle(pA23_1.X + LeftAdd, pA23_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
  9969. g.DrawString(StrMakeupArtist.Trim(), ft12, b, recA2_4);//画第四列的列标题
  9970. #endregion
  9971. #region 第四行
  9972. Rectangle recA3 = new Rectangle(recA2.X, recA2.Y + recA2.Height, rec3.Width, RowHeight);
  9973. g.DrawRectangle(p, recA3);//画标题矩形
  9974. Rectangle recA3_1 = new Rectangle(recA3.X + LeftAdd, recA3.Y + TopAdd, ColumnWidth1, RowContentHeight);
  9975. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("拍摄时间"), ft12, b, recA3_1);//画第一列的列标题
  9976. Point pA31_1 = new Point(recA3.X + ColumnWidth1, recA3.Y);
  9977. Point pA31_2 = new Point(recA3.X + ColumnWidth1, recA3.Y + recA3.Height);
  9978. g.DrawLine(p, pA31_1, pA31_2);//画第一表与第二列的界线
  9979. Rectangle recA3_2 = new Rectangle(pA31_1.X + LeftAdd, pA31_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
  9980. g.DrawString(StrPhotoTime, ft12, b, recA3_2);//画第二列的列标题
  9981. Point pA32_1 = new Point(pA31_1.X + ColumnWidth2, recA3.Y);
  9982. Point pA32_2 = new Point(pA31_1.X + ColumnWidth2, recA3.Y + recA3.Height);
  9983. g.DrawLine(p, pA32_1, pA32_2);//画第二表与第三列的界线
  9984. Rectangle recA3_3 = new Rectangle(pA32_1.X + LeftAdd, pA32_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
  9985. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("取件日期"), ft12, b, recA3_3);//画第三列的列标题
  9986. Point pA33_1 = new Point(recA3_3.X + recA3_3.Width - LeftAdd, recA3.Y);
  9987. Point pA33_2 = new Point(pA33_1.X, recA3.Y + recA3.Height);
  9988. g.DrawLine(p, pA33_1, pA33_2);//画第三表与第四列的界线
  9989. string strPickupTime = "";
  9990. if (tblPickupTime.Rows.Count > 0)
  9991. {
  9992. if (!string.IsNullOrEmpty(tblPickupTime.Rows[0]["OPlist_PickupTime"].ToString().Trim()))
  9993. {
  9994. strPickupTime = LYFZ.Command.Command_Validate.DateTimeToString(tblPickupTime.Rows[0]["OPlist_PickupTime"]);
  9995. }
  9996. }
  9997. Rectangle recA3_4 = new Rectangle(pA33_1.X + LeftAdd, pA33_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
  9998. #endregion
  9999. #endregion
  10000. #region 第七行
  10001. Rectangle recA4 = new Rectangle(recA3.X, recA3.Y + recA3.Height, rec3.Width, RowHeight);
  10002. g.DrawRectangle(p, recA4);//画标题矩形
  10003. Rectangle recA4_1 = new Rectangle(recA4.X + LeftAdd, recA4.Y + TopAdd, ColumnWidth1, RowContentHeight);
  10004. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("选片日期"), ft12, b, recA4_1);//画第一列的列标题
  10005. Point pA41_1 = new Point(recA4.X + ColumnWidth1, recA4.Y);
  10006. Point pA41_2 = new Point(recA4.X + ColumnWidth1, recA4.Y + recA4.Height);
  10007. g.DrawLine(p, pA41_1, pA41_2);//画第一表与第二列的界线
  10008. Rectangle recA4_2 = new Rectangle(pA41_1.X + LeftAdd, pA41_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
  10009. g.DrawString(StrFilmSelectionTime, ft12, b, recA4_2);//画第二列的列标题
  10010. Point pA42_1 = new Point(pA41_1.X + ColumnWidth2, recA4.Y);
  10011. Point pA42_2 = new Point(pA41_1.X + ColumnWidth2, recA4.Y + recA4.Height);
  10012. g.DrawLine(p, pA42_1, pA42_2);//画第二表与第三列的界线
  10013. Rectangle recA4_3 = new Rectangle(pA42_1.X + LeftAdd, pA42_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
  10014. g.DrawString("", ft12, b, recA4_3);//画第三列的列标题
  10015. Point pA43_1 = new Point(pA42_1.X + ColumnWidth3, recA4.Y);
  10016. Point pA43_2 = new Point(pA42_1.X + ColumnWidth3, recA4.Y + recA4.Height);
  10017. g.DrawLine(p, pA43_1, pA43_2);//画第三表与第四列的界线
  10018. Rectangle recA4_4 = new Rectangle(pA43_1.X + LeftAdd, pA43_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
  10019. g.DrawString("", ft12, b, recA4_4);//画第四列的列标题
  10020. Point pA44_1 = new Point(pA43_1.X + ColumnWidth4, recA4.Y);
  10021. Point pA44_2 = new Point(pA43_1.X + ColumnWidth4, recA4.Y + recA4.Height);
  10022. g.DrawLine(p, pA44_1, pA44_2);//画第四表与第五列的界线
  10023. #endregion
  10024. #endregion
  10025. #region 右排
  10026. #region 第一行
  10027. Rectangle Rrec3 = new Rectangle(rec3.X + rec3.Width, rec3.Y, ColumnWidth5 + ColumnWidth6, RowHeight);
  10028. g.DrawRectangle(p, Rrec3);//画标题矩形
  10029. Rectangle Rrec3_5 = new Rectangle(Rrec3.X + LeftAdd, Rrec3.Y + TopAdd, ColumnWidth5, RowContentHeight);
  10030. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("套系名称"), ft12, b, Rrec3_5);//画第五列的列标题
  10031. Point Rp35_1 = new Point(Rrec3.X + ColumnWidth5, Rrec3.Y);
  10032. Point Rp35_2 = new Point(Rrec3.X + ColumnWidth5, Rrec3.Y + Rrec3.Height);
  10033. g.DrawLine(p, Rp35_1, Rp35_2);//画第五表与第六列的界线
  10034. Rectangle Rrec3_6 = new Rectangle(Rp35_1.X + LeftAdd, Rrec3_5.Y, ColumnWidth6, RowContentHeight);
  10035. g.DrawString(tblOrder.Rows[0]["Ord_SeriesName"].ToString().Trim(), ft12, b, Rrec3_6);//画第六列的列标题
  10036. #endregion
  10037. #region 第二行
  10038. Rectangle Rrec4 = new Rectangle(Rrec3.X, Rrec3.Y + Rrec3.Height, Rrec3.Width, RowHeight);
  10039. g.DrawRectangle(p, Rrec4);//画标题矩形
  10040. Rectangle Rrec4_5 = new Rectangle(Rrec4.X + LeftAdd, Rrec4.Y + TopAdd, ColumnWidth5, RowContentHeight);
  10041. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("套系金额"), ft12, b, Rrec4_5);//画第五列的列标题
  10042. Point Rp45_1 = new Point(Rp35_1.X, Rrec4.Y);
  10043. Point Rp45_2 = new Point(Rp35_1.X, Rrec4.Y + Rrec4.Height);
  10044. g.DrawLine(p, Rp45_1, Rp45_2);//画第五表与第六列的界线
  10045. Rectangle Rrec4_6 = new Rectangle(Rp45_1.X + LeftAdd, Rrec4_5.Y, ColumnWidth6, RowContentHeight);
  10046. g.DrawString(tblOrder.Rows[0]["Ord_SeriesPrice"].ToString().Trim(), ft12, b, Rrec4_6);//画第六列的列标题
  10047. #endregion
  10048. #region 第三行
  10049. Rectangle Rrec5 = new Rectangle(Rrec4.X, Rrec4.Y + Rrec4.Height, Rrec3.Width, RowHeight);
  10050. g.DrawRectangle(p, Rrec5);//画标题矩形
  10051. Rectangle Rrec5_5 = new Rectangle(Rrec5.X + LeftAdd, Rrec5.Y + TopAdd, ColumnWidth5, RowContentHeight);
  10052. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("预约定金"), ft12, b, Rrec5_5);//画第五列的列标题
  10053. Point Rp55_1 = new Point(Rp45_1.X, Rrec5.Y);
  10054. Point Rp55_2 = new Point(Rp45_1.X, Rrec5.Y + Rrec5.Height);
  10055. g.DrawLine(p, Rp55_1, Rp55_2);//画第五表与第六列的界线
  10056. Rectangle Rrec5_6 = new Rectangle(Rp55_1.X + LeftAdd, Rrec5_5.Y, ColumnWidth6, RowContentHeight);
  10057. g.DrawString(OrdPrice, ft12, b, Rrec5_6);//画第六列的列标题
  10058. #endregion
  10059. #region 第四行
  10060. Rectangle Rrec6 = new Rectangle(Rrec5.X, Rrec5.Y + Rrec5.Height, Rrec3.Width, RowHeight);
  10061. g.DrawRectangle(p, Rrec6);//画标题矩形
  10062. Rectangle Rrec6_5 = new Rectangle(Rrec6.X + LeftAdd, Rrec6.Y + TopAdd, ColumnWidth5, RowContentHeight);
  10063. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideArrears)
  10064. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("余款金额"), ft12, b, Rrec6_5);//画第五列的列标题
  10065. Point Rp65_1 = new Point(Rp55_1.X, Rrec6.Y);
  10066. Point Rp65_2 = new Point(Rp55_1.X, Rrec6.Y + Rrec6.Height);
  10067. g.DrawLine(p, Rp65_1, Rp65_2);//画第五表与第六列的界线
  10068. Rectangle Rrec6_6 = new Rectangle(Rp65_1.X + LeftAdd, Rrec6_5.Y, ColumnWidth6, RowContentHeight);
  10069. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideArrears)
  10070. g.DrawString(tblOrder.Rows[0]["Ord_OrderArrears"].ToString().Trim(), ft12, b, Rrec6_6);//画第六列的列标题
  10071. #endregion
  10072. #region 第五行
  10073. Rectangle Rrec7 = new Rectangle(Rrec6.X, Rrec6.Y + Rrec6.Height, Rrec3.Width, RowHeight);
  10074. g.DrawRectangle(p, Rrec7);//画标题矩形
  10075. Rectangle Rrec7_5 = new Rectangle(Rrec7.X + LeftAdd, Rrec7.Y + TopAdd, ColumnWidth5, RowContentHeight);
  10076. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("结婚日期"), ft12, b, Rrec7_5);//画第五列的列标题
  10077. Point Rp75_1 = new Point(Rp65_1.X, Rrec7.Y);
  10078. Point Rp75_2 = new Point(Rp65_1.X, Rrec7.Y + Rrec7.Height);
  10079. g.DrawLine(p, Rp75_1, Rp75_2);//画第五表与第六列的界线
  10080. Rectangle Rrec7_6 = new Rectangle(Rp75_1.X + LeftAdd, Rrec7_5.Y, ColumnWidth6, RowContentHeight);
  10081. //e.Graphics.DrawString(DayForMarriage + "2015-05-05", ft9, b, Rrec7_6);//画第六列的列标题
  10082. g.DrawString(DayForMarriage, ft12, b, Rrec7_6);//画第六列的列标题
  10083. #endregion
  10084. #region 第六行
  10085. Rectangle Rrec8 = new Rectangle(Rrec7.X, Rrec7.Y + Rrec7.Height, Rrec3.Width, RowHeight);
  10086. g.DrawRectangle(p, Rrec8);//画标题矩形
  10087. Rectangle Rrec8_5 = new Rectangle(Rrec8.X + LeftAdd, Rrec8.Y + TopAdd, ColumnWidth5, RowContentHeight);
  10088. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("门市"), ft12, b, Rrec8_5);//画第五列的列标题
  10089. Point Rp85_1 = new Point(Rp75_1.X, Rrec8.Y);
  10090. Point Rp85_2 = new Point(Rp75_1.X, Rrec8.Y + Rrec8.Height);
  10091. g.DrawLine(p, Rp85_1, Rp85_2);//画第五表与第六列的界线
  10092. string strOrderPerson = "";
  10093. Rectangle rec8_6 = new Rectangle(Rp85_1.X + LeftAdd, Rrec8_5.Y, ColumnWidth6, RowContentHeight);
  10094. if (tblUser.Rows.Count > 0)
  10095. {
  10096. if (Convert.ToBoolean(tblUser.Rows[0]["User_PhonePrint"]) == true)
  10097. strOrderPerson = tblUser.Rows[0]["User_Name"].ToString() + " " + tblUser.Rows[0]["User_Telephone"].ToString();
  10098. else
  10099. strOrderPerson = tblUser.Rows[0]["User_Name"].ToString() + " " + tbl.Rows[0]["Company_Telephone"].ToString();
  10100. }
  10101. g.DrawString(strOrderPerson, ft12, b, rec8_6);//画第六列的列标题
  10102. #endregion
  10103. #region 第一列
  10104. Rectangle Rrec10 = new Rectangle(Rrec8.X, Rrec8.Y + Rrec8.Height, Rrec3.Width, recA2.Y - Rrec8.Y);
  10105. g.DrawRectangle(p, Rrec10);//画标题矩形
  10106. StrValue = "";
  10107. if (PrintOtherData.ContainsKey("婚纱预约单注意事项说明") && PrintOtherData["婚纱预约单注意事项说明"].ToString().Trim().Length > 0)
  10108. {
  10109. StrValue = PrintOtherData["婚纱预约单注意事项说明"].ToString().Trim();
  10110. }
  10111. Rectangle rec10_1 = new Rectangle(Rrec10.X + LeftAdd, Rrec10.Y + TopAdd, Rrec10.Width - LeftAdd * 2, Rrec10.Height - TopAdd * 2);
  10112. Font scaleFont = PrinterDrawMethod.ComputeAutoScaleFont(g, LYFZ.BLL.OtherCommonModel.FontConversion("注意事项:\r\n") + StrValue, rec10_1, GetFontSize("婚纱预约单注意事项字体大小"), minFontSize: 6);
  10113. PrinterDrawMethod.DrawCellTextAutroWrap(g, LYFZ.BLL.OtherCommonModel.FontConversion("注意事项:\r\n") + StrValue, rec10_1, scaleFont, autoWrap: true, nWrapLineSpace: 1, showFrame: false);
  10114. #endregion
  10115. #region 顾客签字
  10116. Rectangle RrecA5 = new Rectangle(Rrec10.X, Rrec10.Y + Rrec10.Height, Rrec3.Width, RowHeight * 2);
  10117. g.DrawRectangle(p, RrecA5);//画标题矩形
  10118. Rectangle RrecA5_1 = new Rectangle(RrecA5.X + LeftAdd, RrecA5.Y + RowContentHeight, ColumnWidth5, RowContentHeight);
  10119. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("顾客签字"), ft12, b, RrecA5_1);//画第五列的列标题
  10120. Point RpA51_1 = new Point(Rp75_1.X, RrecA5.Y);
  10121. Point RpA51_2 = new Point(Rp75_1.X, RrecA5.Y + RrecA5.Height);
  10122. g.DrawLine(p, RpA51_1, RpA51_2);//画第四表与第五列的界线
  10123. #endregion
  10124. #endregion
  10125. #region 尾行
  10126. string rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("网址:") + tbl.Rows[0]["Company_URL"].ToString().Trim();
  10127. sizef = g.MeasureString(rec2Value, ft9);
  10128. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  10129. FtHeight = Convert.ToInt32(sizef.Height);
  10130. Rectangle recA6_1 = new Rectangle(TableWidth + LeftWidth - FtWidth, recA4.Y + recA4.Height + TopAdd, FtWidth, FtHeight);
  10131. g.DrawString(rec2Value, ft9, b, recA6_1);//画第一列的列标题
  10132. Rectangle recA6 = new Rectangle(recA4.X, recA6_1.Y, TableWidth - recA6_1.Width - 50, FtHeight);
  10133. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("地址:") + tbl.Rows[0]["Company_Address"].ToString().Trim(), ft9, b, recA6);//画第一列的列标题
  10134. Rectangle recA7 = new Rectangle(recA6.X, recA6.Y + recA6.Height, recA6.Width, FtHeight);
  10135. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("电话:") + tbl.Rows[0]["Company_Telephone"].ToString().Trim(), ft9, b, recA7);//画第一列的列标题
  10136. rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("页:") + (iPage + 1) + "/" + pListData.Count;
  10137. sizef = g.MeasureString(rec2Value, ft9);
  10138. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  10139. FtHeight = Convert.ToInt32(sizef.Height);
  10140. Rectangle recA8 = new Rectangle(TableWidth + LeftWidth - FtWidth, recA7.Y + TopAdd, FtWidth, FtHeight);
  10141. g.DrawString(rec2Value, ft9, b, recA8);//画第一列的列标题
  10142. #endregion
  10143. //bitmap.Save("E:\\btn"+ bitmapDataList.Count+".bmp");
  10144. //bitmapDataList.Add(bitmap);
  10145. //size = new Size(size.Width, size.Height * pListData.Count);
  10146. #endregion
  10147. }
  10148. /// <summary>
  10149. /// 其他单获取服务商品详情数据
  10150. /// </summary>
  10151. /// <param name="g1"></param>
  10152. /// <param name="TableWidth"></param>
  10153. /// <param name="tblProductList"></param>
  10154. /// <param name="tblService"></param>
  10155. /// <param name="tblSights"></param>
  10156. /// <returns></returns>
  10157. static List<List<string>> GetProductOrServiceListData(Graphics g1,int TableWidth,DataTable tblProductList,
  10158. DataTable tblService,DataTable tblSights,string fontmsg="婚纱预约单内容详情字体大小"
  10159. ,bool bSign=true,float contentHeight= 460)
  10160. {
  10161. #region 绑定数据
  10162. List<List<string>> pListData = new List<List<string>>();
  10163. List<string> tempListData = new List<string>();
  10164. float tempDataHight = 0;
  10165. int Unit1 = TableWidth / 25;
  10166. int ColumnWidth11 = Unit1 * 3;
  10167. int ColumnWidth12 = Unit1 * 5;
  10168. int ColumnWidth13 = Unit1 * 3;
  10169. int ColumnWidth14 = Unit1 * 5;
  10170. SizeF iSizef = new SizeF();
  10171. for (int i = 0; i < tblProductList.Rows.Count; i++)
  10172. {
  10173. DataRow dr = tblProductList.Rows[i];
  10174. //SizeF iSizef = new SizeF();
  10175. if (i == 0)
  10176. {
  10177. iSizef = g1.MeasureString("商品:",
  10178. GetFontSize(fontmsg), ColumnWidth11 + ColumnWidth12 + ColumnWidth13 + ColumnWidth14);
  10179. tempDataHight += iSizef.Height;
  10180. if (tempDataHight > contentHeight)
  10181. {
  10182. pListData.Add(tempListData);
  10183. tempListData = new List<string>();
  10184. tempDataHight = 0;
  10185. }
  10186. tempListData.Add("商品:");
  10187. }
  10188. iSizef = g1.MeasureString(dr["ProdName"].ToString().Trim(),
  10189. GetFontSize(fontmsg), ColumnWidth11 + ColumnWidth12 + ColumnWidth13 + ColumnWidth14);
  10190. tempDataHight += iSizef.Height;
  10191. if (tempDataHight > contentHeight)
  10192. {
  10193. pListData.Add(tempListData);
  10194. tempListData = new List<string>();
  10195. tempDataHight = 0;
  10196. }
  10197. tempListData.Add(" " + dr["ProdName"].ToString().Trim());
  10198. }
  10199. for (int i = 0; i < tblService.Rows.Count; i++)
  10200. {
  10201. DataRow dr = tblService.Rows[i];
  10202. if (i == 0)
  10203. {
  10204. iSizef = g1.MeasureString("服务:",
  10205. GetFontSize(fontmsg), ColumnWidth11 + ColumnWidth12 + ColumnWidth13 + ColumnWidth14);
  10206. tempDataHight += iSizef.Height;
  10207. if (tempDataHight > contentHeight)
  10208. {
  10209. pListData.Add(tempListData);
  10210. tempListData = new List<string>();
  10211. tempDataHight = 0;
  10212. }
  10213. tempListData.Add("服务:");
  10214. }
  10215. iSizef = g1.MeasureString(dr["ProdName"].ToString().Trim(),
  10216. GetFontSize(fontmsg), ColumnWidth11 + ColumnWidth12 + ColumnWidth13 + ColumnWidth14);
  10217. tempDataHight += iSizef.Height;
  10218. if (tempDataHight > contentHeight)
  10219. {
  10220. pListData.Add(tempListData);
  10221. tempListData = new List<string>();
  10222. tempDataHight = 0;
  10223. }
  10224. tempListData.Add(" "+dr["ProdName"].ToString().Trim());
  10225. }
  10226. iSizef = g1.MeasureString("\r\n",
  10227. GetFontSize(fontmsg), ColumnWidth11 + ColumnWidth12 + ColumnWidth13 + ColumnWidth14);
  10228. tempDataHight += iSizef.Height;
  10229. if (tempDataHight > contentHeight)
  10230. {
  10231. pListData.Add(tempListData);
  10232. tempListData = new List<string>();
  10233. tempDataHight = 0;
  10234. }
  10235. tempListData.Add("\r\n");
  10236. if (bSign)
  10237. {
  10238. iSizef = g1.MeasureString(LYFZ.BLL.OtherCommonModel.FontConversion("景点:\r\n"),
  10239. GetFontSize(fontmsg), ColumnWidth11 + ColumnWidth12 + ColumnWidth13 + ColumnWidth14);
  10240. tempDataHight += iSizef.Height;
  10241. if (tempDataHight > contentHeight)
  10242. {
  10243. pListData.Add(tempListData);
  10244. tempListData = new List<string>();
  10245. tempDataHight = 0;
  10246. }
  10247. tempListData.Add(LYFZ.BLL.OtherCommonModel.FontConversion("景点:\r\n"));
  10248. for (int i = 0; i < tblSights.Rows.Count; i++)
  10249. {
  10250. string StrSights1 = "";
  10251. StrSights1 += (i + 1) + "." + tblSights.Rows[i]["Ordpg_Sights"].ToString().Trim();
  10252. StrSights1 += tblSights.Rows[i]["Ordpg_SightsRemark"].ToString().Trim();
  10253. StrSights1 += "\r\n";
  10254. iSizef = g1.MeasureString(StrSights1,
  10255. GetFontSize(fontmsg), ColumnWidth11 + ColumnWidth12 + ColumnWidth13 + ColumnWidth14);
  10256. tempDataHight += iSizef.Height;
  10257. if (tempDataHight > contentHeight)
  10258. {
  10259. pListData.Add(tempListData);
  10260. tempListData = new List<string>();
  10261. tempDataHight = 0;
  10262. }
  10263. tempListData.Add(" " + StrSights1);
  10264. }
  10265. }
  10266. if (tempListData.Count > 0)
  10267. {
  10268. pListData.Add(tempListData);
  10269. }
  10270. return pListData;
  10271. #endregion
  10272. }
  10273. #if IGNORE
  10274. static void PrintContentData(string strName, Graphics g, Rectangle rec9, int LeftAdd, int TopAdd,Brush b ,string fontSizeText, ref float _infoHeight)
  10275. {
  10276. string info = "";
  10277. string quantity = "";
  10278. SizeF infoSizef;
  10279. if (strName.LastIndexOf("数量") > -1)
  10280. {
  10281. List<string> infoList = new List<string>();
  10282. info = strName.Substring(0, strName.LastIndexOf("数量"));
  10283. quantity = strName.Replace(info, "");
  10284. }
  10285. else
  10286. {
  10287. info = strName;
  10288. }
  10289. if (string.IsNullOrEmpty(quantity))
  10290. {
  10291. Rectangle rec9_2 = new Rectangle(rec9.X + LeftAdd, rec9.Y + TopAdd + (int)_infoHeight, rec9.Width - LeftAdd * 2, rec9.Height - TopAdd * 2);
  10292. infoSizef = g.MeasureString(info,
  10293. GetFontSize(fontSizeText), rec9.Width);
  10294. g.DrawString(info, GetFontSize(fontSizeText), b, rec9_2);//画第一列的列标题
  10295. _infoHeight += infoSizef.Height;
  10296. }
  10297. else
  10298. {
  10299. Rectangle rec9_2 = new Rectangle(rec9.X + LeftAdd, rec9.Y + TopAdd + (int)_infoHeight, rec9.Width - LeftAdd * 2 - 100, rec9.Height - TopAdd * 2);
  10300. infoSizef = g.MeasureString(info,
  10301. GetFontSize(fontSizeText), rec9_2.Width);
  10302. g.DrawString(info, GetFontSize(fontSizeText), b, rec9_2);//画第一列的列标题
  10303. rec9_2 = new Rectangle(rec9.X + LeftAdd + rec9_2.Width, rec9.Y + TopAdd + (int)_infoHeight, 100, rec9.Height - TopAdd * 2);
  10304. infoSizef = g.MeasureString(quantity,
  10305. GetFontSize(fontSizeText), rec9_2.Width);
  10306. g.DrawString(quantity, GetFontSize(fontSizeText), b, rec9_2);//画第一列的列标题
  10307. _infoHeight += infoSizef.Height;
  10308. }
  10309. }
  10310. #else
  10311. /// <summary>
  10312. ///
  10313. /// </summary>
  10314. /// <param name="strText">要打印的文本</param>
  10315. /// <param name="g"></param>
  10316. /// <param name="rcParent">容器区域(父区域),文本在显示的区域不能超过该区域范围</param>
  10317. /// <param name="nLineSpace">行间距</param>
  10318. /// <param name="nPageMargins">页边距</param>
  10319. /// <param name="b"></param>
  10320. /// <param name="fontSizeText">字号大小</param>
  10321. /// <param name="_infoHeight">本次绘图前所有绘图结果的高度总和</param>
  10322. static void PrintContentData( string strText, Graphics g, Rectangle rcParent, int nPageMargins, int nLineSpace, Brush b, string fontSizeText, ref float _infoHeight )
  10323. {
  10324. SizeF TextSize;
  10325. int nIndex = -1;
  10326. strText = strText.Replace(" Null"," ");
  10327. // 商品名称, 商品匹数, 商品数量;
  10328. string strCommodityName = strText, strCommodityPS = "", strCommodityQuantity = "";
  10329. // 解析出商品名称, 商品匹数, 商品数量;
  10330. if ( (nIndex = strText.LastIndexOf( "数量" )) != -1 )
  10331. {
  10332. strCommodityName = strText.Substring( 0, nIndex ).TrimEnd(); // 保留商品名前的空格;
  10333. strCommodityQuantity = strText.Substring( nIndex ).Trim();
  10334. if ( (nIndex = strCommodityName.LastIndexOf( "P数" )) != -1 )
  10335. {
  10336. strCommodityPS = strCommodityName.Substring( nIndex ).Trim();
  10337. strCommodityName = strCommodityName.Substring( 0, nIndex ).TrimEnd();// 保留商品名前的空格;
  10338. }
  10339. if ( (nIndex = strCommodityQuantity.LastIndexOf( "(礼包)" )) != -1 )
  10340. {
  10341. strCommodityQuantity = strCommodityQuantity.Substring( 0, nIndex ).Trim();
  10342. strCommodityName += "(礼包)";
  10343. }
  10344. }
  10345. // 自动缩放时,不使用页边距;
  10346. PrinterDrawMethod.AutoScaleNotMargion = false;
  10347. if ( string.IsNullOrEmpty( strCommodityQuantity ) )
  10348. {// 没有数量信息时, 则要打印的文本不是商品内容,而是其他普通文本;
  10349. Rectangle rec9_2 = new Rectangle( rcParent.X + nPageMargins, rcParent.Y + nLineSpace + (int)_infoHeight, rcParent.Width - nPageMargins * 2, rcParent.Height - nLineSpace * 2 );
  10350. Rectangle rcConfig = PrinterDrawMethod.ComputeTextCell( g, strText, rec9_2, GetFontSize( fontSizeText ) );
  10351. rcConfig.Height = PrinterDrawMethod.DrawCellTextAutroScale( g, strText, rcConfig, GetFontSize( fontSizeText ), autoScale: true, showFrame: false, minFontSize: 5 );
  10352. _infoHeight += rcConfig.Height;
  10353. }
  10354. else
  10355. {// 有数量信息时, 一定是商品信息文本;
  10356. int nWidth = (rcParent.Width - nPageMargins) / 20; // 分成20份, 13份商品名,3份p数,4份数量;
  10357. // 打印商品名;
  10358. Rectangle rec9_2 = new Rectangle( rcParent.X + nPageMargins, rcParent.Y + nLineSpace + (int)_infoHeight, nWidth * 13, rcParent.Height - nLineSpace * 2 );
  10359. Rectangle rcConfig = PrinterDrawMethod.ComputeTextCell( g, strCommodityName, rec9_2, GetFontSize( fontSizeText ) );
  10360. rcConfig.Height = PrinterDrawMethod.DrawCellTextAutroScale( g, strCommodityName, rcConfig, GetFontSize( fontSizeText ), autoScale: true, showFrame: false, minFontSize: 5 );
  10361. if ( !string.IsNullOrEmpty( strCommodityPS ) )
  10362. {// P数存在;
  10363. // 打印P数;
  10364. rec9_2 = new Rectangle( rcParent.X + nPageMargins + nWidth * 13, rcParent.Y + nLineSpace + (int)_infoHeight, nWidth * 3, rcParent.Height - nLineSpace * 2 );
  10365. TextSize = g.MeasureString( strCommodityPS, GetFontSize( fontSizeText ), rec9_2.Width );
  10366. PrinterDrawMethod.DrawCellTextAutroScale( g, strCommodityPS, rec9_2, GetFontSize( fontSizeText ), autoScale: true, showFrame: false, minFontSize: 5 );
  10367. // 打印商品数量;
  10368. rec9_2 = new Rectangle( rcParent.X + nPageMargins + nWidth * 16, rcParent.Y + nLineSpace + (int)_infoHeight, nWidth * 4, rcParent.Height - nLineSpace * 2 );
  10369. TextSize = g.MeasureString( strCommodityQuantity, GetFontSize( fontSizeText ), rec9_2.Width );
  10370. PrinterDrawMethod.DrawCellTextAutroScale( g, strCommodityQuantity, rec9_2, GetFontSize( fontSizeText ), autoScale: true, showFrame: false, minFontSize: 5 );
  10371. }
  10372. else
  10373. {// 没有匹数;
  10374. // 打印商品数量;
  10375. rec9_2 = new Rectangle( rcParent.X + nPageMargins + nWidth * 16, rcParent.Y + nLineSpace + (int)_infoHeight, nWidth * 4, rcParent.Height - nLineSpace * 2 );
  10376. TextSize = g.MeasureString( strCommodityQuantity, GetFontSize( fontSizeText ), rec9_2.Width );
  10377. rcConfig.Height = PrinterDrawMethod.DrawCellTextAutroScale( g, strCommodityQuantity, rec9_2, GetFontSize( fontSizeText ), autoScale: true, showFrame: false, minFontSize: 5 );
  10378. }
  10379. _infoHeight += rcConfig.Height;
  10380. }
  10381. }
  10382. #endif
  10383. /// <summary>
  10384. /// 婚纱二等份打印
  10385. /// </summary>
  10386. /// <param name="objValue"></param>
  10387. private static void Wedding_OrderReport_TwoEqualPrint(DataSet dtSet, Graphics g1, Size size, ref List<List<string>> pListData, int iPage)
  10388. {
  10389. int LeftWidth = 50;
  10390. int TableWidth = size.Width - LeftWidth * 2 + 30;
  10391. DataTable tbl = dtSet.Tables["ds"];//获取影楼信息
  10392. DataTable tblOrder = dtSet.Tables["ds1"];//订单
  10393. DataTable tblDigital = dtSet.Tables["ds2"];//数码
  10394. DataTable tblSights = dtSet.Tables["ds3"];//景点
  10395. DataTable tblPickupTime = dtSet.Tables["ds4"];//取件时间
  10396. DataTable tblProductList = dtSet.Tables["ds5"];//订单商品
  10397. DataTable tblClient = dtSet.Tables["ds6"];//客户资料
  10398. DataTable tblService = dtSet.Tables["ds7"];//服务资料
  10399. DataTable tblStyle = dtSet.Tables["ds8"];//喜爱风格
  10400. DataTable tblPayment = dtSet.Tables["ds9"];//订单定金
  10401. DataTable tblUser = dtSet.Tables["ds11"];//订单定金
  10402. string OrdPrice = "0.00";
  10403. if (tblPayment.Rows.Count > 0)
  10404. {
  10405. OrdPrice = tblPayment.Rows[0]["Pay_AmountOf"].ToString().Trim();
  10406. }
  10407. tblStyle.PrimaryKey = new DataColumn[] { tblStyle.Columns["ID"] };
  10408. DataTable tblIntoRB = dtSet.Tables["ds10"];//订单定金
  10409. int IntoRegisterQuantit = 0;
  10410. int IntoBottomQuantity = 0;
  10411. for (int i = 0; i < tblIntoRB.Rows.Count; i++)
  10412. {
  10413. IntoRegisterQuantit += Convert.ToInt32(tblIntoRB.Rows[i]["Ordv_IntoRegisterQuantity"]);
  10414. IntoBottomQuantity += Convert.ToInt32(tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"]);
  10415. }
  10416. string strPaymentMsg = "";
  10417. foreach (DataRow dr in tblPayment.Rows)
  10418. {
  10419. if (!string.IsNullOrEmpty(strPaymentMsg))
  10420. {
  10421. strPaymentMsg += " ";
  10422. }
  10423. strPaymentMsg += dr["Sc_ClassName"] + ":" + dr["Pay_AmountOf"];
  10424. }
  10425. if (pListData.Count == 0)
  10426. {
  10427. pListData = GetProductOrServiceHelfListData(g1, TableWidth, tblProductList, tblService, tblSights,disInfo: LYFZ.BLL.OtherCommonModel.FontConversion("\r\n备注:") + tblOrder.Rows[0]["Ord_Remark"].ToString().Trim());
  10428. }
  10429. Brush b = Brushes.Black;
  10430. Pen p = GetPen;
  10431. Font ft17 = new Font("宋体", 17);
  10432. Font ft13 = new Font("宋体", 13);
  10433. Font ft10 = new Font("宋体", 10);
  10434. Font ft9 = new Font("宋体", 9);
  10435. #region 获取数据
  10436. string MName = "";
  10437. string MTelephone = "";
  10438. string MIDNumber = "";
  10439. string MMicroSignal = "";
  10440. string MQQ = "";
  10441. string WName = "";
  10442. string WTelephone = "";
  10443. string WIDNumber = "";
  10444. string WMicroSignal = "";
  10445. string WQQ = "";
  10446. string DayForMarriage = "";
  10447. string StrAdderss = "";
  10448. for (int i = 0; i < tblClient.Rows.Count; i++)
  10449. {
  10450. if (Convert.ToBoolean(tblClient.Rows[i]["Cus_Sex"]))
  10451. {
  10452. WName = tblClient.Rows[i]["Cus_Name"].ToString().Trim();
  10453. WTelephone = tblClient.Rows[i]["Cus_Telephone"].ToString().Trim();
  10454. WIDNumber = tblClient.Rows[i]["Cus_IDNumber"].ToString().Trim();
  10455. WMicroSignal = tblClient.Rows[i]["Cus_MicroSignal"].ToString().Trim();
  10456. WQQ = tblClient.Rows[i]["Cus_QQ"].ToString().Trim();
  10457. if (LYFZ.Command.Command_Validate.DateTimeToString(tblClient.Rows[i]["Cus_DayForMarriage"]) != "")
  10458. {
  10459. DayForMarriage = LYFZ.Command.Command_Validate.DateTimeToString(tblClient.Rows[i]["Cus_DayForMarriage"]);
  10460. if (!string.IsNullOrEmpty(tblClient.Rows[i]["Cus_DayForMarriageLunar"].ToString().Trim()) && tblClient.Rows[i]["Cus_DayForMarriageLunar"].ToString().Trim() == "1")
  10461. {
  10462. DayForMarriage += LYFZ.BLL.OtherCommonModel.FontConversion(" (农历)");
  10463. }
  10464. }
  10465. if (tblClient.Rows[i]["Cus_Address"].ToString().Trim() != "")
  10466. {
  10467. if (StrAdderss == "")
  10468. {
  10469. StrAdderss = tblClient.Rows[i]["Cus_Address"].ToString().Trim();
  10470. }
  10471. }
  10472. }
  10473. else
  10474. {
  10475. MName = tblClient.Rows[i]["Cus_Name"].ToString().Trim();
  10476. MTelephone = tblClient.Rows[i]["Cus_Telephone"].ToString().Trim();
  10477. MIDNumber = tblClient.Rows[i]["Cus_IDNumber"].ToString().Trim();
  10478. MMicroSignal = tblClient.Rows[i]["Cus_MicroSignal"].ToString().Trim();
  10479. MQQ = tblClient.Rows[i]["Cus_QQ"].ToString().Trim();
  10480. if (LYFZ.Command.Command_Validate.DateTimeToString(tblClient.Rows[i]["Cus_DayForMarriage"]) != "")
  10481. {
  10482. DayForMarriage = LYFZ.Command.Command_Validate.DateTimeToString(tblClient.Rows[i]["Cus_DayForMarriage"]);
  10483. if (!string.IsNullOrEmpty(tblClient.Rows[i]["Cus_DayForMarriageLunar"].ToString().Trim()) && tblClient.Rows[i]["Cus_DayForMarriageLunar"].ToString().Trim() == "1")
  10484. {
  10485. DayForMarriage += LYFZ.BLL.OtherCommonModel.FontConversion(" (农历)");
  10486. }
  10487. }
  10488. if (tblClient.Rows[i]["Cus_Address"].ToString().Trim() != "")
  10489. {
  10490. StrAdderss = tblClient.Rows[i]["Cus_Address"].ToString().Trim();
  10491. }
  10492. }
  10493. }
  10494. int InnerSights = 0;
  10495. int OuterSights = 0;
  10496. string StrSights = LYFZ.BLL.OtherCommonModel.FontConversion("景点:");
  10497. string StrPhotoTime = "";
  10498. string StrPhotographer = "";
  10499. string StrMakeupArtist = "";
  10500. for (int i = 0; i < tblSights.Rows.Count; i++)
  10501. {
  10502. if (tblSights.Rows[i]["Ordpg_SightsType"].ToString().Trim() == "0")
  10503. {
  10504. InnerSights += Convert.ToInt32(tblSights.Rows[i]["Ordpg_ApparelQuantity"]);
  10505. }
  10506. if (tblSights.Rows[i]["Ordpg_SightsType"].ToString().Trim() == "1")
  10507. {
  10508. OuterSights += Convert.ToInt32(tblSights.Rows[i]["Ordpg_ApparelQuantity"]);
  10509. }
  10510. StrSights += "\r\n" + (i + 1) + "." + tblSights.Rows[i]["Ordpg_Sights"].ToString().Trim();
  10511. StrSights += tblSights.Rows[i]["Ordpg_SightsRemark"].ToString().Trim();
  10512. if (!string.IsNullOrEmpty(tblSights.Rows[i]["Ordpg_Photographer"].ToString().Trim()))
  10513. {
  10514. StrPhotographer = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetUserName(tblSights.Rows[i]["Ordpg_Photographer"]);
  10515. }
  10516. if (!string.IsNullOrEmpty(tblSights.Rows[i]["Ordpg_MakeupArtist"].ToString().Trim()))
  10517. {
  10518. StrMakeupArtist = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetUserName(tblSights.Rows[i]["Ordpg_MakeupArtist"]);
  10519. }
  10520. if (LYFZ.Command.Command_Validate.DateTimeToString(tblSights.Rows[i]["Ordpg_ReservationPhotographyTime"]) != "")
  10521. {
  10522. if (StrPhotoTime == "")
  10523. {
  10524. StrPhotoTime = LYFZ.Command.Command_Validate.DateTimeToString2(tblSights.Rows[i]["Ordpg_ReservationPhotographyTime"]);
  10525. }
  10526. else if (Convert.ToDateTime(tblSights.Rows[i]["Ordpg_ReservationPhotographyTime"]) < Convert.ToDateTime(StrPhotoTime))
  10527. {
  10528. StrPhotoTime = LYFZ.Command.Command_Validate.DateTimeToString2(tblSights.Rows[i]["Ordpg_ReservationPhotographyTime"]);
  10529. }
  10530. }
  10531. }
  10532. string StrFilmSelectionTime = "";
  10533. if (tblDigital.Rows.Count > 0)
  10534. {
  10535. StrFilmSelectionTime = LYFZ.Command.Command_Validate.DateTimeToString2(tblDigital.Rows[0]["Ordv_FilmSelectionTime"]);
  10536. }
  10537. #endregion
  10538. int LeftAdd = 3;
  10539. int TopAdd = 4;
  10540. int RowHeight = 20;
  10541. int RowContentHeight = 18;
  10542. int Unit = TableWidth / 32;
  10543. int ColumnWidth1 = Unit * 3;
  10544. int ColumnWidth2 = Unit * 4;
  10545. int ColumnWidth3 = Unit * 3;
  10546. int ColumnWidth4 = Unit * 4;
  10547. int ColumnWidth5 = Unit * 2 - 4;
  10548. int ColumnWidth6 = Unit * 3 + 4;
  10549. int ColumnWidth7 = Unit * 3;
  10550. int ColumnWidth8 = TableWidth - ColumnWidth1 - ColumnWidth2 - ColumnWidth3 - ColumnWidth4 - ColumnWidth5 - ColumnWidth6 - ColumnWidth7;
  10551. string StrValue = tblOrder.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() != "" ? tblOrder.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() : tblOrder.Rows[0]["Ord_Number"].ToString().Trim();
  10552. string rec3Value = "NO." + StrRandom(StrValue);
  10553. string strNumber = rec3Value;
  10554. List<string> data = pListData[iPage];
  10555. Bitmap bitmap = new Bitmap(827, 580);
  10556. Graphics g = g1;
  10557. string StrProdName = "";
  10558. //for (int i = 0; i < tblProductList.Rows.Count; i++)
  10559. //{
  10560. // StrProdName += tblProductList.Rows[i]["ProdName"].ToString().Trim() + "\r\n";
  10561. //}
  10562. //for (int i = 0; i < tblService.Rows.Count; i++)
  10563. //{
  10564. // StrProdName += tblService.Rows[i]["ProdName"].ToString().Trim() + "\r\n";
  10565. //}
  10566. //StrProdName += LYFZ.BLL.OtherCommonModel.FontConversion("\r\n备注:") + tblOrder.Rows[0]["Ord_Remark"].ToString().Trim();
  10567. foreach (string str in data)
  10568. {
  10569. StrProdName += (string.IsNullOrEmpty(StrProdName) ? " " : "\r\n ") + str;
  10570. }
  10571. //StrProdName += "\r\n付款方式:" + strPaymentMsg;
  10572. #region 金色童年收据凭据
  10573. Rectangle rec1;
  10574. int Rec1Height = 0;
  10575. int TopHeightCount = 0;
  10576. Image imgLog = CachePhoto(PhotoLogType.Wedding, tbl.Rows[0]["Company_UpdateDatetime"], GetReservationSingleLOG("预约婚纱单LOG"));
  10577. if (imgLog != null)
  10578. {
  10579. rec1 = new Rectangle(LeftWidth, 50, TableWidth, 80);
  10580. Rectangle srcRec1 = new Rectangle(0, 0, imgLog.Width, imgLog.Height);
  10581. g.DrawImage(imgLog, rec1, srcRec1, GraphicsUnit.Pixel);
  10582. Rec1Height = rec1.Height - Convert.ToInt32(g.MeasureString("预约婚纱单标题", ft17).Height);
  10583. TopHeightCount = 3;
  10584. }
  10585. else
  10586. {
  10587. string StrTitle = GetReservationSingleTitle("预约婚纱单标题");
  10588. SizeF srcsizef = g.MeasureString(StrTitle, ft17);
  10589. int srcFtWidth = Convert.ToInt32(srcsizef.Width);
  10590. int srcFtHeight = Convert.ToInt32(srcsizef.Height);
  10591. rec1 = new Rectangle(size.Width / 2 - srcFtWidth / 2, 50, srcFtWidth + 5, srcFtHeight);
  10592. g.DrawString(StrTitle, ft17, b, rec1);
  10593. }
  10594. #endregion
  10595. #region 开单日期;
  10596. string strOrderCreatedData = LYFZ.BLL.OtherCommonModel.FontConversion("开单日期:") + LYFZ.Command.Command_Validate.DateTimeToString(tblOrder.Rows[0]["Ord_CreateDatetime"]);
  10597. SizeF sizef = g.MeasureString(strOrderCreatedData, ft10);
  10598. int FtWidth = Convert.ToInt32(sizef.Width) + 1;
  10599. int FtHeight = Convert.ToInt32(sizef.Height);
  10600. Rectangle rec1A = new Rectangle(LeftWidth, rec1.Y + rec1.Height + TopHeightCount, FtWidth, FtHeight);
  10601. g.DrawString(strOrderCreatedData, ft10, b, rec1A);
  10602. #endregion
  10603. #region NO.
  10604. sizef = g.MeasureString(strNumber, ft10);
  10605. rec1A = new Rectangle(rec1A.Right + 10, rec1A.Top, Convert.ToInt32(sizef.Width) + 1, Convert.ToInt32(sizef.Height));
  10606. g.DrawString(strNumber, ft10, b, rec1A);
  10607. #endregion
  10608. #region 打印时间
  10609. string StrPrintDate = LYFZ.BLL.OtherCommonModel.FontConversion("打印时间:") + LYFZ.Command.Command_Validate.DateTimeToString(SDateTime.Now, "yyyy-MM-dd HH:mm");
  10610. sizef = g.MeasureString(StrPrintDate, ft10);
  10611. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  10612. FtHeight = Convert.ToInt32(sizef.Height);
  10613. Rectangle rec2 = new Rectangle(TableWidth + LeftWidth - FtWidth, rec1A.Y, FtWidth, FtHeight);
  10614. g.DrawString(StrPrintDate, ft10, b, rec2);
  10615. #endregion
  10616. #region 第一行
  10617. Rectangle rec3 = new Rectangle(LeftWidth, rec2.Y + rec2.Height, TableWidth, RowHeight);
  10618. g.DrawRectangle(p, rec3);//画标题矩形
  10619. string rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("先生姓名");
  10620. sizef = g.MeasureString(rec2Value, ft17);
  10621. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  10622. FtHeight = Convert.ToInt32(sizef.Height);
  10623. Rectangle rec3_1 = new Rectangle(rec3.X + LeftAdd * 2, rec3.Y + TopAdd, ColumnWidth1, RowContentHeight);
  10624. g.DrawString(rec2Value, ft9, b, rec3_1);//画第一列的列标题
  10625. Point p31_1 = new Point(rec3.X + ColumnWidth1, rec3.Y);
  10626. Point p31_2 = new Point(rec3.X + ColumnWidth1, rec3.Y + rec3.Height);
  10627. g.DrawLine(p, p31_1, p31_2);//画第一表与第二列的界线
  10628. Rectangle rec3_2 = new Rectangle(p31_1.X + LeftAdd, p31_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
  10629. g.DrawString(MName, ft9, b, rec3_2);//画第二列的列标题
  10630. Point p32_1 = new Point(p31_1.X + ColumnWidth2, rec3.Y);
  10631. Point p32_2 = new Point(p31_1.X + ColumnWidth2, rec3.Y + rec3.Height);
  10632. g.DrawLine(p, p32_1, p32_2);//画第二表与第三列的界线
  10633. Rectangle rec3_3 = new Rectangle(p32_1.X + LeftAdd * 2, p32_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
  10634. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("先生电话"), ft9, b, rec3_3);//画第三列的列标题
  10635. Point p33_1 = new Point(p32_1.X + ColumnWidth3, rec3.Y);
  10636. Point p33_2 = new Point(p32_1.X + ColumnWidth3, rec3.Y + rec3.Height);
  10637. g.DrawLine(p, p33_1, p33_2);//画第三表与第四列的界线
  10638. Rectangle rec3_4 = new Rectangle(p33_1.X + LeftAdd, p33_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
  10639. g.DrawString(LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls(MTelephone), ft9, b, rec3_4);//画第四列的列标题
  10640. Point p34_1 = new Point(p33_1.X + ColumnWidth4, rec3.Y);
  10641. Point p34_2 = new Point(p33_1.X + ColumnWidth4, rec3.Y + rec3.Height);
  10642. g.DrawLine(p, p34_1, p34_2);//画第二表与第三列的界线
  10643. Rectangle rec3_5 = new Rectangle(p34_1.X + LeftAdd * 2, p34_1.Y + TopAdd, ColumnWidth5, RowContentHeight);
  10644. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("定金"), ft9, b, rec3_5);//画第三列的列标题
  10645. Point p35_1 = new Point(p34_1.X + ColumnWidth5, rec3.Y);
  10646. Point p35_2 = new Point(p34_1.X + ColumnWidth5, rec3.Y + rec3.Height);
  10647. g.DrawLine(p, p35_1, p35_2);//画第三表与第四列的界线
  10648. Rectangle rec3_6 = new Rectangle(p35_1.X + LeftAdd, p35_1.Y + TopAdd, ColumnWidth6, RowContentHeight);
  10649. g.DrawString(OrdPrice, ft9, b, rec3_6);//画第四列的列标题
  10650. Point p36_1 = new Point(p35_1.X + ColumnWidth6, rec3.Y);
  10651. Point p36_2 = new Point(p35_1.X + ColumnWidth6, rec3.Y + rec3.Height);
  10652. g.DrawLine(p, p36_1, p36_2);//画第二表与第三列的界线
  10653. Rectangle rec3_7 = new Rectangle(p36_1.X + LeftAdd * 2, p36_1.Y + TopAdd, ColumnWidth7, RowContentHeight);
  10654. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("套系名称"), ft9, b, rec3_7);//画第三列的列标题
  10655. Point p37_1 = new Point(p36_1.X + ColumnWidth7, rec3.Y);
  10656. Point p37_2 = new Point(p36_1.X + ColumnWidth7, rec3.Y + rec3.Height);
  10657. g.DrawLine(p, p37_1, p37_2);//画第三表与第四列的界线
  10658. Rectangle rec3_8 = new Rectangle(p37_1.X + LeftAdd, p37_1.Y + TopAdd, ColumnWidth8, RowContentHeight);
  10659. g.DrawString(tblOrder.Rows[0]["Ord_SeriesName"].ToString().Trim(), ft9, b, rec3_8);//画第四列的列标题
  10660. #endregion
  10661. #region 第二行
  10662. Rectangle rec4 = new Rectangle(rec3.X, rec3.Y + rec3.Height, rec3.Width, RowHeight);
  10663. g.DrawRectangle(p, rec4);//画标题矩形
  10664. Rectangle rec4_1 = new Rectangle(rec4.X + LeftAdd * 2, rec4.Y + TopAdd, ColumnWidth1, RowContentHeight);
  10665. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("女士姓名"), ft9, b, rec4_1);//画第一列的列标题
  10666. Point p41_1 = new Point(rec4.X + ColumnWidth1, rec4.Y);
  10667. Point p41_2 = new Point(rec4.X + ColumnWidth1, rec4.Y + rec4.Height);
  10668. g.DrawLine(p, p41_1, p41_2);//画第一表与第二列的界线
  10669. Rectangle rec4_2 = new Rectangle(p41_1.X + LeftAdd, p41_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
  10670. g.DrawString(WName, ft9, b, rec4_2);//画第二列的列标题
  10671. Point p42_1 = new Point(p41_1.X + ColumnWidth2, rec4.Y);
  10672. Point p42_2 = new Point(p41_1.X + ColumnWidth2, rec4.Y + rec4.Height);
  10673. g.DrawLine(p, p42_1, p42_2);//画第二表与第三列的界线
  10674. Rectangle rec4_3 = new Rectangle(p42_1.X + LeftAdd * 2, p42_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
  10675. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("女士电话"), ft9, b, rec4_3);//画第三列的列标题
  10676. Point p43_1 = new Point(p42_1.X + ColumnWidth3, rec4.Y);
  10677. Point p43_2 = new Point(p42_1.X + ColumnWidth3, rec4.Y + rec4.Height);
  10678. g.DrawLine(p, p43_1, p43_2);//画第三表与第四列的界线
  10679. Rectangle rec4_4 = new Rectangle(p43_1.X + LeftAdd, p43_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
  10680. g.DrawString(LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls(WTelephone), ft9, b, rec4_4);//画第四列的列标题
  10681. Point p44_1 = new Point(p43_1.X + ColumnWidth4, rec4.Y);
  10682. Point p44_2 = new Point(p43_1.X + ColumnWidth4, rec4.Y + rec4.Height);
  10683. g.DrawLine(p, p44_1, p44_2);//画第二表与第三列的界线
  10684. Rectangle rec4_5 = new Rectangle(p44_1.X + LeftAdd * 2, p44_1.Y + TopAdd, ColumnWidth5, RowContentHeight);
  10685. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideArrears)
  10686. {
  10687. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("欠款"), ft9, b, rec4_5);//画第三列的列标题
  10688. }
  10689. Point p45_1 = new Point(p44_1.X + ColumnWidth5, rec4.Y);
  10690. Point p45_2 = new Point(p44_1.X + ColumnWidth5, rec4.Y + rec4.Height);
  10691. g.DrawLine(p, p45_1, p45_2);//画第三表与第四列的界线
  10692. Rectangle rec4_6 = new Rectangle(p45_1.X + LeftAdd, p45_1.Y + TopAdd, ColumnWidth6, RowContentHeight);
  10693. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideArrears)
  10694. {
  10695. g.DrawString(tblOrder.Rows[0]["Ord_OrderArrears"].ToString().Trim(), ft9, b, rec4_6);//画第四列的列标题
  10696. }
  10697. Point p46_1 = new Point(p45_1.X + ColumnWidth6, rec4.Y);
  10698. Point p46_2 = new Point(p45_1.X + ColumnWidth6, rec4.Y + rec4.Height);
  10699. g.DrawLine(p, p46_1, p46_2);//画第二表与第三列的界线
  10700. Rectangle rec4_7 = new Rectangle(p46_1.X + LeftAdd * 2, p46_1.Y + TopAdd, ColumnWidth7, RowContentHeight);
  10701. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("结婚日期"), ft9, b, rec4_7);//画第三列的列标题
  10702. Point p47_1 = new Point(p46_1.X + ColumnWidth7, rec4.Y);
  10703. Point p47_2 = new Point(p46_1.X + ColumnWidth7, rec4.Y + rec4.Height);
  10704. g.DrawLine(p, p47_1, p47_2);//画第三表与第四列的界线
  10705. Rectangle rec4_8 = new Rectangle(p47_1.X + LeftAdd, p47_1.Y + TopAdd, ColumnWidth8, RowContentHeight);
  10706. g.DrawString(DayForMarriage, ft9, b, rec4_8);//画第四列的列标题
  10707. #endregion
  10708. #region 第三行
  10709. Rectangle rec5 = new Rectangle(rec4.X, rec4.Y + rec4.Height, rec3.Width, RowHeight);
  10710. g.DrawRectangle(p, rec5);//画标题矩形
  10711. Rectangle rec5_1 = new Rectangle(rec5.X + LeftAdd * 2, rec5.Y + TopAdd, ColumnWidth1, RowContentHeight);
  10712. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("套系金额"), ft9, b, rec5_1);//画第一列的列标题
  10713. Point p51_1 = new Point(rec5.X + ColumnWidth1, rec5.Y);
  10714. Point p51_2 = new Point(rec5.X + ColumnWidth1, rec5.Y + rec5.Height);
  10715. g.DrawLine(p, p51_1, p51_2);//画第一表与第二列的界线
  10716. Rectangle rec5_2 = new Rectangle(p51_1.X + LeftAdd, p51_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
  10717. g.DrawString(tblOrder.Rows[0]["Ord_SeriesPrice"].ToString().Trim(), ft9, b, rec5_2);//画第二列的列标题
  10718. Point p52_1 = new Point(p51_1.X + ColumnWidth2, rec5.Y);
  10719. Point p52_2 = new Point(p51_1.X + ColumnWidth2, rec5.Y + rec5.Height);
  10720. g.DrawLine(p, p52_1, p52_2);//画第二表与第三列的界线
  10721. Rectangle rec5_3 = new Rectangle(p52_1.X + LeftAdd * 11, p52_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
  10722. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
  10723. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("入册"), ft9, b, rec5_3);//画第一列的列标题
  10724. Point p53_1 = new Point(p52_1.X + ColumnWidth3, rec5.Y);
  10725. Point p53_2 = new Point(p52_1.X + ColumnWidth3, rec5.Y + rec5.Height);
  10726. g.DrawLine(p, p53_1, p53_2);//画第一表与第二列的界线
  10727. Rectangle rec5_4 = new Rectangle(p53_1.X + LeftAdd, p53_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
  10728. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
  10729. g.DrawString(IntoRegisterQuantit.ToString().Trim(), ft9, b, rec5_4);//画第二列的列标题
  10730. Point p54_1 = new Point(p43_1.X + ColumnWidth4, rec5.Y);
  10731. Point p54_2 = new Point(p43_1.X + ColumnWidth4, rec5.Y + rec5.Height);
  10732. g.DrawLine(p, p54_1, p54_2);//画第二表与第三列的界线
  10733. Rectangle rec5_5 = new Rectangle(p54_1.X + LeftAdd * 2, p54_1.Y + TopAdd, ColumnWidth5, RowContentHeight);
  10734. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
  10735. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("入底"), ft9, b, rec5_5);//画第三列的列标题
  10736. Point p55_1 = new Point(p54_1.X + ColumnWidth5, rec5.Y);
  10737. Point p55_2 = new Point(p54_1.X + ColumnWidth5, rec5.Y + rec5.Height);
  10738. g.DrawLine(p, p55_1, p55_2);//画第三表与第四列的界线
  10739. string StrIntoBottom = IntoBottomQuantity.ToString().Trim();
  10740. if (StrIntoBottom == "0")
  10741. {
  10742. StrIntoBottom = LYFZ.BLL.OtherCommonModel.FontConversion("不送");
  10743. }
  10744. else if (StrIntoBottom == "-1")
  10745. {
  10746. StrIntoBottom = LYFZ.BLL.OtherCommonModel.FontConversion("全送");
  10747. }
  10748. Rectangle rec5_6 = new Rectangle(p55_1.X + LeftAdd, p55_1.Y + TopAdd, ColumnWidth6, RowContentHeight);
  10749. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
  10750. g.DrawString(StrIntoBottom, ft9, b, rec5_6);//画第四列的列标题
  10751. Point p56_1 = new Point(p55_1.X + ColumnWidth6, rec5.Y);
  10752. Point p56_2 = new Point(p55_1.X + ColumnWidth6, rec5.Y + rec5.Height);
  10753. g.DrawLine(p, p56_1, p56_2);//画第二表与第三列的界线
  10754. Rectangle rec5_7 = new Rectangle(p56_1.X + LeftAdd * 11, p56_1.Y + TopAdd, ColumnWidth7, RowContentHeight);
  10755. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("门市"), ft9, b, rec5_7);//画第三列的列标题
  10756. Point p57_1 = new Point(p56_1.X + ColumnWidth7, rec5.Y);
  10757. Point p57_2 = new Point(p56_1.X + ColumnWidth7, rec5.Y + rec5.Height);
  10758. g.DrawLine(p, p57_1, p57_2);//画第三表与第四列的界线
  10759. Rectangle rec5_8 = new Rectangle(p57_1.X + LeftAdd, p57_1.Y + TopAdd, ColumnWidth8, RowContentHeight);
  10760. string strOrderPerson = "";
  10761. if (tblUser.Rows.Count > 0)
  10762. {
  10763. if (Convert.ToBoolean(tblUser.Rows[0]["User_PhonePrint"]) == true)
  10764. strOrderPerson = tblUser.Rows[0]["User_Name"].ToString() + " " + tblUser.Rows[0]["User_Telephone"].ToString();
  10765. else
  10766. strOrderPerson = tblUser.Rows[0]["User_Name"].ToString() + " " + tbl.Rows[0]["Company_Telephone"].ToString();
  10767. }
  10768. g.DrawString(strOrderPerson, ft9, b, rec5_8);//画第四列的列标题
  10769. #endregion
  10770. #region 第三四行
  10771. //Rectangle rec5A = new Rectangle(rec5.X, rec5.Y + rec5.Height, ColumnWidth1 + ColumnWidth2 + ColumnWidth3 + ColumnWidth4 + ColumnWidth5 + ColumnWidth6 + ColumnWidth7, RowHeight);
  10772. //g.DrawRectangle(p, rec5A);//画标题矩形
  10773. //Rectangle rec5A_1 = new Rectangle(rec5A.X + LeftAdd * 11, rec5A.Y + TopAdd, ColumnWidth1, RowContentHeight);
  10774. //g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("地址"), ft9, b, rec5A_1);//画第一列的列标题
  10775. //Point p5A1_1 = new Point(rec5A.X + ColumnWidth1, rec5A.Y);
  10776. //Point p5A1_2 = new Point(rec5A.X + ColumnWidth1, rec5A.Y + rec5A.Height);
  10777. //g.DrawLine(p, p5A1_1, p5A1_2);//画第一表与第二列的界线
  10778. //Rectangle rec5A_2 = new Rectangle(p5A1_1.X + LeftAdd, p5A1_1.Y + TopAdd, rec5A.Width - ColumnWidth1, RowContentHeight);
  10779. //g.DrawString(StrAdderss, ft9, b, rec5A_2);//画第二列的列标题
  10780. Rectangle rec5A = new Rectangle(rec5.X, rec5.Y + rec5.Height, rec3.Width, RowHeight);
  10781. g.DrawRectangle(p, rec5A);//画标题矩形
  10782. Rectangle rec5A_1 = new Rectangle(rec5A.X + LeftAdd * 2, rec5A.Y + TopAdd, ColumnWidth1, RowContentHeight);
  10783. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideClothingCount)
  10784. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("内景服装"), ft9, b, rec5A_1);//画第一列的列标题
  10785. Point p5A1_1 = new Point(rec5A.X + ColumnWidth1, rec5A.Y);
  10786. Point p5A1_2 = new Point(rec5A.X + ColumnWidth1, rec5A.Y + rec5A.Height);
  10787. g.DrawLine(p, p5A1_1, p5A1_2);//画第一表与第二列的界线
  10788. Rectangle rec5A_2 = new Rectangle(p5A1_1.X + LeftAdd, p5A1_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
  10789. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideClothingCount)
  10790. g.DrawString(InnerSights.ToString().Trim(), ft9, b, rec5A_2);//画第二列的列标题
  10791. Point p5A2_1 = new Point(p5A1_1.X + ColumnWidth2, rec5A.Y);
  10792. Point p5A2_2 = new Point(p5A1_1.X + ColumnWidth2, rec5A.Y + rec5A.Height);
  10793. g.DrawLine(p, p5A2_1, p5A2_2);//画第二表与第三列的界线
  10794. Rectangle rec5A_3 = new Rectangle(p5A2_1.X + LeftAdd * 2, p5A2_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
  10795. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideClothingCount)
  10796. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("外景服装"), ft9, b, rec5A_3);//画第一列的列标题
  10797. Point p5A3_1 = new Point(p5A2_1.X + ColumnWidth3, rec5A.Y);
  10798. Point p5A3_2 = new Point(p5A2_1.X + ColumnWidth3, rec5A.Y + rec5A.Height);
  10799. g.DrawLine(p, p5A3_1, p5A3_2);//画第一表与第二列的界线
  10800. Rectangle rec5A_4 = new Rectangle(p5A3_1.X + LeftAdd, p5A3_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
  10801. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideClothingCount)
  10802. g.DrawString(OuterSights.ToString().Trim(), ft9, b, rec5A_4);//画第二列的列标题
  10803. Point p5A4_1 = new Point(p5A3_1.X + ColumnWidth4, rec5A.Y);
  10804. Point p5A4_2 = new Point(p5A3_1.X + ColumnWidth4, rec5A.Y + rec5A.Height);
  10805. g.DrawLine(p, p5A4_1, p5A4_2);//画第二表与第三列的界线
  10806. Rectangle rec5A_5 = new Rectangle(p5A4_1.X + LeftAdd * 2, p5A4_1.Y + TopAdd, ColumnWidth5, RowContentHeight);
  10807. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("地址"), ft9, b, rec5A_5);//画第三列的列标题
  10808. Point p5A5_1 = new Point(p5A4_1.X + ColumnWidth5, rec5A.Y);
  10809. Point p5A5_2 = new Point(p5A4_1.X + ColumnWidth5, rec5A.Y + rec5A.Height);
  10810. g.DrawLine(p, p5A5_1, p5A5_2);//画第三表与第四列的界线
  10811. Rectangle rec5A_6 = new Rectangle(p5A5_1.X + LeftAdd, p5A5_1.Y + TopAdd, ColumnWidth5 + ColumnWidth6 + ColumnWidth7 + ColumnWidth8, RowContentHeight);
  10812. g.DrawString(StrAdderss, ft9, b, rec5A_6);//画第四列的列标题
  10813. //Point p5A6_1 = new Point(p5A5_1.X + ColumnWidth6, rec5A.Y);
  10814. //Point p5A6_2 = new Point(p5A5_1.X + ColumnWidth6, rec5A.Y + rec5A.Height);
  10815. //g.DrawLine(p, p5A6_1, p5A6_2);//画第二表与第三列的界线
  10816. //Rectangle rec5A_7 = new Rectangle(p5A6_1.X + LeftAdd * 11, p5A6_1.Y + TopAdd, ColumnWidth7, RowContentHeight);
  10817. //g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("门市"), ft9, b, rec5A_7);//画第三列的列标题
  10818. //Point p5A7_1 = new Point(p5A6_1.X + ColumnWidth7, rec5A.Y);
  10819. //Point p5A7_2 = new Point(p5A6_1.X + ColumnWidth7, rec5A.Y + rec5A.Height);
  10820. //g.DrawLine(p, p5A7_1, p5A7_2);//画第三表与第四列的界线
  10821. //Rectangle rec5A_8 = new Rectangle(p5A7_1.X + LeftAdd, p5A7_1.Y + TopAdd, ColumnWidth8, RowContentHeight);
  10822. //g.DrawString(tblOrder.Rows[0]["OrdPe_OrdersPerson"].ToString().Trim(), ft9, b, rec5A_8);//画第四列的列标题
  10823. #endregion
  10824. #region 第四行
  10825. Rectangle rec6 = new Rectangle(rec5A.X, rec5A.Y + rec5A.Height, TableWidth - ColumnWidth8 - ColumnWidth7, 315 - Rec1Height - LeftWidth);
  10826. g.DrawRectangle(p, rec6);//画标题矩形
  10827. rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("套系内容");
  10828. sizef = g.MeasureString(rec2Value, ft17);
  10829. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  10830. FtHeight = Convert.ToInt32(sizef.Height) + 1;
  10831. Rectangle rec6_1 = new Rectangle(rec6.X + LeftAdd * 2, rec6.Y + (rec6.Height / 2 - FtHeight * 2), ColumnWidth1 / 2, FtHeight * 4);
  10832. g.DrawString(rec2Value, ft13, b, rec6_1);//画第一列的列标题
  10833. Point p61_1 = new Point(rec6.X + rec6_1.Width, rec6.Y);
  10834. Point p61_2 = new Point(rec6.X + rec6_1.Width, rec6.Y + rec6.Height);
  10835. g.DrawLine(p, p61_1, p61_2);//画第一表与第二列的界线
  10836. Rectangle rec6_2 = new Rectangle(p61_1.X + LeftAdd, p61_1.Y + TopAdd, rec6.Width - rec6_1.Width - LeftAdd * 2, rec6.Height - TopAdd * 2);
  10837. g.DrawString(StrProdName, GetFontSize("婚纱预约单内容详情字体大小"), b, rec6_2);//画第二列的列标题
  10838. //Point p62_1 = new Point(p61_1.X + rec6_2.Width, rec6.Y);
  10839. //Point p62_2 = new Point(p61_1.X + rec6_2.Width, rec6.Y + rec6.Height);
  10840. //g.DrawLine(p, p62_1, p62_2);//画第二表与第三列的界线
  10841. Rectangle rec6A = new Rectangle(rec6.X + rec6.Width, rec5A.Y + rec5A.Height, ColumnWidth8 + ColumnWidth7, rec6.Height);
  10842. g.DrawRectangle(p, rec6A);//画标题矩形
  10843. sizef = g.MeasureString("注意事项", ft17);
  10844. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  10845. FtHeight = Convert.ToInt32(sizef.Height) + 1;
  10846. Rectangle rec6A_1 = new Rectangle(rec6A.X + LeftAdd * 2, rec6A.Y + (rec6A.Height - FtHeight) / 2, rec6_1.Width, rec6A.Height);
  10847. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("注意事项"), ft13, b, rec6A_1);//画第三列的列标题
  10848. Point p6A1_1 = new Point(rec6A.X + rec6A_1.Width, rec6A.Y);
  10849. Point p6A1_2 = new Point(rec6A.X + rec6A_1.Width, rec6A.Y + rec6A.Height);
  10850. g.DrawLine(p, p6A1_1, p6A1_2);//画第三表与第四列的界线
  10851. StrValue = "";
  10852. if (PrintOtherData.ContainsKey("婚纱预约单注意事项说明") && PrintOtherData["婚纱预约单注意事项说明"].ToString().Trim().Length > 0)
  10853. {
  10854. StrValue = PrintOtherData["婚纱预约单注意事项说明"].ToString().Trim();
  10855. }
  10856. Rectangle rec6A_2 = new Rectangle(p6A1_1.X + LeftAdd, rec6A.Y + TopAdd, ColumnWidth8 + ColumnWidth7 - rec6A_1.Width - LeftAdd * 2, rec6.Height - TopAdd * 2);
  10857. g.DrawString(StrValue, GetFontSize("婚纱预约单注意事项字体大小"), b, rec6A_2);//画第四列的列标题
  10858. #endregion
  10859. #region 第六行
  10860. //int SWidth = (p6A1_1.X - LeftWidth) / 6;
  10861. int SWidth = (ColumnWidth1 + ColumnWidth2 + ColumnWidth3 + ColumnWidth4 + ColumnWidth5 + ColumnWidth6 + ColumnWidth7) / 6;
  10862. int Column1 = SWidth - 20;
  10863. int Column2 = SWidth + 35;
  10864. //Rectangle rec7 = new Rectangle(rec6.X, rec6.Y + rec6.Height, p6A1_1.X - LeftWidth, RowHeight);
  10865. Rectangle rec7 = new Rectangle(rec6.X, rec6.Y + rec6.Height, ColumnWidth1 + ColumnWidth2 + ColumnWidth3 + ColumnWidth4 + ColumnWidth5 + ColumnWidth6 + ColumnWidth7 + ColumnWidth1 / 3, RowHeight);
  10866. g.DrawRectangle(p, rec7);//画标题矩形
  10867. Rectangle rec7_1 = new Rectangle(rec7.X + LeftAdd * 3, rec7.Y + TopAdd, Column1, RowContentHeight);
  10868. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("摄影师"), ft9, b, rec7_1);//画第一列的列标题
  10869. Point p71_1 = new Point(rec7.X + rec7_1.Width, rec7.Y);
  10870. Point p71_2 = new Point(rec7.X + rec7_1.Width, rec7.Y + rec7.Height);
  10871. g.DrawLine(p, p71_1, p71_2);//画第一表与第二列的界线
  10872. Rectangle rec7_2 = new Rectangle(p71_1.X + LeftAdd, p71_1.Y + TopAdd, Column2, RowContentHeight);
  10873. g.DrawString(StrPhotographer, ft9, b, rec7_2);//画第六列的列标题
  10874. Point p72_1 = new Point(p71_1.X + ColumnWidth2, rec7.Y);
  10875. Point p72_2 = new Point(p71_1.X + ColumnWidth2, rec7.Y + rec7.Height);
  10876. g.DrawLine(p, p72_1, p72_2);//画第一表与第二列的界线
  10877. Rectangle rec7_3 = new Rectangle(p72_1.X + LeftAdd, p72_1.Y + TopAdd, rec7_1.Width, RowContentHeight);
  10878. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("拍照时间"), ft9, b, rec7_3);//画第一列的列标题
  10879. Point p73_1 = new Point(p72_1.X + rec7_3.Width, rec7.Y);
  10880. Point p73_2 = new Point(p72_1.X + rec7_3.Width, rec7.Y + rec7.Height);
  10881. g.DrawLine(p, p73_1, p73_2);//画第一表与第二列的界线
  10882. Rectangle rec7_4 = new Rectangle(p73_1.X + LeftAdd, p73_1.Y + TopAdd, rec7_2.Width, RowContentHeight);
  10883. g.DrawString(StrPhotoTime, ft9, b, rec7_4);//画第六列的列标题
  10884. Point p74_1 = new Point(p73_1.X + rec7_4.Width, rec7.Y);
  10885. Point p74_2 = new Point(p73_1.X + rec7_4.Width, rec7.Y + rec7.Height);
  10886. g.DrawLine(p, p74_1, p74_2);//画第一表与第二列的界线
  10887. Rectangle rec7_5 = new Rectangle(p74_1.X + LeftAdd * 3, p74_1.Y + TopAdd, rec7_3.Width, RowContentHeight);
  10888. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("化妆师"), ft9, b, rec7_5);//画第一列的列标题
  10889. Point p75_1 = new Point(p74_1.X + rec7_5.Width, rec7.Y);
  10890. Point p75_2 = new Point(p74_1.X + rec7_5.Width, rec7.Y + rec7.Height);
  10891. g.DrawLine(p, p75_1, p75_2);//画第一表与第二列的界线
  10892. Rectangle rec7_6 = new Rectangle(p75_1.X + LeftAdd, p75_1.Y + TopAdd, rec7_4.Width, RowContentHeight);
  10893. g.DrawString(StrMakeupArtist.Trim(), ft9, b, rec7_6);//画第六列的列标题
  10894. #endregion
  10895. #region 第七行
  10896. Rectangle rec8 = new Rectangle(rec7.X, rec7.Y + rec7.Height, rec7.Width, RowHeight);
  10897. g.DrawRectangle(p, rec8);//画标题矩形
  10898. Rectangle rec8_1 = new Rectangle(rec8.X + LeftAdd * 3, rec8.Y + TopAdd, rec7_1.Width, RowContentHeight);
  10899. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("设计师"), ft9, b, rec8_1);//画第一列的列标题
  10900. Point p81_1 = new Point(rec8.X + rec7_1.Width, rec8.Y);
  10901. Point p81_2 = new Point(rec8.X + rec7_1.Width, rec8.Y + rec8.Height);
  10902. g.DrawLine(p, p81_1, p81_2);//画第一表与第二列的界线
  10903. Rectangle rec8_2 = new Rectangle(p81_1.X + LeftAdd, p81_1.Y + TopAdd, rec7_2.Width, RowContentHeight);
  10904. g.DrawString("", ft9, b, rec8_2);//画第六列的列标题
  10905. Point p82_1 = new Point(p81_1.X + ColumnWidth2, rec8.Y);
  10906. Point p82_2 = new Point(p81_1.X + ColumnWidth2, rec8.Y + rec8.Height);
  10907. g.DrawLine(p, p82_1, p82_2);//画第一表与第二列的界线
  10908. Rectangle rec8_3 = new Rectangle(p82_1.X + LeftAdd, p82_1.Y + TopAdd, rec7_1.Width, RowContentHeight);
  10909. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("选片时间"), ft9, b, rec8_3);//画第一列的列标题
  10910. Point p83_1 = new Point(p82_1.X + rec8_3.Width, rec8.Y);
  10911. Point p83_2 = new Point(p82_1.X + rec8_3.Width, rec8.Y + rec8.Height);
  10912. g.DrawLine(p, p83_1, p83_2);//画第一表与第二列的界线
  10913. Rectangle rec8_4 = new Rectangle(p83_1.X + LeftAdd, p83_1.Y + TopAdd, rec7_2.Width, RowContentHeight);
  10914. g.DrawString(StrFilmSelectionTime, ft9, b, rec8_4);//画第六列的列标题
  10915. Point p84_1 = new Point(p83_1.X + rec8_4.Width, rec8.Y);
  10916. Point p84_2 = new Point(p83_1.X + rec8_4.Width, rec8.Y + rec8.Height);
  10917. g.DrawLine(p, p84_1, p84_2);//画第一表与第二列的界线
  10918. Rectangle rec8_5 = new Rectangle(p84_1.X + LeftAdd, p84_1.Y + TopAdd, rec7_1.Width, RowContentHeight);
  10919. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("取件时间"), ft9, b, rec8_5);//画第一列的列标题
  10920. Point p85_1 = new Point(p84_1.X + rec8_5.Width, rec8.Y);
  10921. Point p85_2 = new Point(p84_1.X + rec8_5.Width, rec8.Y + rec8.Height);
  10922. g.DrawLine(p, p85_1, p85_2);//画第一表与第二列的界线
  10923. string strPickupTime = "";
  10924. if (tblPickupTime.Rows.Count > 0)
  10925. {
  10926. if (!string.IsNullOrEmpty(tblPickupTime.Rows[0]["OPlist_PickupTime"].ToString().Trim()))
  10927. {
  10928. strPickupTime = LYFZ.Command.Command_Validate.DateTimeToString(tblPickupTime.Rows[0]["OPlist_PickupTime"]);
  10929. }
  10930. }
  10931. Rectangle rec8_6 = new Rectangle(p85_1.X + LeftAdd, p85_1.Y + TopAdd, rec7_2.Width, RowContentHeight);
  10932. g.DrawString(strPickupTime, ft9, b, rec8_6);//画第六列的列标题
  10933. #endregion
  10934. #region 顾客签字
  10935. Rectangle rec8A = new Rectangle(rec7.X, rec7.Y, TableWidth - (rec7.X - LeftWidth), rec7.Height + rec8.Height);
  10936. g.DrawRectangle(p, rec8A);//画标题矩形
  10937. Rectangle rec8A_1 = new Rectangle(rec7.X + rec7.Width + LeftAdd * 2, rec8A.Y + TopAdd * 3, Column1, RowContentHeight);
  10938. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("顾客签字"), ft9, b, rec8A_1);//画第一列的列标题
  10939. Point p8A1_1 = new Point(rec8A_1.X + ColumnWidth7, rec8A.Y);
  10940. Point p8A1_2 = new Point(rec8A_1.X + ColumnWidth7, rec8A.Y + rec8A.Height);
  10941. g.DrawLine(p, p8A1_1, p8A1_2);//画第一表与第二列的界线
  10942. Rectangle rec8A_2 = new Rectangle(p8A1_1.X + LeftAdd, p8A1_1.Y + TopAdd, Column2, RowContentHeight);
  10943. if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintOrderShowPayment)
  10944. {
  10945. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("收款"), ft9, b, rec7.X + LeftAdd * 3 + 5, p8A1_2.Y + TopAdd + 2);//画第一列的列标题
  10946. g.DrawLine(p, rec7.X, p8A1_1.Y, rec7.X, p8A1_2.Y + rec8A_2.Height + 5);//画第六列的列标题
  10947. g.DrawLine(p, rec7.X + Column1, p8A1_1.Y, rec7.X + Column1, p8A1_2.Y + rec8A_2.Height + 5);//画第六列的列标题
  10948. g.DrawLine(p, rec7.X + TableWidth, p8A1_1.Y, rec7.X + TableWidth, p8A1_2.Y + rec8A_2.Height + 5);//画第六列的列标题
  10949. g.DrawLine(p, rec7.X, p8A1_2.Y + rec8A_2.Height + 5, rec7.X + TableWidth, p8A1_2.Y + rec8A_2.Height + 5);//画第六列的列标题
  10950. rec8A_2.Height += 10;
  10951. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion(strPaymentMsg), ft9, b, rec7.X + LeftAdd * 22, p8A1_2.Y + TopAdd + 2);//画第一列的列标题
  10952. }
  10953. else
  10954. {
  10955. rec8A_2.Height = 0;
  10956. }
  10957. #endregion
  10958. #region 尾行
  10959. rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("电话:") + tbl.Rows[0]["Company_Telephone"].ToString().Trim();
  10960. sizef = g.MeasureString(rec2Value, ft9);
  10961. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  10962. FtHeight = Convert.ToInt32(sizef.Height);
  10963. Rectangle rec9_1 = new Rectangle(TableWidth + LeftWidth - FtWidth, rec8.Y + rec8.Height + TopAdd + rec8A_2.Height, FtWidth, FtHeight);
  10964. g.DrawString(rec2Value, ft9, b, rec9_1);//画第一列的列标题
  10965. rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("地址:") + tbl.Rows[0]["Company_Address"].ToString().Trim();
  10966. sizef = g.MeasureString(rec2Value, ft9);
  10967. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  10968. FtHeight = Convert.ToInt32(sizef.Height);
  10969. Rectangle rec9 = new Rectangle(rec8.X, rec9_1.Y, TableWidth - rec9_1.Width - LeftWidth + rec8A_2.Height, FtHeight);
  10970. g.DrawString(rec2Value, ft9, b, rec9);//画第一列的列标题
  10971. #endregion
  10972. //bitmapDataList.Add(bitmap);
  10973. }
  10974. /// <summary>
  10975. /// 其他单获取服务商品详情数据
  10976. /// </summary>
  10977. /// <param name="g1"></param>
  10978. /// <param name="TableWidth"></param>
  10979. /// <param name="tblProductList"></param>
  10980. /// <param name="tblService"></param>
  10981. /// <param name="tblSights"></param>
  10982. /// <returns></returns>
  10983. static List<List<string>> GetProductOrServiceHelfListData(Graphics g1, int TableWidth, DataTable tblProductList, DataTable tblService, DataTable tblSights, string fontmsg = "婚纱预约单内容详情字体大小"
  10984. , bool bSign = true, string disInfo = "")
  10985. {
  10986. #region 绑定数据
  10987. List<List<string>> pListData = new List<List<string>>();
  10988. List<string> tempListData = new List<string>();
  10989. float tempDataHight = 0;
  10990. int Unit1 = TableWidth / 25;
  10991. int ColumnWidth11 = Unit1 * 3;
  10992. int ColumnWidth12 = Unit1 * 5;
  10993. int ColumnWidth13 = Unit1 * 3;
  10994. int ColumnWidth14 = Unit1 * 5;
  10995. SizeF iSizef = new SizeF();
  10996. for (int i = 0; i < tblProductList.Rows.Count; i++)
  10997. {
  10998. DataRow dr = tblProductList.Rows[i];
  10999. //SizeF iSizef = new SizeF();
  11000. if (i == 0)
  11001. {
  11002. iSizef = g1.MeasureString("商品:",
  11003. GetFontSize(fontmsg), ColumnWidth11 + ColumnWidth12 + ColumnWidth13 + ColumnWidth14);
  11004. tempDataHight += iSizef.Height;
  11005. if (tempDataHight > 280)
  11006. {
  11007. pListData.Add(tempListData);
  11008. tempListData = new List<string>();
  11009. tempDataHight = 0;
  11010. }
  11011. tempListData.Add("商品:");
  11012. }
  11013. iSizef = g1.MeasureString(dr["ProdName"].ToString().Trim(),
  11014. GetFontSize(fontmsg), ColumnWidth11 + ColumnWidth12 + ColumnWidth13 + ColumnWidth14);
  11015. tempDataHight += iSizef.Height;
  11016. if (tempDataHight > 280)
  11017. {
  11018. pListData.Add(tempListData);
  11019. tempListData = new List<string>();
  11020. tempDataHight = 0;
  11021. }
  11022. tempListData.Add(" " + dr["ProdName"].ToString().Trim());
  11023. }
  11024. for (int i = 0; i < tblService.Rows.Count; i++)
  11025. {
  11026. DataRow dr = tblService.Rows[i];
  11027. if (i == 0)
  11028. {
  11029. iSizef = g1.MeasureString("服务:",
  11030. GetFontSize(fontmsg), ColumnWidth11 + ColumnWidth12 + ColumnWidth13 + ColumnWidth14);
  11031. tempDataHight += iSizef.Height;
  11032. if (tempDataHight > 280)
  11033. {
  11034. pListData.Add(tempListData);
  11035. tempListData = new List<string>();
  11036. tempDataHight = 0;
  11037. }
  11038. tempListData.Add("服务:");
  11039. }
  11040. iSizef = g1.MeasureString(dr["ProdName"].ToString().Trim(),
  11041. GetFontSize(fontmsg), ColumnWidth11 + ColumnWidth12 + ColumnWidth13 + ColumnWidth14);
  11042. tempDataHight += iSizef.Height;
  11043. if (tempDataHight > 280)
  11044. {
  11045. pListData.Add(tempListData);
  11046. tempListData = new List<string>();
  11047. tempDataHight = 0;
  11048. }
  11049. tempListData.Add(" " + dr["ProdName"].ToString().Trim());
  11050. }
  11051. iSizef = g1.MeasureString("\r\n",
  11052. GetFontSize(fontmsg), ColumnWidth11 + ColumnWidth12 + ColumnWidth13 + ColumnWidth14);
  11053. tempDataHight += iSizef.Height;
  11054. if (tempDataHight > 280)
  11055. {
  11056. pListData.Add(tempListData);
  11057. tempListData = new List<string>();
  11058. tempDataHight = 0;
  11059. }
  11060. tempListData.Add("\r\n");
  11061. if (bSign)
  11062. {
  11063. iSizef = g1.MeasureString(LYFZ.BLL.OtherCommonModel.FontConversion("景点:"),
  11064. GetFontSize(fontmsg), ColumnWidth11 + ColumnWidth12 + ColumnWidth13 + ColumnWidth14);
  11065. tempDataHight += iSizef.Height;
  11066. if (tempDataHight > 280)
  11067. {
  11068. pListData.Add(tempListData);
  11069. tempListData = new List<string>();
  11070. tempDataHight = 0;
  11071. }
  11072. tempListData.Add(LYFZ.BLL.OtherCommonModel.FontConversion("景点:"));
  11073. for (int i = 0; i < tblSights.Rows.Count; i++)
  11074. {
  11075. string StrSights1 = "";
  11076. StrSights1 += (i + 1) + "." + tblSights.Rows[i]["Ordpg_Sights"].ToString().Trim();
  11077. StrSights1 += tblSights.Rows[i]["Ordpg_SightsRemark"].ToString().Trim();
  11078. //StrSights1 += "\r\n";
  11079. iSizef = g1.MeasureString(StrSights1,
  11080. GetFontSize(fontmsg), ColumnWidth11 + ColumnWidth12 + ColumnWidth13 + ColumnWidth14);
  11081. tempDataHight += iSizef.Height;
  11082. if (tempDataHight > 280)
  11083. {
  11084. pListData.Add(tempListData);
  11085. tempListData = new List<string>();
  11086. tempDataHight = 0;
  11087. }
  11088. tempListData.Add(" " + StrSights1);
  11089. }
  11090. }
  11091. if (!string.IsNullOrEmpty(disInfo))
  11092. {
  11093. iSizef = g1.MeasureString(disInfo,
  11094. GetFontSize(fontmsg), ColumnWidth11 + ColumnWidth12 + ColumnWidth13 + ColumnWidth14);
  11095. tempDataHight += iSizef.Height;
  11096. if (tempDataHight > 280)
  11097. {
  11098. pListData.Add(tempListData);
  11099. tempListData = new List<string>();
  11100. tempDataHight = 0;
  11101. }
  11102. tempListData.Add(" " + disInfo.Trim());
  11103. }
  11104. if (tempListData.Count > 0)
  11105. {
  11106. pListData.Add(tempListData);
  11107. }
  11108. return pListData;
  11109. #endregion
  11110. }
  11111. #endregion
  11112. #region 儿童
  11113. /// <summary>
  11114. /// 订单报表儿童版()
  11115. /// </summary>
  11116. /// <returns></returns>
  11117. private static void Child_OrderReport_Print(DataSet dtSet, Graphics g1, Size size, List<ReportPrint.SetSmallForm.PrintPreviewSmallForm.ScenicSpot2> listScenicSpot,
  11118. ref List<List<string>> pListData, int iPage)
  11119. {
  11120. int LeftWidth = 30;
  11121. Brush b = Brushes.Black;
  11122. Pen p = GetPen;
  11123. int TableWidth = size.Width - LeftWidth * 2;
  11124. DataTable tbl = dtSet.Tables["ds"];
  11125. DataTable tbl_Order = dtSet.Tables["ds1"];
  11126. DataTable tbl_Digital = dtSet.Tables["ds2"];
  11127. DataTable tbl_Sights = dtSet.Tables["ds3"];
  11128. DataTable tblPickupTime = dtSet.Tables["ds4"];//取件时间
  11129. DataTable tblProductList = dtSet.Tables["ds5"];
  11130. DataTable tblClient = dtSet.Tables["ds6"];//客户资料
  11131. DataTable tblService = dtSet.Tables["ds7"];//服务
  11132. DataTable tblStyle = dtSet.Tables["ds8"];//喜爱风格
  11133. DataTable tblPayment = dtSet.Tables["ds9"];//订单定金
  11134. DataTable tblUser = dtSet.Tables["ds11"];//订单定金
  11135. string OrdPrice = "0.00";
  11136. if (tblPayment.Rows.Count > 0)
  11137. {
  11138. OrdPrice = tblPayment.Rows[0]["Pay_AmountOf"].ToString().Trim();
  11139. }
  11140. tblStyle.PrimaryKey = new DataColumn[] { tblStyle.Columns["ID"] };
  11141. string strPaymentMsg = "";
  11142. foreach (DataRow dr in tblPayment.Rows)
  11143. {
  11144. if (!string.IsNullOrEmpty(strPaymentMsg))
  11145. {
  11146. strPaymentMsg += " ";
  11147. }
  11148. strPaymentMsg += dr["Sc_ClassName"] + ":" + dr["Pay_AmountOf"];
  11149. }
  11150. //获取影楼信息
  11151. if (tbl.Rows.Count <= 0)
  11152. {
  11153. MessageBoxCustom.Show("未设置影楼信息"); return;
  11154. }
  11155. DataTable tblIntoRB = dtSet.Tables["ds10"];//订单定金
  11156. Hashtable htDataA = new Hashtable();
  11157. Hashtable htDataB = new Hashtable();
  11158. Hashtable htDataC = new Hashtable();
  11159. for (int i = 0; i < tblIntoRB.Rows.Count; i++)
  11160. {
  11161. if (Convert.ToInt32(tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"]) > 0)
  11162. {// 送部分;
  11163. htDataA[tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"]] = tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"];
  11164. }
  11165. else if (Convert.ToInt32(tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"]) == 0)
  11166. {// 不送;
  11167. htDataB[tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"]] = tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"];
  11168. }
  11169. else
  11170. {// 全送;
  11171. htDataC[tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"]] = tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"];
  11172. }
  11173. }
  11174. // 订单的入册总数;
  11175. int IntoRegisterQuantit = 0;
  11176. // 订单的入底总数;
  11177. int IntoBottomQuantity = 0;
  11178. string StrIntoBottomQuantity = "";
  11179. bool IsSS = false;
  11180. for (int i = 0; i < tblIntoRB.Rows.Count; i++)
  11181. {
  11182. #if IGNORE
  11183. // 入册数量;
  11184. IntoRegisterQuantit += Convert.ToInt32(tblIntoRB.Rows[i]["Ordv_IntoRegisterQuantity"]);
  11185. // 入底数量;
  11186. if ((htDataA.Count > 0 && htDataB.Count > 0) || (htDataA.Count > 0 && htDataC.Count > 0) || (htDataB.Count > 0 && htDataC.Count > 0))
  11187. {
  11188. if (Convert.ToInt32(tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"]) > 0)
  11189. {
  11190. StrIntoBottomQuantity += tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"].ToString().Trim() + ",";
  11191. }
  11192. else if (Convert.ToInt32(tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"]) == 0)
  11193. {
  11194. StrIntoBottomQuantity += "不送,";
  11195. }
  11196. else
  11197. {
  11198. StrIntoBottomQuantity += "全送,";
  11199. }
  11200. IsSS = true;
  11201. }
  11202. else
  11203. {
  11204. IntoBottomQuantity += Convert.ToInt32(tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"]);
  11205. }
  11206. #else
  11207. if (listScenicSpot != null)
  11208. {
  11209. bool bViceExist = false;
  11210. foreach (ReportPrint.SetSmallForm.PrintPreviewSmallForm.ScenicSpot2 scenic in listScenicSpot)
  11211. {
  11212. if (scenic.strScenicName.Trim() == tbl_Sights.Rows[i]["Ordpg_Sights"].ToString().Trim())
  11213. {
  11214. bViceExist = true;
  11215. break;
  11216. }
  11217. }
  11218. if (!bViceExist)
  11219. continue;
  11220. }
  11221. // 累加入册数量;
  11222. IntoRegisterQuantit += Convert.ToInt32(tblIntoRB.Rows[i]["Ordv_IntoRegisterQuantity"]);
  11223. // 本次入底数量;
  11224. IntoBottomQuantity = Convert.ToInt32(tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"]);
  11225. if (IntoBottomQuantity > 0)
  11226. StrIntoBottomQuantity += IntoBottomQuantity.ToString() + ",";
  11227. else if (IntoBottomQuantity == 0)
  11228. StrIntoBottomQuantity += "不送,";
  11229. else
  11230. StrIntoBottomQuantity += "全送,";
  11231. #endif
  11232. }
  11233. if (pListData.Count == 0)
  11234. {
  11235. pListData = new List<List<string>>();
  11236. pListData = GetChildProductOrServiceListData(g1, listScenicSpot, TableWidth, tblProductList, tblService, tbl_Sights, tblIntoRB);
  11237. }
  11238. #if IGNORE
  11239. if (!IsSS)
  11240. {
  11241. if (IntoBottomQuantity > 0)
  11242. {
  11243. StrIntoBottomQuantity = IntoBottomQuantity.ToString();
  11244. }
  11245. else if (IntoBottomQuantity == 0)
  11246. {
  11247. StrIntoBottomQuantity = "不送";
  11248. }
  11249. else
  11250. {
  11251. StrIntoBottomQuantity = "全送";
  11252. }
  11253. }
  11254. #endif
  11255. StrIntoBottomQuantity = StrIntoBottomQuantity.TrimEnd(',');
  11256. #region 获取数据
  11257. string PName = "";
  11258. string PTelephone = "";
  11259. string PIDNumber = "";
  11260. string PMicroSignal = "";
  11261. string PQQ = "";
  11262. string PAddress = "";
  11263. string RName = "";
  11264. string RBirthday = "";
  11265. string RSex = "";
  11266. string RAgeString = "";
  11267. string PMemberCardNumber = "";
  11268. for (int i = 0; i < tblClient.Rows.Count; i++)
  11269. {
  11270. if (tblClient.Rows[i]["GM_Master"].ToString().Trim() == "1" && tblClient.Rows[i]["GM_ProtagonistCustomer"].ToString().Trim() == "0")
  11271. {
  11272. PName = tblClient.Rows[i]["Cus_Name"].ToString().Trim();
  11273. PTelephone = tblClient.Rows[i]["Cus_Telephone"].ToString().Trim();
  11274. PIDNumber = tblClient.Rows[i]["Cus_IDNumber"].ToString().Trim();
  11275. PMicroSignal = tblClient.Rows[i]["Cus_MicroSignal"].ToString().Trim();
  11276. PQQ = tblClient.Rows[i]["Cus_QQ"].ToString().Trim();
  11277. PAddress = tblClient.Rows[i]["Cus_Address"].ToString().Trim();
  11278. DataTable tblMember = orbll.GetView_Custom("tb_ErpMemberCard", StrWhere: "Mc_CustomerNumber = '" + tblClient.Rows[i]["Cus_CustomerNumber"].ToString().Trim() + "'", ShowColumnName: "Mc_CradNumber").Tables[0];
  11279. if (tblMember.Rows.Count > 0)
  11280. {
  11281. PMemberCardNumber = tblMember.Rows[0]["Mc_CradNumber"].ToString();
  11282. }
  11283. }
  11284. else if (tblClient.Rows[i]["GM_Master"].ToString().Trim() == "0" && tblClient.Rows[i]["GM_ProtagonistCustomer"].ToString().Trim() == "1")
  11285. {
  11286. RName = tblClient.Rows[i]["Cus_Name"].ToString().Trim();
  11287. RSex = tblClient.Rows[i]["Cus_Sex_cs"].ToString().Trim();
  11288. RAgeString = tblClient.Rows[i]["Age_String"].ToString().Trim();
  11289. if (LYFZ.Command.Command_Validate.DateTimeToString(tblClient.Rows[i]["Cus_Birthday"], "yyyy-MM-dd", tblClient.Rows[i]["Cus_BirthdayLunar"].ToString().Trim() == "1") != "")
  11290. {
  11291. RBirthday = LYFZ.Command.Command_Validate.DateTimeToString(tblClient.Rows[i]["Cus_Birthday"], "yyyy-MM-dd", tblClient.Rows[i]["Cus_BirthdayLunar"].ToString().Trim() == "1");
  11292. if (!string.IsNullOrEmpty(tblClient.Rows[i]["Cus_BirthdayLunar"].ToString().Trim()) && tblClient.Rows[i]["Cus_BirthdayLunar"].ToString().Trim() == "1")
  11293. {
  11294. RBirthday += LYFZ.BLL.OtherCommonModel.FontConversion("(农历)");
  11295. }
  11296. }
  11297. }
  11298. }
  11299. int InnerSights = 0;
  11300. int OuterSights = 0;
  11301. string Photographer = "";
  11302. string MakeupArtist = "";
  11303. string PhotographyTime = "";
  11304. string BootDivision = "";
  11305. for (int i = 0; i < tbl_Sights.Rows.Count; i++)
  11306. {
  11307. if (tbl_Sights.Rows[i]["Ordpg_SightsType"].ToString().Trim() == "1")
  11308. {
  11309. OuterSights += Convert.ToInt32(tbl_Sights.Rows[i]["Ordpg_ApparelQuantity"]);
  11310. }
  11311. else if (tbl_Sights.Rows[i]["Ordpg_SightsType"].ToString().Trim() == "0")
  11312. {
  11313. InnerSights += Convert.ToInt32(tbl_Sights.Rows[i]["Ordpg_ApparelQuantity"]);
  11314. }
  11315. if (tbl_Sights.Rows[i]["Ordpg_Photographer"].ToString().Trim() != "")
  11316. {
  11317. Photographer = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetUserName(tbl_Sights.Rows[i]["Ordpg_Photographer"]);
  11318. }
  11319. if (tbl_Sights.Rows[i]["Ordpg_MakeupArtist"].ToString().Trim() != "")
  11320. {
  11321. MakeupArtist = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetUserName(tbl_Sights.Rows[i]["Ordpg_MakeupArtist"]);
  11322. }
  11323. if (tbl_Sights.Rows[i]["Ordpg_BootDivision"].ToString().Trim() != "")
  11324. {
  11325. BootDivision = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetUserName(tbl_Sights.Rows[i]["Ordpg_BootDivision"]);
  11326. }
  11327. if (!string.IsNullOrEmpty(tbl_Sights.Rows[i]["Ordpg_ReservationPhotographyTime"].ToString()))
  11328. {
  11329. if (PhotographyTime != "")
  11330. {
  11331. if (Convert.ToDateTime(tbl_Sights.Rows[i]["Ordpg_ReservationPhotographyTime"]) < Convert.ToDateTime(PhotographyTime))
  11332. {
  11333. PhotographyTime = LYFZ.Command.Command_Validate.DateTimeToString(tbl_Sights.Rows[i]["Ordpg_ReservationPhotographyTime"]);
  11334. }
  11335. }
  11336. else
  11337. {
  11338. PhotographyTime = LYFZ.Command.Command_Validate.DateTimeToString(tbl_Sights.Rows[i]["Ordpg_ReservationPhotographyTime"]);
  11339. }
  11340. }
  11341. }
  11342. string FilmSelectionTime = "";
  11343. if (tbl_Digital.Rows.Count > 0)
  11344. {
  11345. FilmSelectionTime = LYFZ.Command.Command_Validate.DateTimeToString(tbl_Digital.Rows[0]["Ordv_FilmSelectionTime"]);
  11346. }
  11347. #endregion
  11348. Font ft17 = new Font("宋体", 17);
  11349. Font ft12 = new Font("宋体", 12);
  11350. Font ft9 = new Font("宋体", 9);
  11351. 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();
  11352. StrValue = "NO." + StrRandom(StrValue);
  11353. string strNumber = StrValue;
  11354. List<string> dataList = pListData[iPage];
  11355. //{
  11356. //Bitmap bitmap = new Bitmap(827, 1150);
  11357. Graphics g = g1;//Graphics.FromImage(bitmap);
  11358. #region LOG抬头
  11359. int Rec1Height = 0;
  11360. Rectangle rec1;
  11361. Image imgLog = CachePhoto(PhotoLogType.Child, tbl.Rows[0]["Company_UpdateDatetime"], GetReservationSingleLOG("预约儿童单LOG"));
  11362. if (imgLog != null)
  11363. {
  11364. rec1 = new Rectangle(LeftWidth, 50, TableWidth, 120);
  11365. Rectangle srcRec1 = new Rectangle(0, 0, imgLog.Width, imgLog.Height);
  11366. g.DrawImage(imgLog, rec1, srcRec1, GraphicsUnit.Pixel);
  11367. }
  11368. else
  11369. {
  11370. string StrTitle = GetReservationSingleTitle("预约儿童单标题");
  11371. SizeF srcsizef = g.MeasureString(StrTitle, ft17);
  11372. int srcFtWidth = Convert.ToInt32(srcsizef.Width);
  11373. int srcFtHeight = Convert.ToInt32(srcsizef.Height);
  11374. rec1 = new Rectangle(size.Width / 2 - srcFtWidth / 2, 50, srcFtWidth + 5, srcFtHeight);
  11375. g.DrawString(StrTitle, ft17, b, rec1);
  11376. Rec1Height = 120 - rec1.Height;
  11377. }
  11378. #endregion
  11379. int LeftAdd = 3;
  11380. int TopAdd = 6;
  11381. int RowHeight = 25;
  11382. int RowContentHeight = 18;
  11383. int Unit = TableWidth / 25;
  11384. int ColumnWidth1 = Unit * 3;
  11385. int ColumnWidth2 = Unit * 5;
  11386. int ColumnWidth3 = Unit * 3;
  11387. int ColumnWidth4 = Unit * 5;
  11388. int ColumnWidth5 = Unit * 3 - Unit / 2 + 15;
  11389. int ColumnWidth6 = TableWidth - ColumnWidth1 - ColumnWidth2 - ColumnWidth3 - ColumnWidth4 - ColumnWidth5;
  11390. #region 始行
  11391. Rectangle rec2 = new Rectangle(LeftWidth, rec1.Y + rec1.Height + 10, 1000, RowContentHeight);
  11392. 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);
  11393. //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();
  11394. //StrValue = "NO." + StrRandom(StrValue);
  11395. SizeF sizef = g.MeasureString(strNumber, ft12);
  11396. int FtWidth = Convert.ToInt32(sizef.Width) + 1;
  11397. Rectangle rec2_1 = new Rectangle(TableWidth + LeftWidth + LeftAdd - FtWidth, rec2.Y, FtWidth, RowContentHeight);
  11398. g.DrawString(strNumber, ft12, b, rec2_1);
  11399. #endregion
  11400. #region 左排
  11401. #region 第一行
  11402. Rectangle rec3 = new Rectangle(rec2.X, rec2.Y + rec2.Height, ColumnWidth1 + ColumnWidth2 + ColumnWidth3 + ColumnWidth4, RowHeight);
  11403. g.DrawRectangle(p, rec3);//画标题矩形
  11404. Rectangle rec3_1 = new Rectangle(rec3.X + LeftAdd, rec3.Y + TopAdd, ColumnWidth1, RowContentHeight);
  11405. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("宝贝姓名"), ft12, b, rec3_1);//画第一列的列标题
  11406. Point p31_1 = new Point(rec3.X + ColumnWidth1, rec3.Y);
  11407. Point p31_2 = new Point(rec3.X + ColumnWidth1, rec3.Y + rec3.Height);
  11408. g.DrawLine(p, p31_1, p31_2);//画第一表与第二列的界线
  11409. Rectangle rec3_2 = new Rectangle(p31_1.X + LeftAdd, p31_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
  11410. g.DrawString(RName, ft12, b, rec3_2);//画第二列的列标题
  11411. Point p32_1 = new Point(p31_1.X + ColumnWidth2, rec3.Y);
  11412. Point p32_2 = new Point(p31_1.X + ColumnWidth2, rec3.Y + rec3.Height);
  11413. g.DrawLine(p, p32_1, p32_2);//画第二表与第三列的界线
  11414. Rectangle rec3_3 = new Rectangle(p32_1.X + LeftAdd, p32_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
  11415. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("家长姓名"), ft12, b, rec3_3);//画第三列的列标题
  11416. Point p33_1 = new Point(p32_1.X + ColumnWidth3, rec3.Y);
  11417. Point p33_2 = new Point(p32_1.X + ColumnWidth3, rec3.Y + rec3.Height);
  11418. g.DrawLine(p, p33_1, p33_2);//画第三表与第四列的界线
  11419. Rectangle rec3_4 = new Rectangle(p33_1.X + LeftAdd, p33_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
  11420. g.DrawString(PName, ft12, b, rec3_4);//画第四列的列标题
  11421. #endregion
  11422. #region 第二行
  11423. Rectangle rec4 = new Rectangle(rec3.X, rec3.Y + rec3.Height, rec3.Width, RowHeight);
  11424. g.DrawRectangle(p, rec4);//画标题矩形
  11425. Rectangle rec4_1 = new Rectangle(rec4.X + LeftAdd, rec4.Y + TopAdd, ColumnWidth1, RowContentHeight);
  11426. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("宝贝生日"), ft12, b, rec4_1);//画第一列的列标题
  11427. Point p41_1 = new Point(rec4.X + ColumnWidth1, rec4.Y);
  11428. Point p41_2 = new Point(rec4.X + ColumnWidth1, rec4.Y + rec4.Height);
  11429. g.DrawLine(p, p41_1, p41_2);//画第一表与第二列的界线
  11430. Rectangle rec4_2 = new Rectangle(p41_1.X + LeftAdd, p41_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
  11431. g.DrawString(RBirthday, ft12, b, rec4_2);//画第二列的列标题
  11432. Point p42_1 = new Point(p41_1.X + ColumnWidth2, rec4.Y);
  11433. Point p42_2 = new Point(p41_1.X + ColumnWidth2, rec4.Y + rec4.Height);
  11434. g.DrawLine(p, p42_1, p42_2);//画第二表与第三列的界线
  11435. Rectangle rec4_3 = new Rectangle(p42_1.X + LeftAdd, p42_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
  11436. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("联系电话"), ft12, b, rec4_3);//画第三列的列标题
  11437. Point p43_1 = new Point(p42_1.X + ColumnWidth3, rec4.Y);
  11438. Point p43_2 = new Point(p42_1.X + ColumnWidth3, rec4.Y + rec4.Height);
  11439. g.DrawLine(p, p43_1, p43_2);//画第三表与第四列的界线
  11440. Rectangle rec4_4 = new Rectangle(p43_1.X + LeftAdd, p43_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
  11441. g.DrawString(LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls(PTelephone), ft12, b, rec4_4);//画第四列的列标题
  11442. #endregion
  11443. #region 第三行
  11444. Rectangle rec5 = new Rectangle(rec4.X, rec4.Y + rec4.Height, rec3.Width, RowHeight);
  11445. g.DrawRectangle(p, rec5);//画标题矩形
  11446. Rectangle rec5_1 = new Rectangle(rec5.X + LeftAdd, rec5.Y + TopAdd, ColumnWidth1, RowContentHeight);
  11447. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("性别"), ft12, b, rec5_1);//画第一列的列标题
  11448. Point p51_1 = new Point(rec5.X + ColumnWidth1 / 2, rec5.Y);
  11449. Point p51_2 = new Point(rec5.X + ColumnWidth1 / 2, rec5.Y + rec5.Height);
  11450. g.DrawLine(p, p51_1, p51_2);//画第一表与第二列的界线
  11451. Rectangle rec5_2 = new Rectangle(p51_1.X + LeftAdd, p51_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
  11452. g.DrawString(RSex, ft12, b, rec5_2);//画第二列的列标题
  11453. Point p52_1 = new Point(p41_1.X, rec5.Y);
  11454. Point p52_2 = new Point(p41_1.X, rec5.Y + rec5.Height);
  11455. g.DrawLine(p, p52_1, p52_2);//画第二表与第三列的界线
  11456. Rectangle rec5A_1 = new Rectangle(p52_1.X + LeftAdd, p52_1.Y + TopAdd, ColumnWidth1, RowContentHeight);
  11457. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("年龄"), ft12, b, rec5A_1);//画第一列的列标题
  11458. Point p51A_1 = new Point(p52_1.X + ColumnWidth1 / 2, rec5.Y);
  11459. Point p51A_2 = new Point(p52_1.X + ColumnWidth1 / 2, rec5.Y + rec5.Height);
  11460. g.DrawLine(p, p51A_1, p51A_2);//画第一表与第二列的界线
  11461. Rectangle rec5A_2 = new Rectangle(p51A_1.X + LeftAdd, p51A_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
  11462. g.DrawString(RAgeString, ft12, b, rec5A_2);//画第二列的列标题
  11463. Point p52A_1 = new Point(p42_1.X, rec5.Y);
  11464. Point p52A_2 = new Point(p42_1.X, rec5.Y + rec5.Height);
  11465. g.DrawLine(p, p52A_1, p52A_2);//画第二表与第三列的界线
  11466. Rectangle rec5_3 = new Rectangle(p52A_1.X + LeftAdd, p52A_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
  11467. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("微信"), ft12, b, rec5_3);//画第三列的列标题
  11468. Point p53_1 = new Point(p52A_1.X + ColumnWidth3, rec5.Y);
  11469. Point p53_2 = new Point(p52A_1.X + ColumnWidth3, rec5.Y + rec5.Height);
  11470. g.DrawLine(p, p53_1, p53_2);//画第三表与第四列的界线
  11471. Rectangle rec5_4 = new Rectangle(p53_1.X + LeftAdd, p53_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
  11472. g.DrawString(PMicroSignal, ft12, b, rec5_4);//画第四列的列标题
  11473. #endregion
  11474. #region 第四行
  11475. int rec5_Y = rec4.Y + rec4.Height;
  11476. int rec9Height = 0;
  11477. if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.EnabledIDNumber)
  11478. {
  11479. Rectangle rec6 = new Rectangle(rec5.X, rec5.Y + rec5.Height, rec3.Width, RowHeight);
  11480. g.DrawRectangle(p, rec6);//画标题矩形
  11481. Rectangle rec6_1 = new Rectangle(rec6.X + LeftAdd, rec6.Y + TopAdd, ColumnWidth1, RowContentHeight);
  11482. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
  11483. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("入册"), ft12, b, rec6_1);//画第一列的列标题
  11484. Point p61_1 = new Point(rec6.X + ColumnWidth1, rec6.Y);
  11485. Point p61_2 = new Point(rec6.X + ColumnWidth1, rec6.Y + rec6.Height);
  11486. g.DrawLine(p, p61_1, p61_2);//画第一表与第二列的界线
  11487. Rectangle rec6_2 = new Rectangle(p61_1.X + LeftAdd, p61_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
  11488. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
  11489. g.DrawString(IntoRegisterQuantit.ToString().Trim(), ft12, b, rec6_2);//画第二列的列标题
  11490. Point p62_1 = new Point(p61_1.X + ColumnWidth2, rec6.Y);
  11491. Point p62_2 = new Point(p61_1.X + ColumnWidth2, rec6.Y + rec6.Height);
  11492. g.DrawLine(p, p62_1, p62_2);//画第二表与第三列的界线
  11493. Rectangle rec6_3 = new Rectangle(p62_1.X + LeftAdd, p62_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
  11494. g.DrawString("QQ", ft12, b, rec6_3);//画第三列的列标题
  11495. Point p63_1 = new Point(p62_1.X + ColumnWidth3, rec6.Y);
  11496. Point p63_2 = new Point(p62_1.X + ColumnWidth3, rec6.Y + rec6.Height);
  11497. g.DrawLine(p, p63_1, p63_2);//画第三表与第四列的界线
  11498. Rectangle rec6_4 = new Rectangle(p63_1.X + LeftAdd, p63_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
  11499. g.DrawString(PQQ, ft12, b, rec6_4);//画第四列的列标题
  11500. Rectangle rec6A = new Rectangle(rec6.X, rec6.Y + rec6.Height, rec3.Width, RowHeight);
  11501. g.DrawRectangle(p, rec6A);//画标题矩形
  11502. Rectangle rec6A_1 = new Rectangle(rec6A.X + LeftAdd, rec6A.Y + TopAdd, ColumnWidth1, RowContentHeight);
  11503. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
  11504. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("入底"), ft12, b, rec6A_1);//画第一列的列标题
  11505. Point p6A1_1 = new Point(rec6A.X + ColumnWidth1, rec6A.Y);
  11506. Point p6A1_2 = new Point(rec6A.X + ColumnWidth1, rec6A.Y + rec6A.Height);
  11507. g.DrawLine(p, p6A1_1, p6A1_2);//画第一表与第二列的界线
  11508. Rectangle rec6A_2 = new Rectangle(p6A1_1.X + LeftAdd, p6A1_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
  11509. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
  11510. g.DrawString(StrIntoBottomQuantity, ft12, b, rec6A_2);//画第二列的列标题
  11511. Point p6A2_1 = new Point(p6A1_1.X + ColumnWidth2, rec6A.Y);
  11512. Point p6A2_2 = new Point(p6A1_1.X + ColumnWidth2, rec6A.Y + rec6A.Height);
  11513. g.DrawLine(p, p6A2_1, p6A2_2);//画第二表与第三列的界线
  11514. Rectangle rec6A_3 = new Rectangle(p6A2_1.X + LeftAdd, p6A2_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
  11515. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("身份证号"), ft12, b, rec6A_3);//画第三列的列标题
  11516. Point p6A3_1 = new Point(p6A2_1.X + ColumnWidth3, rec6A.Y);
  11517. Point p6A3_2 = new Point(p6A2_1.X + ColumnWidth3, rec6A.Y + rec6A.Height);
  11518. g.DrawLine(p, p6A3_1, p6A3_2);//画第三表与第四列的界线
  11519. Rectangle rec6A_4 = new Rectangle(p6A3_1.X + LeftAdd, p6A3_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
  11520. g.DrawString(PIDNumber, ft12, b, rec6A_4);//画第四列的列标题
  11521. rec5_Y = rec6A.Y + rec6A.Height;
  11522. rec9Height = RowHeight;
  11523. }
  11524. else
  11525. {
  11526. //Rectangle rec6 = new Rectangle(rec5.X, rec5.Y + rec5.Height, rec3.Width, RowHeight);
  11527. //g.DrawRectangle(p, rec6);//画标题矩形
  11528. //Rectangle rec6_1 = new Rectangle(rec6.X + LeftAdd, rec6.Y + TopAdd, ColumnWidth1, RowContentHeight);
  11529. //g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("入册"), ft9, b, rec6_1);//画第一列的列标题
  11530. //Point p61_1 = new Point(p51_1.X, rec6.Y);
  11531. //Point p61_2 = new Point(p51_1.X, rec6.Y + rec6.Height);
  11532. //g.DrawLine(p, p61_1, p61_2);//画第一表与第二列的界线
  11533. //Rectangle rec6_2 = new Rectangle(p61_1.X + LeftAdd, p61_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
  11534. //g.DrawString(IntoRegisterQuantit.ToString().Trim(), ft9, b, rec6_2);//画第二列的列标题
  11535. //Point p62_1 = new Point(p52_1.X, rec6.Y);
  11536. //Point p62_2 = new Point(p52_1.X, rec6.Y + rec6.Height);
  11537. //g.DrawLine(p, p62_1, p62_2);//画第二表与第三列的界线
  11538. //Rectangle rec6A_1 = new Rectangle(p62_1.X + LeftAdd, p62_1.Y + TopAdd, ColumnWidth1, RowContentHeight);
  11539. //g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("入底"), ft9, b, rec6A_1);//画第一列的列标题
  11540. //Point p61A_1 = new Point(p51A_1.X, rec6.Y);
  11541. //Point p61A_2 = new Point(p51A_1.X, rec6.Y + rec6.Height);
  11542. //g.DrawLine(p, p61A_1, p61A_2);//画第一表与第二列的界线
  11543. //string StrIntoBottom = IntoBottomQuantity.ToString().Trim();
  11544. //if (StrIntoBottom == "0")
  11545. //{ StrIntoBottom = LYFZ.BLL.OtherCommonModel.FontConversion("不送"); }
  11546. //else if (StrIntoBottom == "-1")
  11547. //{ StrIntoBottom = LYFZ.BLL.OtherCommonModel.FontConversion("全送"); }
  11548. //Rectangle rec6A_2 = new Rectangle(p61A_1.X + LeftAdd, p61A_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
  11549. //g.DrawString(StrIntoBottom, ft9, b, rec6A_2);//画第二列的列标题
  11550. //Point p62A_1 = new Point(p52A_1.X, rec6.Y);
  11551. //Point p62A_2 = new Point(p52A_1.X, rec6.Y + rec6.Height);
  11552. //g.DrawLine(p, p62A_1, p62A_2);//画第二表与第三列的界线
  11553. //Rectangle rec6_3 = new Rectangle(p62A_1.X + LeftAdd, p62A_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
  11554. //g.DrawString("QQ", ft9, b, rec6_3);//画第三列的列标题
  11555. //Point p63_1 = new Point(p62A_1.X + ColumnWidth3, rec6.Y);
  11556. //Point p63_2 = new Point(p62A_1.X + ColumnWidth3, rec6.Y + rec6.Height);
  11557. //g.DrawLine(p, p63_1, p63_2);//画第三表与第四列的界线
  11558. //Rectangle rec6_4 = new Rectangle(p63_1.X + LeftAdd, p63_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
  11559. //g.DrawString(PQQ, ft9, b, rec6_4);//画第四列的列标题
  11560. //rec5_Y = rec6.Y + rec6.Height;
  11561. Rectangle rec6 = new Rectangle(rec5.X, rec5.Y + rec5.Height, rec3.Width, RowHeight);
  11562. g.DrawRectangle(p, rec6);//画标题矩形
  11563. //Rectangle rec5_1 = new Rectangle(rec5.X + LeftAdd, rec5.Y + TopAdd, ColumnWidth1, RowContentHeight);
  11564. //g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("性别"), ft9, b, rec5_1);//画第一列的列标题
  11565. //Point p51_1 = new Point(rec5.X + ColumnWidth1 / 2, rec5.Y);
  11566. //Point p51_2 = new Point(rec5.X + ColumnWidth1 / 2, rec5.Y + rec5.Height);
  11567. //g.DrawLine(p, p51_1, p51_2);//画第一表与第二列的界线
  11568. Rectangle rec6_1 = new Rectangle(rec6.X + LeftAdd, rec6.Y + TopAdd, ColumnWidth1, RowContentHeight);
  11569. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
  11570. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("入册"), ft12, b, rec6_1);//画第一列的列标题
  11571. Point p61_1 = new Point(rec6.X + ColumnWidth1, rec6.Y);
  11572. Point p61_2 = new Point(rec6.X + ColumnWidth1, rec6.Y + rec6.Height);
  11573. g.DrawLine(p, p61_1, p61_2);//画第一表与第二列的界线
  11574. Rectangle rec6_2 = new Rectangle(p61_1.X + LeftAdd, p61_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
  11575. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
  11576. g.DrawString(IntoRegisterQuantit.ToString().Trim(), ft12, b, rec6_2);//画第二列的列标题
  11577. Point p62_1 = new Point(p52_1.X + ColumnWidth2, rec6.Y);
  11578. Point p62_2 = new Point(p52_1.X + ColumnWidth2, rec6.Y + rec6.Height);
  11579. g.DrawLine(p, p62_1, p62_2);//画第二表与第三列的界线
  11580. Rectangle rec6_3 = new Rectangle(p62_1.X + LeftAdd, p62_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
  11581. g.DrawString("QQ", ft12, b, rec6_3);//画第三列的列标题
  11582. Point p63_1 = new Point(p62_1.X + ColumnWidth3, rec6.Y);
  11583. Point p63_2 = new Point(p62_1.X + ColumnWidth3, rec6.Y + rec6.Height);
  11584. g.DrawLine(p, p63_1, p63_2);//画第三表与第四列的界线
  11585. Rectangle rec6_4 = new Rectangle(p63_1.X + LeftAdd, p63_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
  11586. g.DrawString(PQQ, ft12, b, rec6_4);//画第四列的列标题
  11587. Rectangle rec6A = new Rectangle(rec6.X, rec6.Y + rec6.Height, rec3.Width, RowHeight);
  11588. g.DrawRectangle(p, rec6A);//画标题矩形
  11589. Rectangle rec6A_1 = new Rectangle(rec6A.X + LeftAdd, rec6A.Y + TopAdd, ColumnWidth1, RowContentHeight);
  11590. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
  11591. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("入底"), ft12, b, rec6A_1);//画第一列的列标题
  11592. Point p61A_1 = new Point(rec6A.X + ColumnWidth1, rec6A.Y);
  11593. Point p61A_2 = new Point(rec6A.X + ColumnWidth1, rec6A.Y + rec6A.Height);
  11594. g.DrawLine(p, p61A_1, p61A_2);//画第一表与第二列的界线
  11595. //string StrIntoBottom = IntoBottomQuantity.ToString().Trim();
  11596. //if (StrIntoBottom == "0")
  11597. //{ StrIntoBottom = LYFZ.BLL.OtherCommonModel.FontConversion("不送"); }
  11598. //else if (StrIntoBottom == "-1")
  11599. //{ StrIntoBottom = LYFZ.BLL.OtherCommonModel.FontConversion("全送"); }
  11600. Rectangle rec6A_2 = new Rectangle(p61A_1.X + LeftAdd, p61A_1.Y + TopAdd, ColumnWidth2 * 3, RowContentHeight);
  11601. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
  11602. g.DrawString(StrIntoBottomQuantity, ft12, b, rec6A_2);//画第二列的列标题
  11603. Point p62A_1 = new Point(p61A_1.X, rec6A.Y);
  11604. Point p62A_2 = new Point(p61A_1.X, rec6A.Y + rec6A.Height);
  11605. g.DrawLine(p, p62A_1, p62A_2);//画第二表与第三列的界线
  11606. rec5_Y = rec6A.Y + rec6A.Height;
  11607. }
  11608. #endregion
  11609. #region 第五行
  11610. Rectangle rec7 = new Rectangle(rec3.X, rec5_Y, rec3.Width, RowHeight);
  11611. g.DrawRectangle(p, rec7);//画标题矩形
  11612. Rectangle rec7_1 = new Rectangle(rec7.X + LeftAdd, rec7.Y + TopAdd, ColumnWidth1, RowContentHeight);
  11613. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideClothingCount)
  11614. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("内景服装数"), ft12, b, rec7_1);//画第一列的列标题
  11615. Point p71_1 = new Point(rec7.X + ColumnWidth1, rec7.Y);
  11616. Point p71_2 = new Point(rec7.X + ColumnWidth1, rec7.Y + rec7.Height);
  11617. g.DrawLine(p, p71_1, p71_2);//画第一表与第二列的界线
  11618. Rectangle rec7_2 = new Rectangle(p71_1.X + LeftAdd, p71_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
  11619. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideClothingCount)
  11620. g.DrawString(InnerSights.ToString(), ft12, b, rec7_2);//画第二列的列标题
  11621. Point p72_1 = new Point(p71_1.X + ColumnWidth2, rec7.Y);
  11622. Point p72_2 = new Point(p71_1.X + ColumnWidth2, rec7.Y + rec7.Height);
  11623. g.DrawLine(p, p72_1, p72_2);//画第二表与第三列的界线
  11624. Rectangle rec7_3 = new Rectangle(p72_1.X + LeftAdd, p72_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
  11625. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideClothingCount)
  11626. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("外景服装数"), ft12, b, rec7_3);//画第三列的列标题
  11627. Point p73_1 = new Point(p72_1.X + ColumnWidth3, rec7.Y);
  11628. Point p73_2 = new Point(p72_1.X + ColumnWidth3, rec7.Y + rec7.Height);
  11629. g.DrawLine(p, p73_1, p73_2);//画第三表与第四列的界线
  11630. Rectangle rec7_4 = new Rectangle(p73_1.X + LeftAdd, p73_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
  11631. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideClothingCount)
  11632. g.DrawString(OuterSights.ToString(), ft12, b, rec7_4);//画第四列的列标题
  11633. #endregion
  11634. #region 第六行
  11635. Rectangle rec8 = new Rectangle(rec7.X, rec7.Y + rec7.Height, rec3.Width, RowHeight);
  11636. g.DrawRectangle(p, rec8);//画标题矩形
  11637. Rectangle rec8_1 = new Rectangle(rec8.X + LeftAdd, rec8.Y + TopAdd, ColumnWidth1, RowContentHeight);
  11638. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("家庭地址"), ft12, b, rec8_1);//画第一列的列标题
  11639. Point p81_1 = new Point(rec8.X + ColumnWidth1, rec8.Y);
  11640. Point p81_2 = new Point(rec8.X + ColumnWidth1, rec8.Y + rec8.Height);
  11641. g.DrawLine(p, p81_1, p81_2);//画第一表与第二列的界线
  11642. Rectangle rec8_2 = new Rectangle(p81_1.X + LeftAdd, p81_1.Y + TopAdd, rec8.Width - rec8_1.Width, RowContentHeight);
  11643. g.DrawString(PAddress, ft12, b, rec8_2);//画第六列的列标题
  11644. #endregion
  11645. #region 第七行
  11646. Rectangle rec8A = new Rectangle(rec8.X, rec8.Y + rec8.Height, rec3.Width, RowHeight);
  11647. g.DrawRectangle(p, rec8A);//画标题矩形
  11648. Rectangle rec8A_1 = new Rectangle(rec8A.X + LeftAdd, rec8A.Y + TopAdd, ColumnWidth1, RowContentHeight);
  11649. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("喜爱风格"), ft12, b, rec8A_1);//画第一列的列标题
  11650. Point p81A_1 = new Point(rec8A.X + ColumnWidth1, rec8A.Y);
  11651. Point p81A_2 = new Point(rec8A.X + ColumnWidth1, rec8A.Y + rec8A.Height);
  11652. g.DrawLine(p, p81A_1, p81A_2);//画第一表与第二列的界线
  11653. Rectangle rec8A_2 = new Rectangle(p81A_1.X + LeftAdd, p81A_1.Y + TopAdd, rec8.Width - rec8A_1.Width, RowContentHeight);
  11654. string[] OrdLovedStyle = tbl_Order.Rows[0]["Ord_LovedStyle"].ToString().Trim().Split('|');
  11655. string StrLovedStyle = "";
  11656. for (int i = 0; i < OrdLovedStyle.Length; i++)
  11657. {
  11658. if (OrdLovedStyle[i].Trim() != "")
  11659. {
  11660. string[] StrID = OrdLovedStyle[i].Trim().Split('_');
  11661. DataRow dtRow = tblStyle.Rows.Find(StrID[1].Trim());
  11662. if (dtRow != null)
  11663. {
  11664. StrLovedStyle += dtRow["Style_Name"] + ",";
  11665. }
  11666. }
  11667. }
  11668. g.DrawString(StrLovedStyle.TrimEnd(','), ft12, b, rec8A_2);//画第二列的列标题
  11669. #endregion
  11670. #region 第一列
  11671. #region 第一行
  11672. Rectangle rec9 = new Rectangle(rec8A.X, rec8A.Y + rec8A.Height, rec3.Width, 510 - RowHeight * 2 + Rec1Height - rec9Height);//1515
  11673. g.DrawRectangle(p, rec9);//画标题矩形
  11674. string strSights = "";
  11675. float _infoHeight = 0;
  11676. string orderType = Convert.ToString(tbl_Order.Rows[0]["Ord_Type"]);
  11677. string StrProdName = LYFZ.BLL.OtherCommonModel.FontConversion("详细内容:\r\n" + strSights);
  11678. Rectangle rec9_1 = new Rectangle(rec9.X + LeftAdd, rec9.Y + TopAdd, rec9.Width - LeftAdd * 2, rec9.Height - TopAdd * 2);
  11679. PrintContentData("详细内容:", g, rec9, LeftAdd, TopAdd, b, "儿童预约单内容详情字体大小", ref _infoHeight);
  11680. #region old数据详情
  11681. //int nIndex = 0;
  11682. // 遍历成长次数;
  11683. //for ( int i = 0; i < tbl_Sights.Rows.Count; i++ )
  11684. // {
  11685. // strSights = "";
  11686. // // 订单的入册总数;
  11687. // IntoRegisterQuantit = 0;
  11688. // // 订单的入底总数;
  11689. // IntoBottomQuantity = 0;
  11690. // StrIntoBottomQuantity = "0";
  11691. // if ( listScenicSpot != null )
  11692. // {
  11693. // bool bViceExist = false;
  11694. // foreach ( ReportPrint.SetSmallForm.PrintPreviewSmallForm.ScenicSpot2 scenic in listScenicSpot )
  11695. // {
  11696. // if ( scenic.strScenicName.Trim() == tbl_Sights.Rows[i]["Ordpg_Sights"].ToString().Trim() )
  11697. // {
  11698. // bViceExist = true;
  11699. // // 订单的入册总数;
  11700. // IntoRegisterQuantit = Convert.ToInt32( tblIntoRB.Select( "Ordv_ViceNumber = '" + scenic.strViceNumber + "'" )[0][0].ToString() );
  11701. // // 订单的入底总数;
  11702. // IntoBottomQuantity = Convert.ToInt32( tblIntoRB.Select( "Ordv_ViceNumber = '" + scenic.strViceNumber + "'" )[0][1].ToString() );
  11703. // if ( IntoBottomQuantity > 0 )
  11704. // StrIntoBottomQuantity = IntoBottomQuantity.ToString();
  11705. // else if ( IntoBottomQuantity == 0 )
  11706. // StrIntoBottomQuantity = "不送";
  11707. // else
  11708. // StrIntoBottomQuantity = "全送";
  11709. // break;
  11710. // }
  11711. // }
  11712. // if ( !bViceExist )
  11713. // continue;
  11714. // }
  11715. // nIndex++;
  11716. // if ( i > 0 )
  11717. // {
  11718. // strSights += "";
  11719. // }
  11720. // // 景点名称或成长名称;
  11721. // strSights += (nIndex) + "." + tbl_Sights.Rows[i]["Ordpg_Sights"].ToString().Trim();
  11722. // string FuZhuangString = "";
  11723. // if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideClothingCount)
  11724. // FuZhuangString = String.Format("服装:{0}套", tbl_Sights.Rows[i]["Ordpg_ApparelQuantity"].ToString().Trim());
  11725. // string RuDiRuCheString = "";
  11726. // if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
  11727. // RuDiRuCheString = String.Format("入册:{0}, 入底:{1}", IntoRegisterQuantit, StrIntoBottomQuantity);
  11728. // if (!String.IsNullOrWhiteSpace(FuZhuangString) && !String.IsNullOrWhiteSpace(RuDiRuCheString))
  11729. // {
  11730. // strSights += string.Format("【{0},{1}】", RuDiRuCheString, FuZhuangString);
  11731. // }
  11732. // else if (!String.IsNullOrWhiteSpace(FuZhuangString)){
  11733. // strSights += string.Format("【{0}】", FuZhuangString);
  11734. // }
  11735. // else if (!String.IsNullOrWhiteSpace(RuDiRuCheString))
  11736. // {
  11737. // strSights += string.Format("【{0}】", RuDiRuCheString);
  11738. // }
  11739. // // strSights += string.Format( "【入册:{0}, 入底:{1}, 服装:{2}套】", IntoRegisterQuantit, StrIntoBottomQuantity, tbl_Sights.Rows[i]["Ordpg_ApparelQuantity"].ToString().Trim() );
  11740. // // 景点备注或成长备注;
  11741. // if ( !string.IsNullOrEmpty( orderType ) && orderType != "1" )
  11742. // {
  11743. // if ( !string.IsNullOrEmpty( tbl_Sights.Rows[i]["Ordpg_SightsRemark"].ToString().Trim() ) )
  11744. // {
  11745. // strSights += " " + tbl_Sights.Rows[i]["Ordpg_SightsRemark"].ToString().Trim();
  11746. // }
  11747. // }
  11748. // else
  11749. // {
  11750. // if ( !string.IsNullOrEmpty( tbl_Sights.Rows[i]["Ordpg_OpenOrderRemark"].ToString().Trim() ) )
  11751. // {
  11752. // strSights += " " + tbl_Sights.Rows[i]["Ordpg_OpenOrderRemark"].ToString().Trim();
  11753. // }
  11754. // }
  11755. // PrintContentData( strSights, g, rec9, LeftAdd, TopAdd, b, "儿童预约单内容详情字体大小", ref _infoHeight );
  11756. // // 该成长次的商品记录;
  11757. // DataRow[] dtRowsA = tblProductList.Select( "OPlist_ViceNumber = '" + tbl_Sights.Rows[i]["Ordpg_ViceNumber"].ToString().Trim() + "'" );
  11758. // if ( dtRowsA.Length > 0 )
  11759. // {
  11760. // //strSights += "\r\n商品:";
  11761. // PrintContentData( " 商品:", g, rec9, LeftAdd, TopAdd, b, "儿童预约单内容详情字体大小", ref _infoHeight );
  11762. // for ( int j = 0; j < dtRowsA.Length; j++ )
  11763. // {
  11764. // PrintContentData( " " + dtRowsA[j]["ProdName"].ToString().Trim(), g, rec9, LeftAdd, TopAdd, b, "儿童预约单内容详情字体大小", ref _infoHeight );
  11765. // //strSights += dtRowsA[j]["ProdName"].ToString().Trim();
  11766. // }
  11767. // }
  11768. // // 该成长次的服务记录;
  11769. // DataRow[] dtRowsB = tblService.Select( "Ws_ViceNumber = '" + tbl_Sights.Rows[i]["Ordpg_ViceNumber"].ToString().Trim() + "'" );
  11770. // if ( dtRowsB.Length > 0 )
  11771. // {
  11772. // //strSights += "\r\n服务:";
  11773. // PrintContentData( " 服务:", g, rec9, LeftAdd, TopAdd, b, "儿童预约单内容详情字体大小", ref _infoHeight );
  11774. // for ( int j = 0; j < dtRowsB.Length; j++ )
  11775. // {
  11776. // /* if (j > 0)
  11777. // { strSights += "\r\n"; }
  11778. // strSights += dtRowsB[j]["ProdName"].ToString().Trim();*/
  11779. // PrintContentData( " " + dtRowsB[j]["ProdName"].ToString().Trim(), g, rec9, LeftAdd, TopAdd, b, "儿童预约单内容详情字体大小", ref _infoHeight );
  11780. // }
  11781. // }
  11782. //}
  11783. #endregion
  11784. foreach (string str in dataList)
  11785. {
  11786. string strName = str;
  11787. PrintContentData(" " + strName, g, rec9, LeftAdd, TopAdd, b, "儿童预约单内容详情字体大小", ref _infoHeight);
  11788. }
  11789. //g.DrawString(StrProdName, GetFontSize("儿童预约单内容详情字体大小"), b, rec9_1);//画第一列的列标题
  11790. #endregion
  11791. #region 第二行
  11792. Rectangle recA1 = new Rectangle(rec9.X, rec9.Y + rec9.Height, rec3.Width, 100);
  11793. g.DrawRectangle(p, recA1);//画标题矩形
  11794. Rectangle recA1_1 = new Rectangle(recA1.X + LeftAdd, recA1.Y + TopAdd, recA1.Width, recA1.Height - TopAdd * 2);
  11795. string disInfo = LYFZ.BLL.OtherCommonModel.FontConversion("订单备注:") + tbl_Order.Rows[0]["Ord_Remark"].ToString().Trim();
  11796. if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintOrderShowPayment)
  11797. {
  11798. disInfo += "\r\n付款:" + strPaymentMsg;
  11799. }
  11800. g.DrawString(disInfo, ft12, b, recA1_1);//画第一列的列标题
  11801. #endregion
  11802. #region 第三行
  11803. Rectangle recA2 = new Rectangle(recA1.X, recA1.Y + recA1.Height, rec3.Width, RowHeight);
  11804. g.DrawRectangle(p, recA2);//画标题矩形
  11805. Rectangle recA2_1 = new Rectangle(recA2.X + LeftAdd, recA2.Y + TopAdd, ColumnWidth1, RowContentHeight);
  11806. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("摄影师"), ft12, b, recA2_1);//画第一列的列标题
  11807. Point pA21_1 = new Point(recA2.X + ColumnWidth1, recA2.Y);
  11808. Point pA21_2 = new Point(recA2.X + ColumnWidth1, recA2.Y + recA2.Height);
  11809. g.DrawLine(p, pA21_1, pA21_2);//画第一表与第二列的界线
  11810. Rectangle recA2_2 = new Rectangle(pA21_1.X + LeftAdd, pA21_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
  11811. g.DrawString(Photographer, ft12, b, recA2_2);//画第二列的列标题
  11812. Point pA22_1 = new Point(pA21_1.X + ColumnWidth2, recA2.Y);
  11813. Point pA22_2 = new Point(pA21_1.X + ColumnWidth2, recA2.Y + recA2.Height);
  11814. g.DrawLine(p, pA22_1, pA22_2);//画第二表与第三列的界线
  11815. Rectangle recA2_3 = new Rectangle(pA22_1.X + LeftAdd, pA22_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
  11816. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("化妆师"), ft12, b, recA2_3);//画第三列的列标题
  11817. Point pA23_1 = new Point(pA22_1.X + ColumnWidth3, recA2.Y);
  11818. Point pA23_2 = new Point(pA22_1.X + ColumnWidth3, recA2.Y + recA2.Height);
  11819. g.DrawLine(p, pA23_1, pA23_2);//画第三表与第四列的界线
  11820. Rectangle recA2_4 = new Rectangle(pA23_1.X + LeftAdd, pA23_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
  11821. g.DrawString(MakeupArtist.Trim(), ft12, b, recA2_4);//画第四列的列标题
  11822. //Point pA24_1 = new Point(pA23_1.X + ColumnWidth4, recA2.Y);
  11823. //Point pA24_2 = new Point(pA23_1.X + ColumnWidth4, recA2.Y + recA2.Height);
  11824. //g.DrawLine(p, pA24_1, pA24_2);//画第四表与第五列的界线
  11825. #endregion
  11826. #region 第四行
  11827. Rectangle recA3 = new Rectangle(recA2.X, recA2.Y + recA2.Height, rec3.Width, RowHeight);
  11828. g.DrawRectangle(p, recA3);//画标题矩形
  11829. Rectangle recA3_1 = new Rectangle(recA3.X + LeftAdd, recA3.Y + TopAdd, ColumnWidth1, RowContentHeight);
  11830. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("拍摄时间"), ft12, b, recA3_1);//画第一列的列标题
  11831. Point pA31_1 = new Point(recA3.X + ColumnWidth1, recA3.Y);
  11832. Point pA31_2 = new Point(recA3.X + ColumnWidth1, recA3.Y + recA3.Height);
  11833. g.DrawLine(p, pA31_1, pA31_2);//画第一表与第二列的界线
  11834. Rectangle recA3_2 = new Rectangle(pA31_1.X + LeftAdd, pA31_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
  11835. g.DrawString(PhotographyTime, ft12, b, recA3_2);//画第二列的列标题
  11836. Point pA32_1 = new Point(pA31_1.X + ColumnWidth2, recA3.Y);
  11837. Point pA32_2 = new Point(pA31_1.X + ColumnWidth2, recA3.Y + recA3.Height);
  11838. g.DrawLine(p, pA32_1, pA32_2);//画第二表与第三列的界线
  11839. Rectangle recA3_3 = new Rectangle(pA32_1.X + LeftAdd, pA32_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
  11840. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("取件日期"), ft12, b, recA3_3);//画第三列的列标题
  11841. Point pA33_1 = new Point(pA32_1.X + ColumnWidth3, recA3.Y);
  11842. Point pA33_2 = new Point(pA32_1.X + ColumnWidth3, recA3.Y + recA3.Height);
  11843. g.DrawLine(p, pA33_1, pA33_2);//画第三表与第四列的界线
  11844. string strPickupTime = "";
  11845. if (tblPickupTime.Rows.Count > 0)
  11846. {
  11847. if (!string.IsNullOrEmpty(tblPickupTime.Rows[0]["OPlist_PickupTime"].ToString().Trim()))
  11848. {
  11849. strPickupTime = LYFZ.Command.Command_Validate.DateTimeToString(tblPickupTime.Rows[0]["OPlist_PickupTime"]);
  11850. }
  11851. }
  11852. Rectangle recA3_4 = new Rectangle(pA33_1.X + LeftAdd, pA33_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
  11853. g.DrawString(strPickupTime, ft12, b, recA3_4);//画第四列的列标题
  11854. Point pA34_1 = new Point(pA33_1.X + ColumnWidth4, recA3.Y);
  11855. Point pA34_2 = new Point(pA33_1.X + ColumnWidth4, recA3.Y + recA3.Height);
  11856. g.DrawLine(p, pA34_1, pA34_2);//画第四表与第五列的界线
  11857. #endregion
  11858. #endregion
  11859. #region 第七行
  11860. Rectangle recA4 = new Rectangle(recA3.X, recA3.Y + recA3.Height, rec3.Width, RowHeight);
  11861. g.DrawRectangle(p, recA4);//画标题矩形
  11862. Rectangle recA4_1 = new Rectangle(recA4.X + LeftAdd, recA4.Y + TopAdd, ColumnWidth1, RowContentHeight);
  11863. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("选片日期"), ft12, b, recA4_1);//画第一列的列标题
  11864. Point pA41_1 = new Point(recA4.X + ColumnWidth1, recA4.Y);
  11865. Point pA41_2 = new Point(recA4.X + ColumnWidth1, recA4.Y + recA4.Height);
  11866. g.DrawLine(p, pA41_1, pA41_2);//画第一表与第二列的界线
  11867. Rectangle recA4_2 = new Rectangle(pA41_1.X + LeftAdd, pA41_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
  11868. g.DrawString(FilmSelectionTime, ft12, b, recA4_2);//画第二列的列标题
  11869. Point pA42_1 = new Point(pA41_1.X + ColumnWidth2, recA4.Y);
  11870. Point pA42_2 = new Point(pA41_1.X + ColumnWidth2, recA4.Y + recA4.Height);
  11871. g.DrawLine(p, pA42_1, pA42_2);//画第二表与第三列的界线
  11872. Rectangle recA4_3 = new Rectangle(pA42_1.X + LeftAdd, pA42_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
  11873. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("引导师"), ft12, b, recA4_3);//画第三列的列标题
  11874. Point pA43_1 = new Point(pA42_1.X + ColumnWidth3, recA4.Y);
  11875. Point pA43_2 = new Point(pA42_1.X + ColumnWidth3, recA4.Y + recA4.Height);
  11876. g.DrawLine(p, pA43_1, pA43_2);//画第三表与第四列的界线
  11877. Rectangle recA4_4 = new Rectangle(pA43_1.X + LeftAdd, pA43_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
  11878. g.DrawString(BootDivision, ft12, b, recA4_4);//画第四列的列标题
  11879. #endregion
  11880. #endregion
  11881. #region 右排
  11882. #region 第一行
  11883. Rectangle Rrec3 = new Rectangle(rec3.X + rec3.Width, rec3.Y, ColumnWidth5 + ColumnWidth6, RowHeight);
  11884. g.DrawRectangle(p, Rrec3);//画标题矩形
  11885. Rectangle Rrec3_5 = new Rectangle(Rrec3.X + LeftAdd, Rrec3.Y + TopAdd, ColumnWidth5, RowContentHeight);
  11886. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("套系名称"), ft12, b, Rrec3_5);//画第五列的列标题
  11887. Point Rp35_1 = new Point(Rrec3.X + ColumnWidth5, Rrec3.Y);
  11888. Point Rp35_2 = new Point(Rrec3.X + ColumnWidth5, Rrec3.Y + Rrec3.Height);
  11889. g.DrawLine(p, Rp35_1, Rp35_2);//画第五表与第六列的界线
  11890. Rectangle Rrec3_6 = new Rectangle(Rp35_1.X + LeftAdd, Rrec3_5.Y, ColumnWidth6, RowContentHeight);
  11891. g.DrawString(tbl_Order.Rows[0]["Ord_SeriesName"].ToString().Trim(), ft12, b, Rrec3_6);//画第六列的列标题
  11892. #endregion
  11893. #region 第二行
  11894. Rectangle Rrec4 = new Rectangle(Rrec3.X, Rrec3.Y + Rrec3.Height, Rrec3.Width, RowHeight);
  11895. g.DrawRectangle(p, Rrec4);//画标题矩形
  11896. Rectangle Rrec4_5 = new Rectangle(Rrec4.X + LeftAdd, Rrec4.Y + TopAdd, ColumnWidth5, RowContentHeight);
  11897. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("套系金额"), ft12, b, Rrec4_5);//画第五列的列标题
  11898. Point Rp45_1 = new Point(Rp35_1.X, Rrec4.Y);
  11899. Point Rp45_2 = new Point(Rp35_1.X, Rrec4.Y + Rrec4.Height);
  11900. g.DrawLine(p, Rp45_1, Rp45_2);//画第五表与第六列的界线
  11901. Rectangle Rrec4_6 = new Rectangle(Rp45_1.X + LeftAdd, Rrec4_5.Y, ColumnWidth6, RowContentHeight);
  11902. g.DrawString(tbl_Order.Rows[0]["Ord_SeriesPrice"].ToString().Trim(), ft12, b, Rrec4_6);//画第六列的列标题
  11903. #endregion
  11904. #region 第三行
  11905. Rectangle Rrec5 = new Rectangle(Rrec4.X, Rrec4.Y + Rrec4.Height, Rrec3.Width, RowHeight);
  11906. g.DrawRectangle(p, Rrec5);//画标题矩形
  11907. Rectangle Rrec5_5 = new Rectangle(Rrec5.X + LeftAdd, Rrec5.Y + TopAdd, ColumnWidth5, RowContentHeight);
  11908. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("定金"), ft12, b, Rrec5_5);//画第五列的列标题
  11909. Point Rp55_1 = new Point(Rp45_1.X, Rrec5.Y);
  11910. Point Rp55_2 = new Point(Rp45_1.X, Rrec5.Y + Rrec5.Height);
  11911. g.DrawLine(p, Rp55_1, Rp55_2);//画第五表与第六列的界线
  11912. Rectangle Rrec5_6 = new Rectangle(Rp55_1.X + LeftAdd, Rrec5_5.Y, ColumnWidth6, RowContentHeight);
  11913. g.DrawString(OrdPrice, ft12, b, Rrec5_6);//画第六列的列标题
  11914. #endregion
  11915. #region 第四行
  11916. Rectangle Rrec6 = new Rectangle(Rrec5.X, Rrec5.Y + Rrec5.Height, Rrec3.Width, RowHeight);
  11917. g.DrawRectangle(p, Rrec6);//画标题矩形
  11918. Rectangle Rrec6_5 = new Rectangle(Rrec6.X + LeftAdd, Rrec6.Y + TopAdd, ColumnWidth5, RowContentHeight);
  11919. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideArrears)
  11920. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("余款金额"), ft12, b, Rrec6_5);//画第五列的列标题
  11921. Point Rp65_1 = new Point(Rp55_1.X, Rrec6.Y);
  11922. Point Rp65_2 = new Point(Rp55_1.X, Rrec6.Y + Rrec6.Height);
  11923. g.DrawLine(p, Rp65_1, Rp65_2);//画第五表与第六列的界线
  11924. Rectangle Rrec6_6 = new Rectangle(Rp65_1.X + LeftAdd, Rrec6_5.Y, ColumnWidth6, RowContentHeight);
  11925. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideArrears)
  11926. g.DrawString(tbl_Order.Rows[0]["Ord_OrderArrears"].ToString().Trim(), ft12, b, Rrec6_6);//画第六列的列标题
  11927. #endregion
  11928. #region 第六行: 门市姓名和电话;
  11929. Rectangle Rrec8 = new Rectangle(Rrec6.X, Rrec6.Y + Rrec6.Height, Rrec3.Width, RowHeight);
  11930. g.DrawRectangle(p, Rrec8);//画标题矩形
  11931. Rectangle Rrec8_5 = new Rectangle(Rrec8.X + LeftAdd, Rrec8.Y + TopAdd, ColumnWidth5, RowContentHeight);
  11932. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("门市"), ft12, b, Rrec8_5);//画第五列的列标题
  11933. Point Rp85_1 = new Point(Rp65_1.X, Rrec8.Y);
  11934. Point Rp85_2 = new Point(Rp65_1.X, Rrec8.Y + Rrec8.Height);
  11935. g.DrawLine(p, Rp85_1, Rp85_2);//画第五表与第六列的界线
  11936. string strOrderPerson = "";
  11937. Rectangle rec8_6 = new Rectangle(Rp85_1.X, Rrec8_5.Y, ColumnWidth6, RowContentHeight);
  11938. if (tblUser.Rows.Count > 0)
  11939. {
  11940. if (Convert.ToBoolean(tblUser.Rows[0]["User_PhonePrint"]) == true)
  11941. strOrderPerson = tblUser.Rows[0]["User_Name"].ToString() + " " + tblUser.Rows[0]["User_Telephone"].ToString();
  11942. else
  11943. strOrderPerson = tblUser.Rows[0]["User_Name"].ToString() + " " + tbl.Rows[0]["Company_Telephone"].ToString();
  11944. }
  11945. g.DrawString(strOrderPerson, ft12, b, rec8_6);//画第六列的列标题
  11946. #endregion
  11947. #region 第七行: 顾客会员卡号;
  11948. Rectangle rcRow7 = new Rectangle(Rrec8.X, Rrec8.Y + Rrec8.Height, Rrec3.Width, RowHeight);
  11949. g.DrawRectangle(p, rcRow7);
  11950. Rectangle rcRow7Cell1 = new Rectangle(rcRow7.X + LeftAdd, rcRow7.Y + TopAdd, ColumnWidth5, RowContentHeight);
  11951. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("会员卡"), ft12, b, rcRow7Cell1);
  11952. Point ptRow7CellTop = new Point(Rp85_1.X, rcRow7.Y);
  11953. Point ptRow7CellBottom = new Point(Rp85_1.X, rcRow7.Y + rcRow7.Height);
  11954. g.DrawLine(p, ptRow7CellTop, ptRow7CellBottom);
  11955. Rectangle rcRow7Cell2 = new Rectangle(ptRow7CellTop.X, rcRow7Cell1.Y, ColumnWidth6, RowContentHeight);
  11956. g.DrawString(PMemberCardNumber, ft12, b, rcRow7Cell2);
  11957. #endregion
  11958. #region 第一列
  11959. Rectangle Rrec10 = new Rectangle(rcRow7.X, rcRow7.Y + rcRow7.Height, Rrec3.Width, recA2.Y - rcRow7.Y);
  11960. g.DrawRectangle(p, Rrec10);//画标题矩形
  11961. StrValue = "";
  11962. if (PrintOtherData.ContainsKey("儿童预约单注意事项说明") && PrintOtherData["儿童预约单注意事项说明"].ToString().Trim().Length > 0)
  11963. {
  11964. StrValue = PrintOtherData["儿童预约单注意事项说明"].ToString().Trim();
  11965. }
  11966. Rectangle rec10_1 = new Rectangle(Rrec10.X + LeftAdd, Rrec10.Y + TopAdd, Rrec10.Width - LeftAdd * 2, Rrec10.Height - TopAdd * 2);
  11967. Font scaleFont = PrinterDrawMethod.ComputeAutoScaleFont(g, LYFZ.BLL.OtherCommonModel.FontConversion("注意事项:\r\n") + StrValue, rec10_1, GetFontSize("儿童预约单注意事项字体大小"), minFontSize: 6);
  11968. PrinterDrawMethod.DrawCellTextAutroWrap(g, LYFZ.BLL.OtherCommonModel.FontConversion("注意事项:\r\n") + StrValue, rec10_1, scaleFont, autoWrap: true, nWrapLineSpace: 1, showFrame: false);
  11969. #endregion
  11970. #region 顾客签字
  11971. Rectangle RrecA5 = new Rectangle(Rrec10.X, Rrec10.Y + Rrec10.Height, Rrec3.Width, RowHeight * 2);
  11972. g.DrawRectangle(p, RrecA5);//画标题矩形
  11973. Rectangle RrecA5_1 = new Rectangle(RrecA5.X + LeftAdd, RrecA5.Y + RowContentHeight, ColumnWidth5, RowContentHeight);
  11974. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("顾客签字"), ft12, b, RrecA5_1);//画第五列的列标题
  11975. Point RpA51_1 = new Point(Rp65_1.X, RrecA5.Y);
  11976. Point RpA51_2 = new Point(Rp65_1.X, RrecA5.Y + RrecA5.Height);
  11977. g.DrawLine(p, RpA51_1, RpA51_2);//画第四表与第五列的界线
  11978. #endregion
  11979. #endregion
  11980. #region 尾行
  11981. string rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("网址:") + tbl.Rows[0]["Company_URL"].ToString().Trim();
  11982. sizef = g.MeasureString(rec2Value, ft9);
  11983. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  11984. int FtHeight = Convert.ToInt32(sizef.Height);
  11985. Rectangle recA6_1 = new Rectangle(TableWidth + LeftWidth - FtWidth, recA4.Y + recA4.Height + TopAdd, FtWidth, FtHeight);
  11986. g.DrawString(rec2Value, ft9, b, recA6_1);//画第一列的列标题
  11987. Rectangle recA6 = new Rectangle(recA4.X, recA6_1.Y, TableWidth - recA6_1.Width - 50, FtHeight);
  11988. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("地址:") + tbl.Rows[0]["Company_Address"].ToString().Trim(), ft9, b, recA6);//画第一列的列标题
  11989. Rectangle recA7 = new Rectangle(recA6.X, recA6.Y + recA6.Height, recA6.Width, FtHeight);
  11990. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("电话:") + tbl.Rows[0]["Company_Telephone"].ToString().Trim(), ft9, b, recA7);//画第一列的列标题
  11991. rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("页:") + (iPage + 1) + "/" + pListData.Count;
  11992. sizef = g.MeasureString(rec2Value, ft9);
  11993. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  11994. FtHeight = Convert.ToInt32(sizef.Height);
  11995. Rectangle recA8 = new Rectangle(TableWidth + LeftWidth - FtWidth, recA7.Y + recA7.Height - TopAdd, FtWidth, FtHeight);
  11996. g.DrawString(rec2Value, ft9, b, recA8);//画第一列的列标题
  11997. #endregion
  11998. //bitmapDataList.Add(bitmap);
  11999. }
  12000. /// <summary>
  12001. /// 获取儿童单的商品服务详情列表
  12002. /// </summary>
  12003. /// <param name="g1"></param>
  12004. /// <param name="TableWidth"></param>
  12005. /// <param name="tblProductList"></param>
  12006. /// <param name="tblService"></param>
  12007. /// <param name="tblSights"></param>
  12008. /// <returns></returns>
  12009. static List<List<string>> GetChildProductOrServiceListData(Graphics g1, List<ReportPrint.SetSmallForm.PrintPreviewSmallForm.ScenicSpot2> listScenicSpot,
  12010. int TableWidth, DataTable tblProductList, DataTable tblService, DataTable tblSights,DataTable tblIntoRB)
  12011. {
  12012. List<List<string>> pListData = new List<List<string>>();
  12013. List<string> tempListData = new List<string>();
  12014. float tempDataHight = 0;
  12015. int Unit1 = TableWidth / 25;
  12016. int ColumnWidth11 = Unit1 * 3;
  12017. int ColumnWidth12 = Unit1 * 5;
  12018. int ColumnWidth13 = Unit1 * 3;
  12019. int ColumnWidth14 = Unit1 * 5;
  12020. SizeF iSizef = new SizeF();
  12021. int nIndex = 0;
  12022. string strSights = "";
  12023. int IntoRegisterQuantit = 0;
  12024. int IntoBottomQuantity = 0;
  12025. string StrIntoBottomQuantity = "";
  12026. // 遍历成长次数;
  12027. for (int i = 0; i < tblSights.Rows.Count; i++)
  12028. {
  12029. strSights = "";
  12030. // 订单的入册总数;
  12031. IntoRegisterQuantit = 0;
  12032. // 订单的入底总数;
  12033. IntoBottomQuantity = 0;
  12034. StrIntoBottomQuantity = "0";
  12035. if (listScenicSpot != null)
  12036. {
  12037. bool bViceExist = false;
  12038. foreach (ReportPrint.SetSmallForm.PrintPreviewSmallForm.ScenicSpot2 scenic in listScenicSpot)
  12039. {
  12040. if (scenic.strScenicName.Trim() == tblSights.Rows[i]["Ordpg_Sights"].ToString().Trim())
  12041. {
  12042. bViceExist = true;
  12043. // 订单的入册总数;
  12044. IntoRegisterQuantit = Convert.ToInt32(tblIntoRB.Select("Ordv_ViceNumber = '" + scenic.strViceNumber + "'")[0][0].ToString());
  12045. // 订单的入底总数;
  12046. IntoBottomQuantity = Convert.ToInt32(tblIntoRB.Select("Ordv_ViceNumber = '" + scenic.strViceNumber + "'")[0][1].ToString());
  12047. if (IntoBottomQuantity > 0)
  12048. StrIntoBottomQuantity = IntoBottomQuantity.ToString();
  12049. else if (IntoBottomQuantity == 0)
  12050. StrIntoBottomQuantity = "不送";
  12051. else
  12052. StrIntoBottomQuantity = "全送";
  12053. break;
  12054. }
  12055. }
  12056. if (!bViceExist)
  12057. continue;
  12058. }
  12059. nIndex++;
  12060. if (i > 0)
  12061. {
  12062. strSights += "";
  12063. }
  12064. // 景点名称或成长名称;
  12065. strSights += (nIndex) + "." + tblSights.Rows[i]["Ordpg_Sights"].ToString().Trim();
  12066. string FuZhuangString = "";
  12067. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideClothingCount)
  12068. FuZhuangString = String.Format("服装:{0}套", tblSights.Rows[i]["Ordpg_ApparelQuantity"].ToString().Trim());
  12069. string RuDiRuCheString = "";
  12070. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
  12071. RuDiRuCheString = String.Format("入册:{0}, 入底:{1}", IntoRegisterQuantit, StrIntoBottomQuantity);
  12072. if (!String.IsNullOrWhiteSpace(FuZhuangString) && !String.IsNullOrWhiteSpace(RuDiRuCheString))
  12073. {
  12074. strSights += string.Format("【{0},{1}】", RuDiRuCheString, FuZhuangString);
  12075. }
  12076. else if (!String.IsNullOrWhiteSpace(FuZhuangString))
  12077. {
  12078. strSights += string.Format("【{0}】", FuZhuangString);
  12079. }
  12080. else if (!String.IsNullOrWhiteSpace(RuDiRuCheString))
  12081. {
  12082. strSights += string.Format("【{0}】", RuDiRuCheString);
  12083. }
  12084. // strSights += string.Format( "【入册:{0}, 入底:{1}, 服装:{2}套】", IntoRegisterQuantit, StrIntoBottomQuantity, tbl_Sights.Rows[i]["Ordpg_ApparelQuantity"].ToString().Trim() );
  12085. // 景点备注或成长备注;
  12086. //if (!string.IsNullOrEmpty(orderType) && orderType != "1")
  12087. //{
  12088. // if (!string.IsNullOrEmpty(tbl_Sights.Rows[i]["Ordpg_SightsRemark"].ToString().Trim()))
  12089. // {
  12090. // strSights += " " + tbl_Sights.Rows[i]["Ordpg_SightsRemark"].ToString().Trim();
  12091. // }
  12092. //}
  12093. //else
  12094. //{
  12095. if (!string.IsNullOrEmpty(tblSights.Rows[i]["Ordpg_OpenOrderRemark"].ToString().Trim()))
  12096. {
  12097. strSights += " " + tblSights.Rows[i]["Ordpg_OpenOrderRemark"].ToString().Trim();
  12098. }
  12099. //}
  12100. iSizef = g1.MeasureString(strSights,
  12101. GetFontSize("儿童预约单内容详情字体大小"), ColumnWidth11 + ColumnWidth12 + ColumnWidth13 + ColumnWidth14);
  12102. tempDataHight += iSizef.Height;
  12103. if (tempDataHight > 440)
  12104. {
  12105. pListData.Add(tempListData);
  12106. tempListData = new List<string>();
  12107. tempDataHight = 0;
  12108. }
  12109. tempListData.Add(strSights);
  12110. //PrintContentData(strSights, g1, rec9, LeftAdd, TopAdd, b, "儿童预约单内容详情字体大小", ref _infoHeight);
  12111. // 该成长次的商品记录;
  12112. DataRow[] dtRowsA = tblProductList.Select("OPlist_ViceNumber = '" + tblSights.Rows[i]["Ordpg_ViceNumber"].ToString().Trim() + "'");
  12113. if (dtRowsA.Length > 0)
  12114. {
  12115. //strSights += "\r\n商品:";
  12116. //PrintContentData(" 商品:", g1, rec9, LeftAdd, TopAdd, b, "儿童预约单内容详情字体大小", ref _infoHeight);
  12117. iSizef = g1.MeasureString(" 商品:",
  12118. GetFontSize("儿童预约单内容详情字体大小"), ColumnWidth11 + ColumnWidth12 + ColumnWidth13 + ColumnWidth14);
  12119. tempDataHight += iSizef.Height;
  12120. if (tempDataHight > 440)
  12121. {
  12122. pListData.Add(tempListData);
  12123. tempListData = new List<string>();
  12124. tempDataHight = 0;
  12125. }
  12126. tempListData.Add(" 商品:");
  12127. for (int j = 0; j < dtRowsA.Length; j++)
  12128. {
  12129. //PrintContentData(" " + dtRowsA[j]["ProdName"].ToString().Trim(), g, rec9, LeftAdd, TopAdd, b, "儿童预约单内容详情字体大小", ref _infoHeight);
  12130. iSizef = g1.MeasureString(" " + dtRowsA[j]["ProdName"].ToString().Trim(),
  12131. GetFontSize("儿童预约单内容详情字体大小"), ColumnWidth11 + ColumnWidth12 + ColumnWidth13 + ColumnWidth14);
  12132. tempDataHight += iSizef.Height;
  12133. if (tempDataHight > 440)
  12134. {
  12135. pListData.Add(tempListData);
  12136. tempListData = new List<string>();
  12137. tempDataHight = 0;
  12138. }
  12139. tempListData.Add(" " + dtRowsA[j]["ProdName"].ToString().Trim());
  12140. //strSights += dtRowsA[j]["ProdName"].ToString().Trim();
  12141. }
  12142. }
  12143. // 该成长次的服务记录;
  12144. DataRow[] dtRowsB = tblService.Select("Ws_ViceNumber = '" + tblSights.Rows[i]["Ordpg_ViceNumber"].ToString().Trim() + "'");
  12145. if (dtRowsB.Length > 0)
  12146. {
  12147. //strSights += "\r\n服务:";
  12148. //PrintContentData(" 服务:", g1, rec9, LeftAdd, TopAdd, b, "儿童预约单内容详情字体大小", ref _infoHeight);
  12149. iSizef = g1.MeasureString("\r\n 服务:",
  12150. GetFontSize("儿童预约单内容详情字体大小"), ColumnWidth11 + ColumnWidth12 + ColumnWidth13 + ColumnWidth14);
  12151. tempDataHight += iSizef.Height;
  12152. if (tempDataHight > 440)
  12153. {
  12154. pListData.Add(tempListData);
  12155. tempListData = new List<string>();
  12156. tempDataHight = 0;
  12157. }
  12158. tempListData.Add("\r\n 服务:");
  12159. for (int j = 0; j < dtRowsB.Length; j++)
  12160. {
  12161. /* if (j > 0)
  12162. { strSights += "\r\n"; }
  12163. strSights += dtRowsB[j]["ProdName"].ToString().Trim();*/
  12164. //PrintContentData(" " + dtRowsB[j]["ProdName"].ToString().Trim(), g1, rec9, LeftAdd, TopAdd, b, "儿童预约单内容详情字体大小", ref _infoHeight);
  12165. iSizef = g1.MeasureString(" " + dtRowsB[j]["ProdName"].ToString().Trim(),
  12166. GetFontSize("儿童预约单内容详情字体大小"), ColumnWidth11 + ColumnWidth12 + ColumnWidth13 + ColumnWidth14);
  12167. tempDataHight += iSizef.Height;
  12168. if (tempDataHight > 440)
  12169. {
  12170. pListData.Add(tempListData);
  12171. tempListData = new List<string>();
  12172. tempDataHight = 0;
  12173. }
  12174. tempListData.Add(" " + dtRowsB[j]["ProdName"].ToString().Trim());
  12175. }
  12176. }
  12177. }
  12178. if(tempListData.Count>0)
  12179. {
  12180. pListData.Add(tempListData);
  12181. }
  12182. return pListData;
  12183. }
  12184. static List<List<string>> GetChildProductOrServiceHalfListData(Graphics g1, List<ReportPrint.SetSmallForm.PrintPreviewSmallForm.ScenicSpot2> listScenicSpot,
  12185. int TableWidth, DataTable tblProductList, DataTable tblService, DataTable tblSights, DataTable tblIntoRB,string disInfo="")
  12186. {
  12187. List<List<string>> pListData = new List<List<string>>();
  12188. List<string> tempListData = new List<string>();
  12189. float tempDataHight = 0;
  12190. int Unit1 = TableWidth / 25;
  12191. int ColumnWidth11 = Unit1 * 3;
  12192. int ColumnWidth12 = Unit1 * 5;
  12193. int ColumnWidth13 = Unit1 * 3;
  12194. int ColumnWidth14 = Unit1 * 5;
  12195. SizeF iSizef = new SizeF();
  12196. int nIndex = 0;
  12197. string strSights = "";
  12198. int IntoRegisterQuantit = 0;
  12199. int IntoBottomQuantity = 0;
  12200. string StrIntoBottomQuantity = "";
  12201. // 遍历成长次数;
  12202. for (int i = 0; i < tblSights.Rows.Count; i++)
  12203. {
  12204. strSights = "";
  12205. // 订单的入册总数;
  12206. IntoRegisterQuantit = 0;
  12207. // 订单的入底总数;
  12208. IntoBottomQuantity = 0;
  12209. StrIntoBottomQuantity = "0";
  12210. if (listScenicSpot != null)
  12211. {
  12212. bool bViceExist = false;
  12213. foreach (ReportPrint.SetSmallForm.PrintPreviewSmallForm.ScenicSpot2 scenic in listScenicSpot)
  12214. {
  12215. if (scenic.strScenicName.Trim() == tblSights.Rows[i]["Ordpg_Sights"].ToString().Trim())
  12216. {
  12217. bViceExist = true;
  12218. // 订单的入册总数;
  12219. IntoRegisterQuantit = Convert.ToInt32(tblIntoRB.Select("Ordv_ViceNumber = '" + scenic.strViceNumber + "'")[0][0].ToString());
  12220. // 订单的入底总数;
  12221. IntoBottomQuantity = Convert.ToInt32(tblIntoRB.Select("Ordv_ViceNumber = '" + scenic.strViceNumber + "'")[0][1].ToString());
  12222. if (IntoBottomQuantity > 0)
  12223. StrIntoBottomQuantity = IntoBottomQuantity.ToString();
  12224. else if (IntoBottomQuantity == 0)
  12225. StrIntoBottomQuantity = "不送";
  12226. else
  12227. StrIntoBottomQuantity = "全送";
  12228. break;
  12229. }
  12230. }
  12231. if (!bViceExist)
  12232. continue;
  12233. }
  12234. nIndex++;
  12235. if (i > 0)
  12236. {
  12237. strSights += "";
  12238. }
  12239. // 景点名称或成长名称;
  12240. strSights += (nIndex) + "." + tblSights.Rows[i]["Ordpg_Sights"].ToString().Trim();
  12241. string FuZhuangString = "";
  12242. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideClothingCount)
  12243. FuZhuangString = String.Format("服装:{0}套", tblSights.Rows[i]["Ordpg_ApparelQuantity"].ToString().Trim());
  12244. string RuDiRuCheString = "";
  12245. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
  12246. RuDiRuCheString = String.Format("入册:{0}, 入底:{1}", IntoRegisterQuantit, StrIntoBottomQuantity);
  12247. if (!String.IsNullOrWhiteSpace(FuZhuangString) && !String.IsNullOrWhiteSpace(RuDiRuCheString))
  12248. {
  12249. strSights += string.Format("【{0},{1}】", RuDiRuCheString, FuZhuangString);
  12250. }
  12251. else if (!String.IsNullOrWhiteSpace(FuZhuangString))
  12252. {
  12253. strSights += string.Format("【{0}】", FuZhuangString);
  12254. }
  12255. else if (!String.IsNullOrWhiteSpace(RuDiRuCheString))
  12256. {
  12257. strSights += string.Format("【{0}】", RuDiRuCheString);
  12258. }
  12259. // strSights += string.Format( "【入册:{0}, 入底:{1}, 服装:{2}套】", IntoRegisterQuantit, StrIntoBottomQuantity, tbl_Sights.Rows[i]["Ordpg_ApparelQuantity"].ToString().Trim() );
  12260. // 景点备注或成长备注;
  12261. //if (!string.IsNullOrEmpty(orderType) && orderType != "1")
  12262. //{
  12263. // if (!string.IsNullOrEmpty(tbl_Sights.Rows[i]["Ordpg_SightsRemark"].ToString().Trim()))
  12264. // {
  12265. // strSights += " " + tbl_Sights.Rows[i]["Ordpg_SightsRemark"].ToString().Trim();
  12266. // }
  12267. //}
  12268. //else
  12269. //{
  12270. if (!string.IsNullOrEmpty(tblSights.Rows[i]["Ordpg_OpenOrderRemark"].ToString().Trim()))
  12271. {
  12272. strSights += " " + tblSights.Rows[i]["Ordpg_OpenOrderRemark"].ToString().Trim();
  12273. }
  12274. //}
  12275. iSizef = g1.MeasureString(strSights,
  12276. GetFontSize("儿童预约单内容详情字体大小"), ColumnWidth11 + ColumnWidth12 + ColumnWidth13 + ColumnWidth14);
  12277. tempDataHight += iSizef.Height;
  12278. if (tempDataHight > 290)
  12279. {
  12280. pListData.Add(tempListData);
  12281. tempListData = new List<string>();
  12282. tempDataHight = 0;
  12283. }
  12284. tempListData.Add(strSights);
  12285. //PrintContentData(strSights, g1, rec9, LeftAdd, TopAdd, b, "儿童预约单内容详情字体大小", ref _infoHeight);
  12286. // 该成长次的商品记录;
  12287. DataRow[] dtRowsA = tblProductList.Select("OPlist_ViceNumber = '" + tblSights.Rows[i]["Ordpg_ViceNumber"].ToString().Trim() + "'");
  12288. if (dtRowsA.Length > 0)
  12289. {
  12290. //strSights += "\r\n商品:";
  12291. //PrintContentData(" 商品:", g1, rec9, LeftAdd, TopAdd, b, "儿童预约单内容详情字体大小", ref _infoHeight);
  12292. iSizef = g1.MeasureString(" 商品:",
  12293. GetFontSize("儿童预约单内容详情字体大小"), ColumnWidth11 + ColumnWidth12 + ColumnWidth13 + ColumnWidth14);
  12294. tempDataHight += iSizef.Height;
  12295. if (tempDataHight > 290)
  12296. {
  12297. pListData.Add(tempListData);
  12298. tempListData = new List<string>();
  12299. tempDataHight = 0;
  12300. }
  12301. tempListData.Add(" 商品:");
  12302. for (int j = 0; j < dtRowsA.Length; j++)
  12303. {
  12304. //PrintContentData(" " + dtRowsA[j]["ProdName"].ToString().Trim(), g, rec9, LeftAdd, TopAdd, b, "儿童预约单内容详情字体大小", ref _infoHeight);
  12305. iSizef = g1.MeasureString(" " + dtRowsA[j]["ProdName"].ToString().Trim(),
  12306. GetFontSize("儿童预约单内容详情字体大小"), ColumnWidth11 + ColumnWidth12 + ColumnWidth13 + ColumnWidth14);
  12307. tempDataHight += iSizef.Height;
  12308. if (tempDataHight > 290)
  12309. {
  12310. pListData.Add(tempListData);
  12311. tempListData = new List<string>();
  12312. tempDataHight = 0;
  12313. }
  12314. tempListData.Add(" " + dtRowsA[j]["ProdName"].ToString().Trim());
  12315. //strSights += dtRowsA[j]["ProdName"].ToString().Trim();
  12316. }
  12317. }
  12318. // 该成长次的服务记录;
  12319. DataRow[] dtRowsB = tblService.Select("Ws_ViceNumber = '" + tblSights.Rows[i]["Ordpg_ViceNumber"].ToString().Trim() + "'");
  12320. if (dtRowsB.Length > 0)
  12321. {
  12322. //strSights += "\r\n服务:";
  12323. //PrintContentData(" 服务:", g1, rec9, LeftAdd, TopAdd, b, "儿童预约单内容详情字体大小", ref _infoHeight);
  12324. iSizef = g1.MeasureString("\r\n 服务:",
  12325. GetFontSize("儿童预约单内容详情字体大小"), ColumnWidth11 + ColumnWidth12 + ColumnWidth13 + ColumnWidth14);
  12326. tempDataHight += iSizef.Height;
  12327. if (tempDataHight > 290)
  12328. {
  12329. pListData.Add(tempListData);
  12330. tempListData = new List<string>();
  12331. tempDataHight = 0;
  12332. }
  12333. tempListData.Add("\r\n 服务:");
  12334. for (int j = 0; j < dtRowsB.Length; j++)
  12335. {
  12336. /* if (j > 0)
  12337. { strSights += "\r\n"; }
  12338. strSights += dtRowsB[j]["ProdName"].ToString().Trim();*/
  12339. //PrintContentData(" " + dtRowsB[j]["ProdName"].ToString().Trim(), g1, rec9, LeftAdd, TopAdd, b, "儿童预约单内容详情字体大小", ref _infoHeight);
  12340. iSizef = g1.MeasureString(" " + dtRowsB[j]["ProdName"].ToString().Trim(),
  12341. GetFontSize("儿童预约单内容详情字体大小"), ColumnWidth11 + ColumnWidth12 + ColumnWidth13 + ColumnWidth14);
  12342. tempDataHight += iSizef.Height;
  12343. if (tempDataHight > 290)
  12344. {
  12345. pListData.Add(tempListData);
  12346. tempListData = new List<string>();
  12347. tempDataHight = 0;
  12348. }
  12349. tempListData.Add(" " + dtRowsB[j]["ProdName"].ToString().Trim());
  12350. }
  12351. }
  12352. }
  12353. if (!string.IsNullOrEmpty(disInfo))
  12354. {
  12355. iSizef = g1.MeasureString(" " + disInfo,
  12356. GetFontSize("儿童预约单内容详情字体大小"), ColumnWidth11 + ColumnWidth12 + ColumnWidth13 + ColumnWidth14);
  12357. tempDataHight += iSizef.Height;
  12358. if (tempDataHight > 290)
  12359. {
  12360. pListData.Add(tempListData);
  12361. tempListData = new List<string>();
  12362. tempDataHight = 0;
  12363. }
  12364. tempListData.Add(" " + disInfo);
  12365. }
  12366. if (tempListData.Count > 0)
  12367. {
  12368. pListData.Add(tempListData);
  12369. }
  12370. return pListData;
  12371. }
  12372. /// <summary>
  12373. /// 儿童二等份打印
  12374. /// </summary>
  12375. /// <param name="objValue"></param>
  12376. /// 18-09-20 修改 杨
  12377. private static void Child_OrderReport_TwoEqualPrint(DataSet dtSet, Graphics g1, Size size, List<ReportPrint.SetSmallForm.PrintPreviewSmallForm.ScenicSpot2> listScenicSpot
  12378. , ref List<List<string>> pListData, int iPage)
  12379. {
  12380. DataTable tbl = dtSet.Tables["ds"];
  12381. DataTable tbl_Order = dtSet.Tables["ds1"];
  12382. DataTable tbl_Digital = dtSet.Tables["ds2"];
  12383. DataTable tbl_Sights = dtSet.Tables["ds3"];
  12384. DataTable tblPickupTime = dtSet.Tables["ds4"];//取件时间
  12385. DataTable tblProductList = dtSet.Tables["ds5"];
  12386. DataTable tblClient = dtSet.Tables["ds6"];//客户资料
  12387. DataTable tblService = dtSet.Tables["ds7"];//服务
  12388. DataTable tblStyle = dtSet.Tables["ds8"];//喜爱风格
  12389. DataTable tblPayment = dtSet.Tables["ds9"];//订单定金
  12390. DataTable tblUser = dtSet.Tables["ds11"];//订单定金
  12391. string OrdPrice = "0.00";
  12392. int LeftWidth = 50;
  12393. int TableWidth = size.Width - LeftWidth * 2 + 30;
  12394. if (tblPayment.Rows.Count > 0)
  12395. {
  12396. OrdPrice = tblPayment.Rows[0]["Pay_AmountOf"].ToString().Trim();
  12397. }
  12398. tblStyle.PrimaryKey = new DataColumn[] { tblStyle.Columns["ID"] };
  12399. string strPaymentMsg = "";
  12400. foreach (DataRow dr in tblPayment.Rows)
  12401. {
  12402. if (!string.IsNullOrEmpty(strPaymentMsg))
  12403. {
  12404. strPaymentMsg += " ";
  12405. }
  12406. strPaymentMsg += dr["Sc_ClassName"] + ":" + dr["Pay_AmountOf"];
  12407. }
  12408. DataTable tblIntoRB = dtSet.Tables["ds10"];//订单定金
  12409. Hashtable htDataA = new Hashtable();
  12410. Hashtable htDataB = new Hashtable();
  12411. Hashtable htDataC = new Hashtable();
  12412. for (int i = 0; i < tblIntoRB.Rows.Count; i++)
  12413. {
  12414. if (Convert.ToInt32(tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"]) > 0)
  12415. {// 送部分;
  12416. htDataA[tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"]] = tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"];
  12417. }
  12418. else if (Convert.ToInt32(tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"]) == 0)
  12419. {// 不送;
  12420. htDataB[tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"]] = tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"];
  12421. }
  12422. else
  12423. {// 全送;
  12424. htDataC[tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"]] = tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"];
  12425. }
  12426. }
  12427. string IntoRegisterQuantitString = "";
  12428. // 订单的入册总数;
  12429. int IntoRegisterQuantit = 0;
  12430. // 订单的入底总数;
  12431. int IntoBottomQuantity = 0;
  12432. string StrIntoBottomQuantity = "";
  12433. bool IsSS = false;
  12434. for (int i = 0; i < tblIntoRB.Rows.Count; i++)
  12435. {
  12436. if (listScenicSpot != null)
  12437. {
  12438. bool bViceExist = false;
  12439. foreach (ReportPrint.SetSmallForm.PrintPreviewSmallForm.ScenicSpot2 scenic in listScenicSpot)
  12440. {
  12441. if (scenic.strScenicName.Trim() == tbl_Sights.Rows[i]["Ordpg_Sights"].ToString().Trim())
  12442. {
  12443. bViceExist = true;
  12444. break;
  12445. }
  12446. }
  12447. if (!bViceExist)
  12448. continue;
  12449. }
  12450. // 累加入册数量;
  12451. IntoRegisterQuantit += Convert.ToInt32(tblIntoRB.Rows[i]["Ordv_IntoRegisterQuantity"]);
  12452. // 本次入底数量;
  12453. IntoBottomQuantity = Convert.ToInt32(tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"]);
  12454. if (IntoBottomQuantity > 0)
  12455. StrIntoBottomQuantity += IntoBottomQuantity.ToString() + ",";
  12456. else if (IntoBottomQuantity == 0)
  12457. StrIntoBottomQuantity += "不送,";
  12458. else
  12459. StrIntoBottomQuantity += "全送,";
  12460. }
  12461. IntoRegisterQuantitString = IntoRegisterQuantit.ToString();
  12462. StrIntoBottomQuantity = StrIntoBottomQuantity.TrimEnd(',');
  12463. Brush b = Brushes.Black;
  12464. Pen p = GetPen;
  12465. Font ft17 = new Font("宋体", 17);
  12466. Font ft13 = new Font("宋体", 13);
  12467. Font ft10 = new Font("宋体", 10);
  12468. Font ft9 = new Font("宋体", 9);
  12469. #region 获取数据
  12470. string PName = "";
  12471. string PTelephone = "";
  12472. string PMicroSignal = "";
  12473. string PMemberCardNumber = "";
  12474. string RName = "";
  12475. string RBirthday = "";
  12476. string RSex = "";
  12477. string RAgeString = "";
  12478. string StrAdderss = "";
  12479. for (int i = 0; i < tblClient.Rows.Count; i++)
  12480. {
  12481. if (tblClient.Rows[i]["GM_Master"].ToString().Trim() == "1" && tblClient.Rows[i]["GM_ProtagonistCustomer"].ToString().Trim() == "0")
  12482. {
  12483. PName = tblClient.Rows[i]["Cus_Name"].ToString().Trim();
  12484. PTelephone = tblClient.Rows[i]["Cus_Telephone"].ToString().Trim();
  12485. PMicroSignal = tblClient.Rows[i]["Cus_MicroSignal"].ToString().Trim();
  12486. DataTable tblMember = orbll.GetView_Custom("tb_ErpMemberCard", StrWhere: "Mc_CustomerNumber = '" + tblClient.Rows[i]["Cus_CustomerNumber"].ToString().Trim() + "'", ShowColumnName: "Mc_CradNumber").Tables[0];
  12487. if (tblMember.Rows.Count > 0)
  12488. {
  12489. PMemberCardNumber = tblMember.Rows[0]["Mc_CradNumber"].ToString();
  12490. }
  12491. if (tblClient.Rows[i]["Cus_Address"].ToString().Trim() != "")
  12492. {
  12493. if (StrAdderss == "")
  12494. {
  12495. StrAdderss = tblClient.Rows[i]["Cus_Address"].ToString().Trim();
  12496. }
  12497. }
  12498. }
  12499. else if (tblClient.Rows[i]["GM_Master"].ToString().Trim() == "0" && tblClient.Rows[i]["GM_ProtagonistCustomer"].ToString().Trim() == "1")
  12500. {
  12501. RName = tblClient.Rows[i]["Cus_Name"].ToString().Trim();
  12502. RSex = tblClient.Rows[i]["Cus_Sex_cs"].ToString().Trim();
  12503. RAgeString = tblClient.Rows[i]["Age_String"].ToString().Trim();
  12504. if (LYFZ.Command.Command_Validate.DateTimeToString(tblClient.Rows[i]["Cus_Birthday"], "yyyy-MM-dd", tblClient.Rows[i]["Cus_BirthdayLunar"].ToString().Trim() == "1") != "")
  12505. {
  12506. RBirthday = LYFZ.Command.Command_Validate.DateTimeToString(tblClient.Rows[i]["Cus_Birthday"], "yyyy-MM-dd", tblClient.Rows[i]["Cus_BirthdayLunar"].ToString().Trim() == "1");
  12507. if (!string.IsNullOrEmpty(tblClient.Rows[i]["Cus_BirthdayLunar"].ToString().Trim()) && tblClient.Rows[i]["Cus_BirthdayLunar"].ToString().Trim() == "1")
  12508. {
  12509. RBirthday += LYFZ.BLL.OtherCommonModel.FontConversion("(农历)");
  12510. }
  12511. }
  12512. if (tblClient.Rows[i]["Cus_Address"].ToString().Trim() != "")
  12513. {
  12514. StrAdderss = tblClient.Rows[i]["Cus_Address"].ToString().Trim();
  12515. }
  12516. }
  12517. }
  12518. int InnerSights = 0;
  12519. int OuterSights = 0;
  12520. string Photographer = "";
  12521. string MakeupArtist = "";
  12522. string PhotographyTime = "";
  12523. string BootDivision = "";
  12524. for (int i = 0; i < tbl_Sights.Rows.Count; i++)
  12525. {
  12526. if (tbl_Sights.Rows[i]["Ordpg_SightsType"].ToString().Trim() == "1")
  12527. {
  12528. OuterSights += Convert.ToInt32(tbl_Sights.Rows[i]["Ordpg_ApparelQuantity"]);
  12529. }
  12530. else if (tbl_Sights.Rows[i]["Ordpg_SightsType"].ToString().Trim() == "0")
  12531. {
  12532. InnerSights += Convert.ToInt32(tbl_Sights.Rows[i]["Ordpg_ApparelQuantity"]);
  12533. }
  12534. if (tbl_Sights.Rows[i]["Ordpg_Photographer"].ToString().Trim() != "")
  12535. {
  12536. Photographer = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetUserName(tbl_Sights.Rows[i]["Ordpg_Photographer"]);
  12537. }
  12538. if (tbl_Sights.Rows[i]["Ordpg_MakeupArtist"].ToString().Trim() != "")
  12539. {
  12540. MakeupArtist = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetUserName(tbl_Sights.Rows[i]["Ordpg_MakeupArtist"]);
  12541. }
  12542. if (tbl_Sights.Rows[i]["Ordpg_BootDivision"].ToString().Trim() != "")
  12543. {
  12544. BootDivision = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetUserName(tbl_Sights.Rows[i]["Ordpg_BootDivision"]);
  12545. }
  12546. if (!string.IsNullOrEmpty(tbl_Sights.Rows[i]["Ordpg_ReservationPhotographyTime"].ToString()))
  12547. {
  12548. if (PhotographyTime != "")
  12549. {
  12550. if (Convert.ToDateTime(tbl_Sights.Rows[i]["Ordpg_ReservationPhotographyTime"]) < Convert.ToDateTime(PhotographyTime))
  12551. {
  12552. PhotographyTime = LYFZ.Command.Command_Validate.DateTimeToString2(tbl_Sights.Rows[i]["Ordpg_ReservationPhotographyTime"]);
  12553. }
  12554. }
  12555. else
  12556. {
  12557. PhotographyTime = LYFZ.Command.Command_Validate.DateTimeToString2(tbl_Sights.Rows[i]["Ordpg_ReservationPhotographyTime"]);
  12558. }
  12559. }
  12560. }
  12561. string FilmSelectionTime = "";
  12562. if (tbl_Digital.Rows.Count > 0)
  12563. {
  12564. FilmSelectionTime = LYFZ.Command.Command_Validate.DateTimeToString2(tbl_Digital.Rows[0]["Ordv_FilmSelectionTime"]);
  12565. }
  12566. int nIndex = 1;
  12567. string strSights = "";
  12568. string orderType = Convert.ToString(tbl_Order.Rows[0]["Ord_Type"]);
  12569. string strIntoBottomQuantity = "";
  12570. // 遍历成长阶段;
  12571. //for ( int i = 0; i < tbl_Sights.Rows.Count; i++ )
  12572. //{
  12573. // #region 按选择阶段来打印;
  12574. // // 订单的入册总数;
  12575. // IntoRegisterQuantit = 0;
  12576. // // 订单的入底总数;
  12577. // IntoBottomQuantity = 0;
  12578. // strIntoBottomQuantity = "0";
  12579. // if ( listScenicSpot != null )
  12580. // {
  12581. // bool bViceExist = false;
  12582. // foreach ( ReportPrint.SetSmallForm.PrintPreviewSmallForm.ScenicSpot2 scenic in listScenicSpot )
  12583. // {
  12584. // if ( scenic.strScenicName.Trim() == tbl_Sights.Rows[i]["Ordpg_Sights"].ToString().Trim() )
  12585. // {
  12586. // bViceExist = true;
  12587. // // 订单的入册总数;
  12588. // IntoRegisterQuantit = Convert.ToInt32( tblIntoRB.Select( "Ordv_ViceNumber = '" + scenic.strViceNumber + "'" )[0][0].ToString() );
  12589. // // 订单的入底总数;
  12590. // IntoBottomQuantity = Convert.ToInt32( tblIntoRB.Select( "Ordv_ViceNumber = '" + scenic.strViceNumber + "'" )[0][1].ToString() );
  12591. // if ( IntoBottomQuantity > 0 )
  12592. // strIntoBottomQuantity = IntoBottomQuantity.ToString();
  12593. // else if ( IntoBottomQuantity == 0 )
  12594. // strIntoBottomQuantity = "不送";
  12595. // else
  12596. // strIntoBottomQuantity = "全送";
  12597. // break;
  12598. // }
  12599. // }
  12600. // if ( !bViceExist )
  12601. // continue;
  12602. // }
  12603. // #endregion
  12604. // if ( i > 0 )
  12605. // {
  12606. // strSights += "\r\n";
  12607. // }
  12608. // // 景点名称或成长名称;
  12609. // strSights += (nIndex++) + "." + tbl_Sights.Rows[i]["Ordpg_Sights"].ToString().Trim();
  12610. // string FuZhuangString = "";
  12611. // if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideClothingCount)
  12612. // FuZhuangString = String.Format("服装:{0}套", tbl_Sights.Rows[i]["Ordpg_ApparelQuantity"].ToString().Trim());
  12613. // string RuDiRuCheString = "";
  12614. // if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
  12615. // RuDiRuCheString = String.Format("入册:{0}, 入底:{1}", IntoRegisterQuantit, strIntoBottomQuantity);
  12616. // if (!String.IsNullOrWhiteSpace(FuZhuangString) && !String.IsNullOrWhiteSpace(RuDiRuCheString))
  12617. // {
  12618. // strSights += string.Format("【{0},{1}】", RuDiRuCheString, FuZhuangString);
  12619. // }
  12620. // else if (!String.IsNullOrWhiteSpace(FuZhuangString))
  12621. // {
  12622. // strSights += string.Format("【{0}】", FuZhuangString);
  12623. // }
  12624. // else if (!String.IsNullOrWhiteSpace(RuDiRuCheString))
  12625. // {
  12626. // strSights += string.Format("【{0}】", RuDiRuCheString);
  12627. // }
  12628. // // strSights += string.Format( "【入册:{0}, 入底:{1}, 服装:{2}套】", IntoRegisterQuantit, strIntoBottomQuantity, tbl_Sights.Rows[i]["Ordpg_ApparelQuantity"].ToString().Trim() );
  12629. // //strSights += (nIndex++) + "." + tbl_Sights.Rows[i]["Ordpg_Sights"].ToString().Trim();
  12630. // // 景点备注或成长备注;
  12631. // if ( !string.IsNullOrEmpty( orderType ) && orderType != "1" )
  12632. // {
  12633. // if ( !string.IsNullOrEmpty( tbl_Sights.Rows[i]["Ordpg_SightsRemark"].ToString().Trim() ) )
  12634. // {
  12635. // strSights += " " + tbl_Sights.Rows[i]["Ordpg_SightsRemark"].ToString().Trim();
  12636. // }
  12637. // }
  12638. // else
  12639. // {
  12640. // if ( !string.IsNullOrEmpty( tbl_Sights.Rows[i]["Ordpg_OpenOrderRemark"].ToString().Trim() ) )
  12641. // {
  12642. // strSights += " " + tbl_Sights.Rows[i]["Ordpg_OpenOrderRemark"].ToString().Trim();
  12643. // }
  12644. // }
  12645. // DataRow[] dtRowsA = tblProductList.Select( "OPlist_ViceNumber = '" + tbl_Sights.Rows[i]["Ordpg_ViceNumber"].ToString().Trim() + "'" );
  12646. // if ( dtRowsA.Length > 0 )
  12647. // {
  12648. // strSights += "\r\n商品:";
  12649. // for ( int j = 0; j < dtRowsA.Length; j++ )
  12650. // {
  12651. // if ( j > 0 )
  12652. // {
  12653. // strSights += "\r\n";
  12654. // }
  12655. // strSights += dtRowsA[j]["ProdName"].ToString().Trim();
  12656. // }
  12657. // }
  12658. // DataRow[] dtRowsB = tblService.Select( "Ws_ViceNumber = '" + tbl_Sights.Rows[i]["Ordpg_ViceNumber"].ToString().Trim() + "'" );
  12659. // if ( dtRowsB.Length > 0 )
  12660. // {
  12661. // strSights += "\r\n服务:";
  12662. // for ( int j = 0; j < dtRowsB.Length; j++ )
  12663. // {
  12664. // if ( j > 0 )
  12665. // {
  12666. // strSights += "\r\n";
  12667. // }
  12668. // strSights += dtRowsB[j]["ProdName"].ToString().Trim();
  12669. // }
  12670. // }
  12671. //}
  12672. //strSights += LYFZ.BLL.OtherCommonModel.FontConversion( "\r\n备注:" ) + tbl_Order.Rows[0]["Ord_Remark"].ToString();
  12673. //strSights = strSights.Replace("Null\r\n", "\r\n");
  12674. if (pListData.Count == 0)
  12675. {
  12676. pListData = new List<List<string>>();
  12677. pListData = GetChildProductOrServiceHalfListData(g1, listScenicSpot, TableWidth, tblProductList, tblService, tbl_Sights, tblIntoRB, LYFZ.BLL.OtherCommonModel.FontConversion("\r\n备注:") + tbl_Order.Rows[0]["Ord_Remark"].ToString());
  12678. }
  12679. #endregion
  12680. int LeftAdd = 3;
  12681. int TopAdd = 4;
  12682. int RowHeight = 20;
  12683. int RowContentHeight = 18;
  12684. int Unit = TableWidth / 32;
  12685. int ColumnWidth1 = Unit * 3;
  12686. int ColumnWidth2 = Unit * 4;
  12687. int ColumnWidth3 = Unit * 3;
  12688. int ColumnWidth4 = Unit * 4;
  12689. int ColumnWidth5 = Unit * 2;
  12690. int ColumnWidth6 = Unit * 4;
  12691. int ColumnWidth7 = Unit * 3;
  12692. int ColumnWidth8 = TableWidth - ColumnWidth1 - ColumnWidth2 - ColumnWidth3 - ColumnWidth4 - ColumnWidth5 - ColumnWidth6 - ColumnWidth7;
  12693. 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();
  12694. string rec3Value = "NO." + StrRandom(StrValue);
  12695. string strNumber = rec3Value;
  12696. List<string> dataList = pListData[iPage];
  12697. strSights = "";
  12698. foreach (string str in dataList)
  12699. {
  12700. if (strSights != "")
  12701. {
  12702. strSights += "\r\n";
  12703. }
  12704. strSights += str;
  12705. }
  12706. //Bitmap bitmap = new Bitmap(827, 1150);
  12707. Graphics g = g1;//Graphics.FromImage(bitmap);
  12708. #region 金色童年收据凭据
  12709. Rectangle rec1;
  12710. int Rec1Height = 0;
  12711. int TopHeightCount = 0;
  12712. Image imgLog = CachePhoto(PhotoLogType.Child, tbl.Rows[0]["Company_UpdateDatetime"], GetReservationSingleLOG("预约儿童单LOG"));
  12713. if (imgLog != null)
  12714. {
  12715. rec1 = new Rectangle(LeftWidth, 50, TableWidth, 80);
  12716. Rectangle srcRec1 = new Rectangle(0, 0, imgLog.Width, imgLog.Height);
  12717. g.DrawImage(imgLog, rec1, srcRec1, GraphicsUnit.Pixel);
  12718. Rec1Height = rec1.Height - Convert.ToInt32(g.MeasureString("预约儿童单标题", ft17).Height);
  12719. TopHeightCount = 3;
  12720. }
  12721. else
  12722. {
  12723. string StrTitle = GetReservationSingleTitle("预约儿童单标题");
  12724. SizeF srcsizef = g.MeasureString(StrTitle, ft17);
  12725. int srcFtWidth = Convert.ToInt32(srcsizef.Width);
  12726. int srcFtHeight = Convert.ToInt32(srcsizef.Height);
  12727. rec1 = new Rectangle(size.Width / 2 - srcFtWidth / 2, 50, srcFtWidth + 5, srcFtHeight);
  12728. g.DrawString(StrTitle, ft17, b, rec1);
  12729. }
  12730. #endregion
  12731. #region 家长、联系
  12732. string StrAddress = LYFZ.BLL.OtherCommonModel.FontConversion("家长姓名:") + PName + LYFZ.BLL.OtherCommonModel.FontConversion(" 联系电话:") + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls(PTelephone);
  12733. SizeF sizef = g.MeasureString(StrAddress, ft10);
  12734. int FtWidth = Convert.ToInt32(sizef.Width) + 1;
  12735. int FtHeight = Convert.ToInt32(sizef.Height);
  12736. Rectangle rec2 = new Rectangle(LeftWidth, rec1.Y + rec1.Height + TopHeightCount, FtWidth, FtHeight);//(panlImage.Width / 2) - (FtWidth / 2), rec2.Y + rec2.Height
  12737. g.DrawString(StrAddress, ft10, b, rec2);
  12738. #endregion
  12739. #region 开单日期;
  12740. string strOrderCreatedData = LYFZ.BLL.OtherCommonModel.FontConversion("开单日期:") + LYFZ.Command.Command_Validate.DateTimeToString(tbl_Order.Rows[0]["Ord_CreateDatetime"]);
  12741. sizef = g.MeasureString(strOrderCreatedData, ft10);
  12742. Rectangle rec1A = new Rectangle(rec2.Right + 10, rec2.Top, Convert.ToInt32(sizef.Width) + 1, Convert.ToInt32(sizef.Height));
  12743. g.DrawString(strOrderCreatedData, ft10, b, rec1A);
  12744. #endregion
  12745. #region NO.
  12746. sizef = g.MeasureString(strNumber, ft10);
  12747. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  12748. rec1A = new Rectangle(TableWidth + LeftWidth - FtWidth, rec1A.Top, FtWidth, Convert.ToInt32(sizef.Height));
  12749. g.DrawString(strNumber, ft10, b, rec1A);
  12750. #endregion
  12751. #region 第一行
  12752. Rectangle rec3 = new Rectangle(rec2.X, rec2.Y + rec2.Height, TableWidth, RowHeight);
  12753. g.DrawRectangle(p, rec3);//画标题矩形
  12754. string rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("宝贝姓名");
  12755. sizef = g.MeasureString(rec2Value, ft17);
  12756. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  12757. FtHeight = Convert.ToInt32(sizef.Height);
  12758. Rectangle rec3_1 = new Rectangle(rec3.X + LeftAdd * 3, rec3.Y + TopAdd, ColumnWidth1, RowContentHeight);
  12759. g.DrawString(rec2Value, ft9, b, rec3_1);//画第一列的列标题
  12760. Point p31_1 = new Point(rec3.X + ColumnWidth1, rec3.Y);
  12761. Point p31_2 = new Point(rec3.X + ColumnWidth1, rec3.Y + rec3.Height);
  12762. g.DrawLine(p, p31_1, p31_2);//画第一表与第二列的界线
  12763. Rectangle rec3_2 = new Rectangle(p31_1.X + LeftAdd, p31_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
  12764. g.DrawString(RName, ft9, b, rec3_2);//画第二列的列标题
  12765. Point p32_1 = new Point(p31_1.X + ColumnWidth2, rec3.Y);
  12766. Point p32_2 = new Point(p31_1.X + ColumnWidth2, rec3.Y + rec3.Height);
  12767. g.DrawLine(p, p32_1, p32_2);//画第二表与第三列的界线
  12768. Rectangle rec3_3 = new Rectangle(p32_1.X + LeftAdd * 3, p32_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
  12769. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("性别"), ft9, b, rec3_3);//画第三列的列标题
  12770. Point p33_1 = new Point(p32_1.X + ColumnWidth3, rec3.Y);
  12771. Point p33_2 = new Point(p32_1.X + ColumnWidth3, rec3.Y + rec3.Height);
  12772. g.DrawLine(p, p33_1, p33_2);//画第三表与第四列的界线
  12773. Rectangle rec3_4 = new Rectangle(p33_1.X + LeftAdd, p33_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
  12774. g.DrawString(RSex, ft9, b, rec3_4);//画第四列的列标题
  12775. Point p34_1 = new Point(p33_1.X + ColumnWidth4, rec3.Y);
  12776. Point p34_2 = new Point(p33_1.X + ColumnWidth4, rec3.Y + rec3.Height);
  12777. g.DrawLine(p, p34_1, p34_2);//画第二表与第三列的界线
  12778. Rectangle rec3_5 = new Rectangle(p34_1.X + LeftAdd * 3, p34_1.Y + TopAdd, ColumnWidth5, RowContentHeight);
  12779. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("年龄"), ft9, b, rec3_5);//画第三列的列标题
  12780. Point p35_1 = new Point(p34_1.X + ColumnWidth5, rec3.Y);
  12781. Point p35_2 = new Point(p34_1.X + ColumnWidth5, rec3.Y + rec3.Height);
  12782. g.DrawLine(p, p35_1, p35_2);//画第三表与第四列的界线
  12783. Rectangle rec3_6 = new Rectangle(p35_1.X + LeftAdd, p35_1.Y + TopAdd, ColumnWidth6, RowContentHeight);
  12784. g.DrawString(RAgeString, ft9, b, rec3_6);//画第四列的列标题
  12785. Point p36_1 = new Point(p35_1.X + ColumnWidth6, rec3.Y);
  12786. Point p36_2 = new Point(p35_1.X + ColumnWidth6, rec3.Y + rec3.Height);
  12787. g.DrawLine(p, p36_1, p36_2);//画第二表与第三列的界线
  12788. Rectangle rec3_7 = new Rectangle(p36_1.X + LeftAdd * 3, p36_1.Y + TopAdd, ColumnWidth7, RowContentHeight);
  12789. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("宝贝生日"), ft9, b, rec3_7);//画第三列的列标题
  12790. Point p37_1 = new Point(p36_1.X + ColumnWidth7, rec3.Y);
  12791. Point p37_2 = new Point(p36_1.X + ColumnWidth7, rec3.Y + rec3.Height);
  12792. g.DrawLine(p, p37_1, p37_2);//画第三表与第四列的界线
  12793. Rectangle rec3_8 = new Rectangle(p37_1.X + LeftAdd, p37_1.Y + TopAdd, ColumnWidth8, RowContentHeight);
  12794. g.DrawString(RBirthday, ft9, b, rec3_8);//画第四列的列标题
  12795. #endregion
  12796. #region 第二行
  12797. Rectangle rec4 = new Rectangle(rec3.X, rec3.Y + rec3.Height, rec3.Width, RowHeight);
  12798. g.DrawRectangle(p, rec4);//画标题矩形
  12799. Rectangle rec4_1 = new Rectangle(rec4.X + LeftAdd * 3, rec4.Y + TopAdd, ColumnWidth1, RowContentHeight);
  12800. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("套系金额"), ft9, b, rec4_1);//画第一列的列标题
  12801. Point p41_1 = new Point(rec4.X + ColumnWidth1, rec4.Y);
  12802. Point p41_2 = new Point(rec4.X + ColumnWidth1, rec4.Y + rec4.Height);
  12803. g.DrawLine(p, p41_1, p41_2);//画第一表与第二列的界线
  12804. Rectangle rec4_2 = new Rectangle(p41_1.X + LeftAdd, p41_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
  12805. g.DrawString(tbl_Order.Rows[0]["Ord_SeriesPrice"].ToString().Trim(), ft9, b, rec4_2);//画第二列的列标题
  12806. Point p42_1 = new Point(p41_1.X + ColumnWidth2, rec4.Y);
  12807. Point p42_2 = new Point(p41_1.X + ColumnWidth2, rec4.Y + rec4.Height);
  12808. g.DrawLine(p, p42_1, p42_2);//画第二表与第三列的界线
  12809. Rectangle rec4_3 = new Rectangle(p42_1.X + LeftAdd * 3, p42_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
  12810. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("定金"), ft9, b, rec4_3);//画第三列的列标题
  12811. Point p43_1 = new Point(p42_1.X + ColumnWidth3, rec4.Y);
  12812. Point p43_2 = new Point(p42_1.X + ColumnWidth3, rec4.Y + rec4.Height);
  12813. g.DrawLine(p, p43_1, p43_2);//画第三表与第四列的界线
  12814. Rectangle rec4_4 = new Rectangle(p43_1.X + LeftAdd, p43_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
  12815. g.DrawString(OrdPrice, ft9, b, rec4_4);//画第四列的列标题
  12816. Point p44_1 = new Point(p43_1.X + ColumnWidth4, rec4.Y);
  12817. Point p44_2 = new Point(p43_1.X + ColumnWidth4, rec4.Y + rec4.Height);
  12818. g.DrawLine(p, p44_1, p44_2);//画第二表与第三列的界线
  12819. Rectangle rec4_5 = new Rectangle(p44_1.X + LeftAdd * 3, p44_1.Y + TopAdd, ColumnWidth5, RowContentHeight);
  12820. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideArrears)
  12821. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("欠款"), ft9, b, rec4_5);//画第三列的列标题
  12822. Point p45_1 = new Point(p44_1.X + ColumnWidth5, rec4.Y);
  12823. Point p45_2 = new Point(p44_1.X + ColumnWidth5, rec4.Y + rec4.Height);
  12824. g.DrawLine(p, p45_1, p45_2);//画第三表与第四列的界线
  12825. Rectangle rec4_6 = new Rectangle(p45_1.X + LeftAdd, p45_1.Y + TopAdd, ColumnWidth6, RowContentHeight);
  12826. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideArrears)
  12827. g.DrawString(tbl_Order.Rows[0]["Ord_OrderArrears"].ToString().Trim(), ft9, b, rec4_6);//画第四列的列标题
  12828. Point p46_1 = new Point(p45_1.X + ColumnWidth6, rec4.Y);
  12829. Point p46_2 = new Point(p45_1.X + ColumnWidth6, rec4.Y + rec4.Height);
  12830. g.DrawLine(p, p46_1, p46_2);//画第二表与第三列的界线
  12831. Rectangle rec4_7 = new Rectangle(p46_1.X + LeftAdd * 3, p46_1.Y + TopAdd, ColumnWidth7, RowContentHeight);
  12832. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("套系名称"), ft9, b, rec4_7);//画第三列的列标题
  12833. Point p47_1 = new Point(p46_1.X + ColumnWidth7, rec4.Y);
  12834. Point p47_2 = new Point(p46_1.X + ColumnWidth7, rec4.Y + rec4.Height);
  12835. g.DrawLine(p, p47_1, p47_2);//画第三表与第四列的界线
  12836. Rectangle rec4_8 = new Rectangle(p47_1.X + LeftAdd, p47_1.Y + TopAdd, ColumnWidth8, RowContentHeight);
  12837. g.DrawString(tbl_Order.Rows[0]["Ord_SeriesName"].ToString().Trim(), ft9, b, rec4_8);//画第四列的列标题
  12838. #endregion
  12839. #region 第三行
  12840. Rectangle rec5 = new Rectangle(rec4.X, rec4.Y + rec4.Height, rec3.Width, RowHeight);
  12841. g.DrawRectangle(p, rec5);//画标题矩形
  12842. Rectangle rec5_1 = new Rectangle(rec5.X + LeftAdd * 3, rec5.Y + TopAdd, ColumnWidth1, RowContentHeight);
  12843. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("会员卡号"), ft9, b, rec5_1);//画第一列的列标题
  12844. Point p51_1 = new Point(rec5.X + ColumnWidth1, rec5.Y);
  12845. Point p51_2 = new Point(rec5.X + ColumnWidth1, rec5.Y + rec5.Height);
  12846. g.DrawLine(p, p51_1, p51_2);//画第一表与第二列的界线
  12847. Rectangle rec5_2 = new Rectangle(p51_1.X + LeftAdd, p51_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
  12848. g.DrawString(PMemberCardNumber, ft9, b, rec5_2);//画第二列的列标题
  12849. Point p52_1 = new Point(p51_1.X + ColumnWidth2, rec5.Y);
  12850. Point p52_2 = new Point(p51_1.X + ColumnWidth2, rec5.Y + rec5.Height);
  12851. g.DrawLine(p, p52_1, p52_2);//画第二表与第三列的界线
  12852. Rectangle rec5_3 = new Rectangle(p52_1.X + LeftAdd * 3, p52_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
  12853. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
  12854. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("入册"), ft9, b, rec5_3);//画第一列的列标题
  12855. Point p53_1 = new Point(p52_1.X + ColumnWidth3, rec5.Y);
  12856. Point p53_2 = new Point(p52_1.X + ColumnWidth3, rec5.Y + rec5.Height);
  12857. g.DrawLine(p, p53_1, p53_2);//画第一表与第二列的界线
  12858. Rectangle rec5_4 = new Rectangle(p53_1.X + LeftAdd, p53_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
  12859. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
  12860. g.DrawString(IntoRegisterQuantitString.ToString().Trim(), ft9, b, rec5_4);//画第二列的列标题
  12861. Point p54_1 = new Point(p43_1.X + ColumnWidth4, rec5.Y);
  12862. Point p54_2 = new Point(p43_1.X + ColumnWidth4, rec5.Y + rec5.Height);
  12863. g.DrawLine(p, p54_1, p54_2);//画第二表与第三列的界线
  12864. Rectangle rec5_5 = new Rectangle(p54_1.X + LeftAdd * 3, p54_1.Y + TopAdd, ColumnWidth5, RowContentHeight);
  12865. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
  12866. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("入底"), ft9, b, rec5_5);//画第三列的列标题
  12867. Point p55_1 = new Point(p54_1.X + ColumnWidth5, rec5.Y);
  12868. Point p55_2 = new Point(p54_1.X + ColumnWidth5, rec5.Y + rec5.Height);
  12869. g.DrawLine(p, p55_1, p55_2);//画第三表与第四列的界线
  12870. Rectangle rec5_6 = new Rectangle(p55_1.X + LeftAdd, p55_1.Y + TopAdd, ColumnWidth6, RowContentHeight - 6);
  12871. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
  12872. g.DrawString(StrIntoBottomQuantity, ft9, b, rec5_6);//画第四列的列标题
  12873. Point p56_1 = new Point(p55_1.X + ColumnWidth6, rec5.Y);
  12874. Point p56_2 = new Point(p55_1.X + ColumnWidth6, rec5.Y + rec5.Height);
  12875. g.DrawLine(p, p56_1, p56_2);//画第二表与第三列的界线
  12876. Rectangle rec5_7 = new Rectangle(p56_1.X + LeftAdd * 7, p56_1.Y + TopAdd, ColumnWidth7, RowContentHeight);
  12877. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("门 市"), ft9, b, rec5_7);//画第三列的列标题
  12878. Point p57_1 = new Point(p56_1.X + ColumnWidth7, rec5.Y);
  12879. Point p57_2 = new Point(p56_1.X + ColumnWidth7, rec5.Y + rec5.Height);
  12880. g.DrawLine(p, p57_1, p57_2);//画第三表与第四列的界线
  12881. Rectangle rec5_8 = new Rectangle(p57_1.X + LeftAdd, p57_1.Y + TopAdd, ColumnWidth8, RowContentHeight);
  12882. string strOrderPerson = "";
  12883. if (tblUser.Rows.Count > 0)
  12884. {
  12885. if (Convert.ToBoolean(tblUser.Rows[0]["User_PhonePrint"]) == true)
  12886. strOrderPerson = tblUser.Rows[0]["User_Name"].ToString() + " " + tblUser.Rows[0]["User_Telephone"].ToString();
  12887. else
  12888. strOrderPerson = tblUser.Rows[0]["User_Name"].ToString() + " " + tbl.Rows[0]["Company_Telephone"].ToString();
  12889. }
  12890. g.DrawString(strOrderPerson, ft9, b, rec5_8);//画第四列的列标题
  12891. #endregion
  12892. #region 第三四行
  12893. Rectangle rec5A = new Rectangle(rec5.X, rec5.Y + rec5.Height, rec3.Width, RowHeight);
  12894. g.DrawRectangle(p, rec5A);//画标题矩形
  12895. Rectangle rec5A_1 = new Rectangle(rec5A.X + LeftAdd * 2, rec5A.Y + TopAdd, ColumnWidth1, RowContentHeight);
  12896. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideClothingCount)
  12897. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("内景服装"), ft9, b, rec5A_1);//画第一列的列标题
  12898. Point p5A1_1 = new Point(rec5A.X + ColumnWidth1, rec5A.Y);
  12899. Point p5A1_2 = new Point(rec5A.X + ColumnWidth1, rec5A.Y + rec5A.Height);
  12900. g.DrawLine(p, p5A1_1, p5A1_2);//画第一表与第二列的界线
  12901. Rectangle rec5A_2 = new Rectangle(p5A1_1.X + LeftAdd, p5A1_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
  12902. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideClothingCount)
  12903. g.DrawString(InnerSights.ToString().Trim(), ft9, b, rec5A_2);//画第二列的列标题
  12904. Point p5A2_1 = new Point(p5A1_1.X + ColumnWidth2, rec5A.Y);
  12905. Point p5A2_2 = new Point(p5A1_1.X + ColumnWidth2, rec5A.Y + rec5A.Height);
  12906. g.DrawLine(p, p5A2_1, p5A2_2);//画第二表与第三列的界线
  12907. Rectangle rec5A_3 = new Rectangle(p5A2_1.X + LeftAdd * 2, p5A2_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
  12908. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideClothingCount)
  12909. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("外景服装"), ft9, b, rec5A_3);//画第一列的列标题
  12910. Point p5A3_1 = new Point(p5A2_1.X + ColumnWidth3, rec5A.Y);
  12911. Point p5A3_2 = new Point(p5A2_1.X + ColumnWidth3, rec5A.Y + rec5A.Height);
  12912. g.DrawLine(p, p5A3_1, p5A3_2);//画第一表与第二列的界线
  12913. Rectangle rec5A_4 = new Rectangle(p5A3_1.X + LeftAdd, p5A3_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
  12914. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideClothingCount)
  12915. g.DrawString(OuterSights.ToString().Trim(), ft9, b, rec5A_4);//画第二列的列标题
  12916. Point p5A4_1 = new Point(p5A3_1.X + ColumnWidth4, rec5A.Y);
  12917. Point p5A4_2 = new Point(p5A3_1.X + ColumnWidth4, rec5A.Y + rec5A.Height);
  12918. g.DrawLine(p, p5A4_1, p5A4_2);//画第二表与第三列的界线
  12919. Rectangle rec5A_5 = new Rectangle(p5A4_1.X + LeftAdd * 3, p5A4_1.Y + TopAdd, ColumnWidth5, RowContentHeight);
  12920. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("地址"), ft9, b, rec5A_5);//画第三列的列标题
  12921. Point p5A5_1 = new Point(p5A4_1.X + ColumnWidth5, rec5A.Y);
  12922. Point p5A5_2 = new Point(p5A4_1.X + ColumnWidth5, rec5A.Y + rec5A.Height);
  12923. g.DrawLine(p, p5A5_1, p5A5_2);//画第三表与第四列的界线
  12924. Rectangle rec5A_6 = new Rectangle(p5A5_1.X + LeftAdd, p5A5_1.Y + TopAdd, ColumnWidth5 + ColumnWidth6 + ColumnWidth7 + ColumnWidth8, RowContentHeight);
  12925. g.DrawString(StrAdderss, ft9, b, rec5A_6);//画第四列的列标题
  12926. #endregion
  12927. #region 第四行
  12928. Rectangle rec6 = new Rectangle(rec5A.X, rec5A.Y + rec5A.Height, TableWidth, 315 - Rec1Height - LeftWidth);
  12929. g.DrawRectangle(p, rec6);//画标题矩形
  12930. rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("套系内容");
  12931. sizef = g.MeasureString(rec2Value, ft17);
  12932. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  12933. FtHeight = Convert.ToInt32(sizef.Height) + 1;
  12934. Rectangle rec6_1 = new Rectangle(rec6.X + LeftAdd * 2, rec6.Y + (rec6.Height / 2 - FtHeight * 2), ColumnWidth1 / 2, FtHeight * 4);
  12935. g.DrawString(rec2Value, ft13, b, rec6_1);//画第一列的列标题
  12936. Point p61_1 = new Point(rec6.X + rec6_1.Width, rec6.Y);
  12937. Point p61_2 = new Point(rec6.X + rec6_1.Width, rec6.Y + rec6.Height);
  12938. g.DrawLine(p, p61_1, p61_2);//画第一表与第二列的界线
  12939. 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);
  12940. g.DrawString(strSights, GetFontSize("儿童预约单内容详情字体大小"), b, rec6_2);//画第二列的列标题
  12941. Point p62_1 = new Point(p61_1.X + rec6_2.Width, rec6.Y);
  12942. Point p62_2 = new Point(p61_1.X + rec6_2.Width, rec6.Y + rec6.Height);
  12943. g.DrawLine(p, p62_1, p62_2);//画第二表与第三列的界线
  12944. StrValue = "";
  12945. if (PrintOtherData.ContainsKey("儿童预约单注意事项说明") && PrintOtherData["儿童预约单注意事项说明"].ToString().Trim().Length > 0)
  12946. {
  12947. StrValue = PrintOtherData["儿童预约单注意事项说明"].ToString().Trim();
  12948. }
  12949. Rectangle rec6_3 = new Rectangle(rec6_2.X + rec6_2.Width + LeftAdd, rec6_1.Y, rec6_1.Width, rec6_1.Height);
  12950. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("注意事项"), ft13, b, rec6_3);//画第三列的列标题
  12951. Point p63_1 = new Point(p62_1.X + rec6_3.Width, rec6.Y);
  12952. Point p63_2 = new Point(p62_1.X + rec6_3.Width, rec6.Y + rec6.Height);
  12953. g.DrawLine(p, p63_1, p63_2);//画第三表与第四列的界线
  12954. Rectangle rec6_4 = new Rectangle(p63_1.X + LeftAdd, p63_1.Y + TopAdd, ColumnWidth8 + ColumnWidth7 + (ColumnWidth1 / 2) - rec6_3.Width, rec6.Height - TopAdd * 2);
  12955. g.DrawString(StrValue, GetFontSize("儿童预约单注意事项字体大小"), b, rec6_4);//画第四列的列标题
  12956. #endregion
  12957. #region 第六行
  12958. int SWidth = TableWidth / 8;
  12959. Rectangle rec7 = new Rectangle(rec6.X, rec6.Y + rec6.Height, TableWidth, RowHeight);
  12960. g.DrawRectangle(p, rec7);//画标题矩形
  12961. Rectangle rec7_1 = new Rectangle(rec7.X + LeftAdd * 4, rec7.Y + TopAdd, SWidth - SWidth / 3 + 5, RowContentHeight);
  12962. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("摄影师"), ft9, b, rec7_1);//画第一列的列标题
  12963. Point p71_1 = new Point(rec7.X + rec7_1.Width, rec7.Y);
  12964. Point p71_2 = new Point(rec7.X + rec7_1.Width, rec7.Y + rec7.Height);
  12965. g.DrawLine(p, p71_1, p71_2);//画第一表与第二列的界线
  12966. Rectangle rec7_2 = new Rectangle(p71_1.X + LeftAdd, p71_1.Y + TopAdd, SWidth, RowContentHeight);
  12967. g.DrawString(Photographer, ft9, b, rec7_2);//画第六列的列标题
  12968. Point p72_1 = new Point(p71_1.X + rec7_2.Width, rec7.Y);
  12969. Point p72_2 = new Point(p71_1.X + rec7_2.Width, rec7.Y + rec7.Height);
  12970. g.DrawLine(p, p72_1, p72_2);//画第一表与第二列的界线
  12971. Rectangle rec7_3 = new Rectangle(p72_1.X + LeftAdd * 4, p72_1.Y + TopAdd, rec7_1.Width, RowContentHeight);
  12972. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("化妆师"), ft9, b, rec7_3);//画第一列的列标题
  12973. Point p73_1 = new Point(p72_1.X + rec7_3.Width, rec7.Y);
  12974. Point p73_2 = new Point(p72_1.X + rec7_3.Width, rec7.Y + rec7.Height);
  12975. g.DrawLine(p, p73_1, p73_2);//画第一表与第二列的界线
  12976. Rectangle rec7_4 = new Rectangle(p73_1.X + LeftAdd, p73_1.Y + TopAdd, rec7_2.Width, RowContentHeight);
  12977. g.DrawString(MakeupArtist.Trim(), ft9, b, rec7_4);//画第六列的列标题
  12978. Point p74_1 = new Point(p73_1.X + rec7_4.Width, rec7.Y);
  12979. Point p74_2 = new Point(p73_1.X + rec7_4.Width, rec7.Y + rec7.Height);
  12980. g.DrawLine(p, p74_1, p74_2);//画第一表与第二列的界线
  12981. Rectangle rec7_5 = new Rectangle(p74_1.X + LeftAdd * 2, p74_1.Y + TopAdd, rec7_3.Width, RowContentHeight);
  12982. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("拍照时间"), ft9, b, rec7_5);//画第一列的列标题
  12983. Point p75_1 = new Point(p74_1.X + rec7_5.Width, rec7.Y);
  12984. Point p75_2 = new Point(p74_1.X + rec7_5.Width, rec7.Y + rec7.Height);
  12985. g.DrawLine(p, p75_1, p75_2);//画第一表与第二列的界线
  12986. Rectangle rec7_6 = new Rectangle(p75_1.X + LeftAdd, p75_1.Y + TopAdd, rec7_4.Width + 30, RowContentHeight);
  12987. g.DrawString(PhotographyTime.Trim(), ft9, b, rec7_6);//画第六列的列标题
  12988. Point p76_1 = new Point(p75_1.X + rec7_6.Width, rec7.Y);
  12989. Point p76_2 = new Point(p75_1.X + rec7_6.Width, rec7.Y + rec7.Height);
  12990. g.DrawLine(p, p76_1, p76_2);//画第一表与第二列的界线
  12991. Rectangle rec7_7 = new Rectangle(p76_1.X + LeftAdd * 2, p76_1.Y + TopAdd, rec7_5.Width, RowContentHeight);
  12992. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("选片时间"), ft9, b, rec7_7);//画第一列的列标题
  12993. Point p77_1 = new Point(p76_1.X + rec7_7.Width, rec7.Y);
  12994. Point p77_2 = new Point(p76_1.X + rec7_7.Width, rec7.Y + rec7.Height);
  12995. g.DrawLine(p, p77_1, p77_2);//画第一表与第二列的界线
  12996. Rectangle rec7_8 = new Rectangle(p77_1.X + LeftAdd, p77_1.Y + TopAdd, rec7_6.Width, RowContentHeight);
  12997. g.DrawString(FilmSelectionTime, ft9, b, rec7_2);//画第六列的列标题
  12998. #endregion
  12999. #region 第七行
  13000. Rectangle rec8 = new Rectangle(rec7.X, rec7.Y + rec7.Height, TableWidth, RowHeight);
  13001. g.DrawRectangle(p, rec8);//画标题矩形
  13002. Rectangle rec8_1 = new Rectangle(rec8.X + LeftAdd * 4, rec8.Y + TopAdd, rec7_1.Width, RowContentHeight);
  13003. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("引导师"), ft9, b, rec8_1);//画第一列的列标题
  13004. Point p81_1 = new Point(rec8.X + rec7_1.Width, rec8.Y);
  13005. Point p81_2 = new Point(rec8.X + rec7_1.Width, rec8.Y + rec8.Height);
  13006. g.DrawLine(p, p81_1, p81_2);//画第一表与第二列的界线
  13007. Rectangle rec8_2 = new Rectangle(p81_1.X + LeftAdd, p81_1.Y + TopAdd, SWidth, RowContentHeight);
  13008. g.DrawString(BootDivision, ft9, b, rec8_2);//画第六列的列标题
  13009. Point p82_1 = new Point(p81_1.X + rec8_2.Width, rec8.Y);
  13010. Point p82_2 = new Point(p81_1.X + rec8_2.Width, rec8.Y + rec8.Height);
  13011. g.DrawLine(p, p82_1, p82_2);//画第一表与第二列的界线
  13012. Rectangle rec8_3 = new Rectangle(p82_1.X + LeftAdd * 4, p82_1.Y + TopAdd, rec8_1.Width, RowContentHeight);
  13013. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("设计师"), ft9, b, rec8_3);//画第一列的列标题
  13014. Point p83_1 = new Point(p82_1.X + rec8_3.Width, rec8.Y);
  13015. Point p83_2 = new Point(p82_1.X + rec8_3.Width, rec8.Y + rec8.Height);
  13016. g.DrawLine(p, p83_1, p83_2);//画第一表与第二列的界线
  13017. Rectangle rec8_4 = new Rectangle(p83_1.X + LeftAdd, p83_1.Y + TopAdd, rec8_2.Width, RowContentHeight);
  13018. g.DrawString("", ft9, b, rec8_4);//画第六列的列标题
  13019. Point p84_1 = new Point(p83_1.X + rec8_4.Width, rec8.Y);
  13020. Point p84_2 = new Point(p83_1.X + rec8_4.Width, rec8.Y + rec8.Height);
  13021. g.DrawLine(p, p84_1, p84_2);//画第一表与第二列的界线
  13022. Rectangle rec8_5 = new Rectangle(p84_1.X + LeftAdd * 2, p84_1.Y + TopAdd, rec8_3.Width, RowContentHeight);
  13023. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("取件时间"), ft9, b, rec8_5);//画第一列的列标题
  13024. Point p85_1 = new Point(p84_1.X + rec8_5.Width, rec8.Y);
  13025. Point p85_2 = new Point(p84_1.X + rec8_5.Width, rec8.Y + rec8.Height);
  13026. g.DrawLine(p, p85_1, p85_2);//画第一表与第二列的界线
  13027. string strPickupTime = "";
  13028. if (tblPickupTime.Rows.Count > 0)
  13029. {
  13030. if (!string.IsNullOrEmpty(tblPickupTime.Rows[0]["OPlist_PickupTime"].ToString().Trim()))
  13031. {
  13032. strPickupTime = LYFZ.Command.Command_Validate.DateTimeToString(tblPickupTime.Rows[0]["OPlist_PickupTime"]);
  13033. }
  13034. }
  13035. Rectangle rec8_6 = new Rectangle(p85_1.X + LeftAdd, p85_1.Y + TopAdd, rec8_4.Width + 30, RowContentHeight);
  13036. g.DrawString(strPickupTime, ft9, b, rec8_6);//画第六列的列标题
  13037. Point p86_1 = new Point(p85_1.X + rec8_6.Width, rec8.Y);
  13038. Point p86_2 = new Point(p85_1.X + rec8_6.Width, rec8.Y + rec8.Height);
  13039. g.DrawLine(p, p86_1, p86_2);//画第一表与第二列的界线
  13040. Rectangle rec8_7 = new Rectangle(p86_1.X + LeftAdd * 2, p86_1.Y + TopAdd, rec8_5.Width, RowContentHeight);
  13041. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("顾客签字"), ft9, b, rec8_7);//画第一列的列标题
  13042. Point p87_1 = new Point(p86_1.X + rec8_7.Width, rec8.Y);
  13043. Point p87_2 = new Point(p86_1.X + rec8_7.Width, rec8.Y + rec8.Height);
  13044. g.DrawLine(p, p87_1, p87_2);//画第一表与第二列的界线
  13045. Rectangle rec8A_2 = new Rectangle(p87_1.X + LeftAdd, p87_1.Y + TopAdd, rec8_6.Width, RowContentHeight);
  13046. if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintOrderShowPayment)
  13047. {
  13048. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("收款"), ft9, b, rec7.X + LeftAdd * 3 + 8, rec8A_2.Y + TopAdd * 5 + 2);//画第一列的列标题
  13049. g.DrawLine(p, rec7.X, p87_1.Y, rec7.X, p87_2.Y + rec8A_2.Height + 5);//画第六列的列标题
  13050. g.DrawLine(p, rec7.X + ColumnWidth1 - 1, p87_1.Y, rec7.X + ColumnWidth1 - 1, p87_2.Y + rec8A_2.Height + 5);//画第六列的列标题
  13051. g.DrawLine(p, rec7.X + TableWidth, p87_1.Y, rec7.X + TableWidth, p87_2.Y + rec8A_2.Height + 5);//画第六列的列标题
  13052. g.DrawLine(p, rec7.X, p87_2.Y + rec8A_2.Height + 5, rec7.X + TableWidth, p87_2.Y + rec8A_2.Height + 5);//画第六列的列标题
  13053. rec8A_2.Height += 10;
  13054. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion(strPaymentMsg), ft9, b, rec7.X + LeftAdd * 22 + 2, rec8A_2.Y + TopAdd * 5 + 2);//画第一列的列标题
  13055. }
  13056. else
  13057. {
  13058. rec8A_2.Height = 0;
  13059. }
  13060. #endregion
  13061. #region 尾行
  13062. rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("电话:") + tbl.Rows[0]["Company_Telephone"].ToString().Trim();
  13063. sizef = g.MeasureString(rec2Value, ft9);
  13064. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  13065. FtHeight = Convert.ToInt32(sizef.Height);
  13066. Rectangle rec9_1 = new Rectangle(TableWidth + LeftWidth - FtWidth, rec8.Y + rec8.Height + TopAdd + rec8A_2.Height, FtWidth, FtHeight);
  13067. g.DrawString(rec2Value, ft9, b, rec9_1);//画第一列的列标题
  13068. rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("地址:") + tbl.Rows[0]["Company_Address"].ToString().Trim();
  13069. sizef = g.MeasureString(rec2Value, ft9);
  13070. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  13071. FtHeight = Convert.ToInt32(sizef.Height);
  13072. Rectangle rec9 = new Rectangle(rec8.X, rec9_1.Y, TableWidth - rec9_1.Width - LeftWidth, FtHeight);
  13073. g.DrawString(rec2Value, ft9, b, rec9);//画第一列的列标题
  13074. #endregion
  13075. //bitmapDataList.Add(bitmap);
  13076. }
  13077. /// <summary>
  13078. /// 订单报表儿童版()
  13079. /// </summary>
  13080. /// <returns></returns>
  13081. private static void Child_OrderReport_Print_Back( DataSet dtSet, Graphics g, Size size )
  13082. {
  13083. int LeftWidth = 30;
  13084. Brush b = Brushes.Black;
  13085. Pen p = GetPen;
  13086. int TableWidth = size.Width - LeftWidth * 2;
  13087. DataTable tbl = dtSet.Tables["ds"];
  13088. DataTable tbl_Order = dtSet.Tables["ds1"];
  13089. DataTable tbl_Digital = dtSet.Tables["ds2"];
  13090. DataTable tbl_Sights = dtSet.Tables["ds3"];
  13091. DataTable tblPickupTime = dtSet.Tables["ds4"];//取件时间
  13092. DataTable tblProductList = dtSet.Tables["ds5"];
  13093. DataTable tblClient = dtSet.Tables["ds6"];//客户资料
  13094. DataTable tblService = dtSet.Tables["ds7"];//服务
  13095. DataTable tblStyle = dtSet.Tables["ds8"];//喜爱风格
  13096. DataTable tblPayment = dtSet.Tables["ds9"];//订单定金
  13097. DataTable tblUser = dtSet.Tables["ds11"];//订单主接单人
  13098. string OrdPrice = "0.00";
  13099. if ( tblPayment.Rows.Count > 0 )
  13100. {
  13101. OrdPrice = tblPayment.Rows[0]["Pay_AmountOf"].ToString().Trim();
  13102. }
  13103. tblStyle.PrimaryKey = new DataColumn[] { tblStyle.Columns["ID"] };
  13104. //获取影楼信息
  13105. if ( tbl.Rows.Count <= 0 )
  13106. {
  13107. MessageBoxCustom.Show( "未设置影楼信息" ); return;
  13108. }
  13109. DataTable tblIntoRB = dtSet.Tables["ds10"];//订单定金
  13110. Hashtable htDataA = new Hashtable();
  13111. Hashtable htDataB = new Hashtable();
  13112. Hashtable htDataC = new Hashtable();
  13113. for ( int i = 0; i < tblIntoRB.Rows.Count; i++ )
  13114. {
  13115. if ( Convert.ToInt32( tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"] ) > 0 )
  13116. {
  13117. htDataA[tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"]] = tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"];
  13118. }
  13119. else if ( Convert.ToInt32( tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"] ) == 0 )
  13120. {
  13121. htDataB[tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"]] = tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"];
  13122. }
  13123. else
  13124. {
  13125. htDataC[tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"]] = tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"];
  13126. }
  13127. }
  13128. int IntoRegisterQuantit = 0;
  13129. int IntoBottomQuantity = 0;
  13130. string StrIntoBottomQuantity = "";
  13131. bool IsSS = false;
  13132. for ( int i = 0; i < tblIntoRB.Rows.Count; i++ )
  13133. {
  13134. IntoRegisterQuantit += Convert.ToInt32( tblIntoRB.Rows[i]["Ordv_IntoRegisterQuantity"] );
  13135. if ( tblIntoRB.Rows.Count > 0 )
  13136. {
  13137. if ( (htDataA.Count > 0 && htDataB.Count > 0) || (htDataA.Count > 0 && htDataC.Count > 0) || (htDataB.Count > 0 && htDataC.Count > 0) )
  13138. {
  13139. if ( Convert.ToInt32( tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"] ) > 0 )
  13140. {
  13141. StrIntoBottomQuantity += tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"].ToString().Trim() + ",";
  13142. }
  13143. else if ( Convert.ToInt32( tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"] ) == 0 )
  13144. {
  13145. StrIntoBottomQuantity += "不送,";
  13146. }
  13147. else
  13148. {
  13149. StrIntoBottomQuantity += "全送,";
  13150. }
  13151. IsSS = true;
  13152. }
  13153. else
  13154. {
  13155. IntoBottomQuantity += Convert.ToInt32( tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"] );
  13156. }
  13157. }
  13158. else
  13159. {
  13160. IntoBottomQuantity += Convert.ToInt32( tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"] );
  13161. }
  13162. }
  13163. if ( !IsSS )
  13164. {
  13165. if ( IntoBottomQuantity > 0 )
  13166. {
  13167. StrIntoBottomQuantity = IntoBottomQuantity.ToString();
  13168. }
  13169. else if ( IntoBottomQuantity == 0 )
  13170. {
  13171. StrIntoBottomQuantity = "不送";
  13172. }
  13173. else
  13174. {
  13175. StrIntoBottomQuantity = "全送";
  13176. }
  13177. }
  13178. StrIntoBottomQuantity = StrIntoBottomQuantity.TrimEnd( ',' );
  13179. #region 获取数据
  13180. string PName = "";
  13181. string PTelephone = "";
  13182. string PIDNumber = "";
  13183. string PMicroSignal = "";
  13184. string PQQ = "";
  13185. string PAddress = "";
  13186. string RName = "";
  13187. string RBirthday = "";
  13188. string RSex = "";
  13189. string RAgeString = "";
  13190. for ( int i = 0; i < tblClient.Rows.Count; i++ )
  13191. {
  13192. if ( tblClient.Rows[i]["GM_Master"].ToString().Trim() == "1" && tblClient.Rows[i]["GM_ProtagonistCustomer"].ToString().Trim() == "0" )
  13193. {
  13194. PName = tblClient.Rows[i]["Cus_Name"].ToString().Trim();
  13195. PTelephone = tblClient.Rows[i]["Cus_Telephone"].ToString().Trim();
  13196. PIDNumber = tblClient.Rows[i]["Cus_IDNumber"].ToString().Trim();
  13197. PMicroSignal = tblClient.Rows[i]["Cus_MicroSignal"].ToString().Trim();
  13198. PQQ = tblClient.Rows[i]["Cus_QQ"].ToString().Trim();
  13199. PAddress = tblClient.Rows[i]["Cus_Address"].ToString().Trim();
  13200. }
  13201. else if ( tblClient.Rows[i]["GM_Master"].ToString().Trim() == "0" && tblClient.Rows[i]["GM_ProtagonistCustomer"].ToString().Trim() == "1" )
  13202. {
  13203. RName = tblClient.Rows[i]["Cus_Name"].ToString().Trim();
  13204. RSex = tblClient.Rows[i]["Cus_Sex_cs"].ToString().Trim();
  13205. RAgeString = tblClient.Rows[i]["Age_String"].ToString().Trim();
  13206. if ( LYFZ.Command.Command_Validate.DateTimeToString( tblClient.Rows[i]["Cus_Birthday"] ) != "" )
  13207. {
  13208. RBirthday = LYFZ.Command.Command_Validate.DateTimeToString( tblClient.Rows[i]["Cus_Birthday"] );
  13209. if ( !string.IsNullOrEmpty( tblClient.Rows[i]["Cus_BirthdayLunar"].ToString().Trim() ) && tblClient.Rows[i]["Cus_BirthdayLunar"].ToString().Trim() == "1" )
  13210. {
  13211. RBirthday += LYFZ.BLL.OtherCommonModel.FontConversion( "(农历)" );
  13212. }
  13213. }
  13214. }
  13215. }
  13216. int InnerSights = 0;
  13217. int OuterSights = 0;
  13218. string strSights = LYFZ.BLL.OtherCommonModel.FontConversion( "拍摄名称:\r\n" );
  13219. string Photographer = "";
  13220. string MakeupArtist = "";
  13221. string PhotographyTime = "";
  13222. string BootDivision = "";
  13223. for ( int i = 0; i < tbl_Sights.Rows.Count; i++ )
  13224. {
  13225. if ( tbl_Sights.Rows[i]["Ordpg_SightsType"].ToString().Trim() == "1" )
  13226. {
  13227. OuterSights += Convert.ToInt32( tbl_Sights.Rows[i]["Ordpg_ApparelQuantity"] );
  13228. }
  13229. else if ( tbl_Sights.Rows[i]["Ordpg_SightsType"].ToString().Trim() == "0" )
  13230. {
  13231. InnerSights += Convert.ToInt32( tbl_Sights.Rows[i]["Ordpg_ApparelQuantity"] );
  13232. }
  13233. strSights += (i + 1) + "." + tbl_Sights.Rows[i]["Ordpg_Sights"].ToString().Trim();
  13234. strSights += tbl_Sights.Rows[i]["Ordpg_SightsRemark"].ToString().Trim();
  13235. strSights += "\r\n";
  13236. if ( tbl_Sights.Rows[i]["Ordpg_Photographer"].ToString().Trim() != "" )
  13237. {
  13238. Photographer = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetUserName( tbl_Sights.Rows[i]["Ordpg_Photographer"] );
  13239. }
  13240. if ( tbl_Sights.Rows[i]["Ordpg_MakeupArtist"].ToString().Trim() != "" )
  13241. {
  13242. MakeupArtist = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetUserName( tbl_Sights.Rows[i]["Ordpg_MakeupArtist"] );
  13243. }
  13244. if ( tbl_Sights.Rows[i]["Ordpg_BootDivision"].ToString().Trim() != "" )
  13245. {
  13246. BootDivision = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetUserName( tbl_Sights.Rows[i]["Ordpg_BootDivision"] );
  13247. }
  13248. if ( !string.IsNullOrEmpty( tbl_Sights.Rows[i]["Ordpg_ReservationPhotographyTime"].ToString() ) )
  13249. {
  13250. if ( PhotographyTime != "" )
  13251. {
  13252. if ( Convert.ToDateTime( tbl_Sights.Rows[i]["Ordpg_ReservationPhotographyTime"] ) < Convert.ToDateTime( PhotographyTime ) )
  13253. {
  13254. PhotographyTime = LYFZ.Command.Command_Validate.DateTimeToString( tbl_Sights.Rows[i]["Ordpg_ReservationPhotographyTime"] );
  13255. }
  13256. }
  13257. else
  13258. {
  13259. PhotographyTime = LYFZ.Command.Command_Validate.DateTimeToString( tbl_Sights.Rows[i]["Ordpg_ReservationPhotographyTime"] );
  13260. }
  13261. }
  13262. }
  13263. string FilmSelectionTime = "";
  13264. if ( tbl_Digital.Rows.Count > 0 )
  13265. {
  13266. FilmSelectionTime = LYFZ.Command.Command_Validate.DateTimeToString( tbl_Digital.Rows[0]["Ordv_FilmSelectionTime"] );
  13267. }
  13268. #endregion
  13269. Font ft17 = new Font( "宋体", 17 );
  13270. Font ft12 = new Font( "宋体", 12 );
  13271. Font ft9 = new Font( "宋体", 9 );
  13272. #region LOG抬头
  13273. int Rec1Height = 0;
  13274. Rectangle rec1;
  13275. Image imgLog = CachePhoto( PhotoLogType.Child, tbl.Rows[0]["Company_UpdateDatetime"], GetReservationSingleLOG( "预约儿童单LOG" ) );
  13276. if ( imgLog != null )
  13277. {
  13278. rec1 = new Rectangle( LeftWidth, 50, TableWidth, 120 );
  13279. Rectangle srcRec1 = new Rectangle( 0, 0, imgLog.Width, imgLog.Height );
  13280. g.DrawImage( imgLog, rec1, srcRec1, GraphicsUnit.Pixel );
  13281. }
  13282. else
  13283. {
  13284. string StrTitle = GetReservationSingleTitle( "预约儿童单标题" );
  13285. SizeF srcsizef = g.MeasureString( StrTitle, ft17 );
  13286. int srcFtWidth = Convert.ToInt32( srcsizef.Width );
  13287. int srcFtHeight = Convert.ToInt32( srcsizef.Height );
  13288. rec1 = new Rectangle( size.Width / 2 - srcFtWidth / 2, 50, srcFtWidth + 5, srcFtHeight );
  13289. g.DrawString( StrTitle, ft17, b, rec1 );
  13290. Rec1Height = 120 - rec1.Height;
  13291. }
  13292. #endregion
  13293. int LeftAdd = 3;
  13294. int TopAdd = 6;
  13295. int RowHeight = 25;
  13296. int RowContentHeight = 18;
  13297. int Unit = TableWidth / 25;
  13298. int ColumnWidth1 = Unit * 3;
  13299. int ColumnWidth2 = Unit * 5;
  13300. int ColumnWidth3 = Unit * 3;
  13301. int ColumnWidth4 = Unit * 5;
  13302. int ColumnWidth5 = Unit * 3 - Unit / 2 + 15;
  13303. int ColumnWidth6 = TableWidth - ColumnWidth1 - ColumnWidth2 - ColumnWidth3 - ColumnWidth4 - ColumnWidth5;
  13304. #region 始行
  13305. Rectangle rec2 = new Rectangle( LeftWidth, rec1.Y + rec1.Height + 10, 1000, RowContentHeight );
  13306. 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 );
  13307. 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();
  13308. StrValue = "NO." + StrRandom( StrValue );
  13309. SizeF sizef = g.MeasureString( StrValue, ft12 );
  13310. int FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  13311. Rectangle rec2_1 = new Rectangle( TableWidth + LeftWidth + LeftAdd - FtWidth, rec2.Y, FtWidth, RowContentHeight );
  13312. g.DrawString( StrValue, ft12, b, rec2_1 );
  13313. #endregion
  13314. #region 左排
  13315. #region 第一行
  13316. Rectangle rec3 = new Rectangle( rec2.X, rec2.Y + rec2.Height, ColumnWidth1 + ColumnWidth2 + ColumnWidth3 + ColumnWidth4, RowHeight );
  13317. g.DrawRectangle( p, rec3 );//画标题矩形
  13318. Rectangle rec3_1 = new Rectangle( rec3.X + LeftAdd, rec3.Y + TopAdd, ColumnWidth1, RowContentHeight );
  13319. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "宝贝姓名" ), ft12, b, rec3_1 );//画第一列的列标题
  13320. Point p31_1 = new Point( rec3.X + ColumnWidth1, rec3.Y );
  13321. Point p31_2 = new Point( rec3.X + ColumnWidth1, rec3.Y + rec3.Height );
  13322. g.DrawLine( p, p31_1, p31_2 );//画第一表与第二列的界线
  13323. Rectangle rec3_2 = new Rectangle( p31_1.X + LeftAdd, p31_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
  13324. g.DrawString( RName, ft12, b, rec3_2 );//画第二列的列标题
  13325. Point p32_1 = new Point( p31_1.X + ColumnWidth2, rec3.Y );
  13326. Point p32_2 = new Point( p31_1.X + ColumnWidth2, rec3.Y + rec3.Height );
  13327. g.DrawLine( p, p32_1, p32_2 );//画第二表与第三列的界线
  13328. Rectangle rec3_3 = new Rectangle( p32_1.X + LeftAdd, p32_1.Y + TopAdd, ColumnWidth3, RowContentHeight );
  13329. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "家长姓名" ), ft12, b, rec3_3 );//画第三列的列标题
  13330. Point p33_1 = new Point( p32_1.X + ColumnWidth3, rec3.Y );
  13331. Point p33_2 = new Point( p32_1.X + ColumnWidth3, rec3.Y + rec3.Height );
  13332. g.DrawLine( p, p33_1, p33_2 );//画第三表与第四列的界线
  13333. Rectangle rec3_4 = new Rectangle( p33_1.X + LeftAdd, p33_1.Y + TopAdd, ColumnWidth4, RowContentHeight );
  13334. g.DrawString( PName, ft12, b, rec3_4 );//画第四列的列标题
  13335. #endregion
  13336. #region 第二行
  13337. Rectangle rec4 = new Rectangle( rec3.X, rec3.Y + rec3.Height, rec3.Width, RowHeight );
  13338. g.DrawRectangle( p, rec4 );//画标题矩形
  13339. Rectangle rec4_1 = new Rectangle( rec4.X + LeftAdd, rec4.Y + TopAdd, ColumnWidth1, RowContentHeight );
  13340. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "宝贝生日" ), ft12, b, rec4_1 );//画第一列的列标题
  13341. Point p41_1 = new Point( rec4.X + ColumnWidth1, rec4.Y );
  13342. Point p41_2 = new Point( rec4.X + ColumnWidth1, rec4.Y + rec4.Height );
  13343. g.DrawLine( p, p41_1, p41_2 );//画第一表与第二列的界线
  13344. Rectangle rec4_2 = new Rectangle( p41_1.X + LeftAdd, p41_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
  13345. g.DrawString( RBirthday, ft12, b, rec4_2 );//画第二列的列标题
  13346. Point p42_1 = new Point( p41_1.X + ColumnWidth2, rec4.Y );
  13347. Point p42_2 = new Point( p41_1.X + ColumnWidth2, rec4.Y + rec4.Height );
  13348. g.DrawLine( p, p42_1, p42_2 );//画第二表与第三列的界线
  13349. Rectangle rec4_3 = new Rectangle( p42_1.X + LeftAdd, p42_1.Y + TopAdd, ColumnWidth3, RowContentHeight );
  13350. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "联系电话" ), ft12, b, rec4_3 );//画第三列的列标题
  13351. Point p43_1 = new Point( p42_1.X + ColumnWidth3, rec4.Y );
  13352. Point p43_2 = new Point( p42_1.X + ColumnWidth3, rec4.Y + rec4.Height );
  13353. g.DrawLine( p, p43_1, p43_2 );//画第三表与第四列的界线
  13354. Rectangle rec4_4 = new Rectangle( p43_1.X + LeftAdd, p43_1.Y + TopAdd, ColumnWidth4, RowContentHeight );
  13355. g.DrawString( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( PTelephone ), ft12, b, rec4_4 );//画第四列的列标题
  13356. #endregion
  13357. #region 第三行
  13358. Rectangle rec5 = new Rectangle( rec4.X, rec4.Y + rec4.Height, rec3.Width, RowHeight );
  13359. g.DrawRectangle( p, rec5 );//画标题矩形
  13360. Rectangle rec5_1 = new Rectangle( rec5.X + LeftAdd, rec5.Y + TopAdd, ColumnWidth1, RowContentHeight );
  13361. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "性别" ), ft12, b, rec5_1 );//画第一列的列标题
  13362. Point p51_1 = new Point( rec5.X + ColumnWidth1 / 2, rec5.Y );
  13363. Point p51_2 = new Point( rec5.X + ColumnWidth1 / 2, rec5.Y + rec5.Height );
  13364. g.DrawLine( p, p51_1, p51_2 );//画第一表与第二列的界线
  13365. Rectangle rec5_2 = new Rectangle( p51_1.X + LeftAdd, p51_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
  13366. g.DrawString( RSex, ft12, b, rec5_2 );//画第二列的列标题
  13367. Point p52_1 = new Point( p41_1.X, rec5.Y );
  13368. Point p52_2 = new Point( p41_1.X, rec5.Y + rec5.Height );
  13369. g.DrawLine( p, p52_1, p52_2 );//画第二表与第三列的界线
  13370. Rectangle rec5A_1 = new Rectangle( p52_1.X + LeftAdd, p52_1.Y + TopAdd, ColumnWidth1, RowContentHeight );
  13371. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "年龄" ), ft12, b, rec5A_1 );//画第一列的列标题
  13372. Point p51A_1 = new Point( p52_1.X + ColumnWidth1 / 2, rec5.Y );
  13373. Point p51A_2 = new Point( p52_1.X + ColumnWidth1 / 2, rec5.Y + rec5.Height );
  13374. g.DrawLine( p, p51A_1, p51A_2 );//画第一表与第二列的界线
  13375. Rectangle rec5A_2 = new Rectangle( p51A_1.X + LeftAdd, p51A_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
  13376. g.DrawString( RAgeString, ft12, b, rec5A_2 );//画第二列的列标题
  13377. Point p52A_1 = new Point( p42_1.X, rec5.Y );
  13378. Point p52A_2 = new Point( p42_1.X, rec5.Y + rec5.Height );
  13379. g.DrawLine( p, p52A_1, p52A_2 );//画第二表与第三列的界线
  13380. Rectangle rec5_3 = new Rectangle( p52A_1.X + LeftAdd, p52A_1.Y + TopAdd, ColumnWidth3, RowContentHeight );
  13381. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "微信" ), ft12, b, rec5_3 );//画第三列的列标题
  13382. Point p53_1 = new Point( p52A_1.X + ColumnWidth3, rec5.Y );
  13383. Point p53_2 = new Point( p52A_1.X + ColumnWidth3, rec5.Y + rec5.Height );
  13384. g.DrawLine( p, p53_1, p53_2 );//画第三表与第四列的界线
  13385. Rectangle rec5_4 = new Rectangle( p53_1.X + LeftAdd, p53_1.Y + TopAdd, ColumnWidth4, RowContentHeight );
  13386. g.DrawString( PMicroSignal, ft12, b, rec5_4 );//画第四列的列标题
  13387. #endregion
  13388. #region 第四行
  13389. int rec5_Y = rec4.Y + rec4.Height;
  13390. int rec9Height = 0;
  13391. if ( LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.EnabledIDNumber )
  13392. {
  13393. Rectangle rec6 = new Rectangle( rec5.X, rec5.Y + rec5.Height, rec3.Width, RowHeight );
  13394. g.DrawRectangle( p, rec6 );//画标题矩形
  13395. Rectangle rec6_1 = new Rectangle( rec6.X + LeftAdd, rec6.Y + TopAdd, ColumnWidth1, RowContentHeight );
  13396. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "入册" ), ft12, b, rec6_1 );//画第一列的列标题
  13397. Point p61_1 = new Point( rec6.X + ColumnWidth1, rec6.Y );
  13398. Point p61_2 = new Point( rec6.X + ColumnWidth1, rec6.Y + rec6.Height );
  13399. g.DrawLine( p, p61_1, p61_2 );//画第一表与第二列的界线
  13400. Rectangle rec6_2 = new Rectangle( p61_1.X + LeftAdd, p61_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
  13401. g.DrawString( IntoRegisterQuantit.ToString().Trim(), ft12, b, rec6_2 );//画第二列的列标题
  13402. Point p62_1 = new Point( p61_1.X + ColumnWidth2, rec6.Y );
  13403. Point p62_2 = new Point( p61_1.X + ColumnWidth2, rec6.Y + rec6.Height );
  13404. g.DrawLine( p, p62_1, p62_2 );//画第二表与第三列的界线
  13405. Rectangle rec6_3 = new Rectangle( p62_1.X + LeftAdd, p62_1.Y + TopAdd, ColumnWidth3, RowContentHeight );
  13406. g.DrawString( "QQ", ft12, b, rec6_3 );//画第三列的列标题
  13407. Point p63_1 = new Point( p62_1.X + ColumnWidth3, rec6.Y );
  13408. Point p63_2 = new Point( p62_1.X + ColumnWidth3, rec6.Y + rec6.Height );
  13409. g.DrawLine( p, p63_1, p63_2 );//画第三表与第四列的界线
  13410. Rectangle rec6_4 = new Rectangle( p63_1.X + LeftAdd, p63_1.Y + TopAdd, ColumnWidth4, RowContentHeight );
  13411. g.DrawString( PQQ, ft12, b, rec6_4 );//画第四列的列标题
  13412. Rectangle rec6A = new Rectangle( rec6.X, rec6.Y + rec6.Height, rec3.Width, RowHeight );
  13413. g.DrawRectangle( p, rec6A );//画标题矩形
  13414. Rectangle rec6A_1 = new Rectangle( rec6A.X + LeftAdd, rec6A.Y + TopAdd, ColumnWidth1, RowContentHeight );
  13415. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "入底" ), ft12, b, rec6A_1 );//画第一列的列标题
  13416. Point p6A1_1 = new Point( rec6A.X + ColumnWidth1, rec6A.Y );
  13417. Point p6A1_2 = new Point( rec6A.X + ColumnWidth1, rec6A.Y + rec6A.Height );
  13418. g.DrawLine( p, p6A1_1, p6A1_2 );//画第一表与第二列的界线
  13419. Rectangle rec6A_2 = new Rectangle( p6A1_1.X + LeftAdd, p6A1_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
  13420. string StrIntoBottom = IntoBottomQuantity.ToString().Trim();
  13421. if ( StrIntoBottom == "0" )
  13422. {
  13423. StrIntoBottom = LYFZ.BLL.OtherCommonModel.FontConversion( "不送" );
  13424. }
  13425. else if ( StrIntoBottom == "-1" )
  13426. {
  13427. StrIntoBottom = LYFZ.BLL.OtherCommonModel.FontConversion( "全送" );
  13428. }
  13429. g.DrawString( StrIntoBottom, ft12, b, rec6A_2 );//画第二列的列标题
  13430. Point p6A2_1 = new Point( p6A1_1.X + ColumnWidth2, rec6A.Y );
  13431. Point p6A2_2 = new Point( p6A1_1.X + ColumnWidth2, rec6A.Y + rec6A.Height );
  13432. g.DrawLine( p, p6A2_1, p6A2_2 );//画第二表与第三列的界线
  13433. Rectangle rec6A_3 = new Rectangle( p6A2_1.X + LeftAdd, p6A2_1.Y + TopAdd, ColumnWidth3, RowContentHeight );
  13434. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "身份证号" ), ft12, b, rec6A_3 );//画第三列的列标题
  13435. Point p6A3_1 = new Point( p6A2_1.X + ColumnWidth3, rec6A.Y );
  13436. Point p6A3_2 = new Point( p6A2_1.X + ColumnWidth3, rec6A.Y + rec6A.Height );
  13437. g.DrawLine( p, p6A3_1, p6A3_2 );//画第三表与第四列的界线
  13438. Rectangle rec6A_4 = new Rectangle( p6A3_1.X + LeftAdd, p6A3_1.Y + TopAdd, ColumnWidth4, RowContentHeight );
  13439. g.DrawString( PIDNumber, ft12, b, rec6A_4 );//画第四列的列标题
  13440. rec5_Y = rec6A.Y + rec6A.Height;
  13441. rec9Height = RowHeight;
  13442. }
  13443. else
  13444. {
  13445. //Rectangle rec6 = new Rectangle(rec5.X, rec5.Y + rec5.Height, rec3.Width, RowHeight);
  13446. //g.DrawRectangle(p, rec6);//画标题矩形
  13447. //Rectangle rec6_1 = new Rectangle(rec6.X + LeftAdd, rec6.Y + TopAdd, ColumnWidth1, RowContentHeight);
  13448. //g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("入册"), ft9, b, rec6_1);//画第一列的列标题
  13449. //Point p61_1 = new Point(p51_1.X, rec6.Y);
  13450. //Point p61_2 = new Point(p51_1.X, rec6.Y + rec6.Height);
  13451. //g.DrawLine(p, p61_1, p61_2);//画第一表与第二列的界线
  13452. //Rectangle rec6_2 = new Rectangle(p61_1.X + LeftAdd, p61_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
  13453. //g.DrawString(IntoRegisterQuantit.ToString().Trim(), ft9, b, rec6_2);//画第二列的列标题
  13454. //Point p62_1 = new Point(p52_1.X, rec6.Y);
  13455. //Point p62_2 = new Point(p52_1.X, rec6.Y + rec6.Height);
  13456. //g.DrawLine(p, p62_1, p62_2);//画第二表与第三列的界线
  13457. //Rectangle rec6A_1 = new Rectangle(p62_1.X + LeftAdd, p62_1.Y + TopAdd, ColumnWidth1, RowContentHeight);
  13458. //g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("入底"), ft9, b, rec6A_1);//画第一列的列标题
  13459. //Point p61A_1 = new Point(p51A_1.X, rec6.Y);
  13460. //Point p61A_2 = new Point(p51A_1.X, rec6.Y + rec6.Height);
  13461. //g.DrawLine(p, p61A_1, p61A_2);//画第一表与第二列的界线
  13462. //string StrIntoBottom = IntoBottomQuantity.ToString().Trim();
  13463. //if (StrIntoBottom == "0")
  13464. //{ StrIntoBottom = LYFZ.BLL.OtherCommonModel.FontConversion("不送"); }
  13465. //else if (StrIntoBottom == "-1")
  13466. //{ StrIntoBottom = LYFZ.BLL.OtherCommonModel.FontConversion("全送"); }
  13467. //Rectangle rec6A_2 = new Rectangle(p61A_1.X + LeftAdd, p61A_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
  13468. //g.DrawString(StrIntoBottom, ft9, b, rec6A_2);//画第二列的列标题
  13469. //Point p62A_1 = new Point(p52A_1.X, rec6.Y);
  13470. //Point p62A_2 = new Point(p52A_1.X, rec6.Y + rec6.Height);
  13471. //g.DrawLine(p, p62A_1, p62A_2);//画第二表与第三列的界线
  13472. //Rectangle rec6_3 = new Rectangle(p62A_1.X + LeftAdd, p62A_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
  13473. //g.DrawString("QQ", ft9, b, rec6_3);//画第三列的列标题
  13474. //Point p63_1 = new Point(p62A_1.X + ColumnWidth3, rec6.Y);
  13475. //Point p63_2 = new Point(p62A_1.X + ColumnWidth3, rec6.Y + rec6.Height);
  13476. //g.DrawLine(p, p63_1, p63_2);//画第三表与第四列的界线
  13477. //Rectangle rec6_4 = new Rectangle(p63_1.X + LeftAdd, p63_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
  13478. //g.DrawString(PQQ, ft9, b, rec6_4);//画第四列的列标题
  13479. //rec5_Y = rec6.Y + rec6.Height;
  13480. Rectangle rec6 = new Rectangle( rec5.X, rec5.Y + rec5.Height, rec3.Width, RowHeight );
  13481. g.DrawRectangle( p, rec6 );//画标题矩形
  13482. //Rectangle rec5_1 = new Rectangle(rec5.X + LeftAdd, rec5.Y + TopAdd, ColumnWidth1, RowContentHeight);
  13483. //g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("性别"), ft9, b, rec5_1);//画第一列的列标题
  13484. //Point p51_1 = new Point(rec5.X + ColumnWidth1 / 2, rec5.Y);
  13485. //Point p51_2 = new Point(rec5.X + ColumnWidth1 / 2, rec5.Y + rec5.Height);
  13486. //g.DrawLine(p, p51_1, p51_2);//画第一表与第二列的界线
  13487. Rectangle rec6_1 = new Rectangle( rec6.X + LeftAdd, rec6.Y + TopAdd, ColumnWidth1, RowContentHeight );
  13488. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "入册" ), ft12, b, rec6_1 );//画第一列的列标题
  13489. Point p61_1 = new Point( rec6.X + ColumnWidth1, rec6.Y );
  13490. Point p61_2 = new Point( rec6.X + ColumnWidth1, rec6.Y + rec6.Height );
  13491. g.DrawLine( p, p61_1, p61_2 );//画第一表与第二列的界线
  13492. Rectangle rec6_2 = new Rectangle( p61_1.X + LeftAdd, p61_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
  13493. g.DrawString( IntoRegisterQuantit.ToString().Trim(), ft12, b, rec6_2 );//画第二列的列标题
  13494. Point p62_1 = new Point( p52_1.X + ColumnWidth2, rec6.Y );
  13495. Point p62_2 = new Point( p52_1.X + ColumnWidth2, rec6.Y + rec6.Height );
  13496. g.DrawLine( p, p62_1, p62_2 );//画第二表与第三列的界线
  13497. Rectangle rec6_3 = new Rectangle( p62_1.X + LeftAdd, p62_1.Y + TopAdd, ColumnWidth3, RowContentHeight );
  13498. g.DrawString( "QQ", ft12, b, rec6_3 );//画第三列的列标题
  13499. Point p63_1 = new Point( p62_1.X + ColumnWidth3, rec6.Y );
  13500. Point p63_2 = new Point( p62_1.X + ColumnWidth3, rec6.Y + rec6.Height );
  13501. g.DrawLine( p, p63_1, p63_2 );//画第三表与第四列的界线
  13502. Rectangle rec6_4 = new Rectangle( p63_1.X + LeftAdd, p63_1.Y + TopAdd, ColumnWidth4, RowContentHeight );
  13503. g.DrawString( PQQ, ft12, b, rec6_4 );//画第四列的列标题
  13504. Rectangle rec6A = new Rectangle( rec6.X, rec6.Y + rec6.Height, rec3.Width, RowHeight );
  13505. g.DrawRectangle( p, rec6A );//画标题矩形
  13506. Rectangle rec6A_1 = new Rectangle( rec6A.X + LeftAdd, rec6A.Y + TopAdd, ColumnWidth1, RowContentHeight );
  13507. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "入底" ), ft12, b, rec6A_1 );//画第一列的列标题
  13508. Point p61A_1 = new Point( rec6A.X + ColumnWidth1, rec6A.Y );
  13509. Point p61A_2 = new Point( rec6A.X + ColumnWidth1, rec6A.Y + rec6A.Height );
  13510. g.DrawLine( p, p61A_1, p61A_2 );//画第一表与第二列的界线
  13511. //string StrIntoBottom = IntoBottomQuantity.ToString().Trim();
  13512. //if (StrIntoBottom == "0")
  13513. //{ StrIntoBottom = LYFZ.BLL.OtherCommonModel.FontConversion("不送"); }
  13514. //else if (StrIntoBottom == "-1")
  13515. //{ StrIntoBottom = LYFZ.BLL.OtherCommonModel.FontConversion("全送"); }
  13516. Rectangle rec6A_2 = new Rectangle( p61A_1.X + LeftAdd, p61A_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
  13517. g.DrawString( StrIntoBottomQuantity, ft12, b, rec6A_2 );//画第二列的列标题
  13518. Point p62A_1 = new Point( p61A_1.X, rec6A.Y );
  13519. Point p62A_2 = new Point( p61A_1.X, rec6A.Y + rec6A.Height );
  13520. g.DrawLine( p, p62A_1, p62A_2 );//画第二表与第三列的界线
  13521. rec5_Y = rec6A.Y + rec6A.Height;
  13522. }
  13523. #endregion
  13524. #region 第五行
  13525. Rectangle rec7 = new Rectangle( rec3.X, rec5_Y, rec3.Width, RowHeight );
  13526. g.DrawRectangle( p, rec7 );//画标题矩形
  13527. Rectangle rec7_1 = new Rectangle( rec7.X + LeftAdd, rec7.Y + TopAdd, ColumnWidth1, RowContentHeight );
  13528. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "内景服装数" ), ft12, b, rec7_1 );//画第一列的列标题
  13529. Point p71_1 = new Point( rec7.X + ColumnWidth1, rec7.Y );
  13530. Point p71_2 = new Point( rec7.X + ColumnWidth1, rec7.Y + rec7.Height );
  13531. g.DrawLine( p, p71_1, p71_2 );//画第一表与第二列的界线
  13532. Rectangle rec7_2 = new Rectangle( p71_1.X + LeftAdd, p71_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
  13533. g.DrawString( InnerSights.ToString(), ft12, b, rec7_2 );//画第二列的列标题
  13534. Point p72_1 = new Point( p71_1.X + ColumnWidth2, rec7.Y );
  13535. Point p72_2 = new Point( p71_1.X + ColumnWidth2, rec7.Y + rec7.Height );
  13536. g.DrawLine( p, p72_1, p72_2 );//画第二表与第三列的界线
  13537. Rectangle rec7_3 = new Rectangle( p72_1.X + LeftAdd, p72_1.Y + TopAdd, ColumnWidth3, RowContentHeight );
  13538. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "外景服装数" ), ft12, b, rec7_3 );//画第三列的列标题
  13539. Point p73_1 = new Point( p72_1.X + ColumnWidth3, rec7.Y );
  13540. Point p73_2 = new Point( p72_1.X + ColumnWidth3, rec7.Y + rec7.Height );
  13541. g.DrawLine( p, p73_1, p73_2 );//画第三表与第四列的界线
  13542. Rectangle rec7_4 = new Rectangle( p73_1.X + LeftAdd, p73_1.Y + TopAdd, ColumnWidth4, RowContentHeight );
  13543. g.DrawString( OuterSights.ToString(), ft12, b, rec7_4 );//画第四列的列标题
  13544. #endregion
  13545. #region 第六行
  13546. Rectangle rec8 = new Rectangle( rec7.X, rec7.Y + rec7.Height, rec3.Width, RowHeight );
  13547. g.DrawRectangle( p, rec8 );//画标题矩形
  13548. Rectangle rec8_1 = new Rectangle( rec8.X + LeftAdd, rec8.Y + TopAdd, ColumnWidth1, RowContentHeight );
  13549. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "家庭地址" ), ft12, b, rec8_1 );//画第一列的列标题
  13550. Point p81_1 = new Point( rec8.X + ColumnWidth1, rec8.Y );
  13551. Point p81_2 = new Point( rec8.X + ColumnWidth1, rec8.Y + rec8.Height );
  13552. g.DrawLine( p, p81_1, p81_2 );//画第一表与第二列的界线
  13553. Rectangle rec8_2 = new Rectangle( p81_1.X + LeftAdd, p81_1.Y + TopAdd, rec8.Width - rec8_1.Width, RowContentHeight );
  13554. g.DrawString( PAddress, ft12, b, rec8_2 );//画第六列的列标题
  13555. #endregion
  13556. #region 第七行
  13557. Rectangle rec8A = new Rectangle( rec8.X, rec8.Y + rec8.Height, rec3.Width, RowHeight );
  13558. g.DrawRectangle( p, rec8A );//画标题矩形
  13559. Rectangle rec8A_1 = new Rectangle( rec8A.X + LeftAdd, rec8A.Y + TopAdd, ColumnWidth1, RowContentHeight );
  13560. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "喜爱风格" ), ft12, b, rec8A_1 );//画第一列的列标题
  13561. Point p81A_1 = new Point( rec8A.X + ColumnWidth1, rec8A.Y );
  13562. Point p81A_2 = new Point( rec8A.X + ColumnWidth1, rec8A.Y + rec8A.Height );
  13563. g.DrawLine( p, p81A_1, p81A_2 );//画第一表与第二列的界线
  13564. Rectangle rec8A_2 = new Rectangle( p81A_1.X + LeftAdd, p81A_1.Y + TopAdd, rec8.Width - rec8A_1.Width, RowContentHeight );
  13565. string[] OrdLovedStyle = tbl_Order.Rows[0]["Ord_LovedStyle"].ToString().Trim().Split( '|' );
  13566. string StrLovedStyle = "";
  13567. for ( int i = 0; i < OrdLovedStyle.Length; i++ )
  13568. {
  13569. if ( OrdLovedStyle[i].Trim() != "" )
  13570. {
  13571. string[] StrID = OrdLovedStyle[i].Trim().Split( '_' );
  13572. DataRow dtRow = tblStyle.Rows.Find( StrID[1].Trim() );
  13573. if ( dtRow != null )
  13574. {
  13575. StrLovedStyle += dtRow["Style_Name"] + ",";
  13576. }
  13577. }
  13578. }
  13579. g.DrawString( StrLovedStyle.TrimEnd( ',' ), ft12, b, rec8A_2 );//画第二列的列标题
  13580. #endregion
  13581. #region 第一列
  13582. #region 第一行
  13583. Rectangle rec9 = new Rectangle( rec8A.X, rec8A.Y + rec8A.Height, rec3.Width, 510 - RowHeight * 2 + Rec1Height - rec9Height );//1515
  13584. g.DrawRectangle( p, rec9 );//画标题矩形
  13585. string StrProdName = LYFZ.BLL.OtherCommonModel.FontConversion( "详细内容:" );
  13586. for ( int i = 0; i < tblProductList.Rows.Count; i++ )
  13587. {
  13588. StrProdName += "\r\n" + tblProductList.Rows[i]["ProdName"].ToString().Trim();
  13589. }
  13590. for ( int i = 0; i < tblService.Rows.Count; i++ )
  13591. {
  13592. StrProdName += "\r\n" + tblService.Rows[i]["ProdName"].ToString().Trim();
  13593. }
  13594. Rectangle rec9_1 = new Rectangle( rec9.X + LeftAdd, rec9.Y + TopAdd, rec9.Width - LeftAdd * 2, rec9.Height - TopAdd * 2 );
  13595. g.DrawString( StrProdName + "\r\n\r\n" + strSights, GetFontSize( "儿童预约单内容详情字体大小" ), b, rec9_1 );//画第一列的列标题
  13596. #endregion
  13597. #region 第二行
  13598. Rectangle recA1 = new Rectangle( rec9.X, rec9.Y + rec9.Height, rec3.Width, 100 );
  13599. g.DrawRectangle( p, recA1 );//画标题矩形
  13600. Rectangle recA1_1 = new Rectangle( recA1.X + LeftAdd, recA1.Y + TopAdd, recA1.Width, recA1.Height - TopAdd * 2 );
  13601. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "订单备注:" ) + tbl_Order.Rows[0]["Ord_Remark"].ToString().Trim(), ft12, b, recA1_1 );//画第一列的列标题
  13602. #endregion
  13603. #region 第三行
  13604. Rectangle recA2 = new Rectangle( recA1.X, recA1.Y + recA1.Height, rec3.Width, RowHeight );
  13605. g.DrawRectangle( p, recA2 );//画标题矩形
  13606. Rectangle recA2_1 = new Rectangle( recA2.X + LeftAdd, recA2.Y + TopAdd, ColumnWidth1, RowContentHeight );
  13607. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "摄影师" ), ft12, b, recA2_1 );//画第一列的列标题
  13608. Point pA21_1 = new Point( recA2.X + ColumnWidth1, recA2.Y );
  13609. Point pA21_2 = new Point( recA2.X + ColumnWidth1, recA2.Y + recA2.Height );
  13610. g.DrawLine( p, pA21_1, pA21_2 );//画第一表与第二列的界线
  13611. Rectangle recA2_2 = new Rectangle( pA21_1.X + LeftAdd, pA21_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
  13612. g.DrawString( Photographer, ft12, b, recA2_2 );//画第二列的列标题
  13613. Point pA22_1 = new Point( pA21_1.X + ColumnWidth2, recA2.Y );
  13614. Point pA22_2 = new Point( pA21_1.X + ColumnWidth2, recA2.Y + recA2.Height );
  13615. g.DrawLine( p, pA22_1, pA22_2 );//画第二表与第三列的界线
  13616. Rectangle recA2_3 = new Rectangle( pA22_1.X + LeftAdd, pA22_1.Y + TopAdd, ColumnWidth3, RowContentHeight );
  13617. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "化妆师" ), ft12, b, recA2_3 );//画第三列的列标题
  13618. Point pA23_1 = new Point( pA22_1.X + ColumnWidth3, recA2.Y );
  13619. Point pA23_2 = new Point( pA22_1.X + ColumnWidth3, recA2.Y + recA2.Height );
  13620. g.DrawLine( p, pA23_1, pA23_2 );//画第三表与第四列的界线
  13621. Rectangle recA2_4 = new Rectangle( pA23_1.X + LeftAdd, pA23_1.Y + TopAdd, ColumnWidth4, RowContentHeight );
  13622. g.DrawString( MakeupArtist.Trim(), ft12, b, recA2_4 );//画第四列的列标题
  13623. //Point pA24_1 = new Point(pA23_1.X + ColumnWidth4, recA2.Y);
  13624. //Point pA24_2 = new Point(pA23_1.X + ColumnWidth4, recA2.Y + recA2.Height);
  13625. //g.DrawLine(p, pA24_1, pA24_2);//画第四表与第五列的界线
  13626. #endregion
  13627. #region 第四行
  13628. Rectangle recA3 = new Rectangle( recA2.X, recA2.Y + recA2.Height, rec3.Width, RowHeight );
  13629. g.DrawRectangle( p, recA3 );//画标题矩形
  13630. Rectangle recA3_1 = new Rectangle( recA3.X + LeftAdd, recA3.Y + TopAdd, ColumnWidth1, RowContentHeight );
  13631. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "拍摄时间" ), ft12, b, recA3_1 );//画第一列的列标题
  13632. Point pA31_1 = new Point( recA3.X + ColumnWidth1, recA3.Y );
  13633. Point pA31_2 = new Point( recA3.X + ColumnWidth1, recA3.Y + recA3.Height );
  13634. g.DrawLine( p, pA31_1, pA31_2 );//画第一表与第二列的界线
  13635. Rectangle recA3_2 = new Rectangle( pA31_1.X + LeftAdd, pA31_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
  13636. g.DrawString( PhotographyTime, ft12, b, recA3_2 );//画第二列的列标题
  13637. Point pA32_1 = new Point( pA31_1.X + ColumnWidth2, recA3.Y );
  13638. Point pA32_2 = new Point( pA31_1.X + ColumnWidth2, recA3.Y + recA3.Height );
  13639. g.DrawLine( p, pA32_1, pA32_2 );//画第二表与第三列的界线
  13640. Rectangle recA3_3 = new Rectangle( pA32_1.X + LeftAdd, pA32_1.Y + TopAdd, ColumnWidth3, RowContentHeight );
  13641. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "取件日期" ), ft12, b, recA3_3 );//画第三列的列标题
  13642. Point pA33_1 = new Point( pA32_1.X + ColumnWidth3, recA3.Y );
  13643. Point pA33_2 = new Point( pA32_1.X + ColumnWidth3, recA3.Y + recA3.Height );
  13644. g.DrawLine( p, pA33_1, pA33_2 );//画第三表与第四列的界线
  13645. string strPickupTime = "";
  13646. if ( tblPickupTime.Rows.Count > 0 )
  13647. {
  13648. if ( !string.IsNullOrEmpty( tblPickupTime.Rows[0]["OPlist_PickupTime"].ToString().Trim() ) )
  13649. {
  13650. strPickupTime = LYFZ.Command.Command_Validate.DateTimeToString( tblPickupTime.Rows[0]["OPlist_PickupTime"] );
  13651. }
  13652. }
  13653. Rectangle recA3_4 = new Rectangle( pA33_1.X + LeftAdd, pA33_1.Y + TopAdd, ColumnWidth4, RowContentHeight );
  13654. g.DrawString( strPickupTime, ft12, b, recA2_4 );//画第四列的列标题
  13655. Point pA34_1 = new Point( pA33_1.X + ColumnWidth4, recA3.Y );
  13656. Point pA34_2 = new Point( pA33_1.X + ColumnWidth4, recA3.Y + recA3.Height );
  13657. g.DrawLine( p, pA34_1, pA34_2 );//画第四表与第五列的界线
  13658. #endregion
  13659. #endregion
  13660. #region 第七行
  13661. Rectangle recA4 = new Rectangle( recA3.X, recA3.Y + recA3.Height, rec3.Width, RowHeight );
  13662. g.DrawRectangle( p, recA4 );//画标题矩形
  13663. Rectangle recA4_1 = new Rectangle( recA4.X + LeftAdd, recA4.Y + TopAdd, ColumnWidth1, RowContentHeight );
  13664. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "选片日期" ), ft12, b, recA4_1 );//画第一列的列标题
  13665. Point pA41_1 = new Point( recA4.X + ColumnWidth1, recA4.Y );
  13666. Point pA41_2 = new Point( recA4.X + ColumnWidth1, recA4.Y + recA4.Height );
  13667. g.DrawLine( p, pA41_1, pA41_2 );//画第一表与第二列的界线
  13668. Rectangle recA4_2 = new Rectangle( pA41_1.X + LeftAdd, pA41_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
  13669. g.DrawString( FilmSelectionTime, ft12, b, recA4_2 );//画第二列的列标题
  13670. Point pA42_1 = new Point( pA41_1.X + ColumnWidth2, recA4.Y );
  13671. Point pA42_2 = new Point( pA41_1.X + ColumnWidth2, recA4.Y + recA4.Height );
  13672. g.DrawLine( p, pA42_1, pA42_2 );//画第二表与第三列的界线
  13673. Rectangle recA4_3 = new Rectangle( pA42_1.X + LeftAdd, pA42_1.Y + TopAdd, ColumnWidth3, RowContentHeight );
  13674. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "引导师" ), ft12, b, recA4_3 );//画第三列的列标题
  13675. Point pA43_1 = new Point( pA42_1.X + ColumnWidth3, recA4.Y );
  13676. Point pA43_2 = new Point( pA42_1.X + ColumnWidth3, recA4.Y + recA4.Height );
  13677. g.DrawLine( p, pA43_1, pA43_2 );//画第三表与第四列的界线
  13678. Rectangle recA4_4 = new Rectangle( pA43_1.X + LeftAdd, pA43_1.Y + TopAdd, ColumnWidth4, RowContentHeight );
  13679. g.DrawString( BootDivision, ft12, b, recA4_4 );//画第四列的列标题
  13680. #endregion
  13681. #endregion
  13682. #region 右排
  13683. #region 第一行
  13684. Rectangle Rrec3 = new Rectangle( rec3.X + rec3.Width, rec3.Y, ColumnWidth5 + ColumnWidth6, RowHeight );
  13685. g.DrawRectangle( p, Rrec3 );//画标题矩形
  13686. Rectangle Rrec3_5 = new Rectangle( Rrec3.X + LeftAdd, Rrec3.Y + TopAdd, ColumnWidth5, RowContentHeight );
  13687. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "套系名称" ), ft12, b, Rrec3_5 );//画第五列的列标题
  13688. Point Rp35_1 = new Point( Rrec3.X + ColumnWidth5, Rrec3.Y );
  13689. Point Rp35_2 = new Point( Rrec3.X + ColumnWidth5, Rrec3.Y + Rrec3.Height );
  13690. g.DrawLine( p, Rp35_1, Rp35_2 );//画第五表与第六列的界线
  13691. Rectangle Rrec3_6 = new Rectangle( Rp35_1.X + LeftAdd, Rrec3_5.Y, ColumnWidth6, RowContentHeight );
  13692. g.DrawString( tbl_Order.Rows[0]["Ord_SeriesName"].ToString().Trim(), ft12, b, Rrec3_6 );//画第六列的列标题
  13693. #endregion
  13694. #region 第二行
  13695. Rectangle Rrec4 = new Rectangle( Rrec3.X, Rrec3.Y + Rrec3.Height, Rrec3.Width, RowHeight );
  13696. g.DrawRectangle( p, Rrec4 );//画标题矩形
  13697. Rectangle Rrec4_5 = new Rectangle( Rrec4.X + LeftAdd, Rrec4.Y + TopAdd, ColumnWidth5, RowContentHeight );
  13698. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "套系金额" ), ft12, b, Rrec4_5 );//画第五列的列标题
  13699. Point Rp45_1 = new Point( Rp35_1.X, Rrec4.Y );
  13700. Point Rp45_2 = new Point( Rp35_1.X, Rrec4.Y + Rrec4.Height );
  13701. g.DrawLine( p, Rp45_1, Rp45_2 );//画第五表与第六列的界线
  13702. Rectangle Rrec4_6 = new Rectangle( Rp45_1.X + LeftAdd, Rrec4_5.Y, ColumnWidth6, RowContentHeight );
  13703. g.DrawString( tbl_Order.Rows[0]["Ord_SeriesPrice"].ToString().Trim(), ft12, b, Rrec4_6 );//画第六列的列标题
  13704. #endregion
  13705. #region 第三行
  13706. Rectangle Rrec5 = new Rectangle( Rrec4.X, Rrec4.Y + Rrec4.Height, Rrec3.Width, RowHeight );
  13707. g.DrawRectangle( p, Rrec5 );//画标题矩形
  13708. Rectangle Rrec5_5 = new Rectangle( Rrec5.X + LeftAdd, Rrec5.Y + TopAdd, ColumnWidth5, RowContentHeight );
  13709. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "定金" ), ft12, b, Rrec5_5 );//画第五列的列标题
  13710. Point Rp55_1 = new Point( Rp45_1.X, Rrec5.Y );
  13711. Point Rp55_2 = new Point( Rp45_1.X, Rrec5.Y + Rrec5.Height );
  13712. g.DrawLine( p, Rp55_1, Rp55_2 );//画第五表与第六列的界线
  13713. Rectangle Rrec5_6 = new Rectangle( Rp55_1.X + LeftAdd, Rrec5_5.Y, ColumnWidth6, RowContentHeight );
  13714. g.DrawString( OrdPrice, ft12, b, Rrec5_6 );//画第六列的列标题
  13715. #endregion
  13716. #region 第四行
  13717. Rectangle Rrec6 = new Rectangle( Rrec5.X, Rrec5.Y + Rrec5.Height, Rrec3.Width, RowHeight );
  13718. g.DrawRectangle( p, Rrec6 );//画标题矩形
  13719. Rectangle Rrec6_5 = new Rectangle( Rrec6.X + LeftAdd, Rrec6.Y + TopAdd, ColumnWidth5, RowContentHeight );
  13720. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "余款金额" ), ft12, b, Rrec6_5 );//画第五列的列标题
  13721. Point Rp65_1 = new Point( Rp55_1.X, Rrec6.Y );
  13722. Point Rp65_2 = new Point( Rp55_1.X, Rrec6.Y + Rrec6.Height );
  13723. g.DrawLine( p, Rp65_1, Rp65_2 );//画第五表与第六列的界线
  13724. Rectangle Rrec6_6 = new Rectangle( Rp65_1.X + LeftAdd, Rrec6_5.Y, ColumnWidth6, RowContentHeight );
  13725. g.DrawString( tbl_Order.Rows[0]["Ord_OrderArrears"].ToString().Trim(), ft12, b, Rrec6_6 );//画第六列的列标题
  13726. #endregion
  13727. #region 第六行
  13728. Rectangle Rrec8 = new Rectangle( Rrec6.X, Rrec6.Y + Rrec6.Height, Rrec3.Width, RowHeight );
  13729. g.DrawRectangle( p, Rrec8 );//画标题矩形
  13730. Rectangle Rrec8_5 = new Rectangle( Rrec8.X + LeftAdd, Rrec8.Y + TopAdd, ColumnWidth5, RowContentHeight );
  13731. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "门市" ), ft12, b, Rrec8_5 );//画第五列的列标题
  13732. Point Rp85_1 = new Point( Rp65_1.X, Rrec8.Y );
  13733. Point Rp85_2 = new Point( Rp65_1.X, Rrec8.Y + Rrec8.Height );
  13734. g.DrawLine( p, Rp85_1, Rp85_2 );//画第五表与第六列的界线
  13735. Rectangle rec8_6 = new Rectangle( Rp85_1.X, Rrec8_5.Y, ColumnWidth6, RowContentHeight );
  13736. string strOrderPerson = "";
  13737. if (tblUser.Rows.Count > 0)
  13738. {
  13739. if (Convert.ToBoolean(tblUser.Rows[0]["User_PhonePrint"]) == true)
  13740. strOrderPerson = tblUser.Rows[0]["User_Name"].ToString() + " " + tblUser.Rows[0]["User_Telephone"].ToString();
  13741. else
  13742. strOrderPerson = tblUser.Rows[0]["User_Name"].ToString() + " " + tbl.Rows[0]["Company_Telephone"].ToString();
  13743. }
  13744. g.DrawString( strOrderPerson, ft12, b, rec8_6 );//画第六列的列标题
  13745. #endregion
  13746. #region 第一列
  13747. Rectangle Rrec10 = new Rectangle( Rrec8.X, Rrec8.Y + Rrec8.Height, Rrec3.Width, recA2.Y - Rrec8.Y );
  13748. g.DrawRectangle( p, Rrec10 );//画标题矩形
  13749. StrValue = "";
  13750. if ( PrintOtherData.ContainsKey( "儿童预约单注意事项说明" ) && PrintOtherData["儿童预约单注意事项说明"].ToString().Trim().Length > 0 )
  13751. {
  13752. StrValue = PrintOtherData["儿童预约单注意事项说明"].ToString().Trim();
  13753. }
  13754. Rectangle rec10_1 = new Rectangle( Rrec10.X + LeftAdd, Rrec10.Y + TopAdd, Rrec10.Width - LeftAdd * 2, Rrec10.Height - TopAdd * 2 );
  13755. Font scaleFont = PrinterDrawMethod.ComputeAutoScaleFont( g, LYFZ.BLL.OtherCommonModel.FontConversion( "注意事项:\r\n" ) + StrValue, rec10_1, GetFontSize( "儿童预约单注意事项字体大小" ), minFontSize: 6 );
  13756. PrinterDrawMethod.DrawCellTextAutroWrap( g, LYFZ.BLL.OtherCommonModel.FontConversion( "注意事项:\r\n" ) + StrValue, rec10_1, scaleFont, autoWrap: true, nWrapLineSpace: 1, showFrame: false );
  13757. #endregion
  13758. #region 顾客签字
  13759. Rectangle RrecA5 = new Rectangle( Rrec10.X, Rrec10.Y + Rrec10.Height, Rrec3.Width, RowHeight * 2 );
  13760. g.DrawRectangle( p, RrecA5 );//画标题矩形
  13761. Rectangle RrecA5_1 = new Rectangle( RrecA5.X + LeftAdd, RrecA5.Y + RowContentHeight, ColumnWidth5, RowContentHeight );
  13762. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "顾客签字" ), ft12, b, RrecA5_1 );//画第五列的列标题
  13763. Point RpA51_1 = new Point( Rp65_1.X, RrecA5.Y );
  13764. Point RpA51_2 = new Point( Rp65_1.X, RrecA5.Y + RrecA5.Height );
  13765. g.DrawLine( p, RpA51_1, RpA51_2 );//画第四表与第五列的界线
  13766. #endregion
  13767. #endregion
  13768. #region 尾行
  13769. string rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion( "网址:" ) + tbl.Rows[0]["Company_URL"].ToString().Trim();
  13770. sizef = g.MeasureString( rec2Value, ft9 );
  13771. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  13772. int FtHeight = Convert.ToInt32( sizef.Height );
  13773. Rectangle recA6_1 = new Rectangle( TableWidth + LeftWidth - FtWidth, recA4.Y + recA4.Height + TopAdd, FtWidth, FtHeight );
  13774. g.DrawString( rec2Value, ft9, b, recA6_1 );//画第一列的列标题
  13775. Rectangle recA6 = new Rectangle( recA4.X, recA6_1.Y, TableWidth - recA6_1.Width - 50, FtHeight );
  13776. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "地址:" ) + tbl.Rows[0]["Company_Address"].ToString().Trim(), ft9, b, recA6 );//画第一列的列标题
  13777. Rectangle recA7 = new Rectangle( recA6.X, recA6.Y + recA6.Height, recA6.Width, FtHeight );
  13778. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "电话:" ) + tbl.Rows[0]["Company_Telephone"].ToString().Trim(), ft9, b, recA7 );//画第一列的列标题
  13779. rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion( "页:" ) + "1/1";
  13780. sizef = g.MeasureString( rec2Value, ft9 );
  13781. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  13782. FtHeight = Convert.ToInt32( sizef.Height );
  13783. Rectangle recA8 = new Rectangle( TableWidth + LeftWidth - FtWidth, recA7.Y + recA7.Height - TopAdd, FtWidth, FtHeight );
  13784. g.DrawString( rec2Value, ft9, b, recA8 );//画第一列的列标题
  13785. #endregion
  13786. }
  13787. /// <summary>
  13788. /// 儿童二等份打印
  13789. /// </summary>
  13790. /// <param name="objValue"></param>
  13791. private static void Child_OrderReport_TwoEqualPrint_Back( DataSet dtSet, Graphics g, Size size )
  13792. {
  13793. DataTable tbl = dtSet.Tables["ds"];
  13794. DataTable tbl_Order = dtSet.Tables["ds1"];
  13795. DataTable tbl_Digital = dtSet.Tables["ds2"];
  13796. DataTable tbl_Sights = dtSet.Tables["ds3"];
  13797. DataTable tblPickupTime = dtSet.Tables["ds4"];//取件时间
  13798. DataTable tblProductList = dtSet.Tables["ds5"];
  13799. DataTable tblClient = dtSet.Tables["ds6"];//客户资料
  13800. DataTable tblService = dtSet.Tables["ds7"];//服务
  13801. DataTable tblStyle = dtSet.Tables["ds8"];//喜爱风格
  13802. DataTable tblPayment = dtSet.Tables["ds9"];//订单定金
  13803. DataTable tblUser = dtSet.Tables["ds11"];//订单定金
  13804. string OrdPrice = "0.00";
  13805. if ( tblPayment.Rows.Count > 0 )
  13806. {
  13807. OrdPrice = tblPayment.Rows[0]["Pay_AmountOf"].ToString().Trim();
  13808. }
  13809. tblStyle.PrimaryKey = new DataColumn[] { tblStyle.Columns["ID"] };
  13810. DataTable tblIntoRB = dtSet.Tables["ds10"];//订单定金
  13811. int IntoRegisterQuantit = 0;
  13812. int IntoBottomQuantity = 0;
  13813. for ( int i = 0; i < tblIntoRB.Rows.Count; i++ )
  13814. {
  13815. IntoRegisterQuantit += Convert.ToInt32( tblIntoRB.Rows[i]["Ordv_IntoRegisterQuantity"] );
  13816. IntoBottomQuantity += Convert.ToInt32( tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"] );
  13817. }
  13818. Brush b = Brushes.Black;
  13819. Pen p = GetPen;
  13820. Font ft17 = new Font( "宋体", 17 );
  13821. Font ft13 = new Font( "宋体", 13 );
  13822. Font ft10 = new Font( "宋体", 10 );
  13823. Font ft9 = new Font( "宋体", 9 );
  13824. #region 获取数据
  13825. string PName = "";
  13826. string PTelephone = "";
  13827. string PMicroSignal = "";
  13828. string PMemberCardNumber = "";
  13829. string RName = "";
  13830. string RBirthday = "";
  13831. string RSex = "";
  13832. string RAgeString = "";
  13833. string StrAdderss = "";
  13834. for ( int i = 0; i < tblClient.Rows.Count; i++ )
  13835. {
  13836. if ( tblClient.Rows[i]["GM_Master"].ToString().Trim() == "1" && tblClient.Rows[i]["GM_ProtagonistCustomer"].ToString().Trim() == "0" )
  13837. {
  13838. PName = tblClient.Rows[i]["Cus_Name"].ToString().Trim();
  13839. PTelephone = tblClient.Rows[i]["Cus_Telephone"].ToString().Trim();
  13840. PMicroSignal = tblClient.Rows[i]["Cus_MicroSignal"].ToString().Trim();
  13841. DataTable tblMember = orbll.GetView_Custom( "tb_ErpMemberCard", StrWhere: "Mc_CustomerNumber = '" + tblClient.Rows[i]["Cus_CustomerNumber"].ToString().Trim() + "'", ShowColumnName: "Mc_CradNumber" ).Tables[0];
  13842. if ( tblMember.Rows.Count > 0 )
  13843. {
  13844. PMemberCardNumber = tblMember.Rows[0]["Mc_CradNumber"].ToString();
  13845. }
  13846. if ( tblClient.Rows[i]["Cus_Address"].ToString().Trim() != "" )
  13847. {
  13848. if ( StrAdderss == "" )
  13849. {
  13850. StrAdderss = tblClient.Rows[i]["Cus_Address"].ToString().Trim();
  13851. }
  13852. }
  13853. }
  13854. else if ( tblClient.Rows[i]["GM_Master"].ToString().Trim() == "0" && tblClient.Rows[i]["GM_ProtagonistCustomer"].ToString().Trim() == "1" )
  13855. {
  13856. RName = tblClient.Rows[i]["Cus_Name"].ToString().Trim();
  13857. RSex = tblClient.Rows[i]["Cus_Sex_cs"].ToString().Trim();
  13858. RAgeString = tblClient.Rows[i]["Age_String"].ToString().Trim();
  13859. if ( LYFZ.Command.Command_Validate.DateTimeToString( tblClient.Rows[i]["Cus_Birthday"] ) != "" )
  13860. {
  13861. RBirthday = LYFZ.Command.Command_Validate.DateTimeToString( tblClient.Rows[i]["Cus_Birthday"] );
  13862. if ( !string.IsNullOrEmpty( tblClient.Rows[i]["Cus_BirthdayLunar"].ToString().Trim() ) && tblClient.Rows[i]["Cus_BirthdayLunar"].ToString().Trim() == "1" )
  13863. {
  13864. RBirthday += LYFZ.BLL.OtherCommonModel.FontConversion( "(农历)" );
  13865. }
  13866. }
  13867. if ( tblClient.Rows[i]["Cus_Address"].ToString().Trim() != "" )
  13868. {
  13869. StrAdderss = tblClient.Rows[i]["Cus_Address"].ToString().Trim();
  13870. }
  13871. }
  13872. }
  13873. int InnerSights = 0;
  13874. int OuterSights = 0;
  13875. string strSights = "";
  13876. string Photographer = "";
  13877. string MakeupArtist = "";
  13878. string PhotographyTime = "";
  13879. string BootDivision = "";
  13880. for ( int i = 0; i < tbl_Sights.Rows.Count; i++ )
  13881. {
  13882. if ( tbl_Sights.Rows[i]["Ordpg_SightsType"].ToString().Trim() == "1" )
  13883. {
  13884. OuterSights += Convert.ToInt32( tbl_Sights.Rows[i]["Ordpg_ApparelQuantity"] );
  13885. }
  13886. else if ( tbl_Sights.Rows[i]["Ordpg_SightsType"].ToString().Trim() == "0" )
  13887. {
  13888. InnerSights += Convert.ToInt32( tbl_Sights.Rows[i]["Ordpg_ApparelQuantity"] );
  13889. }
  13890. strSights += (i + 1) + "." + tbl_Sights.Rows[i]["Ordpg_Sights"].ToString().Trim() + " ";
  13891. if ( tbl_Sights.Rows[i]["Ordpg_Photographer"].ToString().Trim() != "" )
  13892. {
  13893. Photographer = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetUserName( tbl_Sights.Rows[i]["Ordpg_Photographer"] );
  13894. }
  13895. if ( tbl_Sights.Rows[i]["Ordpg_MakeupArtist"].ToString().Trim() != "" )
  13896. {
  13897. MakeupArtist = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetUserName( tbl_Sights.Rows[i]["Ordpg_MakeupArtist"] );
  13898. }
  13899. if ( tbl_Sights.Rows[i]["Ordpg_BootDivision"].ToString().Trim() != "" )
  13900. {
  13901. BootDivision = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetUserName( tbl_Sights.Rows[i]["Ordpg_BootDivision"] );
  13902. }
  13903. if ( !string.IsNullOrEmpty( tbl_Sights.Rows[i]["Ordpg_ReservationPhotographyTime"].ToString() ) )
  13904. {
  13905. if ( PhotographyTime != "" )
  13906. {
  13907. if ( Convert.ToDateTime( tbl_Sights.Rows[i]["Ordpg_ReservationPhotographyTime"] ) < Convert.ToDateTime( PhotographyTime ) )
  13908. {
  13909. PhotographyTime = LYFZ.Command.Command_Validate.DateTimeToString2( tbl_Sights.Rows[i]["Ordpg_ReservationPhotographyTime"] );
  13910. }
  13911. }
  13912. else
  13913. {
  13914. PhotographyTime = LYFZ.Command.Command_Validate.DateTimeToString2( tbl_Sights.Rows[i]["Ordpg_ReservationPhotographyTime"] );
  13915. }
  13916. }
  13917. }
  13918. string FilmSelectionTime = "";
  13919. if ( tbl_Digital.Rows.Count > 0 )
  13920. {
  13921. FilmSelectionTime = LYFZ.Command.Command_Validate.DateTimeToString2( tbl_Digital.Rows[0]["Ordv_FilmSelectionTime"] );
  13922. }
  13923. string StrProdName = "";
  13924. for ( int i = 0; i < tblProductList.Rows.Count; i++ )
  13925. {
  13926. StrProdName += tblProductList.Rows[i]["ProdName"].ToString().Trim() + "\r\n";
  13927. }
  13928. for ( int i = 0; i < tblService.Rows.Count; i++ )
  13929. {
  13930. StrProdName += tblService.Rows[i]["ProdName"].ToString().Trim() + "\r\n";
  13931. }
  13932. StrProdName += LYFZ.BLL.OtherCommonModel.FontConversion( "\r\n备注:" ) + tbl_Order.Rows[0]["Ord_Remark"].ToString().Trim();
  13933. #endregion
  13934. int LeftWidth = 30;
  13935. int TableWidth = size.Width - LeftWidth * 2 + 30;
  13936. int LeftAdd = 3;
  13937. int TopAdd = 4;
  13938. int RowHeight = 20;
  13939. int RowContentHeight = 18;
  13940. int Unit = TableWidth / 32;
  13941. int ColumnWidth1 = Unit * 3;
  13942. int ColumnWidth2 = Unit * 4;
  13943. int ColumnWidth3 = Unit * 3;
  13944. int ColumnWidth4 = Unit * 4;
  13945. int ColumnWidth5 = Unit * 2;
  13946. int ColumnWidth6 = Unit * 4;
  13947. int ColumnWidth7 = Unit * 3;
  13948. int ColumnWidth8 = TableWidth - ColumnWidth1 - ColumnWidth2 - ColumnWidth3 - ColumnWidth4 - ColumnWidth5 - ColumnWidth6 - ColumnWidth7;
  13949. #region 金色童年收据凭据
  13950. Rectangle rec1;
  13951. int Rec1Height = 0;
  13952. int TopHeightCount = 0;
  13953. Image imgLog = CachePhoto( PhotoLogType.Child, tbl.Rows[0]["Company_UpdateDatetime"], GetReservationSingleLOG( "预约儿童单LOG" ) );
  13954. if ( imgLog != null )
  13955. {
  13956. rec1 = new Rectangle( LeftWidth, 50, TableWidth, 80 );
  13957. Rectangle srcRec1 = new Rectangle( 0, 0, imgLog.Width, imgLog.Height );
  13958. g.DrawImage( imgLog, rec1, srcRec1, GraphicsUnit.Pixel );
  13959. Rec1Height = rec1.Height - Convert.ToInt32( g.MeasureString( "预约儿童单标题", ft17 ).Height );
  13960. TopHeightCount = 3;
  13961. }
  13962. else
  13963. {
  13964. string StrTitle = GetReservationSingleTitle( "预约儿童单标题" );
  13965. SizeF srcsizef = g.MeasureString( StrTitle, ft17 );
  13966. int srcFtWidth = Convert.ToInt32( srcsizef.Width );
  13967. int srcFtHeight = Convert.ToInt32( srcsizef.Height );
  13968. rec1 = new Rectangle( size.Width / 2 - srcFtWidth / 2, 50, srcFtWidth + 5, srcFtHeight );
  13969. g.DrawString( StrTitle, ft17, b, rec1 );
  13970. }
  13971. #endregion
  13972. #region 家长、联系
  13973. string StrAddress = LYFZ.BLL.OtherCommonModel.FontConversion( "家长姓名:" ) + PName + LYFZ.BLL.OtherCommonModel.FontConversion( " 联系电话:" ) + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( PTelephone );
  13974. SizeF sizef = g.MeasureString( StrAddress, ft10 );
  13975. int FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  13976. int FtHeight = Convert.ToInt32( sizef.Height );
  13977. Rectangle rec2 = new Rectangle( LeftWidth, rec1.Y + rec1.Height + TopHeightCount, FtWidth, FtHeight );//(panlImage.Width / 2) - (FtWidth / 2), rec2.Y + rec2.Height
  13978. g.DrawString( StrAddress, ft10, b, rec2 );
  13979. #endregion
  13980. #region 打印时间
  13981. 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();
  13982. string rec3Value = "NO." + StrRandom( StrValue );
  13983. sizef = g.MeasureString( rec3Value, ft10 );
  13984. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  13985. FtHeight = Convert.ToInt32( sizef.Height );
  13986. Rectangle rec2A = new Rectangle( TableWidth + LeftWidth - FtWidth, rec2.Y, FtWidth, FtHeight );
  13987. g.DrawString( rec3Value, ft10, b, rec2A );
  13988. #endregion
  13989. #region 第一行
  13990. Rectangle rec3 = new Rectangle( rec2.X, rec2.Y + rec2.Height, TableWidth, RowHeight );
  13991. g.DrawRectangle( p, rec3 );//画标题矩形
  13992. string rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion( "宝贝姓名" );
  13993. sizef = g.MeasureString( rec2Value, ft17 );
  13994. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  13995. FtHeight = Convert.ToInt32( sizef.Height );
  13996. Rectangle rec3_1 = new Rectangle( rec3.X + LeftAdd * 3, rec3.Y + TopAdd, ColumnWidth1, RowContentHeight );
  13997. g.DrawString( rec2Value, ft9, b, rec3_1 );//画第一列的列标题
  13998. Point p31_1 = new Point( rec3.X + ColumnWidth1, rec3.Y );
  13999. Point p31_2 = new Point( rec3.X + ColumnWidth1, rec3.Y + rec3.Height );
  14000. g.DrawLine( p, p31_1, p31_2 );//画第一表与第二列的界线
  14001. Rectangle rec3_2 = new Rectangle( p31_1.X + LeftAdd, p31_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
  14002. g.DrawString( RName, ft9, b, rec3_2 );//画第二列的列标题
  14003. Point p32_1 = new Point( p31_1.X + ColumnWidth2, rec3.Y );
  14004. Point p32_2 = new Point( p31_1.X + ColumnWidth2, rec3.Y + rec3.Height );
  14005. g.DrawLine( p, p32_1, p32_2 );//画第二表与第三列的界线
  14006. Rectangle rec3_3 = new Rectangle( p32_1.X + LeftAdd * 3, p32_1.Y + TopAdd, ColumnWidth3, RowContentHeight );
  14007. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "性别" ), ft9, b, rec3_3 );//画第三列的列标题
  14008. Point p33_1 = new Point( p32_1.X + ColumnWidth3, rec3.Y );
  14009. Point p33_2 = new Point( p32_1.X + ColumnWidth3, rec3.Y + rec3.Height );
  14010. g.DrawLine( p, p33_1, p33_2 );//画第三表与第四列的界线
  14011. Rectangle rec3_4 = new Rectangle( p33_1.X + LeftAdd, p33_1.Y + TopAdd, ColumnWidth4, RowContentHeight );
  14012. g.DrawString( RSex, ft9, b, rec3_4 );//画第四列的列标题
  14013. Point p34_1 = new Point( p33_1.X + ColumnWidth4, rec3.Y );
  14014. Point p34_2 = new Point( p33_1.X + ColumnWidth4, rec3.Y + rec3.Height );
  14015. g.DrawLine( p, p34_1, p34_2 );//画第二表与第三列的界线
  14016. Rectangle rec3_5 = new Rectangle( p34_1.X + LeftAdd * 3, p34_1.Y + TopAdd, ColumnWidth5, RowContentHeight );
  14017. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "年龄" ), ft9, b, rec3_5 );//画第三列的列标题
  14018. Point p35_1 = new Point( p34_1.X + ColumnWidth5, rec3.Y );
  14019. Point p35_2 = new Point( p34_1.X + ColumnWidth5, rec3.Y + rec3.Height );
  14020. g.DrawLine( p, p35_1, p35_2 );//画第三表与第四列的界线
  14021. Rectangle rec3_6 = new Rectangle( p35_1.X + LeftAdd, p35_1.Y + TopAdd, ColumnWidth6, RowContentHeight );
  14022. g.DrawString( RAgeString, ft9, b, rec3_6 );//画第四列的列标题
  14023. Point p36_1 = new Point( p35_1.X + ColumnWidth6, rec3.Y );
  14024. Point p36_2 = new Point( p35_1.X + ColumnWidth6, rec3.Y + rec3.Height );
  14025. g.DrawLine( p, p36_1, p36_2 );//画第二表与第三列的界线
  14026. Rectangle rec3_7 = new Rectangle( p36_1.X + LeftAdd * 3, p36_1.Y + TopAdd, ColumnWidth7, RowContentHeight );
  14027. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "宝贝生日" ), ft9, b, rec3_7 );//画第三列的列标题
  14028. Point p37_1 = new Point( p36_1.X + ColumnWidth7, rec3.Y );
  14029. Point p37_2 = new Point( p36_1.X + ColumnWidth7, rec3.Y + rec3.Height );
  14030. g.DrawLine( p, p37_1, p37_2 );//画第三表与第四列的界线
  14031. Rectangle rec3_8 = new Rectangle( p37_1.X + LeftAdd, p37_1.Y + TopAdd, ColumnWidth8, RowContentHeight );
  14032. g.DrawString( RBirthday, ft9, b, rec3_8 );//画第四列的列标题
  14033. #endregion
  14034. #region 第二行
  14035. Rectangle rec4 = new Rectangle( rec3.X, rec3.Y + rec3.Height, rec3.Width, RowHeight );
  14036. g.DrawRectangle( p, rec4 );//画标题矩形
  14037. Rectangle rec4_1 = new Rectangle( rec4.X + LeftAdd * 3, rec4.Y + TopAdd, ColumnWidth1, RowContentHeight );
  14038. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "套系金额" ), ft9, b, rec4_1 );//画第一列的列标题
  14039. Point p41_1 = new Point( rec4.X + ColumnWidth1, rec4.Y );
  14040. Point p41_2 = new Point( rec4.X + ColumnWidth1, rec4.Y + rec4.Height );
  14041. g.DrawLine( p, p41_1, p41_2 );//画第一表与第二列的界线
  14042. Rectangle rec4_2 = new Rectangle( p41_1.X + LeftAdd, p41_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
  14043. g.DrawString( tbl_Order.Rows[0]["Ord_SeriesPrice"].ToString().Trim(), ft9, b, rec4_2 );//画第二列的列标题
  14044. Point p42_1 = new Point( p41_1.X + ColumnWidth2, rec4.Y );
  14045. Point p42_2 = new Point( p41_1.X + ColumnWidth2, rec4.Y + rec4.Height );
  14046. g.DrawLine( p, p42_1, p42_2 );//画第二表与第三列的界线
  14047. Rectangle rec4_3 = new Rectangle( p42_1.X + LeftAdd * 3, p42_1.Y + TopAdd, ColumnWidth3, RowContentHeight );
  14048. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "定金" ), ft9, b, rec4_3 );//画第三列的列标题
  14049. Point p43_1 = new Point( p42_1.X + ColumnWidth3, rec4.Y );
  14050. Point p43_2 = new Point( p42_1.X + ColumnWidth3, rec4.Y + rec4.Height );
  14051. g.DrawLine( p, p43_1, p43_2 );//画第三表与第四列的界线
  14052. Rectangle rec4_4 = new Rectangle( p43_1.X + LeftAdd, p43_1.Y + TopAdd, ColumnWidth4, RowContentHeight );
  14053. g.DrawString( OrdPrice, ft9, b, rec4_4 );//画第四列的列标题
  14054. Point p44_1 = new Point( p43_1.X + ColumnWidth4, rec4.Y );
  14055. Point p44_2 = new Point( p43_1.X + ColumnWidth4, rec4.Y + rec4.Height );
  14056. g.DrawLine( p, p44_1, p44_2 );//画第二表与第三列的界线
  14057. Rectangle rec4_5 = new Rectangle( p44_1.X + LeftAdd * 3, p44_1.Y + TopAdd, ColumnWidth5, RowContentHeight );
  14058. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "欠款" ), ft9, b, rec4_5 );//画第三列的列标题
  14059. Point p45_1 = new Point( p44_1.X + ColumnWidth5, rec4.Y );
  14060. Point p45_2 = new Point( p44_1.X + ColumnWidth5, rec4.Y + rec4.Height );
  14061. g.DrawLine( p, p45_1, p45_2 );//画第三表与第四列的界线
  14062. Rectangle rec4_6 = new Rectangle( p45_1.X + LeftAdd, p45_1.Y + TopAdd, ColumnWidth6, RowContentHeight );
  14063. g.DrawString( tbl_Order.Rows[0]["Ord_OrderArrears"].ToString().Trim(), ft9, b, rec4_6 );//画第四列的列标题
  14064. Point p46_1 = new Point( p45_1.X + ColumnWidth6, rec4.Y );
  14065. Point p46_2 = new Point( p45_1.X + ColumnWidth6, rec4.Y + rec4.Height );
  14066. g.DrawLine( p, p46_1, p46_2 );//画第二表与第三列的界线
  14067. Rectangle rec4_7 = new Rectangle( p46_1.X + LeftAdd * 3, p46_1.Y + TopAdd, ColumnWidth7, RowContentHeight );
  14068. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "套系名称" ), ft9, b, rec4_7 );//画第三列的列标题
  14069. Point p47_1 = new Point( p46_1.X + ColumnWidth7, rec4.Y );
  14070. Point p47_2 = new Point( p46_1.X + ColumnWidth7, rec4.Y + rec4.Height );
  14071. g.DrawLine( p, p47_1, p47_2 );//画第三表与第四列的界线
  14072. Rectangle rec4_8 = new Rectangle( p47_1.X + LeftAdd, p47_1.Y + TopAdd, ColumnWidth8, RowContentHeight );
  14073. g.DrawString( tbl_Order.Rows[0]["Ord_SeriesName"].ToString().Trim(), ft9, b, rec4_8 );//画第四列的列标题
  14074. #endregion
  14075. #region 第三行
  14076. Rectangle rec5 = new Rectangle( rec4.X, rec4.Y + rec4.Height, rec3.Width, RowHeight );
  14077. g.DrawRectangle( p, rec5 );//画标题矩形
  14078. Rectangle rec5_1 = new Rectangle( rec5.X + LeftAdd * 3, rec5.Y + TopAdd, ColumnWidth1, RowContentHeight );
  14079. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "会员卡号" ), ft9, b, rec5_1 );//画第一列的列标题
  14080. Point p51_1 = new Point( rec5.X + ColumnWidth1, rec5.Y );
  14081. Point p51_2 = new Point( rec5.X + ColumnWidth1, rec5.Y + rec5.Height );
  14082. g.DrawLine( p, p51_1, p51_2 );//画第一表与第二列的界线
  14083. Rectangle rec5_2 = new Rectangle( p51_1.X + LeftAdd, p51_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
  14084. g.DrawString( PMemberCardNumber, ft9, b, rec5_2 );//画第二列的列标题
  14085. Point p52_1 = new Point( p51_1.X + ColumnWidth2, rec5.Y );
  14086. Point p52_2 = new Point( p51_1.X + ColumnWidth2, rec5.Y + rec5.Height );
  14087. g.DrawLine( p, p52_1, p52_2 );//画第二表与第三列的界线
  14088. Rectangle rec5_3 = new Rectangle( p52_1.X + LeftAdd * 3, p52_1.Y + TopAdd, ColumnWidth3, RowContentHeight );
  14089. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "入册" ), ft9, b, rec5_3 );//画第一列的列标题
  14090. Point p53_1 = new Point( p52_1.X + ColumnWidth3, rec5.Y );
  14091. Point p53_2 = new Point( p52_1.X + ColumnWidth3, rec5.Y + rec5.Height );
  14092. g.DrawLine( p, p53_1, p53_2 );//画第一表与第二列的界线
  14093. Rectangle rec5_4 = new Rectangle( p53_1.X + LeftAdd, p53_1.Y + TopAdd, ColumnWidth4, RowContentHeight );
  14094. g.DrawString( IntoRegisterQuantit.ToString().Trim(), ft9, b, rec5_4 );//画第二列的列标题
  14095. Point p54_1 = new Point( p43_1.X + ColumnWidth4, rec5.Y );
  14096. Point p54_2 = new Point( p43_1.X + ColumnWidth4, rec5.Y + rec5.Height );
  14097. g.DrawLine( p, p54_1, p54_2 );//画第二表与第三列的界线
  14098. Rectangle rec5_5 = new Rectangle( p54_1.X + LeftAdd * 3, p54_1.Y + TopAdd, ColumnWidth5, RowContentHeight );
  14099. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "入底" ), ft9, b, rec5_5 );//画第三列的列标题
  14100. Point p55_1 = new Point( p54_1.X + ColumnWidth5, rec5.Y );
  14101. Point p55_2 = new Point( p54_1.X + ColumnWidth5, rec5.Y + rec5.Height );
  14102. g.DrawLine( p, p55_1, p55_2 );//画第三表与第四列的界线
  14103. string StrIntoBottom = IntoBottomQuantity.ToString().Trim();
  14104. if ( StrIntoBottom == "0" )
  14105. {
  14106. StrIntoBottom = LYFZ.BLL.OtherCommonModel.FontConversion( "不送" );
  14107. }
  14108. else if ( StrIntoBottom == "-1" )
  14109. {
  14110. StrIntoBottom = LYFZ.BLL.OtherCommonModel.FontConversion( "全送" );
  14111. }
  14112. Rectangle rec5_6 = new Rectangle( p55_1.X + LeftAdd, p55_1.Y + TopAdd, ColumnWidth6, RowContentHeight );
  14113. g.DrawString( StrIntoBottom, ft9, b, rec5_6 );//画第四列的列标题
  14114. Point p56_1 = new Point( p55_1.X + ColumnWidth6, rec5.Y );
  14115. Point p56_2 = new Point( p55_1.X + ColumnWidth6, rec5.Y + rec5.Height );
  14116. g.DrawLine( p, p56_1, p56_2 );//画第二表与第三列的界线
  14117. Rectangle rec5_7 = new Rectangle( p56_1.X + LeftAdd * 7, p56_1.Y + TopAdd, ColumnWidth7, RowContentHeight );
  14118. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "门 市" ), ft9, b, rec5_7 );//画第三列的列标题
  14119. Point p57_1 = new Point( p56_1.X + ColumnWidth7, rec5.Y );
  14120. Point p57_2 = new Point( p56_1.X + ColumnWidth7, rec5.Y + rec5.Height );
  14121. g.DrawLine( p, p57_1, p57_2 );//画第三表与第四列的界线
  14122. Rectangle rec5_8 = new Rectangle( p57_1.X + LeftAdd, p57_1.Y + TopAdd, ColumnWidth8, RowContentHeight );
  14123. string strOrderPerson = "";
  14124. if (tblUser.Rows.Count > 0)
  14125. {
  14126. if (Convert.ToBoolean(tblUser.Rows[0]["User_PhonePrint"]) == true)
  14127. strOrderPerson = tblUser.Rows[0]["User_Name"].ToString() + " " + tblUser.Rows[0]["User_Telephone"].ToString();
  14128. else
  14129. strOrderPerson = tblUser.Rows[0]["User_Name"].ToString() + " " + tbl.Rows[0]["Company_Telephone"].ToString();
  14130. }
  14131. g.DrawString( strOrderPerson, ft9, b, rec5_8 );//画第四列的列标题
  14132. #endregion
  14133. #region 第三四行
  14134. Rectangle rec5A = new Rectangle( rec5.X, rec5.Y + rec5.Height, rec3.Width, RowHeight );
  14135. g.DrawRectangle( p, rec5A );//画标题矩形
  14136. Rectangle rec5A_1 = new Rectangle( rec5A.X + LeftAdd * 2, rec5A.Y + TopAdd, ColumnWidth1, RowContentHeight );
  14137. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "内景服装" ), ft9, b, rec5A_1 );//画第一列的列标题
  14138. Point p5A1_1 = new Point( rec5A.X + ColumnWidth1, rec5A.Y );
  14139. Point p5A1_2 = new Point( rec5A.X + ColumnWidth1, rec5A.Y + rec5A.Height );
  14140. g.DrawLine( p, p5A1_1, p5A1_2 );//画第一表与第二列的界线
  14141. Rectangle rec5A_2 = new Rectangle( p5A1_1.X + LeftAdd, p5A1_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
  14142. g.DrawString( InnerSights.ToString().Trim(), ft9, b, rec5A_2 );//画第二列的列标题
  14143. Point p5A2_1 = new Point( p5A1_1.X + ColumnWidth2, rec5A.Y );
  14144. Point p5A2_2 = new Point( p5A1_1.X + ColumnWidth2, rec5A.Y + rec5A.Height );
  14145. g.DrawLine( p, p5A2_1, p5A2_2 );//画第二表与第三列的界线
  14146. Rectangle rec5A_3 = new Rectangle( p5A2_1.X + LeftAdd * 2, p5A2_1.Y + TopAdd, ColumnWidth3, RowContentHeight );
  14147. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "外景服装" ), ft9, b, rec5A_3 );//画第一列的列标题
  14148. Point p5A3_1 = new Point( p5A2_1.X + ColumnWidth3, rec5A.Y );
  14149. Point p5A3_2 = new Point( p5A2_1.X + ColumnWidth3, rec5A.Y + rec5A.Height );
  14150. g.DrawLine( p, p5A3_1, p5A3_2 );//画第一表与第二列的界线
  14151. Rectangle rec5A_4 = new Rectangle( p5A3_1.X + LeftAdd, p5A3_1.Y + TopAdd, ColumnWidth4, RowContentHeight );
  14152. g.DrawString( OuterSights.ToString().Trim(), ft9, b, rec5A_4 );//画第二列的列标题
  14153. Point p5A4_1 = new Point( p5A3_1.X + ColumnWidth4, rec5A.Y );
  14154. Point p5A4_2 = new Point( p5A3_1.X + ColumnWidth4, rec5A.Y + rec5A.Height );
  14155. g.DrawLine( p, p5A4_1, p5A4_2 );//画第二表与第三列的界线
  14156. Rectangle rec5A_5 = new Rectangle( p5A4_1.X + LeftAdd * 3, p5A4_1.Y + TopAdd, ColumnWidth5, RowContentHeight );
  14157. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "地址" ), ft9, b, rec5A_5 );//画第三列的列标题
  14158. Point p5A5_1 = new Point( p5A4_1.X + ColumnWidth5, rec5A.Y );
  14159. Point p5A5_2 = new Point( p5A4_1.X + ColumnWidth5, rec5A.Y + rec5A.Height );
  14160. g.DrawLine( p, p5A5_1, p5A5_2 );//画第三表与第四列的界线
  14161. Rectangle rec5A_6 = new Rectangle( p5A5_1.X + LeftAdd, p5A5_1.Y + TopAdd, ColumnWidth5 + ColumnWidth6 + ColumnWidth7 + ColumnWidth8, RowContentHeight );
  14162. g.DrawString( StrAdderss, ft9, b, rec5A_6 );//画第四列的列标题
  14163. #endregion
  14164. #region 第四行
  14165. Rectangle rec6 = new Rectangle( rec5A.X, rec5A.Y + rec5A.Height, TableWidth, 315 - Rec1Height - LeftWidth );
  14166. g.DrawRectangle( p, rec6 );//画标题矩形
  14167. rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion( "套系内容" );
  14168. sizef = g.MeasureString( rec2Value, ft17 );
  14169. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  14170. FtHeight = Convert.ToInt32( sizef.Height ) + 1;
  14171. Rectangle rec6_1 = new Rectangle( rec6.X + LeftAdd * 2, rec6.Y + (rec6.Height / 2 - FtHeight * 2), ColumnWidth1 / 2, FtHeight * 4 );
  14172. g.DrawString( rec2Value, ft13, b, rec6_1 );//画第一列的列标题
  14173. Point p61_1 = new Point( rec6.X + rec6_1.Width, rec6.Y );
  14174. Point p61_2 = new Point( rec6.X + rec6_1.Width, rec6.Y + rec6.Height );
  14175. g.DrawLine( p, p61_1, p61_2 );//画第一表与第二列的界线
  14176. 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 );
  14177. g.DrawString( StrProdName, GetFontSize( "儿童预约单内容详情字体大小" ), b, rec6_2 );//画第二列的列标题
  14178. Point p62_1 = new Point( p61_1.X + rec6_2.Width, rec6.Y );
  14179. Point p62_2 = new Point( p61_1.X + rec6_2.Width, rec6.Y + rec6.Height );
  14180. g.DrawLine( p, p62_1, p62_2 );//画第二表与第三列的界线
  14181. StrValue = "";
  14182. if ( PrintOtherData.ContainsKey( "儿童预约单注意事项说明" ) && PrintOtherData["儿童预约单注意事项说明"].ToString().Trim().Length > 0 )
  14183. {
  14184. StrValue = PrintOtherData["儿童预约单注意事项说明"].ToString().Trim();
  14185. }
  14186. Rectangle rec6_3 = new Rectangle( rec6_2.X + rec6_2.Width + LeftAdd, rec6_1.Y, rec6_1.Width, rec6_1.Height );
  14187. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "注意事项" ), ft13, b, rec6_3 );//画第三列的列标题
  14188. Point p63_1 = new Point( p62_1.X + rec6_3.Width, rec6.Y );
  14189. Point p63_2 = new Point( p62_1.X + rec6_3.Width, rec6.Y + rec6.Height );
  14190. g.DrawLine( p, p63_1, p63_2 );//画第三表与第四列的界线
  14191. Rectangle rec6_4 = new Rectangle( p63_1.X + LeftAdd, p63_1.Y + TopAdd, ColumnWidth8 + ColumnWidth7 + (ColumnWidth1 / 2) - rec6_3.Width, rec6.Height - TopAdd * 2 );
  14192. g.DrawString( StrValue, GetFontSize( "儿童预约单注意事项字体大小" ), b, rec6_4 );//画第四列的列标题
  14193. #endregion
  14194. #region 第六行
  14195. int SWidth = TableWidth / 8;
  14196. Rectangle rec7 = new Rectangle( rec6.X, rec6.Y + rec6.Height, TableWidth, RowHeight );
  14197. g.DrawRectangle( p, rec7 );//画标题矩形
  14198. Rectangle rec7_1 = new Rectangle( rec7.X + LeftAdd * 4, rec7.Y + TopAdd, SWidth - SWidth / 3 + 5, RowContentHeight );
  14199. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "摄影师" ), ft9, b, rec7_1 );//画第一列的列标题
  14200. Point p71_1 = new Point( rec7.X + rec7_1.Width, rec7.Y );
  14201. Point p71_2 = new Point( rec7.X + rec7_1.Width, rec7.Y + rec7.Height );
  14202. g.DrawLine( p, p71_1, p71_2 );//画第一表与第二列的界线
  14203. Rectangle rec7_2 = new Rectangle( p71_1.X + LeftAdd, p71_1.Y + TopAdd, SWidth, RowContentHeight );
  14204. g.DrawString( Photographer, ft9, b, rec7_2 );//画第六列的列标题
  14205. Point p72_1 = new Point( p71_1.X + rec7_2.Width, rec7.Y );
  14206. Point p72_2 = new Point( p71_1.X + rec7_2.Width, rec7.Y + rec7.Height );
  14207. g.DrawLine( p, p72_1, p72_2 );//画第一表与第二列的界线
  14208. Rectangle rec7_3 = new Rectangle( p72_1.X + LeftAdd * 4, p72_1.Y + TopAdd, rec7_1.Width, RowContentHeight );
  14209. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "化妆师" ), ft9, b, rec7_3 );//画第一列的列标题
  14210. Point p73_1 = new Point( p72_1.X + rec7_3.Width, rec7.Y );
  14211. Point p73_2 = new Point( p72_1.X + rec7_3.Width, rec7.Y + rec7.Height );
  14212. g.DrawLine( p, p73_1, p73_2 );//画第一表与第二列的界线
  14213. Rectangle rec7_4 = new Rectangle( p73_1.X + LeftAdd, p73_1.Y + TopAdd, rec7_2.Width, RowContentHeight );
  14214. g.DrawString( MakeupArtist.Trim(), ft9, b, rec7_4 );//画第六列的列标题
  14215. Point p74_1 = new Point( p73_1.X + rec7_4.Width, rec7.Y );
  14216. Point p74_2 = new Point( p73_1.X + rec7_4.Width, rec7.Y + rec7.Height );
  14217. g.DrawLine( p, p74_1, p74_2 );//画第一表与第二列的界线
  14218. Rectangle rec7_5 = new Rectangle( p74_1.X + LeftAdd * 2, p74_1.Y + TopAdd, rec7_3.Width, RowContentHeight );
  14219. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "拍照时间" ), ft9, b, rec7_5 );//画第一列的列标题
  14220. Point p75_1 = new Point( p74_1.X + rec7_5.Width, rec7.Y );
  14221. Point p75_2 = new Point( p74_1.X + rec7_5.Width, rec7.Y + rec7.Height );
  14222. g.DrawLine( p, p75_1, p75_2 );//画第一表与第二列的界线
  14223. Rectangle rec7_6 = new Rectangle( p75_1.X + LeftAdd, p75_1.Y + TopAdd, rec7_4.Width + 30, RowContentHeight );
  14224. g.DrawString( PhotographyTime.Trim(), ft9, b, rec7_6 );//画第六列的列标题
  14225. Point p76_1 = new Point( p75_1.X + rec7_6.Width, rec7.Y );
  14226. Point p76_2 = new Point( p75_1.X + rec7_6.Width, rec7.Y + rec7.Height );
  14227. g.DrawLine( p, p76_1, p76_2 );//画第一表与第二列的界线
  14228. Rectangle rec7_7 = new Rectangle( p76_1.X + LeftAdd * 2, p76_1.Y + TopAdd, rec7_5.Width, RowContentHeight );
  14229. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "选片时间" ), ft9, b, rec7_7 );//画第一列的列标题
  14230. Point p77_1 = new Point( p76_1.X + rec7_7.Width, rec7.Y );
  14231. Point p77_2 = new Point( p76_1.X + rec7_7.Width, rec7.Y + rec7.Height );
  14232. g.DrawLine( p, p77_1, p77_2 );//画第一表与第二列的界线
  14233. Rectangle rec7_8 = new Rectangle( p77_1.X + LeftAdd, p77_1.Y + TopAdd, rec7_6.Width, RowContentHeight );
  14234. g.DrawString( FilmSelectionTime, ft9, b, rec7_2 );//画第六列的列标题
  14235. #endregion
  14236. #region 第七行
  14237. Rectangle rec8 = new Rectangle( rec7.X, rec7.Y + rec7.Height, TableWidth, RowHeight );
  14238. g.DrawRectangle( p, rec8 );//画标题矩形
  14239. Rectangle rec8_1 = new Rectangle( rec8.X + LeftAdd * 4, rec8.Y + TopAdd, rec7_1.Width, RowContentHeight );
  14240. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "引导师" ), ft9, b, rec8_1 );//画第一列的列标题
  14241. Point p81_1 = new Point( rec8.X + rec7_1.Width, rec8.Y );
  14242. Point p81_2 = new Point( rec8.X + rec7_1.Width, rec8.Y + rec8.Height );
  14243. g.DrawLine( p, p81_1, p81_2 );//画第一表与第二列的界线
  14244. Rectangle rec8_2 = new Rectangle( p81_1.X + LeftAdd, p81_1.Y + TopAdd, SWidth, RowContentHeight );
  14245. g.DrawString( BootDivision, ft9, b, rec8_2 );//画第六列的列标题
  14246. Point p82_1 = new Point( p81_1.X + rec8_2.Width, rec8.Y );
  14247. Point p82_2 = new Point( p81_1.X + rec8_2.Width, rec8.Y + rec8.Height );
  14248. g.DrawLine( p, p82_1, p82_2 );//画第一表与第二列的界线
  14249. Rectangle rec8_3 = new Rectangle( p82_1.X + LeftAdd * 4, p82_1.Y + TopAdd, rec8_1.Width, RowContentHeight );
  14250. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "设计师" ), ft9, b, rec8_3 );//画第一列的列标题
  14251. Point p83_1 = new Point( p82_1.X + rec8_3.Width, rec8.Y );
  14252. Point p83_2 = new Point( p82_1.X + rec8_3.Width, rec8.Y + rec8.Height );
  14253. g.DrawLine( p, p83_1, p83_2 );//画第一表与第二列的界线
  14254. Rectangle rec8_4 = new Rectangle( p83_1.X + LeftAdd, p83_1.Y + TopAdd, rec8_2.Width, RowContentHeight );
  14255. g.DrawString( "", ft9, b, rec8_4 );//画第六列的列标题
  14256. Point p84_1 = new Point( p83_1.X + rec8_4.Width, rec8.Y );
  14257. Point p84_2 = new Point( p83_1.X + rec8_4.Width, rec8.Y + rec8.Height );
  14258. g.DrawLine( p, p84_1, p84_2 );//画第一表与第二列的界线
  14259. Rectangle rec8_5 = new Rectangle( p84_1.X + LeftAdd * 2, p84_1.Y + TopAdd, rec8_3.Width, RowContentHeight );
  14260. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "取件时间" ), ft9, b, rec8_5 );//画第一列的列标题
  14261. Point p85_1 = new Point( p84_1.X + rec8_5.Width, rec8.Y );
  14262. Point p85_2 = new Point( p84_1.X + rec8_5.Width, rec8.Y + rec8.Height );
  14263. g.DrawLine( p, p85_1, p85_2 );//画第一表与第二列的界线
  14264. string strPickupTime = "";
  14265. if ( tblPickupTime.Rows.Count > 0 )
  14266. {
  14267. if ( !string.IsNullOrEmpty( tblPickupTime.Rows[0]["OPlist_PickupTime"].ToString().Trim() ) )
  14268. {
  14269. strPickupTime = LYFZ.Command.Command_Validate.DateTimeToString( tblPickupTime.Rows[0]["OPlist_PickupTime"] );
  14270. }
  14271. }
  14272. Rectangle rec8_6 = new Rectangle( p85_1.X + LeftAdd, p85_1.Y + TopAdd, rec8_4.Width + 30, RowContentHeight );
  14273. g.DrawString( strPickupTime, ft9, b, rec8_6 );//画第六列的列标题
  14274. Point p86_1 = new Point( p85_1.X + rec8_6.Width, rec8.Y );
  14275. Point p86_2 = new Point( p85_1.X + rec8_6.Width, rec8.Y + rec8.Height );
  14276. g.DrawLine( p, p86_1, p86_2 );//画第一表与第二列的界线
  14277. Rectangle rec8_7 = new Rectangle( p86_1.X + LeftAdd * 2, p86_1.Y + TopAdd, rec8_5.Width, RowContentHeight );
  14278. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "顾客签字" ), ft9, b, rec8_7 );//画第一列的列标题
  14279. Point p87_1 = new Point( p86_1.X + rec8_7.Width, rec8.Y );
  14280. Point p87_2 = new Point( p86_1.X + rec8_7.Width, rec8.Y + rec8.Height );
  14281. g.DrawLine( p, p87_1, p87_2 );//画第一表与第二列的界线
  14282. Rectangle rec8_8 = new Rectangle( p87_1.X + LeftAdd, p87_1.Y + TopAdd, rec8_6.Width, RowContentHeight );
  14283. g.DrawString( "", ft9, b, rec8_2 );//画第六列的列标题
  14284. #endregion
  14285. #region 尾行
  14286. rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion( "电话:" ) + tbl.Rows[0]["Company_Telephone"].ToString().Trim();
  14287. sizef = g.MeasureString( rec2Value, ft9 );
  14288. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  14289. FtHeight = Convert.ToInt32( sizef.Height );
  14290. Rectangle rec9_1 = new Rectangle( TableWidth + LeftWidth - FtWidth, rec8.Y + rec8.Height + TopAdd, FtWidth, FtHeight );
  14291. g.DrawString( rec2Value, ft9, b, rec9_1 );//画第一列的列标题
  14292. rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion( "地址:" ) + tbl.Rows[0]["Company_Address"].ToString().Trim();
  14293. sizef = g.MeasureString( rec2Value, ft9 );
  14294. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  14295. FtHeight = Convert.ToInt32( sizef.Height );
  14296. Rectangle rec9 = new Rectangle( rec8.X, rec9_1.Y, TableWidth - rec9_1.Width - LeftWidth, FtHeight );
  14297. g.DrawString( rec2Value, ft9, b, rec9 );//画第一列的列标题
  14298. #endregion
  14299. }
  14300. #endregion
  14301. #region 写真
  14302. /// <summary>
  14303. /// 订单报表写真版()
  14304. /// </summary>
  14305. /// <returns></returns>
  14306. private static void Portrait_OrderReport_Print(DataSet dtSet, Graphics g1, Size size
  14307. , ref List<List<string>> pListData, int iPage)
  14308. {
  14309. int LeftWidth = 30;
  14310. Brush b = Brushes.Black;
  14311. Pen p = GetPen;
  14312. int TableWidth = size.Width - LeftWidth * 2;
  14313. DataTable tbl = dtSet.Tables["ds"];//获取影楼信息
  14314. DataTable tblOrder = dtSet.Tables["ds1"];//订单
  14315. DataTable tblDigital = dtSet.Tables["ds2"];//数码
  14316. DataTable tblSights = dtSet.Tables["ds3"];//景点
  14317. DataTable tblPickupTime = dtSet.Tables["ds4"];//取件时间
  14318. DataTable tblProductList = dtSet.Tables["ds5"];//取件时间
  14319. DataTable tblClient = dtSet.Tables["ds6"];//客户资料
  14320. DataTable tblService = dtSet.Tables["ds7"];//客户资料
  14321. DataTable tblStyle = dtSet.Tables["ds8"];//喜爱风格
  14322. DataTable tblPayment = dtSet.Tables["ds9"];//订单定金
  14323. DataTable tblUser = dtSet.Tables["ds11"];//订单定金
  14324. string OrdPrice = "0.00";
  14325. if (tblPayment.Rows.Count > 0)
  14326. {
  14327. OrdPrice = tblPayment.Rows[0]["Pay_AmountOf"].ToString().Trim();
  14328. }
  14329. tblStyle.PrimaryKey = new DataColumn[] { tblStyle.Columns["ID"] };
  14330. if (tbl.Rows.Count <= 0)
  14331. {
  14332. MessageBoxCustom.Show("未设置影楼信息"); return;
  14333. }
  14334. DataTable tblIntoRB = dtSet.Tables["ds10"];//订单定金
  14335. int IntoRegisterQuantit = 0;
  14336. int IntoBottomQuantity = 0;
  14337. for (int i = 0; i < tblIntoRB.Rows.Count; i++)
  14338. {
  14339. IntoRegisterQuantit += Convert.ToInt32(tblIntoRB.Rows[i]["Ordv_IntoRegisterQuantity"]);
  14340. IntoBottomQuantity += Convert.ToInt32(tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"]);
  14341. }
  14342. ///付款方式集合
  14343. string strPaymentMsg = "";
  14344. foreach (DataRow dr in tblPayment.Rows)
  14345. {
  14346. if (!string.IsNullOrEmpty(strPaymentMsg))
  14347. {
  14348. strPaymentMsg += " ";
  14349. }
  14350. strPaymentMsg += dr["Sc_ClassName"] + ":" + dr["Pay_AmountOf"];
  14351. }
  14352. if (pListData.Count == 0)
  14353. {
  14354. pListData = GetProductOrServiceListData(g1, TableWidth, tblProductList, tblService, tblSights, "写真预约单内容详情字体大小",true,460);
  14355. }
  14356. #region 获取数据
  14357. string MName = "";
  14358. string MTelephone = "";
  14359. string MIDNumber = "";
  14360. string MMicroSignal = "";
  14361. string MQQ = "";
  14362. string MAddress = "";
  14363. if (tblClient.Rows.Count > 0)
  14364. {
  14365. for (int i = 0; i < tblClient.Rows.Count; i++)
  14366. {
  14367. if (tblClient.Rows[i]["GM_Master"].ToString().Trim() == "1")
  14368. {
  14369. MName = tblClient.Rows[i]["Cus_Name"].ToString().Trim();
  14370. MTelephone = tblClient.Rows[i]["Cus_Telephone"].ToString().Trim();
  14371. MIDNumber = tblClient.Rows[i]["Cus_IDNumber"].ToString().Trim();
  14372. MMicroSignal = tblClient.Rows[i]["Cus_MicroSignal"].ToString().Trim();
  14373. MQQ = tblClient.Rows[i]["Cus_QQ"].ToString().Trim();
  14374. MAddress = tblClient.Rows[i]["Cus_Address"].ToString().Trim();
  14375. }
  14376. }
  14377. }
  14378. int InnerSights = 0;
  14379. int OuterSights = 0;
  14380. string strSights = LYFZ.BLL.OtherCommonModel.FontConversion("景点:\r\n");
  14381. string StrPhotoTime = "";
  14382. string StrPhotographer = "";
  14383. string StrMakeupArtist = "";
  14384. for (int i = 0; i < tblSights.Rows.Count; i++)
  14385. {
  14386. if (tblSights.Rows[i]["Ordpg_SightsType"].ToString().Trim() == "0")
  14387. {
  14388. InnerSights += Convert.ToInt32(tblSights.Rows[i]["Ordpg_ApparelQuantity"]);
  14389. }
  14390. if (tblSights.Rows[i]["Ordpg_SightsType"].ToString().Trim() == "1")
  14391. {
  14392. OuterSights += Convert.ToInt32(tblSights.Rows[i]["Ordpg_ApparelQuantity"]);
  14393. }
  14394. strSights += (i + 1) + "." + tblSights.Rows[i]["Ordpg_Sights"].ToString().Trim();
  14395. strSights += tblSights.Rows[i]["Ordpg_SightsRemark"].ToString().Trim();
  14396. strSights += "\r\n";
  14397. if (!string.IsNullOrEmpty(tblSights.Rows[i]["Ordpg_Photographer"].ToString().Trim()))
  14398. {
  14399. StrPhotographer = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetUserName(tblSights.Rows[i]["Ordpg_Photographer"]);
  14400. }
  14401. if (!string.IsNullOrEmpty(tblSights.Rows[i]["Ordpg_MakeupArtist"].ToString().Trim()))
  14402. {
  14403. StrMakeupArtist = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetUserName(tblSights.Rows[i]["Ordpg_MakeupArtist"]);
  14404. }
  14405. if (LYFZ.Command.Command_Validate.DateTimeToString(tblSights.Rows[i]["Ordpg_ReservationPhotographyTime"]) != "")
  14406. {
  14407. if (StrPhotoTime == "")
  14408. {
  14409. StrPhotoTime = LYFZ.Command.Command_Validate.DateTimeToString(tblSights.Rows[i]["Ordpg_ReservationPhotographyTime"]);
  14410. }
  14411. else if (Convert.ToDateTime(tblSights.Rows[i]["Ordpg_ReservationPhotographyTime"]) < Convert.ToDateTime(StrPhotoTime))
  14412. {
  14413. StrPhotoTime = LYFZ.Command.Command_Validate.DateTimeToString(tblSights.Rows[i]["Ordpg_ReservationPhotographyTime"]);
  14414. }
  14415. }
  14416. }
  14417. string StrFilmSelectionTime = "";
  14418. if (tblDigital.Rows.Count > 0)
  14419. {
  14420. StrFilmSelectionTime = LYFZ.Command.Command_Validate.DateTimeToString(tblDigital.Rows[0]["Ordv_FilmSelectionTime"]);
  14421. }
  14422. #endregion
  14423. Font ft17 = new Font("宋体", 17);
  14424. Font ft12 = new Font("宋体", 12);
  14425. Font ft9 = new Font("宋体", 9);
  14426. string strShowNumber = tblOrder.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() != "" ? tblOrder.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() : tblOrder.Rows[0]["Ord_Number"].ToString().Trim();
  14427. string StrValue = "NO." + StrRandom(strShowNumber);
  14428. string strNumber = StrValue;
  14429. List<string> data = pListData[iPage];
  14430. Bitmap bitmap = new Bitmap(827, 1150);
  14431. Graphics g = g1;//Graphics.FromImage(bitmap);
  14432. #region LOG抬头
  14433. int Rec1Height = 0;
  14434. Rectangle rec1;
  14435. Image imgLog = CachePhoto(PhotoLogType.Portrait, tbl.Rows[0]["Company_UpdateDatetime"], GetReservationSingleLOG("预约写真单LOG"));
  14436. if (imgLog != null)
  14437. {
  14438. rec1 = new Rectangle(LeftWidth, 50, TableWidth, 120);
  14439. Rectangle srcRec1 = new Rectangle(0, 0, imgLog.Width, imgLog.Height);
  14440. g.DrawImage(imgLog, rec1, srcRec1, GraphicsUnit.Pixel);
  14441. }
  14442. else
  14443. {
  14444. string StrTitle = GetReservationSingleTitle("预约写真单标题");
  14445. SizeF srcsizef = g.MeasureString(StrTitle, ft17);
  14446. int srcFtWidth = Convert.ToInt32(srcsizef.Width);
  14447. int srcFtHeight = Convert.ToInt32(srcsizef.Height);
  14448. rec1 = new Rectangle(size.Width / 2 - srcFtWidth / 2, 50, srcFtWidth + 5, srcFtHeight);
  14449. g.DrawString(StrTitle, ft17, b, rec1);
  14450. Rec1Height = 120 - rec1.Height;
  14451. }
  14452. #endregion
  14453. int LeftAdd = 3;
  14454. int TopAdd = 6;
  14455. int RowHeight = 25;
  14456. int RowContentHeight = 18;
  14457. int Unit = TableWidth / 25;
  14458. int ColumnWidth1 = Unit * 3 - Unit / 2 + 15;
  14459. int ColumnWidth2 = Unit * 5;
  14460. int ColumnWidth3 = Unit * 3;
  14461. int ColumnWidth4 = Unit * 5;
  14462. int ColumnWidth5 = Unit * 3 - Unit / 2 + 15;
  14463. int ColumnWidth6 = TableWidth - ColumnWidth1 - ColumnWidth2 - ColumnWidth3 - ColumnWidth4 - ColumnWidth5;
  14464. #region 始行
  14465. Rectangle rec2 = new Rectangle(LeftWidth, rec1.Y + rec1.Height + 10, 1000, RowContentHeight);
  14466. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("开单日期:") + LYFZ.Command.Command_Validate.DateTimeToString(tblOrder.Rows[0]["Ord_CreateDatetime"]), ft12, b, rec2);
  14467. //string strShowNumber = tblOrder.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() != "" ? tblOrder.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() : tblOrder.Rows[0]["Ord_Number"].ToString().Trim();
  14468. //string StrValue = "NO." + StrRandom(strShowNumber);
  14469. SizeF sizef = g.MeasureString(strNumber, ft12);
  14470. int FtWidth = Convert.ToInt32(sizef.Width) + 1;
  14471. int FtHeight = Convert.ToInt32(sizef.Height);
  14472. Rectangle rec2_1 = new Rectangle(TableWidth + LeftWidth + LeftAdd - FtWidth, rec2.Y, FtWidth, RowContentHeight);
  14473. g.DrawString(strNumber, ft12, b, rec2_1);
  14474. #endregion
  14475. #region 左排
  14476. #region 第一行
  14477. Rectangle rec3 = new Rectangle(rec2.X, rec2.Y + rec2.Height, ColumnWidth1 + ColumnWidth2 + ColumnWidth3 + ColumnWidth4, RowHeight);
  14478. g.DrawRectangle(p, rec3);//画标题矩形
  14479. Rectangle rec3_1 = new Rectangle(rec3.X + LeftAdd, rec3.Y + TopAdd, ColumnWidth1, RowContentHeight);
  14480. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("客户姓名"), ft12, b, rec3_1);//画第一列的列标题
  14481. Point p31_1 = new Point(rec3.X + ColumnWidth1, rec3.Y);
  14482. Point p31_2 = new Point(rec3.X + ColumnWidth1, rec3.Y + rec3.Height);
  14483. g.DrawLine(p, p31_1, p31_2);//画第一表与第二列的界线
  14484. Rectangle rec3_2 = new Rectangle(p31_1.X + LeftAdd, p31_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
  14485. g.DrawString(MName, ft12, b, rec3_2);//画第二列的列标题
  14486. Point p32_1 = new Point(p31_1.X + ColumnWidth2, rec3.Y);
  14487. Point p32_2 = new Point(p31_1.X + ColumnWidth2, rec3.Y + rec3.Height);
  14488. g.DrawLine(p, p32_1, p32_2);//画第二表与第三列的界线
  14489. Rectangle rec3_3 = new Rectangle(p32_1.X + LeftAdd, p32_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
  14490. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
  14491. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("入底"), ft12, b, rec3_3);//画第三列的列标题
  14492. Point p33_1 = new Point(p32_1.X + ColumnWidth3, rec3.Y);
  14493. Point p33_2 = new Point(p32_1.X + ColumnWidth3, rec3.Y + rec3.Height);
  14494. g.DrawLine(p, p33_1, p33_2);//画第三表与第四列的界线
  14495. string StrIntoBottom = IntoBottomQuantity.ToString().Trim();
  14496. if (StrIntoBottom == "0")
  14497. {
  14498. StrIntoBottom = LYFZ.BLL.OtherCommonModel.FontConversion("不送");
  14499. }
  14500. else if (StrIntoBottom == "-1")
  14501. {
  14502. StrIntoBottom = LYFZ.BLL.OtherCommonModel.FontConversion("全送");
  14503. }
  14504. Rectangle rec3_4 = new Rectangle(p33_1.X + LeftAdd, p33_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
  14505. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
  14506. g.DrawString(StrIntoBottom, ft12, b, rec3_4);//画第四列的列标题
  14507. Point p34_1 = new Point(p33_1.X + ColumnWidth4, rec3.Y);
  14508. Point p34_2 = new Point(p33_1.X + ColumnWidth4, rec3.Y + rec3.Height);
  14509. g.DrawLine(p, p34_1, p34_2);//画第四表与第五列的界线
  14510. #endregion
  14511. #region 第二行
  14512. Rectangle rec4 = new Rectangle(rec3.X, rec3.Y + rec3.Height, rec3.Width, RowHeight);
  14513. g.DrawRectangle(p, rec4);//画标题矩形
  14514. Rectangle rec4_1 = new Rectangle(rec4.X + LeftAdd, rec4.Y + TopAdd, ColumnWidth1, RowContentHeight);
  14515. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("联系电话"), ft12, b, rec4_1);//画第一列的列标题
  14516. Point p41_1 = new Point(rec4.X + ColumnWidth1, rec4.Y);
  14517. Point p41_2 = new Point(rec4.X + ColumnWidth1, rec4.Y + rec4.Height);
  14518. g.DrawLine(p, p41_1, p41_2);//画第一表与第二列的界线
  14519. Rectangle rec4_2 = new Rectangle(p41_1.X + LeftAdd, p41_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
  14520. g.DrawString(LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls(MTelephone), ft12, b, rec4_2);//画第二列的列标题
  14521. Point p42_1 = new Point(p41_1.X + ColumnWidth2, rec4.Y);
  14522. Point p42_2 = new Point(p41_1.X + ColumnWidth2, rec4.Y + rec4.Height);
  14523. g.DrawLine(p, p42_1, p42_2);//画第二表与第三列的界线
  14524. Rectangle rec4_3 = new Rectangle(p42_1.X + LeftAdd, p42_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
  14525. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
  14526. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("入册"), ft12, b, rec4_3);//画第三列的列标题
  14527. Point p43_1 = new Point(p42_1.X + ColumnWidth3, rec4.Y);
  14528. Point p43_2 = new Point(p42_1.X + ColumnWidth3, rec4.Y + rec4.Height);
  14529. g.DrawLine(p, p43_1, p43_2);//画第三表与第四列的界线
  14530. Rectangle rec4_4 = new Rectangle(p43_1.X + LeftAdd, p43_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
  14531. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
  14532. g.DrawString(IntoRegisterQuantit.ToString().Trim(), ft12, b, rec4_4);//画第四列的列标题
  14533. Point p44_1 = new Point(p43_1.X + ColumnWidth4, rec4.Y);
  14534. Point p44_2 = new Point(p43_1.X + ColumnWidth4, rec4.Y + rec4.Height);
  14535. g.DrawLine(p, p44_1, p44_2);//画第四表与第五列的界线
  14536. #endregion
  14537. #region 第三行
  14538. Rectangle rec5 = new Rectangle(rec4.X, rec4.Y + rec4.Height, rec3.Width, RowHeight);
  14539. g.DrawRectangle(p, rec5);//画标题矩形
  14540. Rectangle rec5_1 = new Rectangle(rec5.X + LeftAdd, rec5.Y + TopAdd, ColumnWidth1, RowContentHeight);
  14541. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("微信"), ft12, b, rec5_1);//画第一列的列标题
  14542. Point p51_1 = new Point(rec5.X + ColumnWidth1, rec5.Y);
  14543. Point p51_2 = new Point(rec5.X + ColumnWidth1, rec5.Y + rec5.Height);
  14544. g.DrawLine(p, p51_1, p51_2);//画第一表与第二列的界线
  14545. Rectangle rec5_2 = new Rectangle(p51_1.X + LeftAdd, p51_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
  14546. g.DrawString(MMicroSignal, ft12, b, rec5_2);//画第二列的列标题
  14547. Point p52_1 = new Point(p51_1.X + ColumnWidth2, rec5.Y);
  14548. Point p52_2 = new Point(p51_1.X + ColumnWidth2, rec5.Y + rec5.Height);
  14549. g.DrawLine(p, p52_1, p52_2);//画第二表与第三列的界线
  14550. Rectangle rec5_3 = new Rectangle(p52_1.X + LeftAdd, p52_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
  14551. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideClothingCount)
  14552. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("内景服装数"), ft12, b, rec5_3);//画第三列的列标题
  14553. Point p53_1 = new Point(p52_1.X + ColumnWidth3, rec5.Y);
  14554. Point p53_2 = new Point(p52_1.X + ColumnWidth3, rec5.Y + rec5.Height);
  14555. g.DrawLine(p, p53_1, p53_2);//画第三表与第四列的界线
  14556. Rectangle rec5_4 = new Rectangle(p53_1.X + LeftAdd, p53_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
  14557. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideClothingCount)
  14558. g.DrawString(InnerSights.ToString(), ft12, b, rec5_4);//画第四列的列标题
  14559. Point p54_1 = new Point(p53_1.X + ColumnWidth4, rec5.Y);
  14560. Point p54_2 = new Point(p53_1.X + ColumnWidth4, rec5.Y + rec5.Height);
  14561. g.DrawLine(p, p54_1, p54_2);//画第四表与第五列的界线
  14562. #endregion
  14563. #region 第四行
  14564. Rectangle rec6 = new Rectangle(rec5.X, rec5.Y + rec5.Height, rec3.Width, RowHeight);
  14565. g.DrawRectangle(p, rec6);//画标题矩形
  14566. Rectangle rec6_1 = new Rectangle(rec6.X + LeftAdd, rec6.Y + TopAdd, ColumnWidth1, RowContentHeight);
  14567. g.DrawString("QQ", ft12, b, rec6_1);//画第一列的列标题
  14568. Point p61_1 = new Point(rec6.X + ColumnWidth1, rec6.Y);
  14569. Point p61_2 = new Point(rec6.X + ColumnWidth1, rec6.Y + rec6.Height);
  14570. g.DrawLine(p, p61_1, p61_2);//画第一表与第二列的界线
  14571. Rectangle rec6_2 = new Rectangle(p61_1.X + LeftAdd, p61_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
  14572. g.DrawString(MQQ, ft12, b, rec6_2);//画第二列的列标题
  14573. Point p62_1 = new Point(p61_1.X + ColumnWidth2, rec6.Y);
  14574. Point p62_2 = new Point(p61_1.X + ColumnWidth2, rec6.Y + rec6.Height);
  14575. g.DrawLine(p, p62_1, p62_2);//画第二表与第三列的界线
  14576. Rectangle rec6_3 = new Rectangle(p62_1.X + LeftAdd, p62_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
  14577. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideClothingCount)
  14578. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("外景服装数"), ft12, b, rec6_3);//画第三列的列标题
  14579. Point p63_1 = new Point(p62_1.X + ColumnWidth3, rec6.Y);
  14580. Point p63_2 = new Point(p62_1.X + ColumnWidth3, rec6.Y + rec6.Height);
  14581. g.DrawLine(p, p63_1, p63_2);//画第三表与第四列的界线
  14582. Rectangle rec6_4 = new Rectangle(p63_1.X + LeftAdd, p63_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
  14583. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideClothingCount)
  14584. g.DrawString(OuterSights.ToString(), ft12, b, rec6_4);//画第四列的列标题
  14585. Point p64_1 = new Point(p63_1.X + ColumnWidth4, rec6.Y);
  14586. Point p64_2 = new Point(p63_1.X + ColumnWidth4, rec6.Y + rec6.Height);
  14587. g.DrawLine(p, p64_1, p64_2);//画第四表与第五列的界线
  14588. #endregion
  14589. #region 第四、五行
  14590. int rec7_Y = rec6.Y + rec6.Height;
  14591. int rec9Height = 0;
  14592. if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.EnabledIDNumber)
  14593. {
  14594. Rectangle rec6A = new Rectangle(rec6.X, rec6.Y + rec6.Height, rec3.Width, RowHeight);
  14595. g.DrawRectangle(p, rec6A);//画标题矩形
  14596. Rectangle rec6A_1 = new Rectangle(rec6A.X + LeftAdd, rec6A.Y + TopAdd, ColumnWidth1, RowContentHeight);
  14597. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("身份证号"), ft12, b, rec6A_1);//画第一列的列标题
  14598. Point p6A1_1 = new Point(rec6A.X + ColumnWidth1, rec6A.Y);
  14599. Point p6A1_2 = new Point(rec6A.X + ColumnWidth1, rec6A.Y + rec6A.Height);
  14600. g.DrawLine(p, p6A1_1, p6A1_2);//画第一表与第二列的界线
  14601. Rectangle rec6A_2 = new Rectangle(p6A1_1.X + LeftAdd, p6A1_1.Y + TopAdd, rec3.Width - ColumnWidth1, RowContentHeight);
  14602. g.DrawString(MIDNumber, ft12, b, rec6A_2);//画第二列的列标题
  14603. rec7_Y = rec6A.Y + rec6A.Height;
  14604. rec9Height = RowHeight;
  14605. }
  14606. #endregion
  14607. #region 第五行
  14608. Rectangle rec7 = new Rectangle(rec6.X, rec7_Y, rec3.Width, RowHeight);
  14609. g.DrawRectangle(p, rec7);//画标题矩形
  14610. Rectangle rec7_1 = new Rectangle(rec7.X + LeftAdd, rec7.Y + TopAdd, ColumnWidth1, RowContentHeight);
  14611. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("地址"), ft12, b, rec7_1);//画第一列的列标题
  14612. Point p71_1 = new Point(rec7.X + ColumnWidth1, rec7.Y);
  14613. Point p71_2 = new Point(rec7.X + ColumnWidth1, rec7.Y + rec7.Height);
  14614. g.DrawLine(p, p71_1, p71_2);//画第一表与第二列的界线
  14615. Rectangle rec7_2 = new Rectangle(p71_1.X + LeftAdd, p71_1.Y + TopAdd, ColumnWidth2 + ColumnWidth3 + ColumnWidth4, RowContentHeight);
  14616. g.DrawString(MAddress, ft12, b, rec7_2);//画第二列的列标题
  14617. Point p72_1 = new Point(p71_1.X + rec7_2.Width, rec7.Y);
  14618. Point p72_2 = new Point(p71_1.X + rec7_2.Width, rec7.Y + rec7.Height);
  14619. g.DrawLine(p, p72_1, p72_2);//画第二表与第三列的界线
  14620. #endregion
  14621. #region 第七行
  14622. Rectangle rec8A = new Rectangle(rec7.X, rec7.Y + rec7.Height, rec3.Width, RowHeight);
  14623. g.DrawRectangle(p, rec8A);//画标题矩形
  14624. Rectangle rec8A_1 = new Rectangle(rec8A.X + LeftAdd, rec8A.Y + TopAdd, ColumnWidth1, RowContentHeight);
  14625. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("喜爱风格"), ft12, b, rec8A_1);//画第一列的列标题
  14626. Point p8A1_1 = new Point(rec8A.X + ColumnWidth1, rec8A.Y);
  14627. Point p8A1_2 = new Point(rec8A.X + ColumnWidth1, rec8A.Y + rec8A.Height);
  14628. g.DrawLine(p, p8A1_1, p8A1_2);//画第一表与第二列的界线
  14629. Rectangle rec8A_2 = new Rectangle(p8A1_1.X + LeftAdd, p8A1_1.Y + TopAdd, rec8A.Width - rec8A_1.Width, RowContentHeight);
  14630. string[] OrdLovedStyle = tblOrder.Rows[0]["Ord_LovedStyle"].ToString().Trim().Split('|');
  14631. string StrLovedStyle = "";
  14632. for (int i = 0; i < OrdLovedStyle.Length; i++)
  14633. {
  14634. if (OrdLovedStyle[i].Trim() != "")
  14635. {
  14636. string[] StrID = OrdLovedStyle[i].Trim().Split('_');
  14637. DataRow dtRow = tblStyle.Rows.Find(StrID[1].Trim());
  14638. if (dtRow != null)
  14639. {
  14640. StrLovedStyle += dtRow["Style_Name"] + ",";
  14641. }
  14642. }
  14643. }
  14644. g.DrawString(StrLovedStyle.TrimEnd(','), ft12, b, rec8A_2);//画第六列的列标题
  14645. #endregion
  14646. #region 第一列
  14647. #region 第一行
  14648. Rectangle rec9 = new Rectangle(rec8A.X, rec8A.Y + rec8A.Height, rec3.Width, 535 - RowHeight + Rec1Height - rec9Height);
  14649. g.DrawRectangle(p, rec9);//画标题矩形
  14650. /*string StrProdName = LYFZ.BLL.OtherCommonModel.FontConversion("详细内容:");
  14651. for (int i = 0; i < tblProductList.Rows.Count; i++)
  14652. { StrProdName += "\r\n" + tblProductList.Rows[i]["ProdName"].ToString().Trim(); }
  14653. for (int i = 0; i < tblService.Rows.Count; i++)
  14654. { StrProdName += "\r\n" + tblService.Rows[i]["ProdName"].ToString().Trim(); }
  14655. Rectangle rec9_1 = new Rectangle(rec9.X + LeftAdd, rec9.Y + TopAdd, rec9.Width, rec9.Height - TopAdd * 2);
  14656. g.DrawString(StrProdName + "\r\n\r\n" + strSights, GetFontSize("写真预约单内容详情字体大小"), b, rec9_1);//画第一列的列标题*/
  14657. float _infoHeight = 0;
  14658. Rectangle rec9_1 = new Rectangle(rec9.X + LeftAdd, rec9.Y + TopAdd, rec9.Width - LeftAdd * 2, rec9.Height - TopAdd * 2);
  14659. string StrProdName = LYFZ.BLL.OtherCommonModel.FontConversion("详细内容:");
  14660. SizeF infoSizef = g.MeasureString(StrProdName,
  14661. GetFontSize("写真预约单内容详情字体大小"), rec9.Width);
  14662. g.DrawString(StrProdName, GetFontSize("写真预约单内容详情字体大小"), b, rec9_1);//画第一列的列标题
  14663. _infoHeight += infoSizef.Height;
  14664. ///此处取单位在商品删除和下架时报错 需要修改
  14665. //for (int i = 0; i < tblProductList.Rows.Count; i++)
  14666. //{
  14667. // if (i == 0)
  14668. // {
  14669. // PrintContentData("商品:", g, rec9, LeftAdd, TopAdd, b, "写真预约单内容详情字体大小", ref _infoHeight);
  14670. // }
  14671. // string strName = tblProductList.Rows[i]["ProdName"].ToString().Trim();
  14672. // PrintContentData(" " + strName, g, rec9, LeftAdd, TopAdd, b, "写真预约单内容详情字体大小", ref _infoHeight);
  14673. //}
  14674. //for (int i = 0; i < tblService.Rows.Count; i++)
  14675. //{
  14676. // if (i == 0)
  14677. // {
  14678. // PrintContentData("服务:", g, rec9, LeftAdd, TopAdd, b, "写真预约单内容详情字体大小", ref _infoHeight);
  14679. // }
  14680. // string strName = tblService.Rows[i]["ProdName"].ToString().Trim();
  14681. // PrintContentData(" " + strName, g, rec9, LeftAdd, TopAdd, b, "写真预约单内容详情字体大小", ref _infoHeight);
  14682. //}
  14683. ////g.DrawString(StrProdName + "\r\n\r\n" + StrSights, GetFontSize("婚纱预约单内容详情字体大小"), b, rec9_1);//画第一列的列标题
  14684. //PrintContentData("\r\n\r\n" + strSights, g, rec9, LeftAdd, TopAdd, b, "写真预约单内容详情字体大小", ref _infoHeight);
  14685. foreach (string str in data)
  14686. {
  14687. PrintContentData(" " + str, g, rec9, LeftAdd, TopAdd, b, "写真预约单内容详情字体大小", ref _infoHeight);
  14688. }
  14689. #endregion
  14690. #region 第二行
  14691. Rectangle recA1 = new Rectangle(rec9.X, rec9.Y + rec9.Height, rec3.Width, 100);
  14692. g.DrawRectangle(p, recA1);//画标题矩形
  14693. Rectangle recA1_1 = new Rectangle(recA1.X + LeftAdd, recA1.Y + TopAdd, recA1.Width, recA1.Height - TopAdd * 2);
  14694. string disInfo = LYFZ.BLL.OtherCommonModel.FontConversion("订单备注:") + tblOrder.Rows[0]["Ord_Remark"].ToString().Trim() ;
  14695. if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintOrderShowPayment)
  14696. {
  14697. disInfo += "\r\n付款:" + strPaymentMsg;
  14698. }
  14699. g.DrawString(disInfo, ft12, b, recA1_1);//画第一列的列标题
  14700. #endregion
  14701. #region 第三行
  14702. Rectangle recA2 = new Rectangle(recA1.X, recA1.Y + recA1.Height, rec3.Width, RowHeight);
  14703. g.DrawRectangle(p, recA2);//画标题矩形
  14704. Rectangle recA2_1 = new Rectangle(recA2.X + LeftAdd, recA2.Y + TopAdd, ColumnWidth1, RowContentHeight);
  14705. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("摄影师"), ft12, b, recA2_1);//画第一列的列标题
  14706. Point pA21_1 = new Point(recA2.X + ColumnWidth1, recA2.Y);
  14707. Point pA21_2 = new Point(recA2.X + ColumnWidth1, recA2.Y + recA2.Height);
  14708. g.DrawLine(p, pA21_1, pA21_2);//画第一表与第二列的界线
  14709. Rectangle recA2_2 = new Rectangle(pA21_1.X + LeftAdd, pA21_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
  14710. g.DrawString(StrPhotographer, ft12, b, recA2_2);//画第二列的列标题
  14711. Point pA22_1 = new Point(pA21_1.X + ColumnWidth2, recA2.Y);
  14712. Point pA22_2 = new Point(pA21_1.X + ColumnWidth2, recA2.Y + recA2.Height);
  14713. g.DrawLine(p, pA22_1, pA22_2);//画第二表与第三列的界线
  14714. Rectangle recA2_3 = new Rectangle(pA22_1.X + LeftAdd, pA22_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
  14715. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("化妆师"), ft12, b, recA2_3);//画第三列的列标题
  14716. Point pA23_1 = new Point(pA22_1.X + ColumnWidth3, recA2.Y);
  14717. Point pA23_2 = new Point(pA22_1.X + ColumnWidth3, recA2.Y + recA2.Height);
  14718. g.DrawLine(p, pA23_1, pA23_2);//画第三表与第四列的界线
  14719. Rectangle recA2_4 = new Rectangle(pA23_1.X + LeftAdd, pA23_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
  14720. g.DrawString(StrMakeupArtist.Trim(), ft12, b, recA2_4);//画第四列的列标题
  14721. Point pA24_1 = new Point(pA23_1.X + ColumnWidth4, recA2.Y);
  14722. Point pA24_2 = new Point(pA23_1.X + ColumnWidth4, recA2.Y + recA2.Height);
  14723. g.DrawLine(p, pA24_1, pA24_2);//画第四表与第五列的界线
  14724. #endregion
  14725. #region 第四行
  14726. Rectangle recA3 = new Rectangle(recA2.X, recA2.Y + recA2.Height, rec3.Width, RowHeight);
  14727. g.DrawRectangle(p, recA3);//画标题矩形
  14728. Rectangle recA3_1 = new Rectangle(recA3.X + LeftAdd, recA3.Y + TopAdd, ColumnWidth1, RowContentHeight);
  14729. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("拍摄时间"), ft12, b, recA3_1);//画第一列的列标题
  14730. Point pA31_1 = new Point(recA3.X + ColumnWidth1, recA3.Y);
  14731. Point pA31_2 = new Point(recA3.X + ColumnWidth1, recA3.Y + recA3.Height);
  14732. g.DrawLine(p, pA31_1, pA31_2);//画第一表与第二列的界线
  14733. Rectangle recA3_2 = new Rectangle(pA31_1.X + LeftAdd, pA31_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
  14734. g.DrawString(StrPhotoTime, ft12, b, recA3_2);//画第二列的列标题
  14735. Point pA32_1 = new Point(pA31_1.X + ColumnWidth2, recA3.Y);
  14736. Point pA32_2 = new Point(pA31_1.X + ColumnWidth2, recA3.Y + recA3.Height);
  14737. g.DrawLine(p, pA32_1, pA32_2);//画第二表与第三列的界线
  14738. Rectangle recA3_3 = new Rectangle(pA32_1.X + LeftAdd, pA32_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
  14739. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("取件日期"), ft12, b, recA3_3);//画第三列的列标题
  14740. Point pA33_1 = new Point(pA32_1.X + ColumnWidth3, recA3.Y);
  14741. Point pA33_2 = new Point(pA32_1.X + ColumnWidth3, recA3.Y + recA3.Height);
  14742. g.DrawLine(p, pA33_1, pA33_2);//画第三表与第四列的界线
  14743. string strPickupTime = "";
  14744. if (tblPickupTime.Rows.Count > 0)
  14745. {
  14746. if (!string.IsNullOrEmpty(tblPickupTime.Rows[0]["OPlist_PickupTime"].ToString().Trim()))
  14747. {
  14748. strPickupTime = LYFZ.Command.Command_Validate.DateTimeToString(tblPickupTime.Rows[0]["OPlist_PickupTime"]);
  14749. }
  14750. }
  14751. Rectangle recA3_4 = new Rectangle(pA33_1.X + LeftAdd, pA33_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
  14752. g.DrawString(strPickupTime, ft12, b, recA2_4);//画第四列的列标题
  14753. #endregion
  14754. #endregion
  14755. #region 第七行
  14756. Rectangle recA4 = new Rectangle(recA3.X, recA3.Y + recA3.Height, rec3.Width, RowHeight);
  14757. g.DrawRectangle(p, recA4);//画标题矩形
  14758. Rectangle recA4_1 = new Rectangle(recA4.X + LeftAdd, recA4.Y + TopAdd, ColumnWidth1, RowContentHeight);
  14759. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("选片日期"), ft12, b, recA4_1);//画第一列的列标题
  14760. Point pA41_1 = new Point(recA4.X + ColumnWidth1, recA4.Y);
  14761. Point pA41_2 = new Point(recA4.X + ColumnWidth1, recA4.Y + recA4.Height);
  14762. g.DrawLine(p, pA41_1, pA41_2);//画第一表与第二列的界线
  14763. Rectangle recA4_2 = new Rectangle(pA41_1.X + LeftAdd, pA41_1.Y + TopAdd, ColumnWidth2 + ColumnWidth3 + ColumnWidth4, RowContentHeight);
  14764. g.DrawString(StrFilmSelectionTime, ft12, b, recA4_2);//画第二列的列标题
  14765. #endregion
  14766. #endregion
  14767. #region 右排
  14768. #region 第一行
  14769. Rectangle Rrec3 = new Rectangle(rec3.X + rec3.Width, rec3.Y, ColumnWidth5 + ColumnWidth6, RowHeight);
  14770. g.DrawRectangle(p, Rrec3);//画标题矩形
  14771. Rectangle Rrec3_5 = new Rectangle(Rrec3.X + LeftAdd, Rrec3.Y + TopAdd, ColumnWidth5, RowContentHeight);
  14772. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("套系名称"), ft12, b, Rrec3_5);//画第五列的列标题
  14773. Point Rp35_1 = new Point(Rrec3.X + ColumnWidth5, Rrec3.Y);
  14774. Point Rp35_2 = new Point(Rrec3.X + ColumnWidth5, Rrec3.Y + Rrec3.Height);
  14775. g.DrawLine(p, Rp35_1, Rp35_2);//画第五表与第六列的界线
  14776. Rectangle Rrec3_6 = new Rectangle(Rp35_1.X + LeftAdd, Rrec3_5.Y, ColumnWidth6, RowContentHeight);
  14777. g.DrawString(tblOrder.Rows[0]["Ord_SeriesName"].ToString().Trim(), ft12, b, Rrec3_6);//画第六列的列标题
  14778. #endregion
  14779. #region 第二行
  14780. Rectangle Rrec4 = new Rectangle(Rrec3.X, Rrec3.Y + Rrec3.Height, Rrec3.Width, RowHeight);
  14781. g.DrawRectangle(p, Rrec4);//画标题矩形
  14782. Rectangle Rrec4_5 = new Rectangle(Rrec4.X + LeftAdd, Rrec4.Y + TopAdd, ColumnWidth5, RowContentHeight);
  14783. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("套系金额"), ft12, b, Rrec4_5);//画第五列的列标题
  14784. Point Rp45_1 = new Point(Rp35_1.X, Rrec4.Y);
  14785. Point Rp45_2 = new Point(Rp35_1.X, Rrec4.Y + Rrec4.Height);
  14786. g.DrawLine(p, Rp45_1, Rp45_2);//画第五表与第六列的界线
  14787. Rectangle Rrec4_6 = new Rectangle(Rp45_1.X + LeftAdd, Rrec4_5.Y, ColumnWidth6, RowContentHeight);
  14788. g.DrawString(tblOrder.Rows[0]["Ord_SeriesPrice"].ToString().Trim(), ft12, b, Rrec4_6);//画第六列的列标题
  14789. #endregion
  14790. #region 第三行
  14791. Rectangle Rrec5 = new Rectangle(Rrec4.X, Rrec4.Y + Rrec4.Height, Rrec3.Width, RowHeight);
  14792. g.DrawRectangle(p, Rrec5);//画标题矩形
  14793. Rectangle Rrec5_5 = new Rectangle(Rrec5.X + LeftAdd, Rrec5.Y + TopAdd, ColumnWidth5, RowContentHeight);
  14794. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("预约定金"), ft12, b, Rrec5_5);//画第五列的列标题
  14795. Point Rp55_1 = new Point(Rp45_1.X, Rrec5.Y);
  14796. Point Rp55_2 = new Point(Rp45_1.X, Rrec5.Y + Rrec5.Height);
  14797. g.DrawLine(p, Rp55_1, Rp55_2);//画第五表与第六列的界线
  14798. Rectangle Rrec5_6 = new Rectangle(Rp55_1.X + LeftAdd, Rrec5_5.Y, ColumnWidth6, RowContentHeight);
  14799. g.DrawString(OrdPrice, ft12, b, Rrec5_6);//画第六列的列标题
  14800. #endregion
  14801. #region 第四行
  14802. Rectangle Rrec6 = new Rectangle(Rrec5.X, Rrec5.Y + Rrec5.Height, Rrec3.Width, RowHeight);
  14803. g.DrawRectangle(p, Rrec6);//画标题矩形
  14804. Rectangle Rrec6_5 = new Rectangle(Rrec6.X + LeftAdd, Rrec6.Y + TopAdd, ColumnWidth5, RowContentHeight);
  14805. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideArrears)
  14806. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("余款金额"), ft12, b, Rrec6_5);//画第五列的列标题
  14807. Point Rp65_1 = new Point(Rp55_1.X, Rrec6.Y);
  14808. Point Rp65_2 = new Point(Rp55_1.X, Rrec6.Y + Rrec6.Height);
  14809. g.DrawLine(p, Rp65_1, Rp65_2);//画第五表与第六列的界线
  14810. Rectangle Rrec6_6 = new Rectangle(Rp65_1.X + LeftAdd, Rrec6_5.Y, ColumnWidth6, RowContentHeight);
  14811. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideArrears)
  14812. g.DrawString(tblOrder.Rows[0]["Ord_OrderArrears"].ToString().Trim(), ft12, b, Rrec6_6);//画第六列的列标题
  14813. #endregion
  14814. #region 第六行
  14815. Rectangle Rrec8 = new Rectangle(Rrec6.X, Rrec6.Y + Rrec6.Height, Rrec3.Width, RowHeight);
  14816. g.DrawRectangle(p, Rrec8);//画标题矩形
  14817. Rectangle Rrec8_5 = new Rectangle(Rrec8.X + LeftAdd, Rrec8.Y + TopAdd, ColumnWidth5, RowContentHeight);
  14818. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("门市"), ft12, b, Rrec8_5);//画第五列的列标题
  14819. Point Rp85_1 = new Point(Rp65_1.X, Rrec8.Y);
  14820. Point Rp85_2 = new Point(Rp65_1.X, Rrec8.Y + Rrec8.Height);
  14821. g.DrawLine(p, Rp85_1, Rp85_2);//画第五表与第六列的界线
  14822. Rectangle rec8_6 = new Rectangle(Rp85_1.X, Rrec8_5.Y, ColumnWidth6, RowContentHeight);
  14823. string strOrderPerson = "";
  14824. if (tblUser.Rows.Count > 0)
  14825. {
  14826. if (Convert.ToBoolean(tblUser.Rows[0]["User_PhonePrint"]) == true)
  14827. strOrderPerson = tblUser.Rows[0]["User_Name"].ToString() + " " + tblUser.Rows[0]["User_Telephone"].ToString();
  14828. else
  14829. strOrderPerson = tblUser.Rows[0]["User_Name"].ToString() + " " + tbl.Rows[0]["Company_Telephone"].ToString();
  14830. }
  14831. g.DrawString(strOrderPerson, ft12, b, rec8_6);//画第六列的列标题
  14832. #endregion
  14833. #region 第一列
  14834. Rectangle Rrec10 = new Rectangle(Rrec8.X, Rrec8.Y + Rrec8.Height, Rrec3.Width, recA2.Y - Rrec8.Y);
  14835. g.DrawRectangle(p, Rrec10);//画标题矩形
  14836. StrValue = "";
  14837. if (PrintOtherData.ContainsKey("写真预约单注意事项说明") && PrintOtherData["写真预约单注意事项说明"].ToString().Trim().Length > 0)
  14838. {
  14839. StrValue = PrintOtherData["写真预约单注意事项说明"].ToString().Trim();
  14840. }
  14841. Rectangle rec10_1 = new Rectangle(Rrec10.X + LeftAdd, Rrec10.Y + TopAdd, Rrec10.Width - LeftAdd * 2, Rrec10.Height - TopAdd * 2);
  14842. Font scaleFont = PrinterDrawMethod.ComputeAutoScaleFont(g, LYFZ.BLL.OtherCommonModel.FontConversion("注意事项:\r\n") + StrValue, rec10_1, GetFontSize("写真预约单注意事项字体大小"), minFontSize: 6);
  14843. PrinterDrawMethod.DrawCellTextAutroWrap(g, LYFZ.BLL.OtherCommonModel.FontConversion("注意事项:\r\n") + StrValue, rec10_1, scaleFont, autoWrap: true, nWrapLineSpace: 1, showFrame: false);
  14844. #endregion
  14845. #region 顾客签字
  14846. Rectangle RrecA5 = new Rectangle(Rrec10.X, Rrec10.Y + Rrec10.Height, Rrec3.Width, RowHeight * 2);
  14847. g.DrawRectangle(p, RrecA5);//画标题矩形
  14848. Rectangle RrecA5_1 = new Rectangle(RrecA5.X + LeftAdd, RrecA5.Y + RowContentHeight, ColumnWidth5, RowContentHeight);
  14849. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("顾客签字"), ft12, b, RrecA5_1);//画第五列的列标题
  14850. Point RpA51_1 = new Point(Rp65_1.X, RrecA5.Y);
  14851. Point RpA51_2 = new Point(Rp65_1.X, RrecA5.Y + RrecA5.Height);
  14852. g.DrawLine(p, RpA51_1, RpA51_2);//画第四表与第五列的界线
  14853. #endregion
  14854. #endregion
  14855. #region 尾行
  14856. string rec2Value = "网址:" + tbl.Rows[0]["Company_URL"].ToString().Trim();
  14857. sizef = g.MeasureString(rec2Value, ft9);
  14858. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  14859. FtHeight = Convert.ToInt32(sizef.Height);
  14860. Rectangle recA6_1 = new Rectangle(TableWidth + LeftWidth - FtWidth, recA4.Y + recA4.Height + TopAdd, FtWidth, FtHeight);
  14861. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("网址:") + tbl.Rows[0]["Company_URL"].ToString().Trim(), ft9, b, recA6_1);//画第一列的列标题
  14862. Rectangle recA6 = new Rectangle(recA4.X, recA6_1.Y, TableWidth - recA6_1.Width - 50, FtHeight);
  14863. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("地址:") + tbl.Rows[0]["Company_Address"].ToString().Trim(), ft9, b, recA6);//画第一列的列标题
  14864. Rectangle recA7 = new Rectangle(recA6.X, recA6.Y + recA6.Height, recA6.Width, FtHeight);
  14865. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("电话:") + tbl.Rows[0]["Company_Telephone"].ToString().Trim(), ft9, b, recA7);//画第一列的列标题
  14866. rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("页:") + (iPage + 1) + "/" + pListData.Count;
  14867. sizef = g.MeasureString(rec2Value, ft9);
  14868. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  14869. FtHeight = Convert.ToInt32(sizef.Height);
  14870. Rectangle recA8 = new Rectangle(TableWidth + LeftWidth - FtWidth, recA7.Y + recA7.Height - TopAdd, FtWidth, FtHeight);
  14871. g.DrawString(rec2Value, ft9, b, recA8);//画第一列的列标题
  14872. #endregion
  14873. // bitmapList.Add(bitmap);
  14874. }
  14875. /// <summary>
  14876. /// 写真二等份打印
  14877. /// </summary>
  14878. /// <param name="objValue"></param>
  14879. private static void Portrait_OrderReport_TwoEqualPrint(DataSet dtSet, Graphics g1, Size size
  14880. , ref List<List<string>> pListData, int iPage)
  14881. {
  14882. DataTable tbl = dtSet.Tables["ds"];//获取影楼信息
  14883. DataTable tblOrder = dtSet.Tables["ds1"];//订单
  14884. DataTable tblDigital = dtSet.Tables["ds2"];//数码
  14885. DataTable tblSights = dtSet.Tables["ds3"];//景点
  14886. DataTable tblPickupTime = dtSet.Tables["ds4"];//取件时间
  14887. DataTable tblProductList = dtSet.Tables["ds5"];//取件时间
  14888. DataTable tblClient = dtSet.Tables["ds6"];//客户资料
  14889. DataTable tblService = dtSet.Tables["ds7"];//客户资料
  14890. DataTable tblStyle = dtSet.Tables["ds8"];//喜爱风格
  14891. DataTable tblPayment = dtSet.Tables["ds9"];//订单定金
  14892. DataTable tblUser = dtSet.Tables["ds11"];//订单定金
  14893. string OrdPrice = "0.00";
  14894. if (tblPayment.Rows.Count > 0)
  14895. {
  14896. OrdPrice = tblPayment.Rows[0]["Pay_AmountOf"].ToString().Trim();
  14897. }
  14898. tblStyle.PrimaryKey = new DataColumn[] { tblStyle.Columns["ID"] };
  14899. DataTable tblIntoRB = dtSet.Tables["ds10"];//订单定金
  14900. int IntoRegisterQuantit = 0;
  14901. int IntoBottomQuantity = 0;
  14902. for (int i = 0; i < tblIntoRB.Rows.Count; i++)
  14903. {
  14904. IntoRegisterQuantit += Convert.ToInt32(tblIntoRB.Rows[i]["Ordv_IntoRegisterQuantity"]);
  14905. IntoBottomQuantity += Convert.ToInt32(tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"]);
  14906. }
  14907. ///获取付款方式集合
  14908. string strPaymentMsg = "";
  14909. foreach (DataRow dr in tblPayment.Rows)
  14910. {
  14911. if (!string.IsNullOrEmpty(strPaymentMsg))
  14912. {
  14913. strPaymentMsg += " ";
  14914. }
  14915. strPaymentMsg += dr["Sc_ClassName"] + ":" + dr["Pay_AmountOf"];
  14916. }
  14917. Brush b = Brushes.Black;
  14918. Pen p = GetPen;
  14919. Font ft17 = new Font("宋体", 17);
  14920. Font ft13 = new Font("宋体", 13);
  14921. Font ft10 = new Font("宋体", 10);
  14922. Font ft9 = new Font("宋体", 9);
  14923. #region 获取数据
  14924. string MName = "";
  14925. string MTelephone = "";
  14926. string MIDNumber = "";
  14927. string MMicroSignal = "";
  14928. string PMemberCardNumber = "";
  14929. string MQQ = "";
  14930. string MAddress = "";
  14931. if (tblClient.Rows.Count > 0)
  14932. {
  14933. for (int i = 0; i < tblClient.Rows.Count; i++)
  14934. {
  14935. if (tblClient.Rows[i]["GM_Master"].ToString().Trim() == "1")
  14936. {
  14937. MName = tblClient.Rows[i]["Cus_Name"].ToString().Trim();
  14938. MTelephone = tblClient.Rows[i]["Cus_Telephone"].ToString().Trim();
  14939. MIDNumber = tblClient.Rows[i]["Cus_IDNumber"].ToString().Trim();
  14940. MMicroSignal = tblClient.Rows[i]["Cus_MicroSignal"].ToString().Trim();
  14941. MQQ = tblClient.Rows[i]["Cus_QQ"].ToString().Trim();
  14942. MAddress = tblClient.Rows[i]["Cus_Address"].ToString().Trim();
  14943. DataTable tblMember = orbll.GetView_Custom("tb_ErpMemberCard", StrWhere: "Mc_CustomerNumber = '" + tblClient.Rows[i]["Cus_CustomerNumber"].ToString().Trim() + "'", ShowColumnName: "Mc_CradNumber").Tables[0];
  14944. if (tblMember.Rows.Count > 0)
  14945. {
  14946. PMemberCardNumber = tblMember.Rows[0]["Mc_CradNumber"].ToString();
  14947. }
  14948. }
  14949. }
  14950. }
  14951. int InnerSights = 0;
  14952. int OuterSights = 0;
  14953. string strSights = LYFZ.BLL.OtherCommonModel.FontConversion("拍摄名称:");
  14954. string StrPhotoTime = "";
  14955. string StrPhotographer = "";
  14956. string StrMakeupArtist = "";
  14957. for (int i = 0; i < tblSights.Rows.Count; i++)
  14958. {
  14959. if (tblSights.Rows[i]["Ordpg_SightsType"].ToString().Trim() == "0")
  14960. {
  14961. InnerSights += Convert.ToInt32(tblSights.Rows[i]["Ordpg_ApparelQuantity"]);
  14962. }
  14963. if (tblSights.Rows[i]["Ordpg_SightsType"].ToString().Trim() == "1")
  14964. {
  14965. OuterSights += Convert.ToInt32(tblSights.Rows[i]["Ordpg_ApparelQuantity"]);
  14966. }
  14967. strSights += "\r\n" + (i + 1) + "." + tblSights.Rows[i]["Ordpg_Sights"].ToString().Trim();
  14968. strSights += tblSights.Rows[i]["Ordpg_SightsRemark"].ToString().Trim();
  14969. if (!string.IsNullOrEmpty(tblSights.Rows[i]["Ordpg_Photographer"].ToString().Trim()))
  14970. {
  14971. StrPhotographer = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetUserName(tblSights.Rows[i]["Ordpg_Photographer"]);
  14972. }
  14973. if (!string.IsNullOrEmpty(tblSights.Rows[i]["Ordpg_MakeupArtist"].ToString().Trim()))
  14974. {
  14975. StrMakeupArtist = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetUserName(tblSights.Rows[i]["Ordpg_MakeupArtist"]);
  14976. }
  14977. if (LYFZ.Command.Command_Validate.DateTimeToString(tblSights.Rows[i]["Ordpg_ReservationPhotographyTime"]) != "")
  14978. {
  14979. if (StrPhotoTime == "")
  14980. {
  14981. StrPhotoTime = LYFZ.Command.Command_Validate.DateTimeToString2(tblSights.Rows[i]["Ordpg_ReservationPhotographyTime"]);
  14982. }
  14983. else if (Convert.ToDateTime(tblSights.Rows[i]["Ordpg_ReservationPhotographyTime"]) < Convert.ToDateTime(StrPhotoTime))
  14984. {
  14985. StrPhotoTime = LYFZ.Command.Command_Validate.DateTimeToString2(tblSights.Rows[i]["Ordpg_ReservationPhotographyTime"]);
  14986. }
  14987. }
  14988. }
  14989. string StrFilmSelectionTime = "";
  14990. if (tblDigital.Rows.Count > 0)
  14991. {
  14992. StrFilmSelectionTime = LYFZ.Command.Command_Validate.DateTimeToString2(tblDigital.Rows[0]["Ordv_FilmSelectionTime"]);
  14993. }
  14994. string StrProdName = "";
  14995. //for ( int i = 0; i < tblProductList.Rows.Count; i++ )
  14996. //{
  14997. // StrProdName += tblProductList.Rows[i]["ProdName"].ToString().Trim() + "\r\n";
  14998. //}
  14999. //for ( int i = 0; i < tblService.Rows.Count; i++ )
  15000. //{
  15001. // StrProdName += tblService.Rows[i]["ProdName"].ToString().Trim() + "\r\n";
  15002. //}
  15003. //StrProdName += LYFZ.BLL.OtherCommonModel.FontConversion( "\r\n备注:" ) + tblOrder.Rows[0]["Ord_Remark"].ToString().Trim();
  15004. #endregion
  15005. int LeftWidth = 50;
  15006. int TableWidth = size.Width - LeftWidth * 2 + 30;
  15007. int LeftAdd = 3;
  15008. int TopAdd = 4;
  15009. int RowHeight = 20;
  15010. int RowContentHeight = 18;
  15011. int Unit = TableWidth / 32;
  15012. int ColumnWidth1 = Unit * 3;
  15013. int ColumnWidth2 = Unit * 4;
  15014. int ColumnWidth3 = Unit * 3;
  15015. int ColumnWidth4 = Unit * 4;
  15016. int ColumnWidth5 = Unit * 3;
  15017. int ColumnWidth6 = Unit * 4;
  15018. int ColumnWidth7 = Unit * 3;
  15019. int ColumnWidth8 = TableWidth - ColumnWidth1 - ColumnWidth2 - ColumnWidth3 - ColumnWidth4 - ColumnWidth5 - ColumnWidth6 - ColumnWidth7;
  15020. if (pListData.Count == 0)
  15021. {
  15022. pListData = GetProductOrServiceHelfListData(g1, TableWidth, tblProductList, tblService, tblSights,disInfo: LYFZ.BLL.OtherCommonModel.FontConversion("\r\n备注:") + tblOrder.Rows[0]["Ord_Remark"].ToString().Trim());
  15023. }
  15024. string StrValue = tblOrder.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() != "" ? tblOrder.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() : tblOrder.Rows[0]["Ord_Number"].ToString().Trim();
  15025. string rec3Value = "NO." + StrRandom(StrValue);
  15026. string strNumber = rec3Value;
  15027. List<string> data = pListData[iPage];
  15028. Bitmap bitmap = new Bitmap(827, 580);
  15029. Graphics g = g1;//Graphics.FromImage(bitmap);
  15030. foreach (string str in data)
  15031. {
  15032. if (!string.IsNullOrEmpty(StrProdName))
  15033. {
  15034. StrProdName += "\r\n";
  15035. }
  15036. StrProdName += str;
  15037. }
  15038. #region 金色童年收据凭据
  15039. Rectangle rec1;
  15040. int Rec1Height = 0;
  15041. int TopHeightCount = 0;
  15042. Image imgLog = CachePhoto(PhotoLogType.Portrait, tbl.Rows[0]["Company_UpdateDatetime"], GetReservationSingleLOG("预约写真单LOG"));
  15043. if (imgLog != null)
  15044. {
  15045. rec1 = new Rectangle(LeftWidth, 50, TableWidth, 80);
  15046. Rectangle srcRec1 = new Rectangle(0, 0, imgLog.Width, imgLog.Height);
  15047. g.DrawImage(imgLog, rec1, srcRec1, GraphicsUnit.Pixel);
  15048. Rec1Height = rec1.Height - Convert.ToInt32(g.MeasureString("预约写真单标题", ft17).Height);
  15049. TopHeightCount = 3;
  15050. }
  15051. else
  15052. {
  15053. string StrTitle = GetReservationSingleTitle("预约写真单标题");
  15054. SizeF srcsizef = g.MeasureString(StrTitle, ft17);
  15055. int srcFtWidth = Convert.ToInt32(srcsizef.Width);
  15056. int srcFtHeight = Convert.ToInt32(srcsizef.Height);
  15057. rec1 = new Rectangle(size.Width / 2 - srcFtWidth / 2, 50, srcFtWidth + 5, srcFtHeight);
  15058. g.DrawString(StrTitle, ft17, b, rec1);
  15059. }
  15060. #endregion
  15061. #region 开单日期;
  15062. string strOrderCreatedData = LYFZ.BLL.OtherCommonModel.FontConversion("开单日期:") + LYFZ.Command.Command_Validate.DateTimeToString(tblOrder.Rows[0]["Ord_CreateDatetime"]);
  15063. SizeF sizef = g.MeasureString(strOrderCreatedData, ft10);
  15064. int FtWidth = Convert.ToInt32(sizef.Width) + 1;
  15065. int FtHeight = Convert.ToInt32(sizef.Height);
  15066. Rectangle rec1A = new Rectangle(LeftWidth, rec1.Y + rec1.Height + TopHeightCount, FtWidth, FtHeight);
  15067. g.DrawString(strOrderCreatedData, ft10, b, rec1A);
  15068. #endregion
  15069. #region NO.
  15070. sizef = g.MeasureString(strNumber, ft10);
  15071. rec1A = new Rectangle(rec1A.Right + 10, rec1A.Top, Convert.ToInt32(sizef.Width) + 1, Convert.ToInt32(sizef.Height));
  15072. g.DrawString(strNumber, ft10, b, rec1A);
  15073. #endregion
  15074. /*#region NO.
  15075. string StrValue = tblOrder.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() != "" ? tblOrder.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() : tblOrder.Rows[0]["Ord_Number"].ToString().Trim();
  15076. string rec3Value = "NO." + StrRandom(StrValue);
  15077. SizeF sizef = g.MeasureString(rec3Value, ft10);
  15078. int FtWidth = Convert.ToInt32(sizef.Width) + 1;
  15079. int FtHeight = Convert.ToInt32(sizef.Height);
  15080. Rectangle rec1A = new Rectangle(LeftWidth, rec1.Y + rec1.Height + TopHeightCount, FtWidth, FtHeight);
  15081. g.DrawString(rec3Value, ft10, b, rec1A);
  15082. #endregion*/
  15083. #region 打印时间
  15084. string StrPrintDate = LYFZ.BLL.OtherCommonModel.FontConversion("打印时间:") + LYFZ.Command.Command_Validate.DateTimeToString(SDateTime.Now, "yyyy-MM-dd HH:mm");
  15085. sizef = g.MeasureString(StrPrintDate, ft10);
  15086. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  15087. FtHeight = Convert.ToInt32(sizef.Height);
  15088. Rectangle rec2 = new Rectangle(TableWidth + LeftWidth - FtWidth, rec1A.Y, FtWidth, FtHeight);
  15089. g.DrawString(StrPrintDate, ft10, b, rec2);
  15090. #endregion
  15091. #region 第一行
  15092. Rectangle rec3 = new Rectangle(LeftWidth, rec2.Y + rec2.Height, TableWidth, RowHeight);
  15093. g.DrawRectangle(p, rec3);//画标题矩形
  15094. string rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("客户姓名");
  15095. sizef = g.MeasureString(rec2Value, ft17);
  15096. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  15097. FtHeight = Convert.ToInt32(sizef.Height);
  15098. Rectangle rec3_1 = new Rectangle(rec3.X + LeftAdd * 2, rec3.Y + TopAdd, ColumnWidth1, RowContentHeight);
  15099. g.DrawString(rec2Value, ft9, b, rec3_1);//画第一列的列标题
  15100. Point p31_1 = new Point(rec3.X + ColumnWidth1, rec3.Y);
  15101. Point p31_2 = new Point(rec3.X + ColumnWidth1, rec3.Y + rec3.Height);
  15102. g.DrawLine(p, p31_1, p31_2);//画第一表与第二列的界线
  15103. Rectangle rec3_2 = new Rectangle(p31_1.X + LeftAdd, p31_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
  15104. g.DrawString(MName, ft9, b, rec3_2);//画第二列的列标题
  15105. Point p32_1 = new Point(p31_1.X + ColumnWidth2, rec3.Y);
  15106. Point p32_2 = new Point(p31_1.X + ColumnWidth2, rec3.Y + rec3.Height);
  15107. g.DrawLine(p, p32_1, p32_2);//画第二表与第三列的界线
  15108. Rectangle rec3_3 = new Rectangle(p32_1.X + LeftAdd * 2, p32_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
  15109. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("电话"), ft9, b, rec3_3);//画第三列的列标题
  15110. Point p33_1 = new Point(p32_1.X + ColumnWidth3, rec3.Y);
  15111. Point p33_2 = new Point(p32_1.X + ColumnWidth3, rec3.Y + rec3.Height);
  15112. g.DrawLine(p, p33_1, p33_2);//画第三表与第四列的界线
  15113. Rectangle rec3_4 = new Rectangle(p33_1.X + LeftAdd, p33_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
  15114. g.DrawString(LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls(MTelephone), ft9, b, rec3_4);//画第四列的列标题
  15115. Point p34_1 = new Point(p33_1.X + ColumnWidth4, rec3.Y);
  15116. Point p34_2 = new Point(p33_1.X + ColumnWidth4, rec3.Y + rec3.Height);
  15117. g.DrawLine(p, p34_1, p34_2);//画第二表与第三列的界线
  15118. Rectangle rec3_5 = new Rectangle(p34_1.X + LeftAdd * 2, p34_1.Y + TopAdd, ColumnWidth5, RowContentHeight);
  15119. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("定金"), ft9, b, rec3_5);//画第三列的列标题
  15120. Point p35_1 = new Point(p34_1.X + ColumnWidth5, rec3.Y);
  15121. Point p35_2 = new Point(p34_1.X + ColumnWidth5, rec3.Y + rec3.Height);
  15122. g.DrawLine(p, p35_1, p35_2);//画第三表与第四列的界线
  15123. Rectangle rec3_6 = new Rectangle(p35_1.X + LeftAdd, p35_1.Y + TopAdd, ColumnWidth6, RowContentHeight);
  15124. g.DrawString(OrdPrice, ft9, b, rec3_6);//画第四列的列标题
  15125. Point p36_1 = new Point(p35_1.X + ColumnWidth6, rec3.Y);
  15126. Point p36_2 = new Point(p35_1.X + ColumnWidth6, rec3.Y + rec3.Height);
  15127. g.DrawLine(p, p36_1, p36_2);//画第二表与第三列的界线
  15128. Rectangle rec3_7 = new Rectangle(p36_1.X + LeftAdd * 2, p36_1.Y + TopAdd, ColumnWidth7, RowContentHeight);
  15129. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("套系金额"), ft9, b, rec3_7);//画第三列的列标题
  15130. Point p37_1 = new Point(p36_1.X + ColumnWidth7, rec3.Y);
  15131. Point p37_2 = new Point(p36_1.X + ColumnWidth7, rec3.Y + rec3.Height);
  15132. g.DrawLine(p, p37_1, p37_2);//画第三表与第四列的界线
  15133. Rectangle rec3_8 = new Rectangle(p37_1.X + LeftAdd, p37_1.Y + TopAdd, ColumnWidth8, RowContentHeight);
  15134. g.DrawString(tblOrder.Rows[0]["Ord_SeriesPrice"].ToString().Trim(), ft9, b, rec3_8);//画第四列的列标题
  15135. #endregion
  15136. #region 第二行
  15137. Rectangle rec4 = new Rectangle(rec3.X, rec3.Y + rec3.Height, rec3.Width, RowHeight);
  15138. g.DrawRectangle(p, rec4);//画标题矩形
  15139. Rectangle rec4_1 = new Rectangle(rec4.X + LeftAdd * 2, rec4.Y + TopAdd, ColumnWidth1, RowContentHeight);
  15140. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
  15141. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("入册"), ft9, b, rec4_1);//画第一列的列标题
  15142. Point p41_1 = new Point(rec4.X + ColumnWidth1, rec4.Y);
  15143. Point p41_2 = new Point(rec4.X + ColumnWidth1, rec4.Y + rec4.Height);
  15144. g.DrawLine(p, p41_1, p41_2);//画第一表与第二列的界线
  15145. Rectangle rec4_2 = new Rectangle(p41_1.X + LeftAdd, p41_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
  15146. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
  15147. g.DrawString(IntoRegisterQuantit.ToString().Trim(), ft9, b, rec4_2);//画第二列的列标题
  15148. Point p42_1 = new Point(p41_1.X + ColumnWidth2, rec4.Y);
  15149. Point p42_2 = new Point(p41_1.X + ColumnWidth2, rec4.Y + rec4.Height);
  15150. g.DrawLine(p, p42_1, p42_2);//画第二表与第三列的界线
  15151. Rectangle rec4_3 = new Rectangle(p42_1.X + LeftAdd * 2, p42_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
  15152. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
  15153. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("入底"), ft9, b, rec4_3);//画第三列的列标题
  15154. Point p43_1 = new Point(p42_1.X + ColumnWidth3, rec4.Y);
  15155. Point p43_2 = new Point(p42_1.X + ColumnWidth3, rec4.Y + rec4.Height);
  15156. g.DrawLine(p, p43_1, p43_2);//画第三表与第四列的界线
  15157. string StrIntoBottom = IntoBottomQuantity.ToString().Trim();
  15158. if (StrIntoBottom == "0")
  15159. {
  15160. StrIntoBottom = LYFZ.BLL.OtherCommonModel.FontConversion("不送");
  15161. }
  15162. else if (StrIntoBottom == "-1")
  15163. {
  15164. StrIntoBottom = LYFZ.BLL.OtherCommonModel.FontConversion("全送");
  15165. }
  15166. Rectangle rec4_4 = new Rectangle(p43_1.X + LeftAdd, p43_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
  15167. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
  15168. g.DrawString(StrIntoBottom, ft9, b, rec4_4);//画第四列的列标题
  15169. Point p44_1 = new Point(p43_1.X + ColumnWidth4, rec4.Y);
  15170. Point p44_2 = new Point(p43_1.X + ColumnWidth4, rec4.Y + rec4.Height);
  15171. g.DrawLine(p, p44_1, p44_2);//画第二表与第三列的界线
  15172. Rectangle rec4_5 = new Rectangle(p44_1.X + LeftAdd * 2, p44_1.Y + TopAdd, ColumnWidth5, RowContentHeight);
  15173. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideArrears)
  15174. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("欠款"), ft9, b, rec4_5);//画第三列的列标题
  15175. Point p45_1 = new Point(p44_1.X + ColumnWidth5, rec4.Y);
  15176. Point p45_2 = new Point(p44_1.X + ColumnWidth5, rec4.Y + rec4.Height);
  15177. g.DrawLine(p, p45_1, p45_2);//画第三表与第四列的界线
  15178. Rectangle rec4_6 = new Rectangle(p45_1.X + LeftAdd, p45_1.Y + TopAdd, ColumnWidth6, RowContentHeight);
  15179. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideArrears)
  15180. g.DrawString(tblOrder.Rows[0]["Ord_OrderArrears"].ToString().Trim(), ft9, b, rec4_6);//画第四列的列标题
  15181. Point p46_1 = new Point(p45_1.X + ColumnWidth6, rec4.Y);
  15182. Point p46_2 = new Point(p45_1.X + ColumnWidth6, rec4.Y + rec4.Height);
  15183. g.DrawLine(p, p46_1, p46_2);//画第二表与第三列的界线
  15184. Rectangle rec4_7 = new Rectangle(p46_1.X + LeftAdd * 2, p46_1.Y + TopAdd, ColumnWidth7, RowContentHeight);
  15185. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("套系名称"), ft9, b, rec4_7);//画第三列的列标题
  15186. Point p47_1 = new Point(p46_1.X + ColumnWidth7, rec4.Y);
  15187. Point p47_2 = new Point(p46_1.X + ColumnWidth7, rec4.Y + rec4.Height);
  15188. g.DrawLine(p, p47_1, p47_2);//画第三表与第四列的界线
  15189. Rectangle rec4_8 = new Rectangle(p47_1.X + LeftAdd, p47_1.Y + TopAdd, ColumnWidth8, RowContentHeight);
  15190. g.DrawString(tblOrder.Rows[0]["Ord_SeriesName"].ToString().Trim(), ft9, b, rec4_8);//画第四列的列标题
  15191. #endregion
  15192. #region 第三行
  15193. //Rectangle rec5 = new Rectangle(rec4.X, rec4.Y + rec4.Height, rec3.Width, RowHeight);
  15194. //g.DrawRectangle(p, rec5);//画标题矩形
  15195. //Rectangle rec5_1 = new Rectangle(rec5.X + LeftAdd * 12 - 1, rec5.Y + TopAdd, ColumnWidth1, RowContentHeight);
  15196. //g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("地址"), ft9, b, rec5_1);//画第一列的列标题
  15197. //Point p51_1 = new Point(rec5.X + ColumnWidth1, rec5.Y);
  15198. //Point p51_2 = new Point(rec5.X + ColumnWidth1, rec5.Y + rec5.Height);
  15199. //g.DrawLine(p, p51_1, p51_2);//画第一表与第二列的界线
  15200. //Rectangle rec5_2 = new Rectangle(p51_1.X + LeftAdd, p51_1.Y + TopAdd, ColumnWidth2 + ColumnWidth3 + ColumnWidth4 + ColumnWidth5 + ColumnWidth6, RowContentHeight);
  15201. //g.DrawString(MAddress, ft9, b, rec5_2);//画第二列的列标题
  15202. //Point p52_1 = new Point(p51_1.X + rec5_2.Width, rec5.Y);
  15203. //Point p52_2 = new Point(p51_1.X + rec5_2.Width, rec5.Y + rec5.Height);
  15204. //g.DrawLine(p, p52_1, p52_2);//画第二表与第三列的界线
  15205. //Rectangle rec5_7 = new Rectangle(p52_1.X + LeftAdd * 7, p52_1.Y + TopAdd, ColumnWidth7, RowContentHeight);
  15206. //g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("门 市"), ft9, b, rec5_7);//画第三列的列标题
  15207. //Point p57_1 = new Point(p52_1.X + ColumnWidth7, rec5.Y);
  15208. //Point p57_2 = new Point(p52_1.X + ColumnWidth7, rec5.Y + rec5.Height);
  15209. //g.DrawLine(p, p57_1, p57_2);//画第三表与第四列的界线
  15210. //Rectangle rec5_8 = new Rectangle(p57_1.X + LeftAdd, p57_1.Y + TopAdd, ColumnWidth8, RowContentHeight);
  15211. //g.DrawString(tblOrder.Rows[0]["OrdPe_OrdersPerson"].ToString(), ft9, b, rec5_8);//画第四列的列标题
  15212. Rectangle rec5 = new Rectangle(rec4.X, rec4.Y + rec4.Height, rec3.Width, RowHeight);
  15213. g.DrawRectangle(p, rec5);//画标题矩形
  15214. Rectangle rec5_1 = new Rectangle(rec5.X + LeftAdd * 2, rec5.Y + TopAdd, ColumnWidth1, RowContentHeight);
  15215. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideClothingCount)
  15216. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("内景服装"), ft9, b, rec5_1);//画第一列的列标题
  15217. Point p51_1 = new Point(rec5.X + rec5_1.Width, rec5.Y);
  15218. Point p51_2 = new Point(rec5.X + rec5_1.Width, rec5.Y + rec5.Height);
  15219. g.DrawLine(p, p51_1, p51_2);//画第一表与第二列的界线
  15220. Rectangle rec5_2 = new Rectangle(p51_1.X + LeftAdd, p51_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
  15221. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideClothingCount)
  15222. g.DrawString(InnerSights.ToString(), ft9, b, rec5_2);//画第二列的列标题
  15223. Point p52_1 = new Point(p51_1.X + rec5_2.Width, rec5.Y);
  15224. Point p52_2 = new Point(p51_1.X + rec5_2.Width, rec5.Y + rec5.Height);
  15225. g.DrawLine(p, p52_1, p52_2);//画第二表与第三列的界线
  15226. Rectangle rec5_3 = new Rectangle(p52_1.X + LeftAdd * 2, p52_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
  15227. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideClothingCount)
  15228. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("外景服装"), ft9, b, rec5_3);//画第一列的列标题
  15229. Point p53_1 = new Point(p52_1.X + rec5_3.Width, rec5.Y);
  15230. Point p53_2 = new Point(p52_1.X + rec5_3.Width, rec5.Y + rec5.Height);
  15231. g.DrawLine(p, p53_1, p53_2);//画第一表与第二列的界线
  15232. Rectangle rec5_4 = new Rectangle(p53_1.X + LeftAdd, p53_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
  15233. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideClothingCount)
  15234. g.DrawString(OuterSights.ToString(), ft9, b, rec5_4);//画第二列的列标题
  15235. Point p54_1 = new Point(p53_1.X + rec5_4.Width, rec5.Y);
  15236. Point p54_2 = new Point(p53_1.X + rec5_4.Width, rec5.Y + rec5.Height);
  15237. g.DrawLine(p, p54_1, p54_2);//画第二表与第三列的界线
  15238. Rectangle rec5_5 = new Rectangle(p54_1.X + LeftAdd * 2, p54_1.Y + TopAdd, ColumnWidth5, RowContentHeight);
  15239. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("会员卡号"), ft9, b, rec5_5);//画第一列的列标题
  15240. Point p55_1 = new Point(p54_1.X + rec5_5.Width, rec5.Y);
  15241. Point p55_2 = new Point(p54_1.X + rec5_5.Width, rec5.Y + rec5.Height);
  15242. g.DrawLine(p, p55_1, p55_2);//画第一表与第二列的界线
  15243. Rectangle rec5_6 = new Rectangle(p55_1.X + LeftAdd, p55_1.Y + TopAdd, ColumnWidth6, RowContentHeight);
  15244. g.DrawString(PMemberCardNumber, ft9, b, rec5_6);//画第二列的列标题
  15245. Point p56_1 = new Point(p55_1.X + rec5_6.Width, rec5.Y);
  15246. Point p56_2 = new Point(p55_1.X + rec5_6.Width, rec5.Y + rec5.Height);
  15247. g.DrawLine(p, p56_1, p56_2);//画第二表与第三列的界线
  15248. Rectangle rec5_7 = new Rectangle(p56_1.X + LeftAdd * 4, p56_1.Y + TopAdd, ColumnWidth7, RowContentHeight);
  15249. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("门 市"), ft9, b, rec5_7);//画第三列的列标题
  15250. Point p57_1 = new Point(p56_1.X + rec5_7.Width, rec5.Y);
  15251. Point p57_2 = new Point(p56_1.X + rec5_7.Width, rec5.Y + rec5.Height);
  15252. g.DrawLine(p, p57_1, p57_2);//画第三表与第四列的界线
  15253. Rectangle rec5_8 = new Rectangle(p57_1.X + LeftAdd, p57_1.Y + TopAdd, ColumnWidth8, RowContentHeight);
  15254. string strOrderPerson = "";
  15255. if (tblUser.Rows.Count > 0)
  15256. {
  15257. if (Convert.ToBoolean(tblUser.Rows[0]["User_PhonePrint"]) == true)
  15258. strOrderPerson = tblUser.Rows[0]["User_Name"].ToString() + " " + tblUser.Rows[0]["User_Telephone"].ToString();
  15259. else
  15260. strOrderPerson = tblUser.Rows[0]["User_Name"].ToString() + " " + tbl.Rows[0]["Company_Telephone"].ToString();
  15261. }
  15262. g.DrawString(strOrderPerson, ft9, b, rec5_8);//画第四列的列标题
  15263. #endregion
  15264. #region 第三四行
  15265. Rectangle rec5A = new Rectangle(rec5.X, rec5.Y + rec5.Height, rec3.Width, RowHeight);
  15266. g.DrawRectangle(p, rec5A);//画标题矩形
  15267. Rectangle rec5A_1 = new Rectangle(rec5A.X + LeftAdd * 2, rec5A.Y + TopAdd, ColumnWidth1, RowContentHeight);
  15268. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("地址"), ft9, b, rec5A_1);//画第一列的列标题
  15269. Point p5A1_1 = new Point(rec5A.X + ColumnWidth1, rec5A.Y);
  15270. Point p5A1_2 = new Point(rec5A.X + ColumnWidth1, rec5A.Y + rec5A.Height);
  15271. g.DrawLine(p, p5A1_1, p5A1_2);//画第一表与第二列的界线
  15272. Rectangle rec5A_2 = new Rectangle(p5A1_1.X + LeftAdd, p5A1_1.Y + TopAdd, TableWidth - ColumnWidth1, RowContentHeight);
  15273. g.DrawString(MAddress.ToString().Trim(), ft9, b, rec5A_2);//画第二列的列标题
  15274. //Point p5A2_1 = new Point(p5A1_1.X + ColumnWidth2, rec5A.Y);
  15275. //Point p5A2_2 = new Point(p5A1_1.X + ColumnWidth2, rec5A.Y + rec5A.Height);
  15276. //g.DrawLine(p, p5A2_1, p5A2_2);//画第二表与第三列的界线
  15277. //Rectangle rec5A_3 = new Rectangle(p5A2_1.X + LeftAdd * 2, p5A2_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
  15278. //g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("外景服装"), ft9, b, rec5A_3);//画第一列的列标题
  15279. //Point p5A3_1 = new Point(p5A2_1.X + ColumnWidth3, rec5A.Y);
  15280. //Point p5A3_2 = new Point(p5A2_1.X + ColumnWidth3, rec5A.Y + rec5A.Height);
  15281. //g.DrawLine(p, p5A3_1, p5A3_2);//画第一表与第二列的界线
  15282. //Rectangle rec5A_4 = new Rectangle(p5A3_1.X + LeftAdd, p5A3_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
  15283. //g.DrawString(OuterSights.ToString().Trim(), ft9, b, rec5A_4);//画第二列的列标题
  15284. //Point p5A4_1 = new Point(p5A3_1.X + ColumnWidth4, rec5A.Y);
  15285. //Point p5A4_2 = new Point(p5A3_1.X + ColumnWidth4, rec5A.Y + rec5A.Height);
  15286. //g.DrawLine(p, p5A4_1, p5A4_2);//画第二表与第三列的界线
  15287. //Rectangle rec5A_5 = new Rectangle(p5A4_1.X + LeftAdd * 2, p5A4_1.Y + TopAdd, ColumnWidth5, RowContentHeight);
  15288. //g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("地址"), ft9, b, rec5A_5);//画第三列的列标题
  15289. //Point p5A5_1 = new Point(p5A4_1.X + ColumnWidth5, rec5A.Y);
  15290. //Point p5A5_2 = new Point(p5A4_1.X + ColumnWidth5, rec5A.Y + rec5A.Height);
  15291. //g.DrawLine(p, p5A5_1, p5A5_2);//画第三表与第四列的界线
  15292. //Rectangle rec5A_6 = new Rectangle(p5A5_1.X + LeftAdd, p5A5_1.Y + TopAdd, ColumnWidth5 + ColumnWidth6 + ColumnWidth7 + ColumnWidth8, RowContentHeight);
  15293. //g.DrawString(MAddress, ft9, b, rec5A_6);//画第四列的列标题
  15294. #endregion
  15295. #region 第四行
  15296. Rectangle rec6 = new Rectangle(rec5A.X, rec5A.Y + rec5A.Height, TableWidth, 315 - Rec1Height - LeftWidth);
  15297. g.DrawRectangle(p, rec6);//画标题矩形
  15298. rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("套系内容");
  15299. sizef = g.MeasureString(rec2Value, ft17);
  15300. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  15301. FtHeight = Convert.ToInt32(sizef.Height) + 1;
  15302. Rectangle rec6_1 = new Rectangle(rec6.X + LeftAdd * 2, rec6.Y + (rec6.Height / 2 - FtHeight * 2), ColumnWidth1 / 2, FtHeight * 4);
  15303. g.DrawString(rec2Value, ft13, b, rec6_1);//画第一列的列标题
  15304. Point p61_1 = new Point(rec6.X + rec6_1.Width, rec6.Y);
  15305. Point p61_2 = new Point(rec6.X + rec6_1.Width, rec6.Y + rec6.Height);
  15306. g.DrawLine(p, p61_1, p61_2);//画第一表与第二列的界线
  15307. 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);
  15308. g.DrawString(StrProdName, GetFontSize("写真预约单内容详情字体大小"), b, rec6_2);//画第二列的列标题
  15309. Point p62_1 = new Point(p61_1.X + rec6_2.Width, rec6.Y);
  15310. Point p62_2 = new Point(p61_1.X + rec6_2.Width, rec6.Y + rec6.Height);
  15311. g.DrawLine(p, p62_1, p62_2);//画第二表与第三列的界线
  15312. Rectangle rec6_3 = new Rectangle(rec6_2.X + rec6_2.Width + LeftAdd, rec6_1.Y, rec6_1.Width, rec6_1.Height);
  15313. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("注意事项"), ft13, b, rec6_3);//画第三列的列标题
  15314. Point p63_1 = new Point(p62_1.X + rec6_3.Width, rec6.Y);
  15315. Point p63_2 = new Point(p62_1.X + rec6_3.Width, rec6.Y + rec6.Height);
  15316. g.DrawLine(p, p63_1, p63_2);//画第三表与第四列的界线
  15317. StrValue = "";
  15318. if (PrintOtherData.ContainsKey("写真预约单注意事项说明") && PrintOtherData["写真预约单注意事项说明"].ToString().Trim().Length > 0)
  15319. {
  15320. StrValue = PrintOtherData["写真预约单注意事项说明"].ToString().Trim();
  15321. }
  15322. Rectangle rec6_4 = new Rectangle(p63_1.X + LeftAdd, p63_1.Y + TopAdd, ColumnWidth8 + ColumnWidth7 + (ColumnWidth1 / 2) - rec6_3.Width, rec6.Height - TopAdd * 2);
  15323. g.DrawString(StrValue, GetFontSize("写真预约单注意事项字体大小"), b, rec6_4);//画第四列的列标题
  15324. #endregion
  15325. #region 第六行
  15326. int SWidth = TableWidth / 8;
  15327. int Column1 = SWidth - SWidth / 3 + 5;
  15328. int Column2 = SWidth + SWidth / 3;
  15329. Rectangle rec7 = new Rectangle(rec6.X, rec6.Y + rec6.Height, TableWidth - Column1 - Column2, RowHeight);
  15330. g.DrawRectangle(p, rec7);//画标题矩形
  15331. Rectangle rec7_1 = new Rectangle(rec7.X + LeftAdd * 2, rec7.Y + TopAdd, Column1, RowContentHeight);
  15332. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("摄影师"), ft9, b, rec7_1);//画第一列的列标题
  15333. Point p71_1 = new Point(rec7.X + rec7_1.Width, rec7.Y);
  15334. Point p71_2 = new Point(rec7.X + rec7_1.Width, rec7.Y + rec7.Height);
  15335. g.DrawLine(p, p71_1, p71_2);//画第一表与第二列的界线
  15336. Rectangle rec7_2 = new Rectangle(p71_1.X + LeftAdd, p71_1.Y + TopAdd, Column2, RowContentHeight);
  15337. g.DrawString(StrPhotographer, ft9, b, rec7_2);//画第六列的列标题
  15338. Point p72_1 = new Point(p71_1.X + rec7_2.Width, rec7.Y);
  15339. Point p72_2 = new Point(p71_1.X + rec7_2.Width, rec7.Y + rec7.Height);
  15340. g.DrawLine(p, p72_1, p72_2);//画第一表与第二列的界线
  15341. Rectangle rec7_3 = new Rectangle(p72_1.X + LeftAdd * 2, p72_1.Y + TopAdd, rec7_1.Width, RowContentHeight);
  15342. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("化妆师"), ft9, b, rec7_3);//画第一列的列标题
  15343. Point p73_1 = new Point(p72_1.X + rec7_3.Width, rec7.Y);
  15344. Point p73_2 = new Point(p72_1.X + rec7_3.Width, rec7.Y + rec7.Height);
  15345. g.DrawLine(p, p73_1, p73_2);//画第一表与第二列的界线
  15346. Rectangle rec7_4 = new Rectangle(p73_1.X + LeftAdd, p73_1.Y + TopAdd, rec7_2.Width - 15, RowContentHeight);
  15347. g.DrawString(StrMakeupArtist.Trim(), ft9, b, rec7_4);//画第六列的列标题
  15348. Point p74_1 = new Point(p73_1.X + rec7_4.Width, rec7.Y);
  15349. Point p74_2 = new Point(p73_1.X + rec7_4.Width, rec7.Y + rec7.Height);
  15350. g.DrawLine(p, p74_1, p74_2);//画第一表与第二列的界线
  15351. Rectangle rec7_5 = new Rectangle(p74_1.X + LeftAdd * 2, p74_1.Y + TopAdd, rec7_3.Width, RowContentHeight);
  15352. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("拍照时间"), ft9, b, rec7_5);//画第一列的列标题
  15353. Point p75_1 = new Point(p74_1.X + rec7_5.Width, rec7.Y);
  15354. Point p75_2 = new Point(p74_1.X + rec7_5.Width, rec7.Y + rec7.Height);
  15355. g.DrawLine(p, p75_1, p75_2);//画第一表与第二列的界线
  15356. Rectangle rec7_6 = new Rectangle(p75_1.X + LeftAdd, p75_1.Y + TopAdd, rec7_4.Width + 15, RowContentHeight);
  15357. g.DrawString(StrPhotoTime.Trim(), ft9, b, rec7_6);//画第六列的列标题
  15358. #endregion
  15359. #region 第七行
  15360. Rectangle rec8 = new Rectangle(rec7.X, rec7.Y + rec7.Height, rec7.Width, RowHeight);
  15361. g.DrawRectangle(p, rec8);//画标题矩形
  15362. Rectangle rec8_1 = new Rectangle(rec8.X + LeftAdd * 2, rec8.Y + TopAdd, rec7_1.Width, RowContentHeight);
  15363. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("选片时间"), ft9, b, rec8_1);//画第一列的列标题
  15364. Point p81_1 = new Point(rec8.X + rec7_1.Width, rec8.Y);
  15365. Point p81_2 = new Point(rec8.X + rec7_1.Width, rec8.Y + rec8.Height);
  15366. g.DrawLine(p, p81_1, p81_2);//画第一表与第二列的界线
  15367. Rectangle rec8_2 = new Rectangle(p81_1.X + LeftAdd, p81_1.Y + TopAdd, SWidth + SWidth / 3, RowContentHeight);
  15368. g.DrawString(StrFilmSelectionTime, ft9, b, rec8_2);//画第六列的列标题
  15369. Point p82_1 = new Point(p81_1.X + rec8_2.Width, rec8.Y);
  15370. Point p82_2 = new Point(p81_1.X + rec8_2.Width, rec8.Y + rec8.Height);
  15371. g.DrawLine(p, p82_1, p82_2);//画第一表与第二列的界线
  15372. Rectangle rec8_3 = new Rectangle(p82_1.X + LeftAdd * 2, p82_1.Y + TopAdd, rec8_1.Width, RowContentHeight);
  15373. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("设计师"), ft9, b, rec8_3);//画第一列的列标题
  15374. Point p83_1 = new Point(p82_1.X + rec8_3.Width, rec8.Y);
  15375. Point p83_2 = new Point(p82_1.X + rec8_3.Width, rec8.Y + rec8.Height);
  15376. g.DrawLine(p, p83_1, p83_2);//画第一表与第二列的界线
  15377. Rectangle rec8_4 = new Rectangle(p83_1.X + LeftAdd, p83_1.Y + TopAdd, rec8_2.Width - 15, RowContentHeight);
  15378. g.DrawString("", ft9, b, rec8_4);//画第六列的列标题
  15379. Point p84_1 = new Point(p83_1.X + rec8_4.Width, rec8.Y);
  15380. Point p84_2 = new Point(p83_1.X + rec8_4.Width, rec8.Y + rec8.Height);
  15381. g.DrawLine(p, p84_1, p84_2);//画第一表与第二列的界线
  15382. Rectangle rec8_5 = new Rectangle(p84_1.X + LeftAdd * 2, p84_1.Y + TopAdd, rec8_3.Width, RowContentHeight);
  15383. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("取件时间"), ft9, b, rec8_5);//画第一列的列标题
  15384. Point p85_1 = new Point(p84_1.X + rec8_5.Width, rec8.Y);
  15385. Point p85_2 = new Point(p84_1.X + rec8_5.Width, rec8.Y + rec8.Height);
  15386. g.DrawLine(p, p85_1, p85_2);//画第一表与第二列的界线
  15387. string strPickupTime = "";
  15388. if (tblPickupTime.Rows.Count > 0)
  15389. {
  15390. if (!string.IsNullOrEmpty(tblPickupTime.Rows[0]["OPlist_PickupTime"].ToString().Trim()))
  15391. {
  15392. strPickupTime = LYFZ.Command.Command_Validate.DateTimeToString(tblPickupTime.Rows[0]["OPlist_PickupTime"]);
  15393. }
  15394. }
  15395. Rectangle rec8_6 = new Rectangle(p85_1.X + LeftAdd, p85_1.Y + TopAdd, rec8_4.Width + 15, RowContentHeight);
  15396. g.DrawString(strPickupTime, ft9, b, rec8_6);//画第六列的列标题
  15397. #endregion
  15398. #region 顾客签字
  15399. Rectangle rec8A = new Rectangle(rec7.X + rec7.Width, rec7.Y, Column1 + Column2, rec7.Height + rec8.Height);
  15400. g.DrawRectangle(p, rec8A);//画标题矩形
  15401. Rectangle rec8A_1 = new Rectangle(rec7.X + rec7.Width + LeftAdd * 2, rec8A.Y + TopAdd * 3, Column1, RowContentHeight);
  15402. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("顾客签字"), ft9, b, rec8A_1);//画第一列的列标题
  15403. Point p8A1_1 = new Point(rec8A.X + Column1, rec8A.Y);
  15404. Point p8A1_2 = new Point(rec8A.X + Column1, rec8A.Y + rec8A.Height);
  15405. g.DrawLine(p, p8A1_1, p8A1_2);//画第一表与第二列的界线
  15406. Rectangle rec8A_2 = new Rectangle(p8A1_1.X + LeftAdd, p8A1_1.Y + TopAdd, Column2, RowContentHeight);
  15407. //g.DrawString("", ft9, b, rec8A_2);//画第六列的列标题
  15408. //Rectangle rec8A_2 = new Rectangle(p8A1_1.X + LeftAdd, p8A1_1.Y + TopAdd, Column2, RowContentHeight);
  15409. if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintOrderShowPayment)
  15410. {
  15411. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("收款"), ft9, b, rec7.X + LeftAdd * 3 + 5, p8A1_2.Y + TopAdd + 2);//画第一列的列标题
  15412. g.DrawLine(p, rec7.X, p8A1_1.Y, rec7.X, p8A1_2.Y + rec8A_2.Height + 5);//画第六列的列标题
  15413. g.DrawLine(p, rec7.X + Column1, p8A1_1.Y, rec7.X + Column1, p8A1_2.Y + rec8A_2.Height + 5);//画第六列的列标题
  15414. g.DrawLine(p, rec7.X + TableWidth, p8A1_1.Y, rec7.X + TableWidth, p8A1_2.Y + rec8A_2.Height + 5);//画第六列的列标题
  15415. g.DrawLine(p, rec7.X, p8A1_2.Y + rec8A_2.Height + 5, rec7.X + TableWidth, p8A1_2.Y + rec8A_2.Height + 5);//画第六列的列标题
  15416. rec8A_2.Height += 10;
  15417. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion(strPaymentMsg), ft9, b, rec7.X + LeftAdd * 22, p8A1_2.Y + TopAdd + 2);//画第一列的列标题
  15418. }
  15419. else
  15420. {
  15421. rec8A_2.Height = 0;
  15422. }
  15423. #endregion
  15424. #region 尾行
  15425. rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("电话:") + tbl.Rows[0]["Company_Telephone"].ToString().Trim();
  15426. sizef = g.MeasureString(rec2Value, ft9);
  15427. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  15428. FtHeight = Convert.ToInt32(sizef.Height);
  15429. Rectangle rec9_1 = new Rectangle(TableWidth + LeftWidth - FtWidth, rec8.Y + rec8.Height + TopAdd + rec8A_2.Height, FtWidth, FtHeight);
  15430. g.DrawString(rec2Value, ft9, b, rec9_1);//画第一列的列标题
  15431. rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("地址:") + tbl.Rows[0]["Company_Address"].ToString().Trim();
  15432. sizef = g.MeasureString(rec2Value, ft9);
  15433. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  15434. FtHeight = Convert.ToInt32(sizef.Height);
  15435. Rectangle rec9 = new Rectangle(rec8.X, rec9_1.Y, TableWidth - rec9_1.Width - LeftWidth, FtHeight);
  15436. g.DrawString(rec2Value, ft9, b, rec9);//画第一列的列标题
  15437. #endregion
  15438. //bitmapList.Add(bitmap);
  15439. }
  15440. #endregion
  15441. #region 婚庆
  15442. /// <summary>
  15443. /// 订单报表婚庆版(2-加身份证号)_备份
  15444. /// </summary>
  15445. /// <returns></returns>
  15446. private static void WeddingCelebration_OrderReport_Print(DataSet dtSet, Graphics g1, Size size
  15447. , ref List<List<string>> pListData, int iPage)
  15448. {
  15449. int LeftWidth = 20;
  15450. Brush b = Brushes.Black;
  15451. Bitmap panlImage = null;
  15452. Pen p = GetPen;
  15453. int TableWidth = size.Width - LeftWidth * 2 - 20;
  15454. DataTable tbl = dtSet.Tables["ds"];//获取影楼信息
  15455. DataTable tblOrder = dtSet.Tables["ds1"];//订单
  15456. DataTable tblDigital = dtSet.Tables["ds2"];//数码
  15457. DataTable tblSights = dtSet.Tables["ds3"];//景点
  15458. DataTable tblPickupTime = dtSet.Tables["ds4"];//取件时间
  15459. DataTable tblProductList = dtSet.Tables["ds5"];//订单商品
  15460. DataTable tblClient = dtSet.Tables["ds6"];//客户资料
  15461. DataTable tblService = dtSet.Tables["ds7"];//服务资料
  15462. DataTable tblStyle = dtSet.Tables["ds8"];//喜爱风格
  15463. DataTable tblPayment = dtSet.Tables["ds9"];//订单定金
  15464. DataTable tblUser = dtSet.Tables["ds11"];//订单主接单人
  15465. string OrdPrice = "0.00";
  15466. if (tblPayment.Rows.Count > 0)
  15467. {
  15468. OrdPrice = tblPayment.Rows[0]["Pay_AmountOf"].ToString().Trim();
  15469. }
  15470. tblStyle.PrimaryKey = new DataColumn[] { tblStyle.Columns["ID"] };
  15471. if (tbl.Rows.Count <= 0)
  15472. {
  15473. MessageBoxCustom.Show("未设置影楼信息"); return;
  15474. }
  15475. ///付款方式集合
  15476. string strPaymentMsg = "";
  15477. foreach (DataRow dr in tblPayment.Rows)
  15478. {
  15479. if (!string.IsNullOrEmpty(strPaymentMsg))
  15480. {
  15481. strPaymentMsg += " ";
  15482. }
  15483. strPaymentMsg += dr["Sc_ClassName"] + ":" + dr["Pay_AmountOf"];
  15484. }
  15485. if (pListData.Count == 0)
  15486. {
  15487. pListData = GetProductOrServiceListData(g1, TableWidth, tblProductList, tblService, tblSights, "婚庆预约单内容详情字体大小",true,700);
  15488. }
  15489. #region 获取数据
  15490. string MName = "";
  15491. string MTelephone = "";
  15492. string MIDNumber = "";
  15493. string MMicroSignal = "";
  15494. string MQQ = "";
  15495. string MAddress = "";
  15496. string WName = "";
  15497. string WTelephone = "";
  15498. string WIDNumber = "";
  15499. string WMicroSignal = "";
  15500. string WQQ = "";
  15501. string WAddress = "";
  15502. string DayForMarriage = "";
  15503. for (int i = 0; i < tblClient.Rows.Count; i++)
  15504. {
  15505. if (Convert.ToBoolean(tblClient.Rows[i]["Cus_Sex"]))
  15506. {
  15507. WName = tblClient.Rows[i]["Cus_Name"].ToString().Trim();
  15508. WTelephone = tblClient.Rows[i]["Cus_Telephone"].ToString().Trim();
  15509. WIDNumber = tblClient.Rows[i]["Cus_IDNumber"].ToString().Trim();
  15510. WMicroSignal = tblClient.Rows[i]["Cus_MicroSignal"].ToString().Trim();
  15511. WQQ = tblClient.Rows[i]["Cus_QQ"].ToString().Trim();
  15512. WAddress = tblClient.Rows[i]["Cus_Address"].ToString().Trim();
  15513. if (LYFZ.Command.Command_Validate.DateTimeToString(tblClient.Rows[i]["Cus_DayForMarriage"]) != "")
  15514. {
  15515. DayForMarriage = LYFZ.Command.Command_Validate.DateTimeToString(tblClient.Rows[i]["Cus_DayForMarriage"]);
  15516. if (!string.IsNullOrEmpty(tblClient.Rows[i]["Cus_DayForMarriageLunar"].ToString().Trim()) && tblClient.Rows[i]["Cus_DayForMarriageLunar"].ToString().Trim() == "1")
  15517. {
  15518. DayForMarriage += LYFZ.BLL.OtherCommonModel.FontConversion(" (农历)");
  15519. }
  15520. }
  15521. }
  15522. else
  15523. {
  15524. MName = tblClient.Rows[i]["Cus_Name"].ToString().Trim();
  15525. MTelephone = tblClient.Rows[i]["Cus_Telephone"].ToString().Trim();
  15526. MIDNumber = tblClient.Rows[i]["Cus_IDNumber"].ToString().Trim();
  15527. MMicroSignal = tblClient.Rows[i]["Cus_MicroSignal"].ToString().Trim();
  15528. MQQ = tblClient.Rows[i]["Cus_QQ"].ToString().Trim();
  15529. MAddress = tblClient.Rows[i]["Cus_Address"].ToString().Trim();
  15530. if (LYFZ.Command.Command_Validate.DateTimeToString(tblClient.Rows[i]["Cus_DayForMarriage"]) != "")
  15531. {
  15532. DayForMarriage = LYFZ.Command.Command_Validate.DateTimeToString(tblClient.Rows[i]["Cus_DayForMarriage"]);
  15533. if (!string.IsNullOrEmpty(tblClient.Rows[i]["Cus_DayForMarriageLunar"].ToString().Trim()) && tblClient.Rows[i]["Cus_DayForMarriageLunar"].ToString().Trim() == "1")
  15534. {
  15535. DayForMarriage += LYFZ.BLL.OtherCommonModel.FontConversion(" (农历)");
  15536. }
  15537. }
  15538. }
  15539. }
  15540. #endregion
  15541. Font ft17 = new Font("宋体", 17);
  15542. Font ft12 = new Font("宋体", 12);
  15543. Font ft9 = new Font("宋体", 9);
  15544. int sizeHeight = size.Height - 120;
  15545. panlImage = new Bitmap(827, 1150);
  15546. Graphics g = g1;//Graphics.FromImage( panlImage );
  15547. #region LOG抬头
  15548. int Rec1Height = 0;
  15549. Rectangle rec1;
  15550. Image imgLog = CachePhoto(PhotoLogType.Wedding, tbl.Rows[0]["Company_UpdateDatetime"], GetReservationSingleLOG("预约婚庆单LOG"));
  15551. if (imgLog != null)
  15552. {
  15553. rec1 = new Rectangle(LeftWidth, 0, TableWidth, 120);
  15554. Rectangle srcRec1 = new Rectangle(0, 0, imgLog.Width, imgLog.Height);
  15555. g.DrawImage(imgLog, rec1, srcRec1, GraphicsUnit.Pixel);
  15556. }
  15557. else
  15558. {
  15559. string StrTitle = GetReservationSingleTitle("预约婚庆单标题");
  15560. SizeF srcsizef = g.MeasureString(StrTitle, ft17);
  15561. int srcFtWidth = Convert.ToInt32(srcsizef.Width);
  15562. int srcFtHeight = Convert.ToInt32(srcsizef.Height);
  15563. rec1 = new Rectangle(size.Width / 2 - srcFtWidth / 2, 0, srcFtWidth + 1, srcFtHeight);
  15564. g.DrawString(StrTitle, ft17, b, rec1);
  15565. Rec1Height = 120 - rec1.Height;
  15566. }
  15567. #endregion
  15568. int LeftAdd = 3;
  15569. int TopAdd = 6;
  15570. int RowHeight = 25;
  15571. int RowContentHeight = 18;
  15572. int Unit = TableWidth / 25;
  15573. int ColumnWidth1 = Unit * 3 - Unit / 5;
  15574. int ColumnWidth2 = Unit * 5 + Unit / 5;
  15575. int ColumnWidth3 = Unit * 3 - Unit / 5;
  15576. int ColumnWidth4 = Unit * 5 + Unit / 5;
  15577. int ColumnWidth5 = Unit * 3 - Unit / 5;
  15578. int ColumnWidth6 = TableWidth - ColumnWidth1 - ColumnWidth2 - ColumnWidth3 - ColumnWidth4 - ColumnWidth5;
  15579. #region 始行
  15580. Rectangle rec2 = new Rectangle(LeftWidth, rec1.Y + rec1.Height + 10, 1000, RowContentHeight);
  15581. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("开单日期:") + LYFZ.Command.Command_Validate.DateTimeToString(tblOrder.Rows[0]["Ord_CreateDatetime"]), ft12, b, rec2);
  15582. string strShowNumber = tblOrder.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() != "" ? tblOrder.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() : tblOrder.Rows[0]["Ord_Number"].ToString().Trim();
  15583. string StrValue = "NO." + StrRandom(strShowNumber);
  15584. SizeF sizef = g.MeasureString(StrValue, ft12);
  15585. int FtWidth = Convert.ToInt32(sizef.Width) + 1;
  15586. int FtHeight = Convert.ToInt32(sizef.Height);
  15587. Rectangle rec2_1 = new Rectangle(TableWidth + LeftWidth + LeftAdd - FtWidth, rec2.Y, FtWidth, RowContentHeight);
  15588. g.DrawString(StrValue, ft12, b, rec2_1);
  15589. #endregion
  15590. #region 左排
  15591. #region 第一行
  15592. Rectangle rec3 = new Rectangle(rec2.X, rec2.Y + rec2.Height, ColumnWidth1 + ColumnWidth2 + ColumnWidth3 + ColumnWidth4, RowHeight);
  15593. g.DrawRectangle(p, rec3);//画标题矩形
  15594. Rectangle rec3_1 = new Rectangle(rec3.X + LeftAdd, rec3.Y + TopAdd, ColumnWidth1, RowContentHeight);
  15595. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("先生姓名"), ft12, b, rec3_1);//画第一列的列标题
  15596. Point p31_1 = new Point(rec3.X + ColumnWidth1, rec3.Y);
  15597. Point p31_2 = new Point(rec3.X + ColumnWidth1, rec3.Y + rec3.Height);
  15598. g.DrawLine(p, p31_1, p31_2);//画第一表与第二列的界线
  15599. Rectangle rec3_2 = new Rectangle(p31_1.X + LeftAdd, p31_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
  15600. g.DrawString(MName, ft12, b, rec3_2);//画第二列的列标题
  15601. Point p32_1 = new Point(p31_1.X + ColumnWidth2, rec3.Y);
  15602. Point p32_2 = new Point(p31_1.X + ColumnWidth2, rec3.Y + rec3.Height);
  15603. g.DrawLine(p, p32_1, p32_2);//画第二表与第三列的界线
  15604. Rectangle rec3_3 = new Rectangle(p32_1.X + LeftAdd, p32_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
  15605. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("女士姓名"), ft12, b, rec3_3);//画第三列的列标题
  15606. Point p33_1 = new Point(p32_1.X + ColumnWidth3, rec3.Y);
  15607. Point p33_2 = new Point(p32_1.X + ColumnWidth3, rec3.Y + rec3.Height);
  15608. g.DrawLine(p, p33_1, p33_2);//画第三表与第四列的界线
  15609. Rectangle rec3_4 = new Rectangle(p33_1.X + LeftAdd, p33_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
  15610. g.DrawString(WName, ft12, b, rec3_4);//画第四列的列标题
  15611. Point p34_1 = new Point(p33_1.X + ColumnWidth4, rec3.Y);
  15612. Point p34_2 = new Point(p33_1.X + ColumnWidth4, rec3.Y + rec3.Height);
  15613. g.DrawLine(p, p34_1, p34_2);//画第四表与第五列的界线
  15614. #endregion
  15615. #region 第二行
  15616. Rectangle rec4 = new Rectangle(rec3.X, rec3.Y + rec3.Height, rec3.Width, RowHeight);
  15617. g.DrawRectangle(p, rec4);//画标题矩形
  15618. Rectangle rec4_1 = new Rectangle(rec4.X + LeftAdd, rec4.Y + TopAdd, ColumnWidth1, RowContentHeight);
  15619. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("联系电话"), ft12, b, rec4_1);//画第一列的列标题
  15620. Point p41_1 = new Point(rec4.X + ColumnWidth1, rec4.Y);
  15621. Point p41_2 = new Point(rec4.X + ColumnWidth1, rec4.Y + rec4.Height);
  15622. g.DrawLine(p, p41_1, p41_2);//画第一表与第二列的界线
  15623. Rectangle rec4_2 = new Rectangle(p41_1.X + LeftAdd, p41_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
  15624. g.DrawString(LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls(MTelephone), ft12, b, rec4_2);//画第二列的列标题
  15625. Point p42_1 = new Point(p41_1.X + ColumnWidth2, rec4.Y);
  15626. Point p42_2 = new Point(p41_1.X + ColumnWidth2, rec4.Y + rec4.Height);
  15627. g.DrawLine(p, p42_1, p42_2);//画第二表与第三列的界线
  15628. Rectangle rec4_3 = new Rectangle(p42_1.X + LeftAdd, p42_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
  15629. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("联系电话"), ft12, b, rec4_3);//画第三列的列标题
  15630. Point p43_1 = new Point(p42_1.X + ColumnWidth3, rec4.Y);
  15631. Point p43_2 = new Point(p42_1.X + ColumnWidth3, rec4.Y + rec4.Height);
  15632. g.DrawLine(p, p43_1, p43_2);//画第三表与第四列的界线
  15633. Rectangle rec4_4 = new Rectangle(p43_1.X + LeftAdd, p43_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
  15634. g.DrawString(LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls(WTelephone), ft12, b, rec4_4);//画第四列的列标题
  15635. Point p44_1 = new Point(p43_1.X + ColumnWidth4, rec4.Y);
  15636. Point p44_2 = new Point(p43_1.X + ColumnWidth4, rec4.Y + rec4.Height);
  15637. g.DrawLine(p, p44_1, p44_2);//画第四表与第五列的界线
  15638. #endregion
  15639. #region 第二、三行
  15640. int rec5_Y = rec4.Y + rec4.Height;
  15641. int rec9Height = 0;
  15642. if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.EnabledIDNumber)
  15643. {
  15644. Rectangle rec4A = new Rectangle(rec4.X, rec4.Y + rec4.Height, rec4.Width, RowHeight);
  15645. g.DrawRectangle(p, rec4A);//画标题矩形
  15646. Rectangle rec4A_1 = new Rectangle(rec4A.X + LeftAdd, rec4A.Y + TopAdd, ColumnWidth1, RowContentHeight);
  15647. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("身份证号"), ft12, b, rec4A_1);//画第一列的列标题
  15648. Point p4A1_1 = new Point(rec4A.X + ColumnWidth1, rec4A.Y);
  15649. Point p4A1_2 = new Point(rec4A.X + ColumnWidth1, rec4A.Y + rec4A.Height);
  15650. g.DrawLine(p, p4A1_1, p4A1_2);//画第一表与第二列的界线
  15651. Rectangle rec4A_2 = new Rectangle(p4A1_1.X + LeftAdd, p4A1_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
  15652. g.DrawString(MIDNumber, ft12, b, rec4A_2);//画第二列的列标题
  15653. Point p4A2_1 = new Point(p4A1_1.X + ColumnWidth2, rec4A.Y);
  15654. Point p4A2_2 = new Point(p4A1_1.X + ColumnWidth2, rec4A.Y + rec4A.Height);
  15655. g.DrawLine(p, p4A2_1, p4A2_2);//画第二表与第三列的界线
  15656. Rectangle rec4A_3 = new Rectangle(p4A2_1.X + LeftAdd, p4A2_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
  15657. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("身份证号"), ft12, b, rec4A_3);//画第三列的列标题
  15658. Point p4A3_1 = new Point(p4A2_1.X + ColumnWidth3, rec4A.Y);
  15659. Point p4A3_2 = new Point(p4A2_1.X + ColumnWidth3, rec4A.Y + rec4A.Height);
  15660. g.DrawLine(p, p4A3_1, p4A3_2);//画第三表与第四列的界线
  15661. Rectangle rec4A_4 = new Rectangle(p4A3_1.X + LeftAdd, p4A3_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
  15662. g.DrawString(WIDNumber, ft12, b, rec4A_4);//画第四列的列标题
  15663. Point p4A4_1 = new Point(p4A3_1.X + ColumnWidth4, rec4A.Y);
  15664. Point p4A4_2 = new Point(p4A3_1.X + ColumnWidth4, rec4A.Y + rec4A.Height);
  15665. g.DrawLine(p, p4A4_1, p4A4_2);//画第四表与第五列的界线
  15666. rec5_Y = rec4A.Y + rec4A.Height;
  15667. rec9Height = RowHeight;
  15668. }
  15669. #endregion
  15670. #region 第三行
  15671. Rectangle rec5 = new Rectangle(rec4.X, rec5_Y, rec3.Width, RowHeight);
  15672. g.DrawRectangle(p, rec5);//画标题矩形
  15673. Rectangle rec5_1 = new Rectangle(rec5.X + LeftAdd, rec5.Y + TopAdd, ColumnWidth1, RowContentHeight);
  15674. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("微信"), ft12, b, rec5_1);//画第一列的列标题
  15675. Point p51_1 = new Point(rec5.X + ColumnWidth1, rec5.Y);
  15676. Point p51_2 = new Point(rec5.X + ColumnWidth1, rec5.Y + rec5.Height);
  15677. g.DrawLine(p, p51_1, p51_2);//画第一表与第二列的界线
  15678. Rectangle rec5_2 = new Rectangle(p51_1.X + LeftAdd, p51_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
  15679. g.DrawString(MMicroSignal, ft12, b, rec5_2);//画第二列的列标题
  15680. Point p52_1 = new Point(p51_1.X + ColumnWidth2, rec5.Y);
  15681. Point p52_2 = new Point(p51_1.X + ColumnWidth2, rec5.Y + rec5.Height);
  15682. g.DrawLine(p, p52_1, p52_2);//画第二表与第三列的界线
  15683. Rectangle rec5_3 = new Rectangle(p52_1.X + LeftAdd, p52_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
  15684. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("微信"), ft12, b, rec5_3);//画第三列的列标题
  15685. Point p53_1 = new Point(p52_1.X + ColumnWidth3, rec5.Y);
  15686. Point p53_2 = new Point(p52_1.X + ColumnWidth3, rec5.Y + rec5.Height);
  15687. g.DrawLine(p, p53_1, p53_2);//画第三表与第四列的界线
  15688. Rectangle rec5_4 = new Rectangle(p53_1.X + LeftAdd, p53_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
  15689. g.DrawString(WMicroSignal, ft12, b, rec5_4);//画第四列的列标题
  15690. Point p54_1 = new Point(p53_1.X + ColumnWidth4, rec5.Y);
  15691. Point p54_2 = new Point(p53_1.X + ColumnWidth4, rec5.Y + rec5.Height);
  15692. g.DrawLine(p, p54_1, p54_2);//画第四表与第五列的界线
  15693. #endregion
  15694. #region 第四行
  15695. Rectangle rec6 = new Rectangle(rec5.X, rec5.Y + rec5.Height, rec3.Width, RowHeight);
  15696. g.DrawRectangle(p, rec6);//画标题矩形
  15697. Rectangle rec6_1 = new Rectangle(rec6.X + LeftAdd, rec6.Y + TopAdd, ColumnWidth1, RowContentHeight);
  15698. g.DrawString("QQ", ft12, b, rec6_1);//画第一列的列标题
  15699. Point p61_1 = new Point(rec6.X + ColumnWidth1, rec6.Y);
  15700. Point p61_2 = new Point(rec6.X + ColumnWidth1, rec6.Y + rec6.Height);
  15701. g.DrawLine(p, p61_1, p61_2);//画第一表与第二列的界线
  15702. Rectangle rec6_2 = new Rectangle(p61_1.X + LeftAdd, p61_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
  15703. g.DrawString(MQQ, ft12, b, rec6_2);//画第二列的列标题
  15704. Point p62_1 = new Point(p61_1.X + ColumnWidth2, rec6.Y);
  15705. Point p62_2 = new Point(p61_1.X + ColumnWidth2, rec6.Y + rec6.Height);
  15706. g.DrawLine(p, p62_1, p62_2);//画第二表与第三列的界线
  15707. Rectangle rec6_3 = new Rectangle(p62_1.X + LeftAdd, p62_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
  15708. g.DrawString("QQ", ft12, b, rec6_3);//画第三列的列标题
  15709. Point p63_1 = new Point(p62_1.X + ColumnWidth3, rec6.Y);
  15710. Point p63_2 = new Point(p62_1.X + ColumnWidth3, rec6.Y + rec6.Height);
  15711. g.DrawLine(p, p63_1, p63_2);//画第三表与第四列的界线
  15712. Rectangle rec6_4 = new Rectangle(p63_1.X + LeftAdd, p63_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
  15713. g.DrawString(WQQ, ft12, b, rec6_4);//画第四列的列标题
  15714. Point p64_1 = new Point(p63_1.X + ColumnWidth4, rec6.Y);
  15715. Point p64_2 = new Point(p63_1.X + ColumnWidth4, rec6.Y + rec6.Height);
  15716. g.DrawLine(p, p64_1, p64_2);//画第四表与第五列的界线
  15717. #endregion
  15718. #region 第五行
  15719. Rectangle rec7 = new Rectangle(rec6.X, rec6.Y + rec6.Height, rec3.Width, RowHeight);
  15720. g.DrawRectangle(p, rec7);//画标题矩形
  15721. Rectangle rec7_1 = new Rectangle(rec7.X + LeftAdd, rec7.Y + TopAdd, ColumnWidth1, RowContentHeight);
  15722. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("男宾地址"), ft12, b, rec7_1);//画第一列的列标题
  15723. Point p71_1 = new Point(rec7.X + ColumnWidth1, rec7.Y);
  15724. Point p71_2 = new Point(rec7.X + ColumnWidth1, rec7.Y + rec7.Height);
  15725. g.DrawLine(p, p71_1, p71_2);//画第一表与第二列的界线
  15726. Rectangle rec7_2 = new Rectangle(p71_1.X + LeftAdd, p71_1.Y + TopAdd, ColumnWidth2 + ColumnWidth3 + ColumnWidth4, RowContentHeight);
  15727. g.DrawString(MAddress, ft12, b, rec7_2);//画第二列的列标题
  15728. Point p72_1 = new Point(p71_1.X + rec7_2.Width, rec7.Y);
  15729. Point p72_2 = new Point(p71_1.X + rec7_2.Width, rec7.Y + rec7.Height);
  15730. g.DrawLine(p, p72_1, p72_2);//画第二表与第三列的界线
  15731. #endregion
  15732. #region 第六行
  15733. Rectangle rec8 = new Rectangle(rec7.X, rec7.Y + rec7.Height, rec3.Width, RowHeight);
  15734. g.DrawRectangle(p, rec8);//画标题矩形
  15735. Rectangle rec8_1 = new Rectangle(rec8.X + LeftAdd, rec8.Y + TopAdd, ColumnWidth1, RowContentHeight);
  15736. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("女宾地址"), ft12, b, rec8_1);//画第一列的列标题
  15737. Point p81_1 = new Point(rec8.X + ColumnWidth1, rec8.Y);
  15738. Point p81_2 = new Point(rec8.X + ColumnWidth1, rec8.Y + rec8.Height);
  15739. g.DrawLine(p, p81_1, p81_2);//画第一表与第二列的界线
  15740. Rectangle rec8_2 = new Rectangle(p81_1.X + LeftAdd, p81_1.Y + TopAdd, rec7_2.Width, RowContentHeight);
  15741. g.DrawString(WAddress, ft12, b, rec8_2);//画第二列的列标题
  15742. Point p82_1 = new Point(p81_1.X + rec7_2.Width, rec8.Y);
  15743. Point p82_2 = new Point(p81_1.X + rec7_2.Width, rec8.Y + rec8.Height);
  15744. g.DrawLine(p, p82_1, p82_2);//画第二表与第三列的界线
  15745. #endregion
  15746. #region 第一列
  15747. #region 第一行
  15748. //string StrProdName = LYFZ.BLL.OtherCommonModel.FontConversion( "商品详细:" );
  15749. //string StrServiceName = LYFZ.BLL.OtherCommonModel.FontConversion( "服务详细:" );
  15750. ////此处取单位在商品删除和下架时报错 需要修改
  15751. //for ( int i = 0; i < tblProductList.Rows.Count; i++ )
  15752. //{
  15753. // StrProdName += "\r\n" + tblProductList.Rows[i]["ProdName"].ToString().Trim();
  15754. //}
  15755. //for ( int i = 0; i < tblService.Rows.Count; i++ )
  15756. //{
  15757. // StrServiceName += "\r\n" + tblService.Rows[i]["ProdName"].ToString().Trim();
  15758. //}
  15759. string StrContent = "";
  15760. foreach (string str in pListData[iPage])
  15761. {
  15762. //PrintContentData(" " + str, g, rec9, LeftAdd, TopAdd, b, "写真预约单内容详情字体大小", ref _infoHeight);
  15763. StrContent += "\r\n " + str;
  15764. }
  15765. int ContentFtHeight = Convert.ToInt32(g.MeasureString(StrContent, GetFontSize("婚庆预约单内容详情字体大小"), rec3.Width).Height + 1);
  15766. int FixedHeight = 430 + RowHeight + Rec1Height - rec9Height;
  15767. if (FixedHeight > ContentFtHeight)
  15768. {
  15769. ContentFtHeight = FixedHeight;
  15770. }
  15771. Rectangle rec9 = new Rectangle(rec8.X, rec8.Y + rec8.Height, rec3.Width, ContentFtHeight + TopAdd * 2);
  15772. g.DrawRectangle(p, rec9);//画标题矩形
  15773. Rectangle rec9_1 = new Rectangle(rec9.X + LeftAdd, rec9.Y + TopAdd, rec9.Width - LeftAdd * 2, ContentFtHeight);
  15774. g.DrawString(StrContent, GetFontSize("婚庆预约单内容详情字体大小"), b, rec9_1);//画第一列的列标题
  15775. #endregion
  15776. #region 第二行
  15777. Rectangle recA1 = new Rectangle(rec9.X, rec9.Y + rec9.Height, rec9.Width, 100);
  15778. g.DrawRectangle(p, recA1);//画标题矩形
  15779. Rectangle recA1_1 = new Rectangle(recA1.X + LeftAdd, recA1.Y + TopAdd, recA1.Width - LeftAdd * 2, recA1.Height - TopAdd * 2);
  15780. string disInfo = LYFZ.BLL.OtherCommonModel.FontConversion("订单备注:") + tblOrder.Rows[0]["Ord_Remark"].ToString().Trim();
  15781. if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintOrderShowPayment)
  15782. {
  15783. disInfo += "\r\n付款:" + strPaymentMsg;
  15784. }
  15785. g.DrawString(disInfo, ft12, b, recA1_1);//画第一列的列标题
  15786. #endregion
  15787. #region 第三行
  15788. Rectangle recA2 = new Rectangle(recA1.X, recA1.Y + recA1.Height, rec3.Width + ColumnWidth5, RowHeight * 2);
  15789. g.DrawRectangle(p, recA2);//画标题矩形
  15790. Rectangle recA2_1 = new Rectangle(recA2.X + LeftAdd, recA2.Y + RowContentHeight, ColumnWidth1, RowContentHeight);
  15791. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("酒店信息"), ft12, b, recA2_1);//画第一列的列标题
  15792. Point pA21_1 = new Point(recA2.X + ColumnWidth1, recA2.Y);
  15793. Point pA21_2 = new Point(recA2.X + ColumnWidth1, recA2.Y + recA2.Height);
  15794. g.DrawLine(p, pA21_1, pA21_2);//画第一表与第二列的界线
  15795. int recA2_2Width = recA2.Width - recA2_1.Width - LeftAdd * 2;
  15796. int FtHeightA = Convert.ToInt32(g.MeasureString("酒店信息", ft12, recA2_2Width).Height);
  15797. int FtHeightB = Convert.ToInt32(g.MeasureString(tblOrder.Rows[0]["Ord_HotelInfo"].ToString().Trim(), ft12, recA2_2Width).Height);
  15798. int recA2_2Y = recA2_1.Y;
  15799. int recA2Height = recA2.Height - TopAdd * 2;
  15800. int recA2_2Count = FtHeightB / FtHeightA;
  15801. if ((FtHeightB % FtHeightA) > 0)
  15802. {
  15803. recA2_2Count++;
  15804. }
  15805. if (recA2_2Count == 2)
  15806. {
  15807. recA2_2Y = pA21_1.Y + RowHeight - FtHeightA + TopAdd;
  15808. }
  15809. else if (recA2_2Count >= 3)
  15810. {
  15811. recA2_2Y = pA21_1.Y + 2;
  15812. recA2Height = recA2.Height - TopAdd;
  15813. }
  15814. Rectangle recA2_2 = new Rectangle(pA21_1.X + LeftAdd, recA2_2Y, recA2_2Width, recA2Height);
  15815. g.DrawString(tblOrder.Rows[0]["Ord_HotelInfo"].ToString().Trim(), ft12, b, recA2_2);//画第二列的列标题
  15816. #endregion
  15817. #endregion
  15818. #endregion
  15819. #region 右排
  15820. #region 第一行
  15821. Rectangle Rrec3 = new Rectangle(rec3.X + rec3.Width, rec3.Y, ColumnWidth5 + ColumnWidth6, RowHeight);
  15822. g.DrawRectangle(p, Rrec3);//画标题矩形
  15823. Rectangle Rrec3_5 = new Rectangle(Rrec3.X + LeftAdd, Rrec3.Y + TopAdd, ColumnWidth5, RowContentHeight);
  15824. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("套系名称"), ft12, b, Rrec3_5);//画第五列的列标题
  15825. Point Rp35_1 = new Point(Rrec3.X + ColumnWidth5, Rrec3.Y);
  15826. Point Rp35_2 = new Point(Rrec3.X + ColumnWidth5, Rrec3.Y + Rrec3.Height);
  15827. g.DrawLine(p, Rp35_1, Rp35_2);//画第五表与第六列的界线
  15828. Rectangle Rrec3_6 = new Rectangle(Rp35_1.X + LeftAdd, Rrec3_5.Y, ColumnWidth6, RowContentHeight);
  15829. g.DrawString(tblOrder.Rows[0]["Ord_SeriesName"].ToString().Trim(), ft12, b, Rrec3_6);//画第六列的列标题
  15830. #endregion
  15831. #region 第二行
  15832. Rectangle Rrec4 = new Rectangle(Rrec3.X, Rrec3.Y + Rrec3.Height, Rrec3.Width, RowHeight);
  15833. g.DrawRectangle(p, Rrec4);//画标题矩形
  15834. Rectangle Rrec4_5 = new Rectangle(Rrec4.X + LeftAdd, Rrec4.Y + TopAdd, ColumnWidth5, RowContentHeight);
  15835. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("套系金额"), ft12, b, Rrec4_5);//画第五列的列标题
  15836. Point Rp45_1 = new Point(Rp35_1.X, Rrec4.Y);
  15837. Point Rp45_2 = new Point(Rp35_1.X, Rrec4.Y + Rrec4.Height);
  15838. g.DrawLine(p, Rp45_1, Rp45_2);//画第五表与第六列的界线
  15839. Rectangle Rrec4_6 = new Rectangle(Rp45_1.X + LeftAdd, Rrec4_5.Y, ColumnWidth6, RowContentHeight);
  15840. g.DrawString(tblOrder.Rows[0]["Ord_SeriesPrice"].ToString().Trim(), ft12, b, Rrec4_6);//画第六列的列标题
  15841. #endregion
  15842. #region 第三行
  15843. Rectangle Rrec5 = new Rectangle(Rrec4.X, Rrec4.Y + Rrec4.Height, Rrec3.Width, RowHeight);
  15844. g.DrawRectangle(p, Rrec5);//画标题矩形
  15845. Rectangle Rrec5_5 = new Rectangle(Rrec5.X + LeftAdd, Rrec5.Y + TopAdd, ColumnWidth5, RowContentHeight);
  15846. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("预约定金"), ft12, b, Rrec5_5);//画第五列的列标题
  15847. Point Rp55_1 = new Point(Rp45_1.X, Rrec5.Y);
  15848. Point Rp55_2 = new Point(Rp45_1.X, Rrec5.Y + Rrec5.Height);
  15849. g.DrawLine(p, Rp55_1, Rp55_2);//画第五表与第六列的界线
  15850. Rectangle Rrec5_6 = new Rectangle(Rp55_1.X + LeftAdd, Rrec5_5.Y, ColumnWidth6, RowContentHeight);
  15851. g.DrawString(OrdPrice, ft12, b, Rrec5_6);//画第六列的列标题
  15852. #endregion
  15853. #region 第四行
  15854. Rectangle Rrec6 = new Rectangle(Rrec5.X, Rrec5.Y + Rrec5.Height, Rrec3.Width, RowHeight);
  15855. g.DrawRectangle(p, Rrec6);//画标题矩形
  15856. Rectangle Rrec6_5 = new Rectangle(Rrec6.X + LeftAdd, Rrec6.Y + TopAdd, ColumnWidth5, RowContentHeight);
  15857. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("余款金额"), ft12, b, Rrec6_5);//画第五列的列标题
  15858. Point Rp65_1 = new Point(Rp55_1.X, Rrec6.Y);
  15859. Point Rp65_2 = new Point(Rp55_1.X, Rrec6.Y + Rrec6.Height);
  15860. g.DrawLine(p, Rp65_1, Rp65_2);//画第五表与第六列的界线
  15861. Rectangle Rrec6_6 = new Rectangle(Rp65_1.X + LeftAdd, Rrec6_5.Y, ColumnWidth6, RowContentHeight);
  15862. g.DrawString(tblOrder.Rows[0]["Ord_OrderArrears"].ToString().Trim(), ft12, b, Rrec6_6);//画第六列的列标题
  15863. #endregion
  15864. #region 第五行
  15865. Rectangle Rrec7 = new Rectangle(Rrec6.X, Rrec6.Y + Rrec6.Height, Rrec3.Width, RowHeight);
  15866. g.DrawRectangle(p, Rrec7);//画标题矩形
  15867. Rectangle Rrec7_5 = new Rectangle(Rrec7.X + LeftAdd, Rrec7.Y + TopAdd, ColumnWidth5, RowContentHeight);
  15868. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("结婚日期"), ft12, b, Rrec7_5);//画第五列的列标题
  15869. Point Rp75_1 = new Point(Rp65_1.X, Rrec7.Y);
  15870. Point Rp75_2 = new Point(Rp65_1.X, Rrec7.Y + Rrec7.Height);
  15871. g.DrawLine(p, Rp75_1, Rp75_2);//画第五表与第六列的界线
  15872. Rectangle Rrec7_6 = new Rectangle(Rp75_1.X + LeftAdd, Rrec7_5.Y, ColumnWidth6, RowContentHeight);
  15873. g.DrawString(DayForMarriage, ft12, b, Rrec7_6);//画第六列的列标题
  15874. #endregion
  15875. #region 第六行
  15876. Rectangle Rrec8 = new Rectangle(Rrec7.X, Rrec7.Y + Rrec7.Height, Rrec3.Width, RowHeight);
  15877. g.DrawRectangle(p, Rrec8);//画标题矩形
  15878. Rectangle Rrec8_5 = new Rectangle(Rrec8.X + LeftAdd, Rrec8.Y + TopAdd, ColumnWidth5, RowContentHeight);
  15879. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("婚礼顾问"), ft12, b, Rrec8_5);//画第五列的列标题
  15880. Point Rp85_1 = new Point(Rp75_1.X, Rrec8.Y);
  15881. Point Rp85_2 = new Point(Rp75_1.X, Rrec8.Y + Rrec8.Height);
  15882. g.DrawLine(p, Rp85_1, Rp85_2);//画第五表与第六列的界线
  15883. Rectangle rec8_6 = new Rectangle(Rp85_1.X + LeftAdd, Rrec8_5.Y, ColumnWidth6, RowContentHeight);
  15884. string strOrderPerson = "";
  15885. if (tblUser.Rows.Count > 0)
  15886. {
  15887. if (Convert.ToBoolean(tblUser.Rows[0]["User_PhonePrint"]) == true)
  15888. strOrderPerson = tblUser.Rows[0]["User_Name"].ToString() + " " + tblUser.Rows[0]["User_Telephone"].ToString();
  15889. else
  15890. strOrderPerson = tblUser.Rows[0]["User_Name"].ToString() + " " + tbl.Rows[0]["Company_Telephone"].ToString();
  15891. }
  15892. g.DrawString(strOrderPerson, ft12, b, rec8_6);//画第六列的列标题
  15893. #endregion
  15894. #region 第一列
  15895. Rectangle Rrec10 = new Rectangle(Rrec8.X, Rrec8.Y + Rrec8.Height, Rrec3.Width, recA2.Y - Rrec8.Y - RowHeight);
  15896. g.DrawRectangle(p, Rrec10);//画标题矩形
  15897. StrValue = "";
  15898. if (PrintOtherData.ContainsKey("婚庆预约单注意事项说明") && PrintOtherData["婚庆预约单注意事项说明"].ToString().Trim().Length > 0)
  15899. {
  15900. StrValue = PrintOtherData["婚庆预约单注意事项说明"].ToString().Trim();
  15901. }
  15902. Rectangle rec10_1 = new Rectangle(Rrec10.X + LeftAdd, Rrec10.Y + TopAdd, Rrec10.Width - LeftAdd * 2, Rrec10.Height - TopAdd * 2);
  15903. Font scaleFont = PrinterDrawMethod.ComputeAutoScaleFont(g, LYFZ.BLL.OtherCommonModel.FontConversion("注意事项:\r\n") + StrValue, rec10_1, GetFontSize("婚庆预约单注意事项字体大小"), minFontSize: 6);
  15904. PrinterDrawMethod.DrawCellTextAutroWrap(g, LYFZ.BLL.OtherCommonModel.FontConversion("注意事项:\r\n") + StrValue, rec10_1, scaleFont, autoWrap: true, nWrapLineSpace: 1, showFrame: false);
  15905. #endregion
  15906. #region 顾客签字
  15907. Rectangle RrecA5 = new Rectangle(Rp75_1.X, Rrec10.Y + Rrec10.Height, ColumnWidth6, RowHeight * 2);
  15908. g.DrawRectangle(p, RrecA5);//画标题矩形
  15909. Rectangle RrecA5_1 = new Rectangle(RrecA5.X + LeftAdd, RrecA5.Y + RowContentHeight, ColumnWidth5, RowContentHeight);
  15910. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("顾客签字"), ft12, b, RrecA5_1);//画第五列的列标题
  15911. Point RpA51_1 = new Point(Rp75_1.X + ColumnWidth5, RrecA5.Y);
  15912. Point RpA51_2 = new Point(Rp75_1.X + ColumnWidth5, RrecA5.Y + RrecA5.Height);
  15913. g.DrawLine(p, RpA51_1, RpA51_2);//画第四表与第五列的界线
  15914. #endregion
  15915. #endregion
  15916. #region 尾行
  15917. string rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("网址:") + tbl.Rows[0]["Company_URL"].ToString().Trim();
  15918. sizef = g.MeasureString(rec2Value, ft9);
  15919. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  15920. FtHeight = Convert.ToInt32(sizef.Height);
  15921. Rectangle recA6_1 = new Rectangle(TableWidth + LeftWidth - FtWidth, recA2.Y + recA2.Height + TopAdd, FtWidth, FtHeight);
  15922. g.DrawString(rec2Value, ft9, b, recA6_1);//画第一列的列标题
  15923. Rectangle recA6 = new Rectangle(recA2.X, recA6_1.Y, TableWidth - recA6_1.Width - 50, FtHeight);
  15924. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("地址:") + tbl.Rows[0]["Company_Address"].ToString().Trim(), ft9, b, recA6);//画第一列的列标题
  15925. Rectangle recA7 = new Rectangle(recA6.X, recA6.Y + recA6.Height, recA6.Width, FtHeight);
  15926. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("电话:") + tbl.Rows[0]["Company_Telephone"].ToString().Trim(), ft9, b, recA7);//画第一列的列标题
  15927. #endregion
  15928. //if ( l == 0 )
  15929. //{
  15930. // if ( sizeHeight < recA7.Y + recA7.Height )
  15931. // {
  15932. // sizeHeight = recA7.Y + recA7.Height;
  15933. // }
  15934. //}
  15935. //else
  15936. //{
  15937. // break;
  15938. //}
  15939. //bitmapList.Add(panlImage);
  15940. //return panlImage;
  15941. }
  15942. /// <summary>
  15943. /// 婚庆二等份打印
  15944. /// </summary>
  15945. /// <param name="objValue"></param>
  15946. private static void WeddingCelebration_OrderReport_TwoEqualPrint(DataSet dtSet, Graphics g1, Size size
  15947. , ref List<List<string>> pListData, int iPage)
  15948. {
  15949. List<Image> imglist = new List<Image>();
  15950. DataTable tbl = dtSet.Tables["ds"];//获取影楼信息
  15951. DataTable tblOrder = dtSet.Tables["ds1"];//订单
  15952. DataTable tblDigital = dtSet.Tables["ds2"];//数码
  15953. DataTable tblSights = dtSet.Tables["ds3"];//景点
  15954. DataTable tblPickupTime = dtSet.Tables["ds4"];//取件时间
  15955. DataTable tblProductList = dtSet.Tables["ds5"];//订单商品
  15956. DataTable tblClient = dtSet.Tables["ds6"];//客户资料
  15957. DataTable tblService = dtSet.Tables["ds7"];//服务资料
  15958. DataTable tblStyle = dtSet.Tables["ds8"];//喜爱风格
  15959. DataTable tblPayment = dtSet.Tables["ds9"];//订单定金
  15960. DataTable tblUser = dtSet.Tables["ds11"];//订单定金
  15961. string OrdPrice = "0.00";
  15962. if (tblPayment.Rows.Count > 0)
  15963. {
  15964. OrdPrice = tblPayment.Rows[0]["Pay_AmountOf"].ToString().Trim();
  15965. }
  15966. tblStyle.PrimaryKey = new DataColumn[] { tblStyle.Columns["ID"] };
  15967. ///付款方式集合
  15968. string strPaymentMsg = "";
  15969. foreach (DataRow dr in tblPayment.Rows)
  15970. {
  15971. if (!string.IsNullOrEmpty(strPaymentMsg))
  15972. {
  15973. strPaymentMsg += " ";
  15974. }
  15975. strPaymentMsg += dr["Sc_ClassName"] + ":" + dr["Pay_AmountOf"];
  15976. }
  15977. Brush b = Brushes.Black;
  15978. Pen p = GetPen;
  15979. Font ft17 = new Font("宋体", 17);
  15980. Font ft13 = new Font("宋体", 13);
  15981. Font ft10 = new Font("宋体", 10);
  15982. Font ft9 = new Font("宋体", 9);
  15983. #region 获取数据
  15984. string MName = "";
  15985. string MTelephone = "";
  15986. string MIDNumber = "";
  15987. string MMicroSignal = "";
  15988. string MQQ = "";
  15989. string MAdderss = "";
  15990. string WName = "";
  15991. string WTelephone = "";
  15992. string WIDNumber = "";
  15993. string WMicroSignal = "";
  15994. string WQQ = "";
  15995. string WAdderss = "";
  15996. string DayForMarriage = "";
  15997. for (int i = 0; i < tblClient.Rows.Count; i++)
  15998. {
  15999. if (Convert.ToBoolean(tblClient.Rows[i]["Cus_Sex"]))
  16000. {
  16001. WName = tblClient.Rows[i]["Cus_Name"].ToString().Trim();
  16002. WTelephone = tblClient.Rows[i]["Cus_Telephone"].ToString().Trim();
  16003. WIDNumber = tblClient.Rows[i]["Cus_IDNumber"].ToString().Trim();
  16004. WMicroSignal = tblClient.Rows[i]["Cus_MicroSignal"].ToString().Trim();
  16005. WQQ = tblClient.Rows[i]["Cus_QQ"].ToString().Trim();
  16006. if (LYFZ.Command.Command_Validate.DateTimeToString(tblClient.Rows[i]["Cus_DayForMarriage"]) != "")
  16007. {
  16008. DayForMarriage = LYFZ.Command.Command_Validate.DateTimeToString(tblClient.Rows[i]["Cus_DayForMarriage"]);
  16009. if (!string.IsNullOrEmpty(tblClient.Rows[i]["Cus_DayForMarriageLunar"].ToString().Trim()) && tblClient.Rows[i]["Cus_DayForMarriageLunar"].ToString().Trim() == "1")
  16010. {
  16011. DayForMarriage += LYFZ.BLL.OtherCommonModel.FontConversion(" (农历)");
  16012. }
  16013. }
  16014. WAdderss = tblClient.Rows[i]["Cus_Address"].ToString().Trim();
  16015. }
  16016. else
  16017. {
  16018. MName = tblClient.Rows[i]["Cus_Name"].ToString().Trim();
  16019. MTelephone = tblClient.Rows[i]["Cus_Telephone"].ToString().Trim();
  16020. MIDNumber = tblClient.Rows[i]["Cus_IDNumber"].ToString().Trim();
  16021. MMicroSignal = tblClient.Rows[i]["Cus_MicroSignal"].ToString().Trim();
  16022. MQQ = tblClient.Rows[i]["Cus_QQ"].ToString().Trim();
  16023. if (LYFZ.Command.Command_Validate.DateTimeToString(tblClient.Rows[i]["Cus_DayForMarriage"]) != "")
  16024. {
  16025. DayForMarriage = LYFZ.Command.Command_Validate.DateTimeToString(tblClient.Rows[i]["Cus_DayForMarriage"]);
  16026. if (!string.IsNullOrEmpty(tblClient.Rows[i]["Cus_DayForMarriageLunar"].ToString().Trim()) && tblClient.Rows[i]["Cus_DayForMarriageLunar"].ToString().Trim() == "1")
  16027. {
  16028. DayForMarriage += LYFZ.BLL.OtherCommonModel.FontConversion(" (农历)");
  16029. }
  16030. }
  16031. MAdderss = tblClient.Rows[i]["Cus_Address"].ToString().Trim();
  16032. }
  16033. }
  16034. string StrProdName = "";
  16035. //for ( int i = 0; i < tblProductList.Rows.Count; i++ )
  16036. //{
  16037. // StrProdName += tblProductList.Rows[i]["ProdName"].ToString().Trim() + "\r\n";
  16038. //}
  16039. //for ( int i = 0; i < tblService.Rows.Count; i++ )
  16040. //{
  16041. // StrProdName += tblService.Rows[i]["ProdName"].ToString().Trim() + "\r\n";
  16042. //}
  16043. //StrProdName += LYFZ.BLL.OtherCommonModel.FontConversion( "\r\n备注:" ) + tblOrder.Rows[0]["Ord_Remark"].ToString().Trim();
  16044. #endregion
  16045. int LeftWidth = 50;
  16046. int TableWidth = size.Width - LeftWidth * 2 + 30;
  16047. int LeftAdd = 3;
  16048. int TopAdd = 4;
  16049. int RowHeight = 20;
  16050. int RowContentHeight = 18;
  16051. int Unit = TableWidth / 32;
  16052. int ColumnWidth1 = Unit * 3;
  16053. int ColumnWidth2 = Unit * 4;
  16054. int ColumnWidth3 = Unit * 3;
  16055. int ColumnWidth4 = Unit * 4;
  16056. int ColumnWidth5 = Unit * 2 - 4;
  16057. int ColumnWidth6 = Unit * 3 + 4;
  16058. int ColumnWidth7 = Unit * 3;
  16059. int ColumnWidth8 = TableWidth - ColumnWidth1 - ColumnWidth2 - ColumnWidth3 - ColumnWidth4 - ColumnWidth5 - ColumnWidth6 - ColumnWidth7;
  16060. if (pListData.Count == 0)
  16061. {
  16062. pListData = GetProductOrServiceHelfListData(g1, TableWidth, tblProductList, tblService, tblSights,disInfo: LYFZ.BLL.OtherCommonModel.FontConversion("\r\n备注:") + tblOrder.Rows[0]["Ord_Remark"].ToString().Trim());
  16063. }
  16064. string StrValue = tblOrder.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() != "" ? tblOrder.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() : tblOrder.Rows[0]["Ord_Number"].ToString().Trim();
  16065. string rec3Value = "NO." + StrRandom(StrValue);
  16066. string striNumber = rec3Value;
  16067. List<string> data = pListData[iPage];
  16068. Bitmap bitmap = new Bitmap(827, 580);
  16069. Graphics g = g1;//Graphics.FromImage(bitmap);
  16070. StrProdName = "";
  16071. foreach (string str in data)
  16072. {
  16073. if (!string.IsNullOrEmpty(StrProdName))
  16074. {
  16075. StrProdName += "\r\n";
  16076. }
  16077. StrProdName += str;
  16078. }
  16079. #region 金色童年收据凭据
  16080. Rectangle rec1;
  16081. int Rec1Height = 0;
  16082. int TopHeightCount = 0;
  16083. Image imgLog = CachePhoto(PhotoLogType.Wedding, tbl.Rows[0]["Company_UpdateDatetime"], GetReservationSingleLOG("预约婚庆单LOG"));
  16084. if (imgLog != null)
  16085. {
  16086. rec1 = new Rectangle(LeftWidth, 50, TableWidth, 80);
  16087. Rectangle srcRec1 = new Rectangle(0, 0, imgLog.Width, imgLog.Height);
  16088. g.DrawImage(imgLog, rec1, srcRec1, GraphicsUnit.Pixel);
  16089. Rec1Height = rec1.Height - Convert.ToInt32(g.MeasureString("预约婚庆单标题", ft17).Height);
  16090. TopHeightCount = 3;
  16091. }
  16092. else
  16093. {
  16094. string StrTitle = GetReservationSingleTitle("预约婚庆单标题");
  16095. SizeF srcsizef = g.MeasureString(StrTitle, ft17);
  16096. int srcFtWidth = Convert.ToInt32(srcsizef.Width);
  16097. int srcFtHeight = Convert.ToInt32(srcsizef.Height);
  16098. rec1 = new Rectangle(size.Width / 2 - srcFtWidth / 2, 50, srcFtWidth + 5, srcFtHeight);
  16099. g.DrawString(StrTitle, ft17, b, rec1);
  16100. }
  16101. #endregion
  16102. #region 开单日期;
  16103. string strOrderCreatedData = LYFZ.BLL.OtherCommonModel.FontConversion("开单日期:") + LYFZ.Command.Command_Validate.DateTimeToString(tblOrder.Rows[0]["Ord_CreateDatetime"]);
  16104. SizeF sizef = g.MeasureString(strOrderCreatedData, ft10);
  16105. int FtWidth = Convert.ToInt32(sizef.Width) + 1;
  16106. int FtHeight = Convert.ToInt32(sizef.Height);
  16107. Rectangle rec1A = new Rectangle(LeftWidth, rec1.Y + rec1.Height + TopHeightCount, FtWidth, FtHeight);
  16108. g.DrawString(strOrderCreatedData, ft10, b, rec1A);
  16109. #endregion
  16110. #region NO.
  16111. sizef = g.MeasureString(striNumber, ft10);
  16112. rec1A = new Rectangle(rec1A.Right + 10, rec1A.Top, Convert.ToInt32(sizef.Width) + 1, Convert.ToInt32(sizef.Height));
  16113. g.DrawString(striNumber, ft10, b, rec1A);
  16114. #endregion
  16115. /* #region NO.
  16116. string StrValue = tblOrder.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() != "" ? tblOrder.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() : tblOrder.Rows[0]["Ord_Number"].ToString().Trim();
  16117. string rec3Value = "NO." + StrRandom(StrValue);
  16118. SizeF sizef = g.MeasureString(rec3Value, ft10);
  16119. int FtWidth = Convert.ToInt32(sizef.Width) + 1;
  16120. int FtHeight = Convert.ToInt32(sizef.Height);
  16121. Rectangle rec1A = new Rectangle(LeftWidth, rec1.Y + rec1.Height + TopHeightCount, FtWidth, FtHeight);
  16122. g.DrawString(rec3Value, ft10, b, rec1A);
  16123. #endregion*/
  16124. #region 打印时间
  16125. string StrPrintDate = LYFZ.BLL.OtherCommonModel.FontConversion("打印时间:") + LYFZ.Command.Command_Validate.DateTimeToString(SDateTime.Now, "yyyy-MM-dd HH:mm");
  16126. sizef = g.MeasureString(StrPrintDate, ft10);
  16127. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  16128. FtHeight = Convert.ToInt32(sizef.Height);
  16129. Rectangle rec2 = new Rectangle(TableWidth + LeftWidth - FtWidth, rec1A.Y, FtWidth, FtHeight);
  16130. g.DrawString(StrPrintDate, ft10, b, rec2);
  16131. #endregion
  16132. #region 第一行
  16133. Rectangle rec3 = new Rectangle(LeftWidth, rec2.Y + rec2.Height, TableWidth, RowHeight);
  16134. g.DrawRectangle(p, rec3);//画标题矩形
  16135. string rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("先生姓名");
  16136. sizef = g.MeasureString(rec2Value, ft17);
  16137. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  16138. FtHeight = Convert.ToInt32(sizef.Height);
  16139. Rectangle rec3_1 = new Rectangle(rec3.X + LeftAdd * 2, rec3.Y + TopAdd, ColumnWidth1, RowContentHeight);
  16140. g.DrawString(rec2Value, ft9, b, rec3_1);//画第一列的列标题
  16141. Point p31_1 = new Point(rec3.X + ColumnWidth1, rec3.Y);
  16142. Point p31_2 = new Point(rec3.X + ColumnWidth1, rec3.Y + rec3.Height);
  16143. g.DrawLine(p, p31_1, p31_2);//画第一表与第二列的界线
  16144. Rectangle rec3_2 = new Rectangle(p31_1.X + LeftAdd, p31_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
  16145. g.DrawString(MName, ft9, b, rec3_2);//画第二列的列标题
  16146. Point p32_1 = new Point(p31_1.X + ColumnWidth2, rec3.Y);
  16147. Point p32_2 = new Point(p31_1.X + ColumnWidth2, rec3.Y + rec3.Height);
  16148. g.DrawLine(p, p32_1, p32_2);//画第二表与第三列的界线
  16149. Rectangle rec3_3 = new Rectangle(p32_1.X + LeftAdd * 2, p32_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
  16150. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("先生电话"), ft9, b, rec3_3);//画第三列的列标题
  16151. Point p33_1 = new Point(p32_1.X + ColumnWidth3, rec3.Y);
  16152. Point p33_2 = new Point(p32_1.X + ColumnWidth3, rec3.Y + rec3.Height);
  16153. g.DrawLine(p, p33_1, p33_2);//画第三表与第四列的界线
  16154. Rectangle rec3_4 = new Rectangle(p33_1.X + LeftAdd, p33_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
  16155. g.DrawString(LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls(MTelephone), ft9, b, rec3_4);//画第四列的列标题
  16156. Point p34_1 = new Point(p33_1.X + ColumnWidth4, rec3.Y);
  16157. Point p34_2 = new Point(p33_1.X + ColumnWidth4, rec3.Y + rec3.Height);
  16158. g.DrawLine(p, p34_1, p34_2);//画第二表与第三列的界线
  16159. Rectangle rec3_5 = new Rectangle(p34_1.X + LeftAdd * 2, p34_1.Y + TopAdd, ColumnWidth5, RowContentHeight);
  16160. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("定金"), ft9, b, rec3_5);//画第三列的列标题
  16161. Point p35_1 = new Point(p34_1.X + ColumnWidth5, rec3.Y);
  16162. Point p35_2 = new Point(p34_1.X + ColumnWidth5, rec3.Y + rec3.Height);
  16163. g.DrawLine(p, p35_1, p35_2);//画第三表与第四列的界线
  16164. Rectangle rec3_6 = new Rectangle(p35_1.X + LeftAdd, p35_1.Y + TopAdd, ColumnWidth6, RowContentHeight);
  16165. g.DrawString(OrdPrice, ft9, b, rec3_6);//画第四列的列标题
  16166. Point p36_1 = new Point(p35_1.X + ColumnWidth6, rec3.Y);
  16167. Point p36_2 = new Point(p35_1.X + ColumnWidth6, rec3.Y + rec3.Height);
  16168. g.DrawLine(p, p36_1, p36_2);//画第二表与第三列的界线
  16169. Rectangle rec3_7 = new Rectangle(p36_1.X + LeftAdd * 2, p36_1.Y + TopAdd, ColumnWidth7, RowContentHeight);
  16170. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("套系名称"), ft9, b, rec3_7);//画第三列的列标题
  16171. Point p37_1 = new Point(p36_1.X + ColumnWidth7, rec3.Y);
  16172. Point p37_2 = new Point(p36_1.X + ColumnWidth7, rec3.Y + rec3.Height);
  16173. g.DrawLine(p, p37_1, p37_2);//画第三表与第四列的界线
  16174. Rectangle rec3_8 = new Rectangle(p37_1.X + LeftAdd, p37_1.Y + TopAdd, ColumnWidth8, RowContentHeight);
  16175. g.DrawString(tblOrder.Rows[0]["Ord_SeriesName"].ToString().Trim(), ft9, b, rec3_8);//画第四列的列标题
  16176. #endregion
  16177. #region 第二行
  16178. Rectangle rec4 = new Rectangle(rec3.X, rec3.Y + rec3.Height, rec3.Width, RowHeight);
  16179. g.DrawRectangle(p, rec4);//画标题矩形
  16180. Rectangle rec4_1 = new Rectangle(rec4.X + LeftAdd * 2, rec4.Y + TopAdd, ColumnWidth1, RowContentHeight);
  16181. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("女士姓名"), ft9, b, rec4_1);//画第一列的列标题
  16182. Point p41_1 = new Point(rec4.X + ColumnWidth1, rec4.Y);
  16183. Point p41_2 = new Point(rec4.X + ColumnWidth1, rec4.Y + rec4.Height);
  16184. g.DrawLine(p, p41_1, p41_2);//画第一表与第二列的界线
  16185. Rectangle rec4_2 = new Rectangle(p41_1.X + LeftAdd, p41_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
  16186. g.DrawString(WName, ft9, b, rec4_2);//画第二列的列标题
  16187. Point p42_1 = new Point(p41_1.X + ColumnWidth2, rec4.Y);
  16188. Point p42_2 = new Point(p41_1.X + ColumnWidth2, rec4.Y + rec4.Height);
  16189. g.DrawLine(p, p42_1, p42_2);//画第二表与第三列的界线
  16190. Rectangle rec4_3 = new Rectangle(p42_1.X + LeftAdd * 2, p42_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
  16191. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("女士电话"), ft9, b, rec4_3);//画第三列的列标题
  16192. Point p43_1 = new Point(p42_1.X + ColumnWidth3, rec4.Y);
  16193. Point p43_2 = new Point(p42_1.X + ColumnWidth3, rec4.Y + rec4.Height);
  16194. g.DrawLine(p, p43_1, p43_2);//画第三表与第四列的界线
  16195. Rectangle rec4_4 = new Rectangle(p43_1.X + LeftAdd, p43_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
  16196. g.DrawString(LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls(WTelephone), ft9, b, rec4_4);//画第四列的列标题
  16197. Point p44_1 = new Point(p43_1.X + ColumnWidth4, rec4.Y);
  16198. Point p44_2 = new Point(p43_1.X + ColumnWidth4, rec4.Y + rec4.Height);
  16199. g.DrawLine(p, p44_1, p44_2);//画第二表与第三列的界线
  16200. Rectangle rec4_5 = new Rectangle(p44_1.X + LeftAdd * 2, p44_1.Y + TopAdd, ColumnWidth5, RowContentHeight);
  16201. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("欠款"), ft9, b, rec4_5);//画第三列的列标题
  16202. Point p45_1 = new Point(p44_1.X + ColumnWidth5, rec4.Y);
  16203. Point p45_2 = new Point(p44_1.X + ColumnWidth5, rec4.Y + rec4.Height);
  16204. g.DrawLine(p, p45_1, p45_2);//画第三表与第四列的界线
  16205. Rectangle rec4_6 = new Rectangle(p45_1.X + LeftAdd, p45_1.Y + TopAdd, ColumnWidth6, RowContentHeight);
  16206. g.DrawString(tblOrder.Rows[0]["Ord_OrderArrears"].ToString().Trim(), ft9, b, rec4_6);//画第四列的列标题
  16207. Point p46_1 = new Point(p45_1.X + ColumnWidth6, rec4.Y);
  16208. Point p46_2 = new Point(p45_1.X + ColumnWidth6, rec4.Y + rec4.Height);
  16209. g.DrawLine(p, p46_1, p46_2);//画第二表与第三列的界线
  16210. Rectangle rec4_7 = new Rectangle(p46_1.X + LeftAdd * 2, p46_1.Y + TopAdd, ColumnWidth7, RowContentHeight);
  16211. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("套系金额"), ft9, b, rec4_7);//画第三列的列标题
  16212. Point p47_1 = new Point(p46_1.X + ColumnWidth7, rec4.Y);
  16213. Point p47_2 = new Point(p46_1.X + ColumnWidth7, rec4.Y + rec4.Height);
  16214. g.DrawLine(p, p47_1, p47_2);//画第三表与第四列的界线
  16215. Rectangle rec4_8 = new Rectangle(p47_1.X + LeftAdd, p47_1.Y + TopAdd, ColumnWidth8, RowContentHeight);
  16216. g.DrawString(tblOrder.Rows[0]["Ord_SeriesPrice"].ToString().Trim(), ft9, b, rec4_8);//画第四列的列标题
  16217. #endregion
  16218. #region 第三行
  16219. Rectangle rec5 = new Rectangle(rec4.X, rec4.Y + rec4.Height, ColumnWidth1 + ColumnWidth2 + ColumnWidth3 + ColumnWidth4 + ColumnWidth5 + ColumnWidth6 + ColumnWidth7 + ColumnWidth8, RowHeight);
  16220. g.DrawRectangle(p, rec5);//画标题矩形
  16221. Rectangle rec5_1 = new Rectangle(rec5.X + LeftAdd * 2, rec5.Y + TopAdd, ColumnWidth1, RowContentHeight);
  16222. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("男宾地址"), ft9, b, rec5_1);//画第一列的列标题
  16223. Point p51_1 = new Point(rec5.X + ColumnWidth1, rec5.Y);
  16224. Point p51_2 = new Point(rec5.X + ColumnWidth1, rec5.Y + rec5.Height);
  16225. g.DrawLine(p, p51_1, p51_2);//画第一表与第二列的界线
  16226. Rectangle rec5_2 = new Rectangle(p51_1.X + LeftAdd, p51_1.Y + TopAdd, rec5.Width - ColumnWidth1 - ColumnWidth7 - ColumnWidth8, RowContentHeight);
  16227. g.DrawString(MAdderss, ft9, b, rec5_2);//画第二列的列标题
  16228. Point p52_1 = new Point(p51_1.X + rec5_2.Width, rec5.Y);
  16229. Point p52_2 = new Point(p51_1.X + rec5_2.Width, rec5.Y + rec5.Height);
  16230. g.DrawLine(p, p52_1, p52_2);//画第二表与第三列的界线
  16231. Rectangle rec5_7 = new Rectangle(p52_1.X + LeftAdd * 2, p52_1.Y + TopAdd, ColumnWidth7, RowContentHeight);
  16232. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("礼服顾问"), ft9, b, rec5_7);//画第三列的列标题
  16233. Point p57_1 = new Point(p52_1.X + ColumnWidth7, rec5.Y);
  16234. Point p57_2 = new Point(p52_1.X + ColumnWidth7, rec5.Y + rec5.Height);
  16235. g.DrawLine(p, p57_1, p57_2);//画第三表与第四列的界线
  16236. Rectangle rec5_8 = new Rectangle(p57_1.X + LeftAdd, p57_1.Y + TopAdd, ColumnWidth8, RowContentHeight);
  16237. string strOrderPerson = "";
  16238. if (tblUser.Rows.Count > 0)
  16239. {
  16240. if (Convert.ToBoolean(tblUser.Rows[0]["User_PhonePrint"]) == true)
  16241. strOrderPerson = tblUser.Rows[0]["User_Name"].ToString() + " " + tblUser.Rows[0]["User_Telephone"].ToString();
  16242. else
  16243. strOrderPerson = tblUser.Rows[0]["User_Name"].ToString() + " " + tbl.Rows[0]["Company_Telephone"].ToString();
  16244. }
  16245. g.DrawString(strOrderPerson, ft9, b, rec5_8);//画第四列的列标题
  16246. #endregion
  16247. #region 第三四行
  16248. Rectangle rec5A = new Rectangle(rec5.X, rec5.Y + rec5.Height, rec5.Width, RowHeight);
  16249. g.DrawRectangle(p, rec5A);//画标题矩形
  16250. Rectangle rec5A_1 = new Rectangle(rec5A.X + LeftAdd * 2, rec5A.Y + TopAdd, ColumnWidth1, RowContentHeight);
  16251. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("女宾地址"), ft9, b, rec5A_1);//画第一列的列标题
  16252. Point p5A1_1 = new Point(rec5A.X + ColumnWidth1, rec5A.Y);
  16253. Point p5A1_2 = new Point(rec5A.X + ColumnWidth1, rec5A.Y + rec5A.Height);
  16254. g.DrawLine(p, p5A1_1, p5A1_2);//画第一表与第二列的界线
  16255. Rectangle rec5A_2 = new Rectangle(p5A1_1.X + LeftAdd, p5A1_1.Y + TopAdd, rec5_2.Width, RowContentHeight);
  16256. g.DrawString(WAdderss, ft9, b, rec5A_2);//画第二列的列标题
  16257. Point p5A2_1 = new Point(p5A1_1.X + rec5A_2.Width, rec5A.Y);
  16258. Point p5A2_2 = new Point(p5A1_1.X + rec5A_2.Width, rec5A.Y + rec5A.Height);
  16259. g.DrawLine(p, p5A2_1, p5A2_2);//画第二表与第三列的界线
  16260. Rectangle rec5A_3 = new Rectangle(p5A2_1.X + LeftAdd * 2, p5A2_1.Y + TopAdd, ColumnWidth7, RowContentHeight);
  16261. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("结婚日期"), ft9, b, rec5A_3);//画第三列的列标题
  16262. Point p5A3_1 = new Point(p5A2_1.X + ColumnWidth7, rec5A.Y);
  16263. Point p5A3_2 = new Point(p5A2_1.X + ColumnWidth7, rec5A.Y + rec5A.Height);
  16264. g.DrawLine(p, p5A3_1, p5A3_2);//画第三表与第四列的界线
  16265. Rectangle rec5A_4 = new Rectangle(p5A3_1.X + LeftAdd, p5A3_1.Y + TopAdd, ColumnWidth8, RowContentHeight);
  16266. g.DrawString(DayForMarriage, ft9, b, rec5A_4);//画第四列的列标题
  16267. #endregion
  16268. #region 第四行
  16269. Rectangle rec6 = new Rectangle(rec5A.X, rec5A.Y + rec5A.Height, TableWidth - ColumnWidth8, 310 - Rec1Height - LeftWidth);
  16270. g.DrawRectangle(p, rec6);//画标题矩形
  16271. rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("内容详情");
  16272. sizef = g.MeasureString(rec2Value, ft17);
  16273. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  16274. FtHeight = Convert.ToInt32(sizef.Height) + 1;
  16275. Rectangle rec6_1 = new Rectangle(rec6.X + LeftAdd * 2, rec6.Y + (rec6.Height / 2 - FtHeight * 2), ColumnWidth1 / 2, FtHeight * 4);
  16276. g.DrawString(rec2Value, ft13, b, rec6_1);//画第一列的列标题
  16277. Point p61_1 = new Point(rec6.X + rec6_1.Width, rec6.Y);
  16278. Point p61_2 = new Point(rec6.X + rec6_1.Width, rec6.Y + rec6.Height);
  16279. g.DrawLine(p, p61_1, p61_2);//画第一表与第二列的界线
  16280. Rectangle rec6_2 = new Rectangle(p61_1.X + LeftAdd, p61_1.Y + TopAdd, rec6.Width - rec6_1.Width - LeftAdd * 2, rec6.Height - TopAdd * 2);
  16281. g.DrawString(StrProdName, GetFontSize("婚庆预约单内容详情字体大小"), b, rec6_2);//画第二列的列标题
  16282. Rectangle rec6A = new Rectangle(rec6.X + rec6.Width, rec6.Y, ColumnWidth8, rec6.Height);
  16283. g.DrawRectangle(p, rec6A);//画标题矩形
  16284. sizef = g.MeasureString("注意事项", ft17);
  16285. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  16286. FtHeight = Convert.ToInt32(sizef.Height) + 1;
  16287. Rectangle rec6A_1 = new Rectangle(rec6A.X + LeftAdd * 2, rec6_1.Y, rec6_1.Width, rec6A.Height);
  16288. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("注意事项"), ft13, b, rec6A_1);//画第三列的列标题
  16289. Point p6A1_1 = new Point(rec6A.X + rec6A_1.Width, rec6A.Y);
  16290. Point p6A1_2 = new Point(rec6A.X + rec6A_1.Width, rec6A.Y + rec6A.Height);
  16291. g.DrawLine(p, p6A1_1, p6A1_2);//画第三表与第四列的界线
  16292. StrValue = "";
  16293. if (PrintOtherData.ContainsKey("婚庆预约单注意事项说明") && PrintOtherData["婚庆预约单注意事项说明"].ToString().Trim().Length > 0)
  16294. {
  16295. StrValue = PrintOtherData["婚庆预约单注意事项说明"].ToString().Trim();
  16296. }
  16297. Rectangle rec6A_2 = new Rectangle(p6A1_1.X + LeftAdd, rec6A.Y + TopAdd, ColumnWidth8 - rec6A_1.Width - LeftAdd * 2, rec6.Height - TopAdd * 2);
  16298. g.DrawString(StrValue, GetFontSize("婚庆预约单注意事项字体大小"), b, rec6A_2);//画第四列的列标题
  16299. #endregion
  16300. #region 第六行
  16301. int SWidth = (p6A1_1.X - LeftWidth) / 6;
  16302. int Column1 = SWidth - 20;
  16303. int Column2 = SWidth + 20;
  16304. Rectangle rec7 = new Rectangle(rec6.X, rec6.Y + rec6.Height, p6A1_1.X - LeftWidth, RowHeight * 2 + 5);
  16305. g.DrawRectangle(p, rec7);//画标题矩形
  16306. Rectangle rec7_1 = new Rectangle(rec7.X + LeftAdd * 2, rec7.Y + TopAdd * 3 + 3, Column1, RowContentHeight);
  16307. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("酒店信息"), ft9, b, rec7_1);//画第一列的列标题
  16308. Point p71_1 = new Point(rec7.X + rec7_1.Width, rec7.Y);
  16309. Point p71_2 = new Point(rec7.X + rec7_1.Width, rec7.Y + rec7.Height);
  16310. g.DrawLine(p, p71_1, p71_2);//画第一表与第二列的界线
  16311. int recA2_2Width = rec7.Width - Column1 - LeftAdd * 2;
  16312. int FtHeightA = Convert.ToInt32(g.MeasureString("酒店信息", ft9, recA2_2Width).Height);
  16313. int FtHeightB = Convert.ToInt32(g.MeasureString(tblOrder.Rows[0]["Ord_HotelInfo"].ToString().Trim(), ft9, recA2_2Width).Height);
  16314. int recA2_2Y = rec7_1.Y;
  16315. int recA2Height = rec7.Height - TopAdd * 2;
  16316. int recA2_2Count = FtHeightB / FtHeightA;
  16317. if ((FtHeightB % FtHeightA) > 0)
  16318. {
  16319. recA2_2Count++;
  16320. }
  16321. if (recA2_2Count == 2)
  16322. {
  16323. recA2_2Y = rec7.Y + RowHeight - FtHeightA + TopAdd;
  16324. }
  16325. else if (recA2_2Count >= 3)
  16326. {
  16327. recA2_2Y = p71_1.Y + 2;
  16328. recA2Height = rec7.Height - TopAdd;
  16329. }
  16330. Rectangle rec7_2 = new Rectangle(p71_1.X + LeftAdd, recA2_2Y, recA2_2Width, recA2Height);
  16331. g.DrawString(tblOrder.Rows[0]["Ord_HotelInfo"].ToString().Trim(), ft9, b, rec7_2);//画第六列的列标题
  16332. #endregion
  16333. #region 顾客签字
  16334. Rectangle rec8A = new Rectangle(p6A1_1.X, rec7.Y, TableWidth - (p6A1_1.X - LeftWidth), rec7.Height);
  16335. g.DrawRectangle(p, rec8A);//画标题矩形
  16336. Rectangle rec8A_1 = new Rectangle(rec7.X + rec7.Width + LeftAdd * 2, rec7_1.Y, Column1, RowContentHeight);
  16337. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("顾客签字"), ft9, b, rec8A_1);//画第一列的列标题
  16338. Point p8A1_1 = new Point(rec8A.X + Column1, rec8A.Y);
  16339. Point p8A1_2 = new Point(rec8A.X + Column1, rec8A.Y + rec8A.Height);
  16340. g.DrawLine(p, p8A1_1, p8A1_2);//画第一表与第二列的界线
  16341. Rectangle rec8A_2 = new Rectangle(p8A1_1.X + LeftAdd, p8A1_1.Y + TopAdd, Column2, RowContentHeight);
  16342. //g.DrawString( "", ft9, b, rec8A_2 );//画第六列的列标题
  16343. if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintOrderShowPayment)
  16344. {
  16345. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("收款"), ft9, b, rec7.X + LeftAdd * 3 + 5, p8A1_2.Y + TopAdd + 2);//画第一列的列标题
  16346. g.DrawLine(p, rec7.X, p8A1_1.Y, rec7.X, p8A1_2.Y + rec8A_2.Height + 5);//画第六列的列标题
  16347. g.DrawLine(p, rec7.X + Column1, p8A1_1.Y, rec7.X + Column1, p8A1_2.Y + rec8A_2.Height + 5);//画第六列的列标题
  16348. g.DrawLine(p, rec7.X + TableWidth, p8A1_1.Y, rec7.X + TableWidth, p8A1_2.Y + rec8A_2.Height + 5);//画第六列的列标题
  16349. g.DrawLine(p, rec7.X, p8A1_2.Y + rec8A_2.Height + 5, rec7.X + TableWidth, p8A1_2.Y + rec8A_2.Height + 5);//画第六列的列标题
  16350. rec8A_2.Height += 10;
  16351. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion(strPaymentMsg), ft9, b, rec7.X + LeftAdd * 22, p8A1_2.Y + TopAdd + 2);//画第一列的列标题
  16352. }
  16353. else
  16354. {
  16355. rec8A_2.Height = 0;
  16356. }
  16357. #endregion
  16358. #region 尾行
  16359. rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("电话:") + tbl.Rows[0]["Company_Telephone"].ToString().Trim();
  16360. sizef = g.MeasureString(rec2Value, ft9);
  16361. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  16362. FtHeight = Convert.ToInt32(sizef.Height);
  16363. Rectangle rec9_1 = new Rectangle(TableWidth + LeftWidth - FtWidth, rec7.Y + rec7.Height + TopAdd + rec8A_2.Height, FtWidth, FtHeight);
  16364. g.DrawString(rec2Value, ft9, b, rec9_1);//画第一列的列标题
  16365. rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("地址:") + tbl.Rows[0]["Company_Address"].ToString().Trim();
  16366. sizef = g.MeasureString(rec2Value, ft9);
  16367. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  16368. FtHeight = Convert.ToInt32(sizef.Height);
  16369. Rectangle rec9 = new Rectangle(rec7.X, rec9_1.Y, TableWidth - rec9_1.Width - LeftWidth, FtHeight);
  16370. g.DrawString(rec2Value, ft9, b, rec9);//画第一列的列标题
  16371. #endregion
  16372. //bitmapList.Add(bitmap);
  16373. }
  16374. #endregion
  16375. #region 服务
  16376. /// <summary>
  16377. /// 订单报表服务版()
  16378. /// </summary>
  16379. /// <returns></returns>
  16380. private static void Service_OrderReport_Print(DataSet dtSet, Graphics g1, Size size
  16381. , ref List<List<string>> pListData, int iPage)
  16382. {
  16383. int LeftWidth = 30;
  16384. Brush b = Brushes.Black;
  16385. Pen p = GetPen;
  16386. int TableWidth = size.Width - LeftWidth * 2;
  16387. DataTable tbl = dtSet.Tables["ds"];//获取影楼信息
  16388. DataTable tblOrder = dtSet.Tables["ds1"];//订单
  16389. DataTable tblDigital = dtSet.Tables["ds2"];//数码
  16390. DataTable tblSights = dtSet.Tables["ds3"];//景点
  16391. DataTable tblPickupTime = dtSet.Tables["ds4"];//取件时间
  16392. DataTable tblProductList = dtSet.Tables["ds5"];//取件时间
  16393. DataTable tblClient = dtSet.Tables["ds6"];//客户资料
  16394. DataTable tblService = dtSet.Tables["ds7"];//客户资料
  16395. DataTable tblStyle = dtSet.Tables["ds8"];//喜爱风格
  16396. DataTable tblPayment = dtSet.Tables["ds9"];//订单定金
  16397. DataTable tblUser = dtSet.Tables["ds11"];//订单定金
  16398. string OrdPrice = "0.00";
  16399. if (tblPayment.Rows.Count > 0)
  16400. {
  16401. OrdPrice = tblPayment.Rows[0]["Pay_AmountOf"].ToString().Trim();
  16402. }
  16403. tblStyle.PrimaryKey = new DataColumn[] { tblStyle.Columns["ID"] };
  16404. if (tbl.Rows.Count <= 0)
  16405. {
  16406. MessageBoxCustom.Show("未设置影楼信息"); return;
  16407. }
  16408. ///付款方式集合
  16409. string strPaymentMsg = "";
  16410. foreach (DataRow dr in tblPayment.Rows)
  16411. {
  16412. if (!string.IsNullOrEmpty(strPaymentMsg))
  16413. {
  16414. strPaymentMsg += " ";
  16415. }
  16416. strPaymentMsg += dr["Sc_ClassName"] + ":" + dr["Pay_AmountOf"];
  16417. }
  16418. if (pListData.Count == 0)
  16419. {
  16420. pListData = GetProductOrServiceListData(g1, TableWidth, tblProductList, tblService, tblSights, "服务预约单内容详情字体大小", false,630);
  16421. }
  16422. #region 获取数据
  16423. string MName = "";
  16424. string MTelephone = "";
  16425. string MIDNumber = "";
  16426. string MMicroSignal = "";
  16427. string MQQ = "";
  16428. string MAddress = "";
  16429. if (tblClient.Rows.Count > 0)
  16430. {
  16431. for (int i = 0; i < tblClient.Rows.Count; i++)
  16432. {
  16433. if (tblClient.Rows[i]["GM_Master"].ToString().Trim() == "1")
  16434. {
  16435. MName = tblClient.Rows[i]["Cus_Name"].ToString().Trim();
  16436. MTelephone = tblClient.Rows[i]["Cus_Telephone"].ToString().Trim();
  16437. MIDNumber = tblClient.Rows[i]["Cus_IDNumber"].ToString().Trim();
  16438. MMicroSignal = tblClient.Rows[i]["Cus_MicroSignal"].ToString().Trim();
  16439. MQQ = tblClient.Rows[i]["Cus_QQ"].ToString().Trim();
  16440. MAddress = tblClient.Rows[i]["Cus_Address"].ToString().Trim();
  16441. }
  16442. }
  16443. }
  16444. #endregion
  16445. Font ft17 = new Font("宋体", 17);
  16446. Font ft12 = new Font("宋体", 12);
  16447. Font ft9 = new Font("宋体", 9);
  16448. List<string> data = pListData[iPage];
  16449. //Bitmap bitmap = new Bitmap(827, 1150);
  16450. Graphics g = g1;//Graphics.FromImage(bitmap);
  16451. #region LOG抬头
  16452. int Rec1Height = 0;
  16453. Rectangle rec1;
  16454. Image imgLog = CachePhoto(PhotoLogType.Portrait, tbl.Rows[0]["Company_UpdateDatetime"], GetReservationSingleLOG("预约服务单LOG"));
  16455. if (imgLog != null)
  16456. {
  16457. rec1 = new Rectangle(LeftWidth, 50, TableWidth, 120);
  16458. Rectangle srcRec1 = new Rectangle(0, 0, imgLog.Width, imgLog.Height);
  16459. g.DrawImage(imgLog, rec1, srcRec1, GraphicsUnit.Pixel);
  16460. }
  16461. else
  16462. {
  16463. string StrTitle = GetReservationSingleTitle("预约服务单标题");
  16464. SizeF srcsizef = g.MeasureString(StrTitle, ft17);
  16465. int srcFtWidth = Convert.ToInt32(srcsizef.Width);
  16466. int srcFtHeight = Convert.ToInt32(srcsizef.Height);
  16467. rec1 = new Rectangle(size.Width / 2 - srcFtWidth / 2, 50, srcFtWidth + 5, srcFtHeight);
  16468. g.DrawString(StrTitle, ft17, b, rec1);
  16469. Rec1Height = 120 - rec1.Height;
  16470. }
  16471. #endregion
  16472. int LeftAdd = 3;
  16473. int TopAdd = 6;
  16474. int RowHeight = 25;
  16475. int RowContentHeight = 18;
  16476. int Unit = TableWidth / 25;
  16477. int ColumnWidth1 = Unit * 3 - Unit / 2 + 15;
  16478. int ColumnWidth2 = Unit * 5;
  16479. int ColumnWidth3 = Unit * 3;
  16480. int ColumnWidth4 = Unit * 5;
  16481. int ColumnWidth5 = Unit * 3 - Unit / 2 + 15;
  16482. int ColumnWidth6 = TableWidth - ColumnWidth1 - ColumnWidth2 - ColumnWidth3 - ColumnWidth4 - ColumnWidth5;
  16483. #region 始行
  16484. Rectangle rec2 = new Rectangle(LeftWidth, rec1.Y + rec1.Height + 10, 1000, RowContentHeight);
  16485. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("开单日期:") + LYFZ.Command.Command_Validate.DateTimeToString(tblOrder.Rows[0]["Ord_CreateDatetime"]), ft12, b, rec2);
  16486. string strShowNumber = tblOrder.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() != "" ? tblOrder.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() : tblOrder.Rows[0]["Ord_Number"].ToString().Trim();
  16487. string StrValue = "NO." + StrRandom(strShowNumber);
  16488. SizeF sizef = g.MeasureString(StrValue, ft12);
  16489. int FtWidth = Convert.ToInt32(sizef.Width) + 1;
  16490. int FtHeight = Convert.ToInt32(sizef.Height);
  16491. Rectangle rec2_1 = new Rectangle(TableWidth + LeftWidth + LeftAdd - FtWidth, rec2.Y, FtWidth, RowContentHeight);
  16492. g.DrawString(StrValue, ft12, b, rec2_1);
  16493. #endregion
  16494. #region 左排
  16495. #region 第一行
  16496. Rectangle rec3 = new Rectangle(rec2.X, rec2.Y + rec2.Height, ColumnWidth1 + ColumnWidth2 + ColumnWidth3 + ColumnWidth4, RowHeight);
  16497. g.DrawRectangle(p, rec3);//画标题矩形
  16498. Rectangle rec3_1 = new Rectangle(rec3.X + LeftAdd, rec3.Y + TopAdd, ColumnWidth1, RowContentHeight);
  16499. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("客户姓名"), ft12, b, rec3_1);//画第一列的列标题
  16500. Point p31_1 = new Point(rec3.X + ColumnWidth1, rec3.Y);
  16501. Point p31_2 = new Point(rec3.X + ColumnWidth1, rec3.Y + rec3.Height);
  16502. g.DrawLine(p, p31_1, p31_2);//画第一表与第二列的界线
  16503. Rectangle rec3_2 = new Rectangle(p31_1.X + LeftAdd, p31_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
  16504. g.DrawString(MName, ft12, b, rec3_2);//画第二列的列标题
  16505. Point p32_1 = new Point(p31_1.X + ColumnWidth2, rec3.Y);
  16506. Point p32_2 = new Point(p31_1.X + ColumnWidth2, rec3.Y + rec3.Height);
  16507. g.DrawLine(p, p32_1, p32_2);//画第二表与第三列的界线
  16508. Rectangle rec3_3 = new Rectangle(p32_1.X + LeftAdd, p32_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
  16509. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("入底"), ft12, b, rec3_3);//画第三列的列标题
  16510. Point p33_1 = new Point(p32_1.X + ColumnWidth3, rec3.Y);
  16511. Point p33_2 = new Point(p32_1.X + ColumnWidth3, rec3.Y + rec3.Height);
  16512. g.DrawLine(p, p33_1, p33_2);//画第三表与第四列的界线
  16513. string StrIntoBottom = tblOrder.Rows[0]["Ord_IntoBottom"].ToString().Trim();
  16514. if (StrIntoBottom == "0")
  16515. {
  16516. StrIntoBottom = LYFZ.BLL.OtherCommonModel.FontConversion("不送");
  16517. }
  16518. else if (StrIntoBottom == "-1")
  16519. {
  16520. StrIntoBottom = LYFZ.BLL.OtherCommonModel.FontConversion("全送");
  16521. }
  16522. Rectangle rec3_4 = new Rectangle(p33_1.X + LeftAdd, p33_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
  16523. g.DrawString(StrIntoBottom, ft12, b, rec3_4);//画第四列的列标题
  16524. Point p34_1 = new Point(p33_1.X + ColumnWidth4, rec3.Y);
  16525. Point p34_2 = new Point(p33_1.X + ColumnWidth4, rec3.Y + rec3.Height);
  16526. g.DrawLine(p, p34_1, p34_2);//画第四表与第五列的界线
  16527. #endregion
  16528. #region 第二行
  16529. Rectangle rec4 = new Rectangle(rec3.X, rec3.Y + rec3.Height, rec3.Width, RowHeight);
  16530. g.DrawRectangle(p, rec4);//画标题矩形
  16531. Rectangle rec4_1 = new Rectangle(rec4.X + LeftAdd, rec4.Y + TopAdd, ColumnWidth1, RowContentHeight);
  16532. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("联系电话"), ft12, b, rec4_1);//画第一列的列标题
  16533. Point p41_1 = new Point(rec4.X + ColumnWidth1, rec4.Y);
  16534. Point p41_2 = new Point(rec4.X + ColumnWidth1, rec4.Y + rec4.Height);
  16535. g.DrawLine(p, p41_1, p41_2);//画第一表与第二列的界线
  16536. Rectangle rec4_2 = new Rectangle(p41_1.X + LeftAdd, p41_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
  16537. g.DrawString(MTelephone, ft12, b, rec4_2);//画第二列的列标题
  16538. Point p42_1 = new Point(p41_1.X + ColumnWidth2, rec4.Y);
  16539. Point p42_2 = new Point(p41_1.X + ColumnWidth2, rec4.Y + rec4.Height);
  16540. g.DrawLine(p, p42_1, p42_2);//画第二表与第三列的界线
  16541. Rectangle rec4_3 = new Rectangle(p42_1.X + LeftAdd, p42_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
  16542. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("入册"), ft12, b, rec4_3);//画第三列的列标题
  16543. Point p43_1 = new Point(p42_1.X + ColumnWidth3, rec4.Y);
  16544. Point p43_2 = new Point(p42_1.X + ColumnWidth3, rec4.Y + rec4.Height);
  16545. g.DrawLine(p, p43_1, p43_2);//画第三表与第四列的界线
  16546. Rectangle rec4_4 = new Rectangle(p43_1.X + LeftAdd, p43_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
  16547. g.DrawString(tblOrder.Rows[0]["Ord_IntoRegister"].ToString().Trim(), ft12, b, rec4_4);//画第四列的列标题
  16548. Point p44_1 = new Point(p43_1.X + ColumnWidth4, rec4.Y);
  16549. Point p44_2 = new Point(p43_1.X + ColumnWidth4, rec4.Y + rec4.Height);
  16550. g.DrawLine(p, p44_1, p44_2);//画第四表与第五列的界线
  16551. #endregion
  16552. #region 第三行
  16553. Rectangle rec5 = new Rectangle(rec4.X, rec4.Y + rec4.Height, rec3.Width, RowHeight);
  16554. g.DrawRectangle(p, rec5);//画标题矩形
  16555. Rectangle rec5_1 = new Rectangle(rec5.X + LeftAdd, rec5.Y + TopAdd, ColumnWidth1, RowContentHeight);
  16556. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("微信"), ft12, b, rec5_1);//画第一列的列标题
  16557. Point p51_1 = new Point(rec5.X + ColumnWidth1, rec5.Y);
  16558. Point p51_2 = new Point(rec5.X + ColumnWidth1, rec5.Y + rec5.Height);
  16559. g.DrawLine(p, p51_1, p51_2);//画第一表与第二列的界线
  16560. Rectangle rec5_2 = new Rectangle(p51_1.X + LeftAdd, p51_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
  16561. g.DrawString(MMicroSignal, ft12, b, rec5_2);//画第二列的列标题
  16562. Point p52_1 = new Point(p51_1.X + ColumnWidth2, rec5.Y);
  16563. Point p52_2 = new Point(p51_1.X + ColumnWidth2, rec5.Y + rec5.Height);
  16564. g.DrawLine(p, p52_1, p52_2);//画第二表与第三列的界线
  16565. Rectangle rec5_3 = new Rectangle(p52_1.X + LeftAdd, p52_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
  16566. g.DrawString("QQ", ft12, b, rec5_3);//画第三列的列标题
  16567. Point p53_1 = new Point(p52_1.X + ColumnWidth3, rec5.Y);
  16568. Point p53_2 = new Point(p52_1.X + ColumnWidth3, rec5.Y + rec5.Height);
  16569. g.DrawLine(p, p53_1, p53_2);//画第三表与第四列的界线
  16570. Rectangle rec5_4 = new Rectangle(p53_1.X + LeftAdd, p53_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
  16571. g.DrawString(MQQ, ft12, b, rec5_4);//画第四列的列标题
  16572. Point p54_1 = new Point(p53_1.X + ColumnWidth4, rec5.Y);
  16573. Point p54_2 = new Point(p53_1.X + ColumnWidth4, rec5.Y + rec5.Height);
  16574. g.DrawLine(p, p54_1, p54_2);//画第四表与第五列的界线
  16575. #endregion
  16576. #region 第四、五行
  16577. int rec7_Y = rec5.Y + rec5.Height;
  16578. int rec9Height = 0;
  16579. if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.EnabledIDNumber)
  16580. {
  16581. Rectangle rec6A = new Rectangle(rec5.X, rec5.Y + rec5.Height, rec3.Width, RowHeight);
  16582. g.DrawRectangle(p, rec6A);//画标题矩形
  16583. Rectangle rec6A_1 = new Rectangle(rec6A.X + LeftAdd, rec6A.Y + TopAdd, ColumnWidth1, RowContentHeight);
  16584. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("身份证号"), ft12, b, rec6A_1);//画第一列的列标题
  16585. Point p6A1_1 = new Point(rec6A.X + ColumnWidth1, rec6A.Y);
  16586. Point p6A1_2 = new Point(rec6A.X + ColumnWidth1, rec6A.Y + rec6A.Height);
  16587. g.DrawLine(p, p6A1_1, p6A1_2);//画第一表与第二列的界线
  16588. Rectangle rec6A_2 = new Rectangle(p6A1_1.X + LeftAdd, p6A1_1.Y + TopAdd, rec3.Width - ColumnWidth1, RowContentHeight);
  16589. g.DrawString(MIDNumber, ft12, b, rec6A_2);//画第二列的列标题
  16590. rec7_Y = rec6A.Y + rec6A.Height;
  16591. rec9Height = RowHeight;
  16592. }
  16593. #endregion
  16594. #region 第五行
  16595. Rectangle rec7 = new Rectangle(rec5.X, rec7_Y, rec3.Width, RowHeight);
  16596. g.DrawRectangle(p, rec7);//画标题矩形
  16597. Rectangle rec7_1 = new Rectangle(rec7.X + LeftAdd, rec7.Y + TopAdd, ColumnWidth1, RowContentHeight);
  16598. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("地址"), ft12, b, rec7_1);//画第一列的列标题
  16599. Point p71_1 = new Point(rec7.X + ColumnWidth1, rec7.Y);
  16600. Point p71_2 = new Point(rec7.X + ColumnWidth1, rec7.Y + rec7.Height);
  16601. g.DrawLine(p, p71_1, p71_2);//画第一表与第二列的界线
  16602. Rectangle rec7_2 = new Rectangle(p71_1.X + LeftAdd, p71_1.Y + TopAdd, ColumnWidth2 + ColumnWidth3 + ColumnWidth4, RowContentHeight);
  16603. g.DrawString(MAddress, ft12, b, rec7_2);//画第二列的列标题
  16604. Point p72_1 = new Point(p71_1.X + rec7_2.Width, rec7.Y);
  16605. Point p72_2 = new Point(p71_1.X + rec7_2.Width, rec7.Y + rec7.Height);
  16606. g.DrawLine(p, p72_1, p72_2);//画第二表与第三列的界线
  16607. #endregion
  16608. #region 第一列
  16609. #region 第一行
  16610. Rectangle rec9 = new Rectangle(rec7.X, rec7.Y + rec7.Height, rec3.Width, 635 + Rec1Height - rec9Height);
  16611. g.DrawRectangle(p, rec9);//画标题矩形
  16612. string StrProdName = LYFZ.BLL.OtherCommonModel.FontConversion("服务内容:");
  16613. //for (int i = 0; i < tblProductList.Rows.Count; i++)
  16614. //{
  16615. // StrProdName += "\r\n" + tblProductList.Rows[i]["ProdName"].ToString().Trim();
  16616. //}
  16617. //for (int i = 0; i < tblService.Rows.Count; i++)
  16618. //{
  16619. // StrProdName += "\r\n" + tblService.Rows[i]["ProdName"].ToString().Trim();
  16620. //}
  16621. Rectangle rec9_1 = new Rectangle(rec9.X + LeftAdd, rec9.Y + TopAdd, rec9.Width, rec9.Height - TopAdd * 2);
  16622. //g.DrawString(StrProdName, GetFontSize("服务预约单内容详情字体大小"), b, rec9_1);//画第一列的列标题
  16623. foreach (string str in data)
  16624. {
  16625. //PrintContentData(" " + str, g, rec9, LeftAdd, TopAdd, b, "服务预约单内容详情字体大小", ref _infoHeight);
  16626. StrProdName += "\r\n " + str;
  16627. }
  16628. g.DrawString(StrProdName, GetFontSize("服务预约单内容详情字体大小"), b, rec9_1);//画第一列的列标题
  16629. #endregion
  16630. #region 第二行
  16631. Rectangle recA1 = new Rectangle(rec9.X, rec9.Y + rec9.Height, rec3.Width, 100);
  16632. g.DrawRectangle(p, recA1);//画标题矩形
  16633. Rectangle recA1_1 = new Rectangle(recA1.X + LeftAdd, recA1.Y + TopAdd, recA1.Width, recA1.Height - TopAdd * 2);
  16634. string disInfo = LYFZ.BLL.OtherCommonModel.FontConversion("订单备注:") + tblOrder.Rows[0]["Ord_Remark"].ToString().Trim();
  16635. if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintOrderShowPayment)
  16636. {
  16637. disInfo += "\r\n付款:" + strPaymentMsg;
  16638. }
  16639. g.DrawString(disInfo, ft12, b, recA1_1);//画第一列的列标题
  16640. #endregion
  16641. #endregion
  16642. #endregion
  16643. #region 右排
  16644. #region 第一行
  16645. Rectangle Rrec3 = new Rectangle(rec3.X + rec3.Width, rec3.Y, ColumnWidth5 + ColumnWidth6, RowHeight);
  16646. g.DrawRectangle(p, Rrec3);//画标题矩形
  16647. Rectangle Rrec3_5 = new Rectangle(Rrec3.X + LeftAdd, Rrec3.Y + TopAdd, ColumnWidth5, RowContentHeight);
  16648. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("套系名称"), ft12, b, Rrec3_5);//画第五列的列标题
  16649. Point Rp35_1 = new Point(Rrec3.X + ColumnWidth5, Rrec3.Y);
  16650. Point Rp35_2 = new Point(Rrec3.X + ColumnWidth5, Rrec3.Y + Rrec3.Height);
  16651. g.DrawLine(p, Rp35_1, Rp35_2);//画第五表与第六列的界线
  16652. Rectangle Rrec3_6 = new Rectangle(Rp35_1.X + LeftAdd, Rrec3_5.Y, ColumnWidth6, RowContentHeight);
  16653. g.DrawString(tblOrder.Rows[0]["Ord_SeriesName"].ToString().Trim(), ft12, b, Rrec3_6);//画第六列的列标题
  16654. #endregion
  16655. #region 第二行
  16656. Rectangle Rrec4 = new Rectangle(Rrec3.X, Rrec3.Y + Rrec3.Height, Rrec3.Width, RowHeight);
  16657. g.DrawRectangle(p, Rrec4);//画标题矩形
  16658. Rectangle Rrec4_5 = new Rectangle(Rrec4.X + LeftAdd, Rrec4.Y + TopAdd, ColumnWidth5, RowContentHeight);
  16659. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("套系金额"), ft12, b, Rrec4_5);//画第五列的列标题
  16660. Point Rp45_1 = new Point(Rp35_1.X, Rrec4.Y);
  16661. Point Rp45_2 = new Point(Rp35_1.X, Rrec4.Y + Rrec4.Height);
  16662. g.DrawLine(p, Rp45_1, Rp45_2);//画第五表与第六列的界线
  16663. Rectangle Rrec4_6 = new Rectangle(Rp45_1.X + LeftAdd, Rrec4_5.Y, ColumnWidth6, RowContentHeight);
  16664. g.DrawString(tblOrder.Rows[0]["Ord_SeriesPrice"].ToString().Trim(), ft12, b, Rrec4_6);//画第六列的列标题
  16665. #endregion
  16666. #region 第三行
  16667. Rectangle Rrec5 = new Rectangle(Rrec4.X, Rrec4.Y + Rrec4.Height, Rrec3.Width, RowHeight);
  16668. g.DrawRectangle(p, Rrec5);//画标题矩形
  16669. Rectangle Rrec5_5 = new Rectangle(Rrec5.X + LeftAdd, Rrec5.Y + TopAdd, ColumnWidth5, RowContentHeight);
  16670. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("预约定金"), ft12, b, Rrec5_5);//画第五列的列标题
  16671. Point Rp55_1 = new Point(Rp45_1.X, Rrec5.Y);
  16672. Point Rp55_2 = new Point(Rp45_1.X, Rrec5.Y + Rrec5.Height);
  16673. g.DrawLine(p, Rp55_1, Rp55_2);//画第五表与第六列的界线
  16674. Rectangle Rrec5_6 = new Rectangle(Rp55_1.X + LeftAdd, Rrec5_5.Y, ColumnWidth6, RowContentHeight);
  16675. g.DrawString(OrdPrice, ft12, b, Rrec5_6);//画第六列的列标题
  16676. #endregion
  16677. #region 第四行
  16678. Rectangle Rrec6 = new Rectangle(Rrec5.X, Rrec5.Y + Rrec5.Height, Rrec3.Width, RowHeight);
  16679. g.DrawRectangle(p, Rrec6);//画标题矩形
  16680. Rectangle Rrec6_5 = new Rectangle(Rrec6.X + LeftAdd, Rrec6.Y + TopAdd, ColumnWidth5, RowContentHeight);
  16681. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("余款金额"), ft12, b, Rrec6_5);//画第五列的列标题
  16682. Point Rp65_1 = new Point(Rp55_1.X, Rrec6.Y);
  16683. Point Rp65_2 = new Point(Rp55_1.X, Rrec6.Y + Rrec6.Height);
  16684. g.DrawLine(p, Rp65_1, Rp65_2);//画第五表与第六列的界线
  16685. Rectangle Rrec6_6 = new Rectangle(Rp65_1.X + LeftAdd, Rrec6_5.Y, ColumnWidth6, RowContentHeight);
  16686. g.DrawString(tblOrder.Rows[0]["Ord_OrderArrears"].ToString().Trim(), ft12, b, Rrec6_6);//画第六列的列标题
  16687. #endregion
  16688. #region 第六行
  16689. Rectangle Rrec8 = new Rectangle(Rrec6.X, Rrec6.Y + Rrec6.Height, Rrec3.Width, RowHeight);
  16690. g.DrawRectangle(p, Rrec8);//画标题矩形
  16691. Rectangle Rrec8_5 = new Rectangle(Rrec8.X + LeftAdd, Rrec8.Y + TopAdd, ColumnWidth5, RowContentHeight);
  16692. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("门市"), ft12, b, Rrec8_5);//画第五列的列标题
  16693. Point Rp85_1 = new Point(Rp65_1.X, Rrec8.Y);
  16694. Point Rp85_2 = new Point(Rp65_1.X, Rrec8.Y + Rrec8.Height);
  16695. g.DrawLine(p, Rp85_1, Rp85_2);//画第五表与第六列的界线
  16696. Rectangle rec8_6 = new Rectangle(Rp85_1.X, Rrec8_5.Y, ColumnWidth6, RowContentHeight);
  16697. string strOrderPerson = "";
  16698. if (tblUser.Rows.Count > 0)
  16699. {
  16700. if (Convert.ToBoolean(tblUser.Rows[0]["User_PhonePrint"]) == true)
  16701. strOrderPerson = tblUser.Rows[0]["User_Name"].ToString() + " " + tblUser.Rows[0]["User_Telephone"].ToString();
  16702. else
  16703. strOrderPerson = tblUser.Rows[0]["User_Name"].ToString() + " " + tbl.Rows[0]["Company_Telephone"].ToString();
  16704. }
  16705. g.DrawString(strOrderPerson, ft12, b, rec8_6);//画第六列的列标题
  16706. #endregion
  16707. #region 第一列
  16708. Rectangle Rrec10 = new Rectangle(Rrec8.X, Rrec8.Y + Rrec8.Height, Rrec3.Width, recA1.Y + recA1.Height - Rrec8.Y - RowHeight * 3);
  16709. g.DrawRectangle(p, Rrec10);//画标题矩形
  16710. StrValue = "";
  16711. if (PrintOtherData.ContainsKey("服务预约单注意事项说明") && PrintOtherData["服务预约单注意事项说明"].ToString().Trim().Length > 0)
  16712. {
  16713. StrValue = PrintOtherData["服务预约单注意事项说明"].ToString().Trim();
  16714. }
  16715. Rectangle rec10_1 = new Rectangle(Rrec10.X + LeftAdd, Rrec10.Y + TopAdd, Rrec10.Width - LeftAdd * 2, Rrec10.Height - TopAdd * 2);
  16716. Font scaleFont = PrinterDrawMethod.ComputeAutoScaleFont(g, LYFZ.BLL.OtherCommonModel.FontConversion("注意事项:\r\n") + StrValue, rec10_1, GetFontSize("服务预约单注意事项字体大小"), minFontSize: 6);
  16717. PrinterDrawMethod.DrawCellTextAutroWrap(g, LYFZ.BLL.OtherCommonModel.FontConversion("注意事项:\r\n") + StrValue, rec10_1, scaleFont, autoWrap: true, nWrapLineSpace: 1, showFrame: false);
  16718. #endregion
  16719. #region 顾客签字
  16720. Rectangle RrecA5 = new Rectangle(Rrec10.X, Rrec10.Y + Rrec10.Height, Rrec3.Width, RowHeight * 2);
  16721. g.DrawRectangle(p, RrecA5);//画标题矩形
  16722. Rectangle RrecA5_1 = new Rectangle(RrecA5.X + LeftAdd, RrecA5.Y + RowContentHeight, ColumnWidth5, RowContentHeight);
  16723. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("顾客签字"), ft12, b, RrecA5_1);//画第五列的列标题
  16724. Point RpA51_1 = new Point(Rp65_1.X, RrecA5.Y);
  16725. Point RpA51_2 = new Point(Rp65_1.X, RrecA5.Y + RrecA5.Height);
  16726. g.DrawLine(p, RpA51_1, RpA51_2);//画第四表与第五列的界线
  16727. #endregion
  16728. #endregion
  16729. #region 尾行
  16730. string rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("网址:") + tbl.Rows[0]["Company_URL"].ToString().Trim();
  16731. sizef = g.MeasureString(rec2Value, ft9);
  16732. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  16733. FtHeight = Convert.ToInt32(sizef.Height);
  16734. Rectangle recA6_1 = new Rectangle(TableWidth + LeftWidth - FtWidth, recA1.Y + recA1.Height + TopAdd, FtWidth, FtHeight);
  16735. g.DrawString(rec2Value, ft9, b, recA6_1);//画第一列的列标题
  16736. Rectangle recA6 = new Rectangle(recA1.X, recA6_1.Y, TableWidth - recA6_1.Width - 50, FtHeight);
  16737. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("地址:") + tbl.Rows[0]["Company_Address"].ToString().Trim(), ft9, b, recA6);//画第一列的列标题
  16738. Rectangle recA7 = new Rectangle(recA6.X, recA6.Y + recA6.Height, recA6.Width, FtHeight);
  16739. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("电话:") + tbl.Rows[0]["Company_Telephone"].ToString().Trim(), ft9, b, recA7);//画第一列的列标题
  16740. rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("页:") + "" + (iPage + 1) + "/" + pListData.Count;
  16741. sizef = g.MeasureString(rec2Value, ft9);
  16742. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  16743. FtHeight = Convert.ToInt32(sizef.Height);
  16744. Rectangle recA8 = new Rectangle(TableWidth + LeftWidth - FtWidth, recA7.Y + recA7.Height - TopAdd, FtWidth, FtHeight);
  16745. g.DrawString(rec2Value, ft9, b, recA8);//画第一列的列标题
  16746. #endregion
  16747. //bitmapList.Add(bitmap);
  16748. }
  16749. /// <summary>
  16750. /// 服务二等份打印
  16751. /// </summary>
  16752. /// <param name="objValue"></param>
  16753. private static void Service_OrderReport_TwoEqualPrint(DataSet dtSet, Graphics g1, Size size
  16754. , ref List<List<string>> pListData, int iPage)
  16755. {
  16756. DataTable tbl = dtSet.Tables["ds"];//获取影楼信息
  16757. DataTable tblOrder = dtSet.Tables["ds1"];//订单
  16758. DataTable tblDigital = dtSet.Tables["ds2"];//数码
  16759. DataTable tblSights = dtSet.Tables["ds3"];//景点
  16760. DataTable tblPickupTime = dtSet.Tables["ds4"];//取件时间
  16761. DataTable tblProductList = dtSet.Tables["ds5"];//取件时间
  16762. DataTable tblClient = dtSet.Tables["ds6"];//客户资料
  16763. DataTable tblService = dtSet.Tables["ds7"];//客户资料
  16764. DataTable tblStyle = dtSet.Tables["ds8"];//喜爱风格
  16765. DataTable tblPayment = dtSet.Tables["ds9"];//订单定金
  16766. DataTable tblUser = dtSet.Tables["ds11"];//订单定金
  16767. string OrdPrice = "0.00";
  16768. if (tblPayment.Rows.Count > 0)
  16769. {
  16770. OrdPrice = tblPayment.Rows[0]["Pay_AmountOf"].ToString().Trim();
  16771. }
  16772. tblStyle.PrimaryKey = new DataColumn[] { tblStyle.Columns["ID"] };
  16773. ///付款方式集合
  16774. string strPaymentMsg = "";
  16775. foreach (DataRow dr in tblPayment.Rows)
  16776. {
  16777. if (!string.IsNullOrEmpty(strPaymentMsg))
  16778. {
  16779. strPaymentMsg += " ";
  16780. }
  16781. strPaymentMsg += dr["Sc_ClassName"] + ":" + dr["Pay_AmountOf"];
  16782. }
  16783. Brush b = Brushes.Black;
  16784. Pen p = GetPen;
  16785. Font ft17 = new Font("宋体", 17);
  16786. Font ft13 = new Font("宋体", 13);
  16787. Font ft10 = new Font("宋体", 10);
  16788. Font ft9 = new Font("宋体", 9);
  16789. #region 获取数据
  16790. string MName = "";
  16791. string MTelephone = "";
  16792. string MIDNumber = "";
  16793. string MMicroSignal = "";
  16794. string MQQ = "";
  16795. string MAddress = "";
  16796. if (tblClient.Rows.Count > 0)
  16797. {
  16798. for (int i = 0; i < tblClient.Rows.Count; i++)
  16799. {
  16800. if (tblClient.Rows[i]["GM_Master"].ToString().Trim() == "1")
  16801. {
  16802. MName = tblClient.Rows[i]["Cus_Name"].ToString().Trim();
  16803. MTelephone = tblClient.Rows[i]["Cus_Telephone"].ToString().Trim();
  16804. MIDNumber = tblClient.Rows[i]["Cus_IDNumber"].ToString().Trim();
  16805. MMicroSignal = tblClient.Rows[i]["Cus_MicroSignal"].ToString().Trim();
  16806. MQQ = tblClient.Rows[i]["Cus_QQ"].ToString().Trim();
  16807. MAddress = tblClient.Rows[i]["Cus_Address"].ToString().Trim();
  16808. }
  16809. }
  16810. }
  16811. string StrProdName = "";
  16812. //for ( int i = 0; i < tblProductList.Rows.Count; i++ )
  16813. //{
  16814. // StrProdName += tblProductList.Rows[i]["ProdName"].ToString().Trim() + "\r\n";
  16815. //}
  16816. //for ( int i = 0; i < tblService.Rows.Count; i++ )
  16817. //{
  16818. // StrProdName += tblService.Rows[i]["ProdName"].ToString().Trim() + "\r\n";
  16819. //}
  16820. //StrProdName += LYFZ.BLL.OtherCommonModel.FontConversion( "\r\n备注:" ) + tblOrder.Rows[0]["Ord_Remark"].ToString().Trim();
  16821. #endregion
  16822. int LeftWidth = 50;
  16823. int TableWidth = size.Width - LeftWidth * 2 + 30;
  16824. int LeftAdd = 3;
  16825. int TopAdd = 4;
  16826. int RowHeight = 20;
  16827. int RowContentHeight = 18;
  16828. int Unit = TableWidth / 30;
  16829. int ColumnWidth1 = 66;// Unit * 3;
  16830. int ColumnWidth2 = Unit * 6;
  16831. int ColumnWidth3 = Unit * 3;
  16832. int ColumnWidth4 = Unit * 6;
  16833. int ColumnWidth5 = 66;// Unit * 3;
  16834. int ColumnWidth6 = TableWidth - ColumnWidth1 - ColumnWidth2 - ColumnWidth3 - ColumnWidth4 - ColumnWidth5;
  16835. if (pListData.Count == 0)
  16836. {
  16837. pListData = GetProductOrServiceHelfListData(g1, TableWidth, tblProductList, tblService, tblSights,disInfo: LYFZ.BLL.OtherCommonModel.FontConversion("\r\n备注:") + tblOrder.Rows[0]["Ord_Remark"].ToString().Trim());
  16838. }
  16839. string StrValue = tblOrder.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() != "" ? tblOrder.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() : tblOrder.Rows[0]["Ord_Number"].ToString().Trim();
  16840. string rec3Value = "NO." + StrRandom(StrValue);
  16841. string striNumber = rec3Value;
  16842. List<string> data = pListData[iPage];
  16843. Bitmap bitmap = new Bitmap(827, 580);
  16844. Graphics g = g1;//Graphics.FromImage(bitmap);
  16845. StrProdName = "";
  16846. foreach (string str in data)
  16847. {
  16848. if (!string.IsNullOrEmpty(StrProdName))
  16849. {
  16850. StrProdName += "\r\n";
  16851. }
  16852. StrProdName += str;
  16853. }
  16854. #region 金色童年收据凭据
  16855. Rectangle rec1;
  16856. int Rec1Height = 0;
  16857. int TopHeightCount = 0;
  16858. Image imgLog = CachePhoto(PhotoLogType.Portrait, tbl.Rows[0]["Company_UpdateDatetime"], GetReservationSingleLOG("预约服务单LOG"));
  16859. if (imgLog != null)
  16860. {
  16861. rec1 = new Rectangle(LeftWidth, 50, TableWidth, 80);
  16862. Rectangle srcRec1 = new Rectangle(0, 0, imgLog.Width, imgLog.Height);
  16863. g.DrawImage(imgLog, rec1, srcRec1, GraphicsUnit.Pixel);
  16864. Rec1Height = rec1.Height - Convert.ToInt32(g.MeasureString("预约服务单标题", ft17).Height);
  16865. TopHeightCount = 3;
  16866. }
  16867. else
  16868. {
  16869. string StrTitle = GetReservationSingleTitle("预约服务单标题");
  16870. SizeF srcsizef = g.MeasureString(StrTitle, ft17);
  16871. int srcFtWidth = Convert.ToInt32(srcsizef.Width);
  16872. int srcFtHeight = Convert.ToInt32(srcsizef.Height);
  16873. rec1 = new Rectangle(size.Width / 2 - srcFtWidth / 2, 50, srcFtWidth + 5, srcFtHeight);
  16874. g.DrawString(StrTitle, ft17, b, rec1);
  16875. }
  16876. #endregion
  16877. #region 开单日期;
  16878. string strOrderCreatedData = LYFZ.BLL.OtherCommonModel.FontConversion("开单日期:") + LYFZ.Command.Command_Validate.DateTimeToString(tblOrder.Rows[0]["Ord_CreateDatetime"]);
  16879. SizeF sizef = g.MeasureString(strOrderCreatedData, ft10);
  16880. int FtWidth = Convert.ToInt32(sizef.Width) + 1;
  16881. int FtHeight = Convert.ToInt32(sizef.Height);
  16882. Rectangle rec1A = new Rectangle(LeftWidth, rec1.Y + rec1.Height + TopHeightCount, FtWidth, FtHeight);
  16883. g.DrawString(strOrderCreatedData, ft10, b, rec1A);
  16884. #endregion
  16885. #region NO.
  16886. sizef = g.MeasureString(striNumber, ft10);
  16887. rec1A = new Rectangle(rec1A.Right + 10, rec1A.Top, Convert.ToInt32(sizef.Width) + 1, Convert.ToInt32(sizef.Height));
  16888. g.DrawString(striNumber, ft10, b, rec1A);
  16889. #endregion
  16890. /* #region NO.
  16891. string StrValue = tblOrder.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() != "" ? tblOrder.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() : tblOrder.Rows[0]["Ord_Number"].ToString().Trim();
  16892. string rec3Value = "NO." + StrRandom(StrValue);
  16893. SizeF sizef = g.MeasureString(rec3Value, ft10);
  16894. int FtWidth = Convert.ToInt32(sizef.Width) + 1;
  16895. int FtHeight = Convert.ToInt32(sizef.Height);
  16896. Rectangle rec1A = new Rectangle(LeftWidth, rec1.Y + rec1.Height + TopHeightCount, FtWidth, FtHeight);
  16897. g.DrawString(rec3Value, ft10, b, rec1A);
  16898. #endregion*/
  16899. #region 打印时间
  16900. string StrPrintDate = LYFZ.BLL.OtherCommonModel.FontConversion("打印时间:") + LYFZ.Command.Command_Validate.DateTimeToString(SDateTime.Now, "yyyy-MM-dd HH:mm");
  16901. sizef = g.MeasureString(StrPrintDate, ft10);
  16902. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  16903. FtHeight = Convert.ToInt32(sizef.Height);
  16904. Rectangle rec2 = new Rectangle(TableWidth + LeftWidth - FtWidth, rec1A.Y, FtWidth, FtHeight);
  16905. g.DrawString(StrPrintDate, ft10, b, rec2);
  16906. #endregion
  16907. #region 第一行
  16908. Rectangle rec3 = new Rectangle(LeftWidth, rec2.Y + rec2.Height, TableWidth, RowHeight);
  16909. g.DrawRectangle(p, rec3);//画标题矩形
  16910. string rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("客户姓名");
  16911. sizef = g.MeasureString(rec2Value, ft17);
  16912. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  16913. FtHeight = Convert.ToInt32(sizef.Height);
  16914. Rectangle rec3_1 = new Rectangle(rec3.X + LeftAdd * 3, rec3.Y + TopAdd, ColumnWidth1, RowContentHeight);
  16915. g.DrawString(rec2Value, ft9, b, rec3_1);//画第一列的列标题
  16916. Point p31_1 = new Point(rec3.X + ColumnWidth1, rec3.Y);
  16917. Point p31_2 = new Point(rec3.X + ColumnWidth1, rec3.Y + rec3.Height);
  16918. g.DrawLine(p, p31_1, p31_2);//画第一表与第二列的界线
  16919. Rectangle rec3_2 = new Rectangle(p31_1.X + LeftAdd, p31_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
  16920. g.DrawString(MName, ft9, b, rec3_2);//画第二列的列标题
  16921. Point p32_1 = new Point(p31_1.X + ColumnWidth2, rec3.Y);
  16922. Point p32_2 = new Point(p31_1.X + ColumnWidth2, rec3.Y + rec3.Height);
  16923. g.DrawLine(p, p32_1, p32_2);//画第二表与第三列的界线
  16924. Rectangle rec3_3 = new Rectangle(p32_1.X + LeftAdd * 12 - 1, p32_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
  16925. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("电话"), ft9, b, rec3_3);//画第三列的列标题
  16926. Point p33_1 = new Point(p32_1.X + ColumnWidth3, rec3.Y);
  16927. Point p33_2 = new Point(p32_1.X + ColumnWidth3, rec3.Y + rec3.Height);
  16928. g.DrawLine(p, p33_1, p33_2);//画第三表与第四列的界线
  16929. Rectangle rec3_4 = new Rectangle(p33_1.X + LeftAdd, p33_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
  16930. g.DrawString(LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls(MTelephone), ft9, b, rec3_4);//画第四列的列标题
  16931. Point p34_1 = new Point(p33_1.X + ColumnWidth4, rec3.Y);
  16932. Point p34_2 = new Point(p33_1.X + ColumnWidth4, rec3.Y + rec3.Height);
  16933. g.DrawLine(p, p34_1, p34_2);//画第二表与第三列的界线
  16934. Rectangle rec3_7 = new Rectangle(p34_1.X + LeftAdd * 3, p34_1.Y + TopAdd, ColumnWidth5, RowContentHeight);
  16935. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("套系金额"), ft9, b, rec3_7);//画第三列的列标题
  16936. Point p37_1 = new Point(p34_1.X + ColumnWidth5, rec3.Y);
  16937. Point p37_2 = new Point(p34_1.X + ColumnWidth5, rec3.Y + rec3.Height);
  16938. g.DrawLine(p, p37_1, p37_2);//画第三表与第四列的界线
  16939. Rectangle rec3_8 = new Rectangle(p37_1.X + LeftAdd, p37_1.Y + TopAdd, ColumnWidth6, RowContentHeight);
  16940. g.DrawString(tblOrder.Rows[0]["Ord_SeriesPrice"].ToString().Trim(), ft9, b, rec3_8);//画第四列的列标题
  16941. #endregion
  16942. #region 第二行
  16943. Rectangle rec4 = new Rectangle(rec3.X, rec3.Y + rec3.Height, rec3.Width, RowHeight);
  16944. g.DrawRectangle(p, rec4);//画标题矩形
  16945. Rectangle rec4_1 = new Rectangle(rec4.X + LeftAdd * 12 - 1, rec4.Y + TopAdd, ColumnWidth1, RowContentHeight);
  16946. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("定金"), ft9, b, rec4_1);//画第一列的列标题
  16947. Point p41_1 = new Point(rec4.X + ColumnWidth1, rec4.Y);
  16948. Point p41_2 = new Point(rec4.X + ColumnWidth1, rec4.Y + rec4.Height);
  16949. g.DrawLine(p, p41_1, p41_2);//画第一表与第二列的界线
  16950. Rectangle rec4_2 = new Rectangle(p41_1.X + LeftAdd, p41_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
  16951. g.DrawString(OrdPrice, ft9, b, rec4_2);//画第二列的列标题
  16952. Point p42_1 = new Point(p41_1.X + ColumnWidth2, rec4.Y);
  16953. Point p42_2 = new Point(p41_1.X + ColumnWidth2, rec4.Y + rec4.Height);
  16954. g.DrawLine(p, p42_1, p42_2);//画第二表与第三列的界线
  16955. Rectangle rec4_3 = new Rectangle(p42_1.X + LeftAdd * 12 - 1, p42_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
  16956. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("欠款"), ft9, b, rec4_3);//画第三列的列标题
  16957. Point p43_1 = new Point(p42_1.X + ColumnWidth3, rec4.Y);
  16958. Point p43_2 = new Point(p42_1.X + ColumnWidth3, rec4.Y + rec4.Height);
  16959. g.DrawLine(p, p43_1, p43_2);//画第三表与第四列的界线
  16960. Rectangle rec4_4 = new Rectangle(p43_1.X + LeftAdd, p43_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
  16961. g.DrawString(tblOrder.Rows[0]["Ord_OrderArrears"].ToString().Trim(), ft9, b, rec4_4);//画第四列的列标题
  16962. Point p44_1 = new Point(p43_1.X + ColumnWidth4, rec4.Y);
  16963. Point p44_2 = new Point(p43_1.X + ColumnWidth4, rec4.Y + rec4.Height);
  16964. g.DrawLine(p, p44_1, p44_2);//画第二表与第三列的界线
  16965. Rectangle rec4_7 = new Rectangle(p44_1.X + LeftAdd * 3, p44_1.Y + TopAdd, ColumnWidth5, RowContentHeight);
  16966. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("套系名称"), ft9, b, rec4_7);//画第三列的列标题
  16967. Point p47_1 = new Point(p44_1.X + ColumnWidth5, rec4.Y);
  16968. Point p47_2 = new Point(p44_1.X + ColumnWidth5, rec4.Y + rec4.Height);
  16969. g.DrawLine(p, p47_1, p47_2);//画第三表与第四列的界线
  16970. Rectangle rec4_8 = new Rectangle(p47_1.X + LeftAdd, p47_1.Y + TopAdd, ColumnWidth6, RowContentHeight);
  16971. g.DrawString(tblOrder.Rows[0]["Ord_SeriesName"].ToString().Trim(), ft9, b, rec4_8);//画第四列的列标题
  16972. #endregion
  16973. #region 第三行
  16974. Rectangle rec5 = new Rectangle(rec4.X, rec4.Y + rec4.Height, rec3.Width, RowHeight);
  16975. g.DrawRectangle(p, rec5);//画标题矩形
  16976. Rectangle rec5_1 = new Rectangle(rec5.X + LeftAdd * 12 - 1, rec5.Y + TopAdd, ColumnWidth1, RowContentHeight);
  16977. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("地址"), ft9, b, rec5_1);//画第一列的列标题
  16978. Point p51_1 = new Point(rec5.X + ColumnWidth1, rec5.Y);
  16979. Point p51_2 = new Point(rec5.X + ColumnWidth1, rec5.Y + rec5.Height);
  16980. g.DrawLine(p, p51_1, p51_2);//画第一表与第二列的界线
  16981. Rectangle rec5_2 = new Rectangle(p51_1.X + LeftAdd, p51_1.Y + TopAdd, ColumnWidth2 + ColumnWidth3 + ColumnWidth4, RowContentHeight);
  16982. g.DrawString(MAddress, ft9, b, rec5_2);//画第二列的列标题
  16983. Point p52_1 = new Point(p51_1.X + rec5_2.Width, rec5.Y);
  16984. Point p52_2 = new Point(p51_1.X + rec5_2.Width, rec5.Y + rec5.Height);
  16985. g.DrawLine(p, p52_1, p52_2);//画第二表与第三列的界线
  16986. Rectangle rec5_7 = new Rectangle(p52_1.X + LeftAdd * 7, p52_1.Y + TopAdd, ColumnWidth5, RowContentHeight);
  16987. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("门 市"), ft9, b, rec5_7);//画第三列的列标题
  16988. Point p57_1 = new Point(p52_1.X + ColumnWidth5, rec5.Y);
  16989. Point p57_2 = new Point(p52_1.X + ColumnWidth5, rec5.Y + rec5.Height);
  16990. g.DrawLine(p, p57_1, p57_2);//画第三表与第四列的界线
  16991. Rectangle rec5_8 = new Rectangle(p57_1.X + LeftAdd, p57_1.Y + TopAdd, ColumnWidth6, RowContentHeight);
  16992. string strOrderPerson = "";
  16993. if (tblUser.Rows.Count > 0)
  16994. {
  16995. if (Convert.ToBoolean(tblUser.Rows[0]["User_PhonePrint"]) == true)
  16996. strOrderPerson = tblUser.Rows[0]["User_Name"].ToString() + " " + tblUser.Rows[0]["User_Telephone"].ToString();
  16997. else
  16998. strOrderPerson = tblUser.Rows[0]["User_Name"].ToString() + " " + tbl.Rows[0]["Company_Telephone"].ToString();
  16999. }
  17000. g.DrawString(strOrderPerson, ft9, b, rec5_8);//画第四列的列标题
  17001. #endregion
  17002. #region 第四行
  17003. Rectangle rec6 = new Rectangle(rec5.X, rec5.Y + rec5.Height, TableWidth - ColumnWidth5 - ColumnWidth6, 375 - Rec1Height - LeftWidth);
  17004. g.DrawRectangle(p, rec6);//画标题矩形
  17005. rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("服务内容");
  17006. sizef = g.MeasureString(rec2Value, ft17);
  17007. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  17008. FtHeight = Convert.ToInt32(sizef.Height) + 1;
  17009. Rectangle rec6_1 = new Rectangle(rec6.X + LeftAdd * 2, rec6.Y + (rec6.Height / 2 - FtHeight * 2), ColumnWidth1 / 2, FtHeight * 4);
  17010. g.DrawString(rec2Value, ft13, b, rec6_1);//画第一列的列标题
  17011. Point p61_1 = new Point(rec6.X + rec6_1.Width, rec6.Y);
  17012. Point p61_2 = new Point(rec6.X + rec6_1.Width, rec6.Y + rec6.Height);
  17013. g.DrawLine(p, p61_1, p61_2);//画第一表与第二列的界线
  17014. Rectangle rec6_2 = new Rectangle(p61_1.X + LeftAdd, p61_1.Y + TopAdd, TableWidth - ColumnWidth6 - rec6_1.Width, rec6.Height - TopAdd * 2);
  17015. g.DrawString(StrProdName, GetFontSize("服务预约单内容详情字体大小"), b, rec6_2);//画第二列的列标题
  17016. Rectangle rec7 = new Rectangle(rec6.X + rec6.Width, rec6.Y, ColumnWidth5 + ColumnWidth6, rec6.Height - RowHeight * 2);
  17017. g.DrawRectangle(p, rec7);//画标题矩形
  17018. Rectangle rec7_3 = new Rectangle(rec7.X + LeftAdd, rec7.Y + (rec7.Height / 2 - FtHeight * 2), rec6_1.Width, rec7.Height);
  17019. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("注意事项"), ft13, b, rec7_3);//画第三列的列标题
  17020. Point p73_1 = new Point(rec7.X + rec7_3.Width, rec7.Y);
  17021. Point p73_2 = new Point(rec7.X + rec7_3.Width, rec7.Y + rec7.Height);
  17022. g.DrawLine(p, p73_1, p73_2);//画第三表与第四列的界线
  17023. StrValue = "";
  17024. if (PrintOtherData.ContainsKey("服务预约单注意事项说明") && PrintOtherData["服务预约单注意事项说明"].ToString().Trim().Length > 0)
  17025. {
  17026. StrValue = PrintOtherData["服务预约单注意事项说明"].ToString().Trim();
  17027. }
  17028. Rectangle rec7_4 = new Rectangle(p73_1.X + LeftAdd, p73_1.Y + TopAdd, rec7.Width - rec7_3.Width - LeftAdd * 2, rec7.Height - TopAdd * 2);
  17029. g.DrawString(StrValue, GetFontSize("服务预约单注意事项字体大小"), b, rec7_4);//画第四列的列标题
  17030. #endregion
  17031. #region 顾客签字
  17032. Rectangle rec8A = new Rectangle(rec7.X, rec7.Y + rec7.Height, ColumnWidth5 + ColumnWidth6, RowHeight * 2);
  17033. g.DrawRectangle(p, rec8A);//画标题矩形
  17034. Rectangle rec8A_1 = new Rectangle(rec6.X + rec6.Width + LeftAdd * 2, rec8A.Y + TopAdd * 3, ColumnWidth5, RowContentHeight);
  17035. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("顾客签字"), ft9, b, rec8A_1);//画第一列的列标题
  17036. Point p8A1_1 = new Point(rec8A.X + ColumnWidth5, rec8A.Y);
  17037. Point p8A1_2 = new Point(rec8A.X + ColumnWidth5, rec8A.Y + rec8A.Height);
  17038. g.DrawLine(p, p8A1_1, p8A1_2);//画第一表与第二列的界线
  17039. Rectangle rec8A_2 = new Rectangle(p8A1_1.X + LeftAdd, p8A1_1.Y + TopAdd, ColumnWidth6, RowContentHeight);
  17040. //g.DrawString("", ft9, b, rec8A_2);//画第六列的列标题
  17041. if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintOrderShowPayment)
  17042. {
  17043. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("收款"), ft9, b, rec6_1.X + LeftAdd * 3 + 5 - 6, p8A1_2.Y + TopAdd + 2);//画第一列的列标题
  17044. g.DrawLine(p, rec6_1.X - 6, p8A1_1.Y, rec6_1.X - 6, p8A1_2.Y + rec8A_2.Height + 5);//画第六列的列标题
  17045. 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);//画第六列的列标题
  17046. g.DrawLine(p, rec6_1.X - 6 + TableWidth, p8A1_1.Y, rec6_1.X - 6 + TableWidth, p8A1_2.Y + rec8A_2.Height + 5);//画第六列的列标题
  17047. 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);//画第六列的列标题
  17048. rec8A_2.Height += 10;
  17049. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion(strPaymentMsg), ft9, b, rec6_1.X + LeftAdd * 22, p8A1_2.Y + TopAdd + 2);//画第一列的列标题
  17050. }
  17051. else
  17052. {
  17053. rec8A_2.Height = 0;
  17054. }
  17055. #endregion
  17056. #region 尾行
  17057. rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("电话:") + tbl.Rows[0]["Company_Telephone"].ToString().Trim();
  17058. sizef = g.MeasureString(rec2Value, ft9);
  17059. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  17060. FtHeight = Convert.ToInt32(sizef.Height);
  17061. Rectangle rec9_1 = new Rectangle(TableWidth + LeftWidth - FtWidth, rec6.Y + rec6.Height + TopAdd + rec8A_2.Height, FtWidth, FtHeight);
  17062. g.DrawString(rec2Value, ft9, b, rec9_1);//画第一列的列标题
  17063. rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("地址:") + tbl.Rows[0]["Company_Address"].ToString().Trim();
  17064. sizef = g.MeasureString(rec2Value, ft9);
  17065. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  17066. FtHeight = Convert.ToInt32(sizef.Height);
  17067. Rectangle rec9 = new Rectangle(rec6.X, rec9_1.Y, TableWidth - rec9_1.Width - LeftWidth, FtHeight);
  17068. g.DrawString(rec2Value, ft9, b, rec9);//画第一列的列标题
  17069. #endregion
  17070. //bitmapList.Add(bitmap);
  17071. }
  17072. #endregion
  17073. /// <summary>
  17074. /// 缓存图片
  17075. /// </summary>
  17076. /// <returns></returns>
  17077. static Image CachePhoto( PhotoLogType phototype, object StrUpdateDate, string SingleLOG = "" )
  17078. {
  17079. if ( phototype == PhotoLogType.DimensionalCode )
  17080. {
  17081. string strUpdateTime = LYFZ.Command.Command_Validate.DateTimeToString( StrUpdateDate, "yyyyMMddHHmmss" );
  17082. string PhotoLogPath = LYFZ.WinAPI.CustomPublicMethod.GetFullDirectoryPath( LYFZ.WinAPI.CustomPublicMethod.BasePath ) + @"Temp\StorePhotoLog\";
  17083. string PhotoLogName = phototype.ToString().Trim() + "_" + strUpdateTime + ".jpg";
  17084. string PhotoLogAllPath = PhotoLogPath + PhotoLogName;
  17085. if ( !System.IO.Directory.Exists( PhotoLogPath ) )
  17086. {
  17087. try { System.IO.Directory.CreateDirectory( PhotoLogPath ); }
  17088. catch ( Exception e )
  17089. {
  17090. MessageBoxCustom.Show( "创建打印的图片文件夹失败“" + PhotoLogPath + "”!原因:" + e.Message.ToString() ); return null;
  17091. }
  17092. }
  17093. else
  17094. {
  17095. string[] StrFilePath = System.IO.Directory.GetFiles( PhotoLogPath );
  17096. for ( int i = 0; i < StrFilePath.Length; i++ )
  17097. {
  17098. if ( PhotoLogAllPath.ToLower() != StrFilePath[i].Trim().ToLower() )
  17099. {
  17100. try
  17101. {
  17102. if ( System.IO.File.Exists( StrFilePath[i].Trim() ) )
  17103. {
  17104. System.IO.File.Delete( StrFilePath[i].Trim() );
  17105. }
  17106. }
  17107. catch { }
  17108. }
  17109. }
  17110. }
  17111. bool Istrue = true;
  17112. if ( System.IO.File.Exists( PhotoLogAllPath ) )
  17113. {
  17114. string[] OldPhotoName = System.IO.Path.GetFileNameWithoutExtension( PhotoLogAllPath ).Trim().Split( '_' );
  17115. if ( OldPhotoName[1].Trim() == strUpdateTime )
  17116. {
  17117. Istrue = false;
  17118. }
  17119. }
  17120. Image PhotoImg = null;
  17121. if ( Istrue )
  17122. {
  17123. string strColumnsName = "";
  17124. switch ( phototype )
  17125. {
  17126. case PhotoLogType.Portrait:
  17127. strColumnsName = "Company_PortraitLOG";
  17128. break;
  17129. case PhotoLogType.Wedding:
  17130. strColumnsName = "Company_WeddingSingleLOG";
  17131. break;
  17132. case PhotoLogType.Child:
  17133. strColumnsName = "Company_ChildSingleLOG";
  17134. break;
  17135. case PhotoLogType.Service:
  17136. strColumnsName = "Company_ServiceLOG";
  17137. break;
  17138. case PhotoLogType.DimensionalCode:
  17139. strColumnsName = "Company_DimensionalCode";
  17140. break;
  17141. }
  17142. DataTable tb = new BLL.BLL_ErpOrder().GetView_Custom( "tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID() + "'", ShowColumnName: strColumnsName ).Tables[0];
  17143. if ( tb.Rows[0][strColumnsName].ToString().Trim() != "" )
  17144. {
  17145. Bitmap bmp = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetImage( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.StringToByte( tb.Rows[0][strColumnsName].ToString() ) );
  17146. // System.Drawing.Image img = (Bitmap)bmp;
  17147. PhotoImg = new System.Drawing.Bitmap( bmp );
  17148. bmp.Dispose();
  17149. // img.Dispose();
  17150. PhotoImg.Save( PhotoLogAllPath );
  17151. }
  17152. //else
  17153. //{ MessageBoxCustom.Show("本店信息未设置图片"); }
  17154. }
  17155. else
  17156. {
  17157. System.IO.FileStream fs = new System.IO.FileStream( PhotoLogAllPath, System.IO.FileMode.Open, System.IO.FileAccess.Read );
  17158. Bitmap bmp = (Bitmap)System.Drawing.Bitmap.FromStream( fs );
  17159. PhotoImg = new System.Drawing.Bitmap( bmp );
  17160. bmp.Dispose();
  17161. fs.Close();
  17162. }
  17163. return PhotoImg;
  17164. }
  17165. else
  17166. {
  17167. return LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetImage( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.StringToByte( SingleLOG ) );
  17168. }
  17169. //if (!string.IsNullOrEmpty(SingleLOG))
  17170. //{ return LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetImage(LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.StringToByte(SingleLOG)); }
  17171. //else
  17172. //{
  17173. // return null;
  17174. // //string strUpdateTime = LYFZ.Command.Command_Validate.DateTimeToString(StrUpdateDate, "yyyyMMddHHmmss");
  17175. // //string PhotoLogPath = LYFZ.WinAPI.CustomPublicMethod.GetFullDirectoryPath(LYFZ.WinAPI.CustomPublicMethod.BasePath) + @"Temp\StorePhotoLog\";
  17176. // //string PhotoLogName = phototype.ToString().Trim() + "_" + strUpdateTime + ".jpg";
  17177. // //string PhotoLogAllPath = PhotoLogPath + PhotoLogName;
  17178. // //if (!System.IO.Directory.Exists(PhotoLogPath))
  17179. // //{
  17180. // // try { System.IO.Directory.CreateDirectory(PhotoLogPath); }
  17181. // // catch
  17182. // // { MessageBoxCustom.Show("创建预约单文件夹失败"); return null; }
  17183. // //}
  17184. // //else
  17185. // //{
  17186. // // string[] StrFilePath = System.IO.Directory.GetFiles(PhotoLogPath);
  17187. // // for (int i = 0; i < StrFilePath.Length; i++)
  17188. // // {
  17189. // // if (System.IO.File.Exists(StrFilePath[i].Trim()))
  17190. // // { System.IO.File.Delete(StrFilePath[i].Trim()); }
  17191. // // }
  17192. // //}
  17193. // //bool Istrue = true;
  17194. // //if (System.IO.File.Exists(PhotoLogAllPath))
  17195. // //{
  17196. // // string[] OldPhotoName = System.IO.Path.GetFileNameWithoutExtension(PhotoLogAllPath).Trim().Split('_');
  17197. // // if (OldPhotoName[1].Trim() == strUpdateTime)
  17198. // // { Istrue = false; }
  17199. // //}
  17200. // //Image PhotoImg = null;
  17201. // //if (Istrue)
  17202. // //{
  17203. // // string strColumnsName = "";
  17204. // // switch (phototype)
  17205. // // {
  17206. // // case PhotoLogType.Portrait:
  17207. // // strColumnsName = "Company_PortraitLOG";
  17208. // // break;
  17209. // // case PhotoLogType.Wedding:
  17210. // // strColumnsName = "Company_WeddingSingleLOG";
  17211. // // break;
  17212. // // case PhotoLogType.Child:
  17213. // // strColumnsName = "Company_ChildSingleLOG";
  17214. // // break;
  17215. // // case PhotoLogType.Service:
  17216. // // strColumnsName = "Company_ServiceLOG";
  17217. // // break;
  17218. // // case PhotoLogType.DimensionalCode:
  17219. // // strColumnsName = "Company_DimensionalCode";
  17220. // // break;
  17221. // // }
  17222. // // DataTable tb = new BLL.BLL_ErpOrder().GetView_Custom("tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID() + "'", ShowColumnName: strColumnsName).Tables[0];
  17223. // // if (tb.Rows[0][strColumnsName].ToString().Trim() != "")
  17224. // // {
  17225. // // Bitmap bmp = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetImage(LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.StringToByte(tb.Rows[0][strColumnsName].ToString()));
  17226. // // System.Drawing.Image img = (Bitmap)bmp;
  17227. // // PhotoImg = new System.Drawing.Bitmap(img);
  17228. // // img.Dispose();
  17229. // // PhotoImg.Save(PhotoLogAllPath);
  17230. // // }
  17231. // // //else
  17232. // // //{ MessageBoxCustom.Show("本店信息未设置图片"); }
  17233. // //}
  17234. // //else
  17235. // //{
  17236. // // System.IO.FileStream fs = new System.IO.FileStream(PhotoLogAllPath, System.IO.FileMode.Open, System.IO.FileAccess.Read);
  17237. // // PhotoImg = System.Drawing.Image.FromStream(fs);
  17238. // // fs.Close();
  17239. // //}
  17240. // //return PhotoImg;
  17241. //}
  17242. }
  17243. /// <summary>
  17244. /// 相片类型
  17245. /// </summary>
  17246. private enum PhotoLogType
  17247. {
  17248. /// <summary>
  17249. /// 二维码
  17250. /// </summary>
  17251. DimensionalCode = -1,
  17252. /// <summary>
  17253. /// 婚纱
  17254. /// </summary>
  17255. Wedding = 0,
  17256. /// <summary>
  17257. /// 儿童
  17258. /// </summary>
  17259. Child = 1,
  17260. /// <summary>
  17261. /// 写真
  17262. /// </summary>
  17263. Portrait = 2,
  17264. /// <summary>
  17265. /// 服务
  17266. /// </summary>
  17267. Service = 3,
  17268. /// <summary>
  17269. /// 小票婚纱
  17270. /// </summary>
  17271. SmallTicketWedding = 4,
  17272. /// <summary>
  17273. /// 小票儿童
  17274. /// </summary>
  17275. SmallTicketChild = 5,
  17276. /// <summary>
  17277. /// 小票写真
  17278. /// </summary>
  17279. SmallTicketPortrait = 6
  17280. }
  17281. #endregion
  17282. #region 礼服管理
  17283. /// <summary>
  17284. /// 礼服管理——出租清单打印
  17285. /// </summary>
  17286. /// <returns></returns>
  17287. public static void Dresses_RentalGownsList_Print( object objValue, Graphics g, Size size )
  17288. {
  17289. string ExecuteSql = orbll.GetView_CustomReturnExecuteSql( "tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Address,Company_Telephone" );
  17290. ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql( "tb_ErpDressSaleRentalOrder", StrWhere: "Dsro_Number = '" + objValue.ToString().Trim() + "'" );
  17291. 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() + "'";
  17292. DataSet dtSet = orbll.GetView_Custom( ExecuteSql );
  17293. DataTable tbl = dtSet.Tables["ds"];//获取影楼信息
  17294. DataTable tbl_order = dtSet.Tables["ds1"];
  17295. DataTable tbl_Detail = dtSet.Tables["ds2"];
  17296. if ( tbl.Rows.Count <= 0 )
  17297. {
  17298. MessageBoxCustom.Show( "未设置影楼信息!" ); return;
  17299. }
  17300. if ( tbl_order.Rows.Count <= 0 )
  17301. {
  17302. MessageBoxCustom.Show( "订单" + objValue.ToString().Trim() + "不存在!" ); return;
  17303. }
  17304. 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];
  17305. Brush b = Brushes.Black;
  17306. Pen p = GetPen;
  17307. Font ft18 = new Font( "宋体", 18 );
  17308. Font ft10 = new Font( "宋体", 10 );
  17309. Font ft9 = new Font( "宋体", 9 );
  17310. Font ft8 = new Font( "宋体", 8 );
  17311. int LeftWidth = 50;
  17312. int TableWidth = size.Width - LeftWidth * 2 + 30;
  17313. int LeftAdd = 3;
  17314. int TopAdd = 6;
  17315. //金色童年收据凭据
  17316. SizeF sizef = g.MeasureString( DefaultPrintTitle, ft18 );
  17317. int StrHeigth = Convert.ToInt32( sizef.Height );
  17318. int StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  17319. Rectangle rec1 = new Rectangle( size.Width / 2 - StrWidth / 2, 50, StrWidth, StrHeigth );
  17320. g.DrawString( DefaultPrintTitle, ft18, b, rec1 );
  17321. string SinglePerson = "接单人:" + LYFZ.DAL.DAL_ErpUser.GetUserIDToUserName( tbl_order.Rows[0]["Dsro_CreateName"].ToString_s() ); //2017-03-30 刘工添加
  17322. string recValue = LYFZ.BLL.OtherCommonModel.FontConversion( SinglePerson + " " + "出租单号:" ) + objValue.ToString().Trim();
  17323. sizef = g.MeasureString( recValue, ft9 );
  17324. StrHeigth = Convert.ToInt32( sizef.Height );
  17325. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  17326. Rectangle rec2 = new Rectangle( TableWidth + LeftWidth - StrWidth, rec1.Y + rec1.Height + 15 - StrHeigth, StrWidth, StrHeigth );
  17327. g.DrawString( recValue, ft9, b, rec2 );
  17328. Rectangle rec3 = new Rectangle( LeftWidth, rec2.Y + rec2.Height, TableWidth, 50 );
  17329. g.DrawRectangle( p, rec3 );//画标题矩形
  17330. #region 第一行
  17331. #region 姓名
  17332. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名:" );
  17333. sizef = g.MeasureString( recValue, ft10 );
  17334. StrHeigth = Convert.ToInt32( sizef.Height );
  17335. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  17336. Rectangle rec3_A1 = new Rectangle( rec3.X + LeftAdd, rec3.Y + TopAdd, StrWidth, StrHeigth );
  17337. g.DrawString( recValue, ft10, b, rec3_A1 );
  17338. recValue = tbl_Cus.Rows[0]["Cus_Name"].ToString().Trim();
  17339. Rectangle rec3_A2 = new Rectangle( rec3_A1.X + rec3_A1.Width, rec3.Y + TopAdd, rec3_A1.X + rec3_A1.Width + 85, StrHeigth );
  17340. g.DrawString( recValue, ft10, b, rec3_A2 );
  17341. 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 ) );
  17342. #endregion
  17343. #region 电话
  17344. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "客户电话:" );
  17345. sizef = g.MeasureString( recValue, ft10 );
  17346. StrHeigth = Convert.ToInt32( sizef.Height );
  17347. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  17348. Rectangle rec3_B1 = new Rectangle( rec3_A2.X + rec3_A2.Y + 5, rec3.Y + TopAdd, StrWidth, StrHeigth );
  17349. g.DrawString( recValue, ft10, b, rec3_B1 );
  17350. recValue = tbl_Cus.Rows[0]["Cus_Telephone"].ToString().Trim();
  17351. Rectangle rec3_B2 = new Rectangle( rec3_B1.X + rec3_B1.Width, rec3.Y + TopAdd, rec3_B1.X + rec3_B1.Width + 85, StrHeigth );
  17352. g.DrawString( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( recValue ), ft10, b, rec3_B2 );
  17353. 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 ) );
  17354. #endregion
  17355. #region 租金
  17356. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "应交租金:" );
  17357. sizef = g.MeasureString( recValue, ft10 );
  17358. StrHeigth = Convert.ToInt32( sizef.Height );
  17359. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  17360. Rectangle rec3_C1 = new Rectangle( rec3_B2.X + rec3_B2.Y + 5, rec3.Y + TopAdd, StrWidth, StrHeigth );
  17361. g.DrawString( recValue, ft10, b, rec3_C1 );
  17362. recValue = tbl_order.Rows[0]["Dsro_Amount"].ToString().Trim();
  17363. Rectangle rec3_C2 = new Rectangle( rec3_C1.X + rec3_C1.Width, rec3.Y + TopAdd, rec3_C1.X + rec3_C1.Width + 90, StrHeigth );
  17364. g.DrawString( recValue, ft10, b, rec3_C2 );
  17365. 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 ) );
  17366. #endregion
  17367. #region 押金
  17368. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "应交押金:" );
  17369. sizef = g.MeasureString( recValue, ft10 );
  17370. StrHeigth = Convert.ToInt32( sizef.Height );
  17371. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  17372. Rectangle rec3_D1 = new Rectangle( rec3_C2.X + rec3_C2.Y + 5, rec3.Y + TopAdd, StrWidth, StrHeigth );
  17373. g.DrawString( recValue, ft10, b, rec3_D1 );
  17374. recValue = tbl_order.Rows[0]["Dsro_MortgageAmount"].ToString().Trim();
  17375. Rectangle rec3_D2 = new Rectangle( rec3_D1.X + rec3_D1.Width, rec3.Y + TopAdd, rec3_D1.X + rec3_D1.Width + 90, StrHeigth );
  17376. g.DrawString( recValue, ft10, b, rec3_D2 );
  17377. 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 ) );
  17378. #endregion
  17379. #endregion
  17380. #region 第二行
  17381. #region 结婚日期
  17382. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "结婚日期:" );
  17383. sizef = g.MeasureString( recValue, ft10 );
  17384. StrHeigth = Convert.ToInt32( sizef.Height );
  17385. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  17386. Rectangle rec3_E1 = new Rectangle( rec3.X + LeftAdd, rec3_A2.Y + rec3_A2.Height + TopAdd, StrWidth, StrHeigth );
  17387. g.DrawString( recValue, ft10, b, rec3_E1 );
  17388. if ( tbl_Cus.Rows[0]["Cus_DayForMarriage"].ToString().Trim() != "" )
  17389. {
  17390. recValue = Convert.ToDateTime( tbl_Cus.Rows[0]["Cus_DayForMarriage"] ).ToString( "yyyy-MM-dd" );
  17391. }
  17392. else { recValue = ""; }
  17393. Rectangle rec3_E2 = new Rectangle( rec3_A1.X + rec3_A1.Width, rec3_E1.Y, rec3_A1.X + rec3_A1.Width + 100, StrHeigth );
  17394. g.DrawString( recValue, ft10, b, rec3_E2 );
  17395. 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 ) );
  17396. #endregion
  17397. #region 预定日期
  17398. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "预定日期:" );
  17399. sizef = g.MeasureString( recValue, ft10 );
  17400. StrHeigth = Convert.ToInt32( sizef.Height );
  17401. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  17402. Rectangle rec3_F1 = new Rectangle( rec3_B1.X, rec3_E1.Y, StrWidth, StrHeigth );
  17403. g.DrawString( recValue, ft10, b, rec3_F1 );
  17404. if ( tbl_order.Rows[0]["Dsro_CreateDateTime"].ToString().Trim() != "" )
  17405. {
  17406. recValue = Convert.ToDateTime( tbl_order.Rows[0]["Dsro_CreateDateTime"] ).ToString( "yyyy-MM-dd" );
  17407. }
  17408. else { recValue = ""; }
  17409. Rectangle rec3_F2 = new Rectangle( rec3_F1.X + rec3_F1.Width, rec3_E2.Y, rec3_B2.Width, StrHeigth );
  17410. g.DrawString( recValue, ft10, b, rec3_F2 );
  17411. 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 ) );
  17412. #endregion
  17413. #region 取衣日期
  17414. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "取衣日期:" );
  17415. sizef = g.MeasureString( recValue, ft10 );
  17416. StrHeigth = Convert.ToInt32( sizef.Height );
  17417. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  17418. Rectangle rec3_G1 = new Rectangle( rec3_C1.X, rec3_F1.Y, StrWidth, StrHeigth );
  17419. g.DrawString( recValue, ft10, b, rec3_G1 );
  17420. if ( tbl_order.Rows[0]["Dsro_TakeDressTime"].ToString().Trim() != "" )
  17421. {
  17422. recValue = Convert.ToDateTime( tbl_order.Rows[0]["Dsro_TakeDressTime"] ).ToString( "yyyy-MM-dd" );
  17423. }
  17424. else { recValue = ""; }
  17425. Rectangle rec3_G2 = new Rectangle( rec3_G1.X + rec3_G1.Width, rec3_E2.Y, rec3_C2.Width, StrHeigth );
  17426. g.DrawString( recValue, ft10, b, rec3_G2 );
  17427. 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 ) );
  17428. #endregion
  17429. #region 归还日期
  17430. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "归还日期:" );
  17431. sizef = g.MeasureString( recValue, ft10 );
  17432. StrHeigth = Convert.ToInt32( sizef.Height );
  17433. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  17434. Rectangle rec3_H1 = new Rectangle( rec3_D1.X, rec3_G1.Y, StrWidth, StrHeigth );
  17435. g.DrawString( recValue, ft10, b, rec3_H1 );
  17436. if ( tbl_order.Rows[0]["Dsro_ReservationBackTime"].ToString().Trim() != "" )
  17437. {
  17438. recValue = Convert.ToDateTime( tbl_order.Rows[0]["Dsro_ReservationBackTime"] ).ToString( "yyyy-MM-dd" );
  17439. }
  17440. else { recValue = ""; }
  17441. Rectangle rec3_H2 = new Rectangle( rec3_H1.X + rec3_H1.Width, rec3_E2.Y, rec3_D2.Width, StrHeigth );
  17442. g.DrawString( recValue, ft10, b, rec3_H2 );
  17443. 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 ) );
  17444. #endregion
  17445. #endregion
  17446. #region 服务项
  17447. string recValue3 = "";
  17448. for ( int i = 0; i < tbl_Detail.Rows.Count; i++ )
  17449. {
  17450. 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";
  17451. }
  17452. sizef = g.MeasureString( recValue3.TrimEnd( 'n', '/', 'r', '/' ), ft10 );
  17453. int StrHeigth3 = 0;
  17454. int rec4Height = 0;
  17455. if ( tbl_Detail.Rows.Count > 11 )
  17456. {
  17457. StrHeigth3 = Convert.ToInt32( sizef.Height );
  17458. rec4Height = StrHeigth3 + TopAdd;
  17459. }
  17460. else
  17461. {
  17462. StrHeigth3 = StrHeigth;
  17463. rec4Height = 140;
  17464. }
  17465. int StrWidth3 = Convert.ToInt32( sizef.Width ) + 5;
  17466. Rectangle rec4 = new Rectangle( LeftWidth, rec3.Y + rec3.Height, TableWidth, rec4Height );
  17467. g.DrawRectangle( p, rec4 );//画标题矩形
  17468. #region 服务项目
  17469. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "服务项目:" );
  17470. sizef = g.MeasureString( recValue, ft10 );
  17471. StrHeigth = Convert.ToInt32( sizef.Height );
  17472. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  17473. Rectangle rec4_A1 = new Rectangle( rec4.X + LeftAdd, rec4.Y + TopAdd, StrWidth, StrHeigth );
  17474. g.DrawString( recValue, ft10, b, rec4_A1 );
  17475. #endregion
  17476. #region 项目内容
  17477. Rectangle rec4_A2 = new Rectangle( rec3_A1.X + rec3_A1.Width, rec4.Y + TopAdd, TableWidth - rec4_A1.Width - LeftAdd, rec4Height - TopAdd * 2 );
  17478. g.DrawString( recValue3.TrimEnd( 'n', '/', 'r', '/' ), ft10, b, rec4_A2 );
  17479. #endregion
  17480. #endregion
  17481. #region 备注
  17482. recValue = "测试:";
  17483. sizef = g.MeasureString( recValue, ft10 );
  17484. StrHeigth = Convert.ToInt32( sizef.Height );
  17485. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  17486. Rectangle rec5 = new Rectangle( LeftWidth, rec4.Y + rec4.Height, TableWidth, StrHeigth * 2 + TopAdd );
  17487. g.DrawRectangle( p, rec5 );//画标题矩形
  17488. #region 备注
  17489. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "备 注:" );
  17490. sizef = g.MeasureString( recValue, ft10 );
  17491. StrHeigth = Convert.ToInt32( sizef.Height );
  17492. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  17493. Rectangle rec5_A1 = new Rectangle( rec5.X + LeftAdd, rec5.Y + TopAdd, StrWidth, StrHeigth );
  17494. g.DrawString( recValue, ft10, b, rec5_A1 );
  17495. #endregion
  17496. #region 项目内容
  17497. //int IntCout = 3;
  17498. recValue = tbl_order.Rows[0]["Dsro_Remark"].ToString().Trim();
  17499. sizef = g.MeasureString( recValue, ft10 );
  17500. StrHeigth = Convert.ToInt32( sizef.Height );
  17501. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  17502. Rectangle rec5_A2 = new Rectangle( rec3_A1.X + rec3_A1.Width, rec5.Y + TopAdd, rec4_A2.Width, StrHeigth * 2 );
  17503. g.DrawString( recValue, ft10, b, rec5_A2 );
  17504. #endregion
  17505. #endregion
  17506. #region 注意事项
  17507. string recValue2 = "";
  17508. if ( PrintOtherData.ContainsKey( "礼服单说明" ) && PrintOtherData["礼服单说明"].ToString().Trim().Length > 0 )
  17509. {
  17510. recValue2 = PrintOtherData["礼服单说明"].ToString().Trim();
  17511. sizef = g.MeasureString( recValue2, ft8 );
  17512. sizef.Height = 128;
  17513. }
  17514. else
  17515. {
  17516. sizef = g.MeasureString( "测试", ft8 );
  17517. sizef.Height = 128;
  17518. }
  17519. int StrHeigth2 = Convert.ToInt32( sizef.Height );
  17520. int StrWidth2 = Convert.ToInt32( sizef.Width ) + 5;
  17521. Rectangle rec6 = new Rectangle( LeftWidth, rec5.Y + rec5.Height, TableWidth, StrHeigth2 + (TopAdd * 3) / 2 );
  17522. g.DrawRectangle( p, rec6 );//画标题矩形
  17523. #region 事项说明
  17524. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "注意事项:" );
  17525. sizef = g.MeasureString( recValue, ft8 );
  17526. StrHeigth = Convert.ToInt32( sizef.Height );
  17527. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  17528. Rectangle rec6_A1 = new Rectangle( rec6.X + LeftAdd, rec6.Y + TopAdd, StrWidth, StrHeigth );
  17529. g.DrawString( recValue, ft8, b, rec6_A1 );
  17530. Rectangle rec6_A2 = new Rectangle( rec6_A1.X + rec6_A1.Width, rec6.Y + TopAdd, rec4_A2.Width, StrHeigth2 );
  17531. g.DrawString( recValue2, ft8, b, rec6_A2 );
  17532. #endregion
  17533. #endregion
  17534. #region 尾
  17535. Rectangle rec7 = new Rectangle( LeftWidth, rec6.Y + rec6.Height, TableWidth, 55 );
  17536. g.DrawRectangle( p, rec7 );//画标题矩形
  17537. #region 第一行
  17538. #region 本店电话
  17539. string StrPhone = tbl.Rows[0]["Company_Telephone"].ToString().Trim();
  17540. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "本店电话:" ) + StrPhone;
  17541. sizef = g.MeasureString( recValue, ft10 );
  17542. StrHeigth = Convert.ToInt32( sizef.Height );
  17543. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  17544. Rectangle rec7_B1 = new Rectangle( TableWidth + LeftWidth - 20 - StrWidth, rec7.Y + TopAdd, StrWidth, StrHeigth );
  17545. g.DrawString( recValue, ft10, b, rec7_B1 );
  17546. 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 ) );
  17547. #endregion
  17548. #region 本店地址
  17549. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "本店地址:" ) + tbl.Rows[0]["Company_Address"].ToString().Trim();
  17550. sizef = g.MeasureString( recValue, ft10 );
  17551. StrHeigth = Convert.ToInt32( sizef.Height );
  17552. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  17553. Rectangle rec7_A1 = new Rectangle( rec7.X + LeftAdd, rec7.Y + TopAdd, TableWidth - LeftWidth - rec7_B1.Width - 20, StrHeigth );
  17554. g.DrawString( recValue, ft10, b, rec7_A1 );
  17555. 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 ) );
  17556. #endregion
  17557. #endregion
  17558. #region 第二行
  17559. #region 客户地址
  17560. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "客户地址:" ) + tbl_Cus.Rows[0]["Cus_Address"].ToString().Trim();
  17561. sizef = g.MeasureString( recValue, ft10 );
  17562. StrHeigth = Convert.ToInt32( sizef.Height );
  17563. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  17564. Rectangle rec7_E1 = new Rectangle( rec7_A1.X, rec7_B1.Y + rec7_B1.Height + TopAdd, StrWidth, StrHeigth );
  17565. g.DrawString( recValue, ft10, b, rec7_E1 );
  17566. 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 ) );
  17567. #endregion
  17568. #region 客户签名
  17569. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "客户签名:" );
  17570. sizef = g.MeasureString( recValue, ft10 );
  17571. StrHeigth = Convert.ToInt32( sizef.Height );
  17572. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  17573. Rectangle rec7_F1 = new Rectangle( rec7_B1.X, rec7_E1.Y, StrWidth, StrHeigth );
  17574. g.DrawString( recValue, ft10, b, rec7_F1 );
  17575. 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 ) );
  17576. #endregion
  17577. #endregion
  17578. #endregion
  17579. }
  17580. /// <summary>
  17581. /// 礼服管理——出租清单A4打印
  17582. /// </summary>
  17583. /// <returns></returns>
  17584. public static void Dresses_RentalGownsList_A4Print( object objValue, Graphics g, Size size )
  17585. {
  17586. string ExecuteSql = orbll.GetView_CustomReturnExecuteSql( "tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Address,Company_Telephone" );
  17587. ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql( "tb_ErpDressSaleRentalOrder", StrWhere: "Dsro_Number = '" + objValue.ToString().Trim() + "'" );
  17588. 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() + "'";
  17589. DataSet dtSet = orbll.GetView_Custom( ExecuteSql );
  17590. DataTable tbl = dtSet.Tables["ds"];//获取影楼信息
  17591. DataTable tbl_order = dtSet.Tables["ds1"];
  17592. DataTable tbl_Detail = dtSet.Tables["ds2"];
  17593. if ( tbl.Rows.Count <= 0 )
  17594. {
  17595. MessageBoxCustom.Show( "未设置影楼信息!" ); return;
  17596. }
  17597. if ( tbl_order.Rows.Count <= 0 )
  17598. {
  17599. MessageBoxCustom.Show( "订单" + objValue.ToString().Trim() + "不存在!" ); return;
  17600. }
  17601. 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];
  17602. Brush b = Brushes.Black;
  17603. Pen p = GetPen;
  17604. Font ft18 = new Font( "宋体", 18 );
  17605. Font ft10 = new Font( "宋体", 10 );
  17606. Font ft9 = new Font( "宋体", 9 );
  17607. Font ft8 = new Font( "宋体", 8 );
  17608. int LeftWidth = 50;
  17609. int TableWidth = size.Width - LeftWidth * 2 + 30;
  17610. int LeftAdd = 3;
  17611. int TopAdd = 10;
  17612. //金色童年收据凭据
  17613. SizeF sizef = g.MeasureString( DefaultPrintTitle, ft18 );
  17614. int StrHeigth = Convert.ToInt32( sizef.Height );
  17615. int StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  17616. Rectangle rec1 = new Rectangle( size.Width / 2 - StrWidth / 2, 50, StrWidth, StrHeigth );
  17617. g.DrawString( DefaultPrintTitle, ft18, b, rec1 );
  17618. string SinglePerson = "接单人:" + LYFZ.DAL.DAL_ErpUser.GetUserIDToUserName( tbl_order.Rows[0]["Dsro_CreateName"].ToString_s() ); //2017-03-30 刘工添加
  17619. string recValue = LYFZ.BLL.OtherCommonModel.FontConversion( SinglePerson + " " + "出租单号:" ) + objValue.ToString().Trim();
  17620. sizef = g.MeasureString( recValue, ft9 );
  17621. StrHeigth = Convert.ToInt32( sizef.Height );
  17622. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  17623. Rectangle rec2 = new Rectangle( TableWidth + LeftWidth - StrWidth, rec1.Y + rec1.Height + 15 - StrHeigth, StrWidth, StrHeigth );
  17624. g.DrawString( recValue, ft9, b, rec2 );
  17625. Rectangle rec3 = new Rectangle( LeftWidth, rec2.Y + rec2.Height + 5, TableWidth, 60 );
  17626. g.DrawRectangle( p, rec3 );//画标题矩形
  17627. #region 第一行
  17628. #region 姓名
  17629. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名:" );
  17630. sizef = g.MeasureString( recValue, ft10 );
  17631. StrHeigth = Convert.ToInt32( sizef.Height );
  17632. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  17633. Rectangle rec3_A1 = new Rectangle( rec3.X + LeftAdd, rec3.Y + TopAdd, StrWidth, StrHeigth );
  17634. g.DrawString( recValue, ft10, b, rec3_A1 );
  17635. recValue = tbl_Cus.Rows[0]["Cus_Name"].ToString().Trim();
  17636. Rectangle rec3_A2 = new Rectangle( rec3_A1.X + rec3_A1.Width, rec3.Y + TopAdd, rec3_A1.X + rec3_A1.Width + 85, StrHeigth );
  17637. g.DrawString( recValue, ft10, b, rec3_A2 );
  17638. 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 ) );
  17639. #endregion
  17640. #region 电话
  17641. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "客户电话:" );
  17642. sizef = g.MeasureString( recValue, ft10 );
  17643. StrHeigth = Convert.ToInt32( sizef.Height );
  17644. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  17645. Rectangle rec3_B1 = new Rectangle( rec3_A2.X + rec3_A2.Y + 5, rec3.Y + TopAdd, StrWidth, StrHeigth );
  17646. g.DrawString( recValue, ft10, b, rec3_B1 );
  17647. recValue = tbl_Cus.Rows[0]["Cus_Telephone"].ToString().Trim();
  17648. Rectangle rec3_B2 = new Rectangle( rec3_B1.X + rec3_B1.Width, rec3.Y + TopAdd, rec3_B1.X + rec3_B1.Width + 85, StrHeigth );
  17649. g.DrawString( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( recValue ), ft10, b, rec3_B2 );
  17650. 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 ) );
  17651. #endregion
  17652. #region 租金
  17653. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "应交租金:" );
  17654. sizef = g.MeasureString( recValue, ft10 );
  17655. StrHeigth = Convert.ToInt32( sizef.Height );
  17656. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  17657. Rectangle rec3_C1 = new Rectangle( rec3_B2.X + rec3_B2.Y + 5, rec3.Y + TopAdd, StrWidth, StrHeigth );
  17658. g.DrawString( recValue, ft10, b, rec3_C1 );
  17659. recValue = tbl_order.Rows[0]["Dsro_Amount"].ToString().Trim();
  17660. Rectangle rec3_C2 = new Rectangle( rec3_C1.X + rec3_C1.Width, rec3.Y + TopAdd, rec3_C1.X + rec3_C1.Width + 90, StrHeigth );
  17661. g.DrawString( recValue, ft10, b, rec3_C2 );
  17662. 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 ) );
  17663. #endregion
  17664. #region 押金
  17665. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "应交押金:" );
  17666. sizef = g.MeasureString( recValue, ft10 );
  17667. StrHeigth = Convert.ToInt32( sizef.Height );
  17668. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  17669. Rectangle rec3_D1 = new Rectangle( rec3_C2.X + rec3_C2.Y + 5, rec3.Y + TopAdd, StrWidth, StrHeigth );
  17670. g.DrawString( recValue, ft10, b, rec3_D1 );
  17671. recValue = tbl_order.Rows[0]["Dsro_MortgageAmount"].ToString().Trim();
  17672. Rectangle rec3_D2 = new Rectangle( rec3_D1.X + rec3_D1.Width, rec3.Y + TopAdd, rec3_D1.X + rec3_D1.Width + 90, StrHeigth );
  17673. g.DrawString( recValue, ft10, b, rec3_D2 );
  17674. 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 ) );
  17675. #endregion
  17676. #endregion
  17677. #region 第二行
  17678. #region 结婚日期
  17679. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "结婚日期:" );
  17680. sizef = g.MeasureString( recValue, ft10 );
  17681. StrHeigth = Convert.ToInt32( sizef.Height );
  17682. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  17683. Rectangle rec3_E1 = new Rectangle( rec3.X + LeftAdd, rec3_A2.Y + rec3_A2.Height + TopAdd, StrWidth, StrHeigth );
  17684. g.DrawString( recValue, ft10, b, rec3_E1 );
  17685. if ( tbl_Cus.Rows[0]["Cus_DayForMarriage"].ToString().Trim() != "" )
  17686. {
  17687. recValue = Convert.ToDateTime( tbl_Cus.Rows[0]["Cus_DayForMarriage"] ).ToString( "yyyy-MM-dd" );
  17688. }
  17689. else { recValue = ""; }
  17690. Rectangle rec3_E2 = new Rectangle( rec3_A1.X + rec3_A1.Width, rec3_E1.Y, rec3_A1.X + rec3_A1.Width + 100, StrHeigth );
  17691. g.DrawString( recValue, ft10, b, rec3_E2 );
  17692. 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 ) );
  17693. #endregion
  17694. #region 预定日期
  17695. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "预定日期:" );
  17696. sizef = g.MeasureString( recValue, ft10 );
  17697. StrHeigth = Convert.ToInt32( sizef.Height );
  17698. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  17699. Rectangle rec3_F1 = new Rectangle( rec3_B1.X, rec3_E1.Y, StrWidth, StrHeigth );
  17700. g.DrawString( recValue, ft10, b, rec3_F1 );
  17701. if ( tbl_order.Rows[0]["Dsro_CreateDateTime"].ToString().Trim() != "" )
  17702. {
  17703. recValue = Convert.ToDateTime( tbl_order.Rows[0]["Dsro_CreateDateTime"] ).ToString( "yyyy-MM-dd" );
  17704. }
  17705. else { recValue = ""; }
  17706. Rectangle rec3_F2 = new Rectangle( rec3_F1.X + rec3_F1.Width, rec3_E2.Y, rec3_B2.Width, StrHeigth );
  17707. g.DrawString( recValue, ft10, b, rec3_F2 );
  17708. 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 ) );
  17709. #endregion
  17710. #region 取衣日期
  17711. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "取衣日期:" );
  17712. sizef = g.MeasureString( recValue, ft10 );
  17713. StrHeigth = Convert.ToInt32( sizef.Height );
  17714. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  17715. Rectangle rec3_G1 = new Rectangle( rec3_C1.X, rec3_F1.Y, StrWidth, StrHeigth );
  17716. g.DrawString( recValue, ft10, b, rec3_G1 );
  17717. if ( tbl_order.Rows[0]["Dsro_TakeDressTime"].ToString().Trim() != "" )
  17718. {
  17719. recValue = Convert.ToDateTime( tbl_order.Rows[0]["Dsro_TakeDressTime"] ).ToString( "yyyy-MM-dd" );
  17720. }
  17721. else { recValue = ""; }
  17722. Rectangle rec3_G2 = new Rectangle( rec3_G1.X + rec3_G1.Width, rec3_E2.Y, rec3_C2.Width, StrHeigth );
  17723. g.DrawString( recValue, ft10, b, rec3_G2 );
  17724. 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 ) );
  17725. #endregion
  17726. #region 归还日期
  17727. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "归还日期:" );
  17728. sizef = g.MeasureString( recValue, ft10 );
  17729. StrHeigth = Convert.ToInt32( sizef.Height );
  17730. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  17731. Rectangle rec3_H1 = new Rectangle( rec3_D1.X, rec3_G1.Y, StrWidth, StrHeigth );
  17732. g.DrawString( recValue, ft10, b, rec3_H1 );
  17733. if ( tbl_order.Rows[0]["Dsro_ReservationBackTime"].ToString().Trim() != "" )
  17734. {
  17735. recValue = Convert.ToDateTime( tbl_order.Rows[0]["Dsro_ReservationBackTime"] ).ToString( "yyyy-MM-dd" );
  17736. }
  17737. else { recValue = ""; }
  17738. Rectangle rec3_H2 = new Rectangle( rec3_H1.X + rec3_H1.Width, rec3_E2.Y, rec3_D2.Width, StrHeigth );
  17739. g.DrawString( recValue, ft10, b, rec3_H2 );
  17740. 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 ) );
  17741. #endregion
  17742. #endregion
  17743. #region 服务项
  17744. string recValue3 = "";
  17745. for ( int i = 0; i < tbl_Detail.Rows.Count; i++ )
  17746. {
  17747. 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";
  17748. }
  17749. sizef = g.MeasureString( recValue3.TrimEnd( 'n', '/', 'r', '/' ), ft10 );
  17750. int StrHeigth3 = 0;
  17751. int rec4Height = 0;
  17752. if ( tbl_Detail.Rows.Count > 30 )
  17753. {
  17754. StrHeigth3 = Convert.ToInt32( sizef.Height );
  17755. rec4Height = StrHeigth3 + TopAdd;
  17756. if ( rec4Height < 400 )
  17757. {
  17758. rec4Height = 400;
  17759. }
  17760. }
  17761. else
  17762. {
  17763. StrHeigth3 = StrHeigth;
  17764. rec4Height = 400;
  17765. }
  17766. int StrWidth3 = Convert.ToInt32( sizef.Width ) + 5;
  17767. Rectangle rec4 = new Rectangle( LeftWidth, rec3.Y + rec3.Height, TableWidth, rec4Height );
  17768. g.DrawRectangle( p, rec4 );//画标题矩形
  17769. #region 服务项目
  17770. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "服务项目:" );
  17771. sizef = g.MeasureString( recValue, ft10 );
  17772. StrHeigth = Convert.ToInt32( sizef.Height );
  17773. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  17774. Rectangle rec4_A1 = new Rectangle( rec4.X + LeftAdd, rec4.Y + TopAdd, StrWidth, StrHeigth );
  17775. g.DrawString( recValue, ft10, b, rec4_A1 );
  17776. #endregion
  17777. #region 项目内容
  17778. Rectangle rec4_A2 = new Rectangle( rec3_A1.X + rec3_A1.Width, rec4.Y + TopAdd, TableWidth - rec4_A1.Width - LeftAdd, rec4Height - TopAdd * 2 );
  17779. g.DrawString( recValue3.TrimEnd( 'n', '/', 'r', '/' ), ft10, b, rec4_A2 );
  17780. #endregion
  17781. #endregion
  17782. #region 备注
  17783. recValue = "测试:";
  17784. sizef = g.MeasureString( recValue, ft10 );
  17785. StrHeigth = Convert.ToInt32( sizef.Height );
  17786. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  17787. Rectangle rec5 = new Rectangle( LeftWidth, rec4.Y + rec4.Height, TableWidth, StrHeigth * 3 + TopAdd );
  17788. g.DrawRectangle( p, rec5 );//画标题矩形
  17789. #region 备注
  17790. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "备 注:" );
  17791. sizef = g.MeasureString( recValue, ft10 );
  17792. StrHeigth = Convert.ToInt32( sizef.Height );
  17793. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  17794. Rectangle rec5_A1 = new Rectangle( rec5.X + LeftAdd, rec5.Y + TopAdd, StrWidth, StrHeigth );
  17795. g.DrawString( recValue, ft10, b, rec5_A1 );
  17796. #endregion
  17797. #region 项目内容
  17798. //int IntCout = 3;
  17799. recValue = tbl_order.Rows[0]["Dsro_Remark"].ToString().Trim();
  17800. sizef = g.MeasureString( recValue, ft10 );
  17801. StrHeigth = Convert.ToInt32( sizef.Height );
  17802. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  17803. Rectangle rec5_A2 = new Rectangle( rec3_A1.X + rec3_A1.Width, rec5.Y + TopAdd, rec4_A2.Width, StrHeigth * 3 );
  17804. g.DrawString( recValue, ft10, b, rec5_A2 );
  17805. #endregion
  17806. #endregion
  17807. #region 注意事项
  17808. string recValue2 = "";
  17809. if ( PrintOtherData.ContainsKey( "礼服单说明" ) && PrintOtherData["礼服单说明"].ToString().Trim().Length > 0 )
  17810. {
  17811. recValue2 = PrintOtherData["礼服单说明"].ToString().Trim();
  17812. sizef = g.MeasureString( recValue2, ft10 );
  17813. sizef.Height = 280;
  17814. }
  17815. else
  17816. {
  17817. sizef = g.MeasureString( "测试", ft10 );
  17818. sizef.Height = 280;
  17819. }
  17820. int StrHeigth2 = Convert.ToInt32( sizef.Height );
  17821. int StrWidth2 = Convert.ToInt32( sizef.Width ) + 5;
  17822. Rectangle rec6 = new Rectangle( LeftWidth, rec5.Y + rec5.Height, TableWidth, StrHeigth2 + (TopAdd * 3) / 2 );
  17823. g.DrawRectangle( p, rec6 );//画标题矩形
  17824. #region 事项说明
  17825. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "注意事项:" );
  17826. sizef = g.MeasureString( recValue, ft10 );
  17827. StrHeigth = Convert.ToInt32( sizef.Height );
  17828. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  17829. Rectangle rec6_A1 = new Rectangle( rec6.X + LeftAdd, rec6.Y + TopAdd, StrWidth, StrHeigth );
  17830. g.DrawString( recValue, ft10, b, rec6_A1 );
  17831. Rectangle rec6_A2 = new Rectangle( rec6_A1.X + rec6_A1.Width, rec6.Y + TopAdd, rec4_A2.Width, StrHeigth2 );
  17832. g.DrawString( recValue2, ft10, b, rec6_A2 );
  17833. #endregion
  17834. #endregion
  17835. #region 尾
  17836. Rectangle rec7 = new Rectangle( LeftWidth, rec6.Y + rec6.Height, TableWidth, 65 );
  17837. g.DrawRectangle( p, rec7 );//画标题矩形
  17838. #region 第一行
  17839. #region 本店电话
  17840. string StrPhone = tbl.Rows[0]["Company_Telephone"].ToString().Trim();
  17841. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "本店电话:" ) + StrPhone;
  17842. sizef = g.MeasureString( recValue, ft10 );
  17843. StrHeigth = Convert.ToInt32( sizef.Height );
  17844. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  17845. Rectangle rec7_B1 = new Rectangle( TableWidth + LeftWidth - 20 - StrWidth, rec7.Y + TopAdd, StrWidth, StrHeigth );
  17846. g.DrawString( recValue, ft10, b, rec7_B1 );
  17847. 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 ) );
  17848. #endregion
  17849. #region 本店地址
  17850. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "本店地址:" ) + tbl.Rows[0]["Company_Address"].ToString().Trim();
  17851. sizef = g.MeasureString( recValue, ft10 );
  17852. StrHeigth = Convert.ToInt32( sizef.Height );
  17853. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  17854. Rectangle rec7_A1 = new Rectangle( rec7.X + LeftAdd, rec7.Y + TopAdd, TableWidth - LeftWidth - rec7_B1.Width - 20, StrHeigth );
  17855. g.DrawString( recValue, ft10, b, rec7_A1 );
  17856. 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 ) );
  17857. #endregion
  17858. #endregion
  17859. #region 第二行
  17860. #region 客户地址
  17861. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "客户地址:" ) + tbl_Cus.Rows[0]["Cus_Address"].ToString().Trim();
  17862. sizef = g.MeasureString( recValue, ft10 );
  17863. StrHeigth = Convert.ToInt32( sizef.Height );
  17864. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  17865. Rectangle rec7_E1 = new Rectangle( rec7_A1.X, rec7_B1.Y + rec7_B1.Height + TopAdd, StrWidth, StrHeigth );
  17866. g.DrawString( recValue, ft10, b, rec7_E1 );
  17867. 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 ) );
  17868. #endregion
  17869. #region 客户签名
  17870. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "客户签名:" );
  17871. sizef = g.MeasureString( recValue, ft10 );
  17872. StrHeigth = Convert.ToInt32( sizef.Height );
  17873. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  17874. Rectangle rec7_F1 = new Rectangle( rec7_B1.X, rec7_E1.Y, StrWidth, StrHeigth );
  17875. g.DrawString( recValue, ft10, b, rec7_F1 );
  17876. 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 ) );
  17877. #endregion
  17878. #endregion
  17879. #endregion
  17880. }
  17881. /// <summary>
  17882. /// 礼服管理——出售清单A4打印
  17883. /// </summary>
  17884. /// <returns></returns>
  17885. public static void Dresses_SoldGownsList_A4Print( object objValue, Graphics g, Size size )
  17886. {
  17887. string ExecuteSql = orbll.GetView_CustomReturnExecuteSql( "tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Address,Company_Telephone" );
  17888. ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql( "tb_ErpDressSaleRentalOrder", StrWhere: "Dsro_Number = '" + objValue.ToString().Trim() + "'" );
  17889. 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() + "'";
  17890. DataSet dtSet = orbll.GetView_Custom( ExecuteSql );
  17891. DataTable tbl = dtSet.Tables["ds"];//获取影楼信息
  17892. DataTable tbl_order = dtSet.Tables["ds1"];
  17893. DataTable tbl_Detail = dtSet.Tables["ds2"];
  17894. if ( tbl.Rows.Count <= 0 )
  17895. {
  17896. MessageBoxCustom.Show( "未设置影楼信息" ); return;
  17897. }
  17898. if ( tbl_order.Rows.Count <= 0 )
  17899. {
  17900. MessageBoxCustom.Show( "订单" + objValue.ToString().Trim() + "不存在" ); return;
  17901. }
  17902. 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];
  17903. Font ft18 = new Font( "宋体", 18 );
  17904. Font ft10 = new Font( "宋体", 10 );
  17905. Font ft9 = new Font( "宋体", 9 );
  17906. Brush b = Brushes.Black;
  17907. Pen p = GetPen;
  17908. int LeftWidth = 50;
  17909. int TableWidth = size.Width - LeftWidth * 2 + 30;
  17910. int LeftAdd = 3;
  17911. int TopAdd = 10;
  17912. //金色童年收据凭据
  17913. SizeF sizef = g.MeasureString( DefaultPrintTitle, ft18 );
  17914. int StrHeigth = Convert.ToInt32( sizef.Height );
  17915. int StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  17916. Rectangle rec1 = new Rectangle( size.Width / 2 - StrWidth / 2, 50, StrWidth, StrHeigth );
  17917. g.DrawString( DefaultPrintTitle, ft18, b, rec1 );
  17918. string SinglePerson = "接单人:" + LYFZ.DAL.DAL_ErpUser.GetUserIDToUserName( tbl_order.Rows[0]["Dsro_CreateName"].ToString_s() ); //2017-03-30 刘工添加
  17919. string recValue = LYFZ.BLL.OtherCommonModel.FontConversion( SinglePerson + " " + "出售单号:" ) + objValue.ToString().Trim();
  17920. // string recValue = LYFZ.BLL.OtherCommonModel.FontConversion("出售单号:") + objValue.ToString().Trim();
  17921. sizef = g.MeasureString( recValue, ft9 );
  17922. StrHeigth = Convert.ToInt32( sizef.Height );
  17923. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  17924. Rectangle rec2 = new Rectangle( TableWidth + LeftWidth - StrWidth, rec1.Y + rec1.Height + 15 - StrHeigth, StrWidth, StrHeigth );
  17925. g.DrawString( recValue, ft9, b, rec2 );
  17926. Rectangle rec3 = new Rectangle( LeftWidth, rec2.Y + rec2.Height, TableWidth, 60 );
  17927. g.DrawRectangle( p, rec3 );//画标题矩形
  17928. #region 第一行
  17929. #region 姓名
  17930. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名:" );
  17931. sizef = g.MeasureString( recValue, ft10 );
  17932. StrHeigth = Convert.ToInt32( sizef.Height );
  17933. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  17934. Rectangle rec3_A1 = new Rectangle( rec3.X + LeftAdd, rec3.Y + TopAdd, StrWidth, StrHeigth );
  17935. g.DrawString( recValue, ft10, b, rec3_A1 );
  17936. recValue = tbl_Cus.Rows[0]["Cus_Name"].ToString().Trim();
  17937. Rectangle rec3_A2 = new Rectangle( rec3_A1.X + rec3_A1.Width, rec3.Y + TopAdd, rec3_A1.X + rec3_A1.Width + 100, StrHeigth );
  17938. g.DrawString( recValue, ft10, b, rec3_A2 );
  17939. 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 ) );
  17940. #endregion
  17941. #region 电话
  17942. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "客户电话:" );
  17943. sizef = g.MeasureString( recValue, ft10 );
  17944. StrHeigth = Convert.ToInt32( sizef.Height );
  17945. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  17946. Rectangle rec3_B1 = new Rectangle( rec3_A2.X + rec3_A2.Y + 80, rec3.Y + TopAdd, StrWidth, StrHeigth );
  17947. g.DrawString( recValue, ft10, b, rec3_B1 );
  17948. recValue = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( tbl_Cus.Rows[0]["Cus_Telephone"] );
  17949. Rectangle rec3_B2 = new Rectangle( rec3_B1.X + rec3_B1.Width, rec3.Y + TopAdd, rec3_B1.X + rec3_B1.Width + 100, StrHeigth );
  17950. g.DrawString( recValue, ft10, b, rec3_B2 );
  17951. 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 ) );
  17952. #endregion
  17953. #region 租金
  17954. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "出售金额:" );
  17955. sizef = g.MeasureString( recValue, ft10 );
  17956. StrHeigth = Convert.ToInt32( sizef.Height );
  17957. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  17958. Rectangle rec3_C1 = new Rectangle( rec3_B2.X + rec3_B2.Y + 80, rec3.Y + TopAdd, StrWidth, StrHeigth );
  17959. g.DrawString( recValue, ft10, b, rec3_C1 );
  17960. recValue = tbl_order.Rows[0]["Dsro_Amount"].ToString().Trim();
  17961. Rectangle rec3_C2 = new Rectangle( rec3_C1.X + rec3_C1.Width, rec3.Y + TopAdd, rec3_C1.X + rec3_C1.Width + 100, StrHeigth );
  17962. g.DrawString( recValue, ft10, b, rec3_C2 );
  17963. 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 ) );
  17964. #endregion
  17965. #endregion
  17966. #region 第二行
  17967. #region 结婚日期
  17968. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "结婚日期:" );
  17969. sizef = g.MeasureString( recValue, ft10 );
  17970. StrHeigth = Convert.ToInt32( sizef.Height );
  17971. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  17972. Rectangle rec3_E1 = new Rectangle( rec3.X + LeftAdd, rec3_A2.Y + rec3_A2.Height + TopAdd, StrWidth, StrHeigth );
  17973. g.DrawString( recValue, ft10, b, rec3_E1 );
  17974. if ( tbl_Cus.Rows[0]["Cus_DayForMarriage"].ToString().Trim() != "" )
  17975. {
  17976. recValue = Convert.ToDateTime( tbl_Cus.Rows[0]["Cus_DayForMarriage"] ).ToString( "yyyy-MM-dd" );
  17977. }
  17978. else { recValue = ""; }
  17979. Rectangle rec3_E2 = new Rectangle( rec3_A1.X + rec3_A1.Width, rec3_E1.Y, rec3_A1.X + rec3_A1.Width + 250, StrHeigth );
  17980. g.DrawString( recValue, ft10, b, rec3_E2 );
  17981. 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 ) );
  17982. #endregion
  17983. #region 预定日期
  17984. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "预定日期:" );
  17985. sizef = g.MeasureString( recValue, ft10 );
  17986. StrHeigth = Convert.ToInt32( sizef.Height );
  17987. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  17988. Rectangle rec3_F1 = new Rectangle( rec3_B1.X, rec3_E1.Y, StrWidth, StrHeigth );
  17989. g.DrawString( recValue, ft10, b, rec3_F1 );
  17990. if ( tbl_order.Rows[0]["Dsro_CreateDateTime"].ToString().Trim() != "" )
  17991. {
  17992. recValue = Convert.ToDateTime( tbl_order.Rows[0]["Dsro_CreateDateTime"] ).ToString( "yyyy-MM-dd" );
  17993. }
  17994. else { recValue = ""; }
  17995. Rectangle rec3_F2 = new Rectangle( rec3_F1.X + rec3_F1.Width, rec3_E2.Y, rec3_B2.Width, StrHeigth );
  17996. g.DrawString( recValue, ft10, b, rec3_F2 );
  17997. 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 ) );
  17998. #endregion
  17999. #region 取衣日期
  18000. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "取衣日期:" );
  18001. sizef = g.MeasureString( recValue, ft10 );
  18002. StrHeigth = Convert.ToInt32( sizef.Height );
  18003. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18004. Rectangle rec3_G1 = new Rectangle( rec3_C1.X, rec3_F1.Y, StrWidth, StrHeigth );
  18005. g.DrawString( recValue, ft10, b, rec3_G1 );
  18006. if ( tbl_order.Rows[0]["Dsro_TakeDressTime"].ToString().Trim() != "" )
  18007. {
  18008. recValue = Convert.ToDateTime( tbl_order.Rows[0]["Dsro_TakeDressTime"] ).ToString( "yyyy-MM-dd" );
  18009. }
  18010. else { recValue = ""; }
  18011. Rectangle rec3_G2 = new Rectangle( rec3_G1.X + rec3_G1.Width, rec3_E2.Y, rec3_C2.Width, StrHeigth );
  18012. g.DrawString( recValue, ft10, b, rec3_G2 );
  18013. 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 ) );
  18014. #endregion
  18015. #endregion
  18016. #region 服务项
  18017. string recValue3 = "";
  18018. for ( int i = 0; i < tbl_Detail.Rows.Count; i++ )
  18019. {
  18020. 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";
  18021. }
  18022. sizef = g.MeasureString( recValue3.TrimEnd( 'n', '/', 'r', '/' ), ft10 );
  18023. int StrHeigth3 = 0;
  18024. int rec4Height = 0;
  18025. if ( tbl_Detail.Rows.Count > 13 )
  18026. {
  18027. StrHeigth3 = Convert.ToInt32( sizef.Height );
  18028. rec4Height = StrHeigth3 + TopAdd;
  18029. if ( rec4Height < 400 )
  18030. {
  18031. rec4Height = 400;
  18032. }
  18033. }
  18034. else
  18035. {
  18036. StrHeigth3 = StrHeigth;
  18037. rec4Height = 400;
  18038. }
  18039. int StrWidth3 = Convert.ToInt32( sizef.Width ) + 5;
  18040. Rectangle rec4 = new Rectangle( LeftWidth, rec3.Y + rec3.Height, TableWidth, rec4Height );
  18041. g.DrawRectangle( p, rec4 );//画标题矩形
  18042. #region 服务项目
  18043. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "服务项目:" );
  18044. sizef = g.MeasureString( recValue, ft10 );
  18045. StrHeigth = Convert.ToInt32( sizef.Height );
  18046. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18047. Rectangle rec4_A1 = new Rectangle( rec4.X + LeftAdd, rec4.Y + TopAdd, StrWidth, StrHeigth );
  18048. g.DrawString( recValue, ft10, b, rec4_A1 );
  18049. #endregion
  18050. #region 项目内容
  18051. Rectangle rec4_A2 = new Rectangle( rec3_A1.X + rec3_A1.Width, rec4.Y + TopAdd, TableWidth - rec4_A1.Width - LeftAdd, rec4Height );
  18052. g.DrawString( recValue3.TrimEnd( 'n', '/', 'r', '/' ), ft10, b, rec4_A2 );
  18053. #endregion
  18054. #endregion
  18055. #region 备注
  18056. recValue = "测试:";
  18057. sizef = g.MeasureString( recValue, ft10 );
  18058. StrHeigth = Convert.ToInt32( sizef.Height );
  18059. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18060. Rectangle rec5 = new Rectangle( LeftWidth, rec4.Y + rec4.Height, TableWidth, StrHeigth * 2 + TopAdd );
  18061. g.DrawRectangle( p, rec5 );//画标题矩形
  18062. #region 备注
  18063. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "备 注:" );
  18064. sizef = g.MeasureString( recValue, ft10 );
  18065. StrHeigth = Convert.ToInt32( sizef.Height );
  18066. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18067. Rectangle rec5_A1 = new Rectangle( rec5.X + LeftAdd, rec5.Y + TopAdd, StrWidth, StrHeigth );
  18068. g.DrawString( recValue, ft10, b, rec5_A1 );
  18069. #endregion
  18070. #region 项目内容
  18071. recValue = tbl_order.Rows[0]["Dsro_Remark"].ToString().Trim();
  18072. sizef = g.MeasureString( recValue, ft10 );
  18073. StrHeigth = Convert.ToInt32( sizef.Height );
  18074. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18075. Rectangle rec5_A2 = new Rectangle( rec3_A1.X + rec3_A1.Width, rec5.Y + TopAdd, rec4_A2.Width, StrHeigth * 2 );
  18076. g.DrawString( recValue, ft10, b, rec5_A2 );
  18077. #endregion
  18078. #endregion
  18079. #region 注意事项
  18080. string recValue2 = "";
  18081. if ( PrintOtherData.ContainsKey( "礼服单说明" ) && PrintOtherData["礼服单说明"].ToString().Trim().Length > 0 )
  18082. {
  18083. recValue2 = PrintOtherData["礼服单说明"].ToString().Trim();
  18084. sizef = g.MeasureString( recValue2, ft10 );
  18085. sizef.Height = 280;
  18086. }
  18087. else
  18088. {
  18089. sizef = g.MeasureString( "测试", ft10 );
  18090. sizef.Height = 280;
  18091. }
  18092. int StrHeigth2 = Convert.ToInt32( sizef.Height );
  18093. int StrWidth2 = Convert.ToInt32( sizef.Width ) + 5;
  18094. Rectangle rec6 = new Rectangle( LeftWidth, rec5.Y + rec5.Height, TableWidth, StrHeigth2 + (TopAdd * 3) / 2 );
  18095. g.DrawRectangle( p, rec6 );//画标题矩形
  18096. #region 事项说明
  18097. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "注意事项:" );
  18098. sizef = g.MeasureString( recValue, ft10 );
  18099. StrHeigth = Convert.ToInt32( sizef.Height );
  18100. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18101. Rectangle rec6_A1 = new Rectangle( rec6.X + LeftAdd, rec6.Y + TopAdd, StrWidth, StrHeigth );
  18102. g.DrawString( recValue, ft10, b, rec6_A1 );
  18103. Rectangle rec6_A2 = new Rectangle( rec6_A1.X + rec6_A1.Width, rec6.Y + TopAdd, rec4_A2.Width, StrHeigth2 );
  18104. g.DrawString( recValue2, ft10, b, rec6_A2 );
  18105. #endregion
  18106. #endregion
  18107. #region 尾
  18108. Rectangle rec7 = new Rectangle( LeftWidth, rec6.Y + rec6.Height, TableWidth, 65 );
  18109. g.DrawRectangle( p, rec7 );//画标题矩形
  18110. #region 第一行
  18111. #region 本店电话
  18112. string StrPhone = tbl.Rows[0]["Company_Telephone"].ToString().Trim();
  18113. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "本店电话:" ) + StrPhone;
  18114. sizef = g.MeasureString( recValue, ft10 );
  18115. StrHeigth = Convert.ToInt32( sizef.Height );
  18116. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18117. Rectangle rec7_B1 = new Rectangle( TableWidth + LeftWidth - 20 - StrWidth, rec7.Y + TopAdd, StrWidth, StrHeigth );
  18118. g.DrawString( recValue, ft10, b, rec7_B1 );
  18119. 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 ) );
  18120. #endregion
  18121. #region 本店地址
  18122. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "本店地址:" ) + tbl.Rows[0]["Company_Address"].ToString().Trim();
  18123. sizef = g.MeasureString( recValue, ft10 );
  18124. StrHeigth = Convert.ToInt32( sizef.Height );
  18125. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18126. Rectangle rec7_A1 = new Rectangle( rec7.X + LeftAdd, rec7.Y + TopAdd, TableWidth - LeftWidth - rec7_B1.Width - 20, StrHeigth );
  18127. g.DrawString( recValue, ft10, b, rec7_A1 );
  18128. 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 ) );
  18129. #endregion
  18130. #endregion
  18131. #region 第二行
  18132. #region 客户地址
  18133. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "客户地址:" ) + tbl_Cus.Rows[0]["Cus_Address"].ToString().Trim();
  18134. sizef = g.MeasureString( recValue, ft10 );
  18135. StrHeigth = Convert.ToInt32( sizef.Height );
  18136. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18137. Rectangle rec7_E1 = new Rectangle( rec7_A1.X, rec7_B1.Y + rec7_B1.Height + TopAdd, StrWidth, StrHeigth );
  18138. g.DrawString( recValue, ft10, b, rec7_E1 );
  18139. 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 ) );
  18140. #endregion
  18141. #region 客户签名
  18142. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "客户签名:" );
  18143. sizef = g.MeasureString( recValue, ft10 );
  18144. StrHeigth = Convert.ToInt32( sizef.Height );
  18145. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18146. Rectangle rec7_F1 = new Rectangle( rec7_B1.X, rec7_E1.Y, StrWidth, StrHeigth );
  18147. g.DrawString( recValue, ft10, b, rec7_F1 );
  18148. 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 ) );
  18149. #endregion
  18150. #endregion
  18151. #endregion
  18152. }
  18153. /// <summary>
  18154. /// 礼服管理——出售清单打印
  18155. /// </summary>
  18156. /// <returns></returns>
  18157. public static void Dresses_SoldGownsList_Print( object objValue, Graphics g, Size size )
  18158. {
  18159. string ExecuteSql = orbll.GetView_CustomReturnExecuteSql( "tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Address,Company_Telephone" );
  18160. ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql( "tb_ErpDressSaleRentalOrder", StrWhere: "Dsro_Number = '" + objValue.ToString().Trim() + "'" );
  18161. 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() + "'";
  18162. DataSet dtSet = orbll.GetView_Custom( ExecuteSql );
  18163. DataTable tbl = dtSet.Tables["ds"];//获取影楼信息
  18164. DataTable tbl_order = dtSet.Tables["ds1"];
  18165. DataTable tbl_Detail = dtSet.Tables["ds2"];
  18166. if ( tbl.Rows.Count <= 0 )
  18167. {
  18168. MessageBoxCustom.Show( "未设置影楼信息" ); return;
  18169. }
  18170. if ( tbl_order.Rows.Count <= 0 )
  18171. {
  18172. MessageBoxCustom.Show( "订单" + objValue.ToString().Trim() + "不存在" ); return;
  18173. }
  18174. 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];
  18175. Font ft18 = new Font( "宋体", 18 );
  18176. Font ft10 = new Font( "宋体", 10 );
  18177. Font ft9 = new Font( "宋体", 9 );
  18178. Brush b = Brushes.Black;
  18179. Pen p = GetPen;
  18180. int LeftWidth = 50;
  18181. int TableWidth = size.Width - LeftWidth * 2 + 30;
  18182. int LeftAdd = 3;
  18183. int TopAdd = 6;
  18184. //金色童年收据凭据
  18185. SizeF sizef = g.MeasureString( DefaultPrintTitle, ft18 );
  18186. int StrHeigth = Convert.ToInt32( sizef.Height );
  18187. int StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18188. Rectangle rec1 = new Rectangle( size.Width / 2 - StrWidth / 2, 50, StrWidth, StrHeigth );
  18189. g.DrawString( DefaultPrintTitle, ft18, b, rec1 );
  18190. string SinglePerson = "接单人:" + LYFZ.DAL.DAL_ErpUser.GetUserIDToUserName( tbl_order.Rows[0]["Dsro_CreateName"].ToString_s() ); //2017-03-30 刘工添加
  18191. string recValue = LYFZ.BLL.OtherCommonModel.FontConversion( SinglePerson + " " + "出售单号:" ) + objValue.ToString().Trim();
  18192. // string recValue = LYFZ.BLL.OtherCommonModel.FontConversion("出售单号:") + objValue.ToString().Trim();
  18193. sizef = g.MeasureString( recValue, ft9 );
  18194. StrHeigth = Convert.ToInt32( sizef.Height );
  18195. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18196. Rectangle rec2 = new Rectangle( TableWidth + LeftWidth - StrWidth, rec1.Y + rec1.Height + 15 - StrHeigth, StrWidth, StrHeigth );
  18197. g.DrawString( recValue, ft9, b, rec2 );
  18198. Rectangle rec3 = new Rectangle( LeftWidth, rec2.Y + rec2.Height, TableWidth, 50 );
  18199. g.DrawRectangle( p, rec3 );//画标题矩形
  18200. #region 第一行
  18201. #region 姓名
  18202. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名:" );
  18203. sizef = g.MeasureString( recValue, ft10 );
  18204. StrHeigth = Convert.ToInt32( sizef.Height );
  18205. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18206. Rectangle rec3_A1 = new Rectangle( rec3.X + LeftAdd, rec3.Y + TopAdd, StrWidth, StrHeigth );
  18207. g.DrawString( recValue, ft10, b, rec3_A1 );
  18208. recValue = tbl_Cus.Rows[0]["Cus_Name"].ToString().Trim();
  18209. Rectangle rec3_A2 = new Rectangle( rec3_A1.X + rec3_A1.Width, rec3.Y + TopAdd, rec3_A1.X + rec3_A1.Width + 100, StrHeigth );
  18210. g.DrawString( recValue, ft10, b, rec3_A2 );
  18211. 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 ) );
  18212. #endregion
  18213. #region 电话
  18214. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "客户电话:" );
  18215. sizef = g.MeasureString( recValue, ft10 );
  18216. StrHeigth = Convert.ToInt32( sizef.Height );
  18217. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18218. Rectangle rec3_B1 = new Rectangle( rec3_A2.X + rec3_A2.Y + 80, rec3.Y + TopAdd, StrWidth, StrHeigth );
  18219. g.DrawString( recValue, ft10, b, rec3_B1 );
  18220. recValue = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( tbl_Cus.Rows[0]["Cus_Telephone"] );
  18221. Rectangle rec3_B2 = new Rectangle( rec3_B1.X + rec3_B1.Width, rec3.Y + TopAdd, rec3_B1.X + rec3_B1.Width + 100, StrHeigth );
  18222. g.DrawString( recValue, ft10, b, rec3_B2 );
  18223. 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 ) );
  18224. #endregion
  18225. #region 租金
  18226. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "出售金额:" );
  18227. sizef = g.MeasureString( recValue, ft10 );
  18228. StrHeigth = Convert.ToInt32( sizef.Height );
  18229. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18230. Rectangle rec3_C1 = new Rectangle( rec3_B2.X + rec3_B2.Y + 80, rec3.Y + TopAdd, StrWidth, StrHeigth );
  18231. g.DrawString( recValue, ft10, b, rec3_C1 );
  18232. recValue = tbl_order.Rows[0]["Dsro_Amount"].ToString().Trim();
  18233. Rectangle rec3_C2 = new Rectangle( rec3_C1.X + rec3_C1.Width, rec3.Y + TopAdd, rec3_C1.X + rec3_C1.Width + 100, StrHeigth );
  18234. g.DrawString( recValue, ft10, b, rec3_C2 );
  18235. 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 ) );
  18236. #endregion
  18237. #endregion
  18238. #region 第二行
  18239. #region 结婚日期
  18240. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "结婚日期:" );
  18241. sizef = g.MeasureString( recValue, ft10 );
  18242. StrHeigth = Convert.ToInt32( sizef.Height );
  18243. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18244. Rectangle rec3_E1 = new Rectangle( rec3.X + LeftAdd, rec3_A2.Y + rec3_A2.Height + TopAdd, StrWidth, StrHeigth );
  18245. g.DrawString( recValue, ft10, b, rec3_E1 );
  18246. if ( tbl_Cus.Rows[0]["Cus_DayForMarriage"].ToString().Trim() != "" )
  18247. {
  18248. recValue = Convert.ToDateTime( tbl_Cus.Rows[0]["Cus_DayForMarriage"] ).ToString( "yyyy-MM-dd" );
  18249. }
  18250. else { recValue = ""; }
  18251. Rectangle rec3_E2 = new Rectangle( rec3_A1.X + rec3_A1.Width, rec3_E1.Y, rec3_A1.X + rec3_A1.Width + 250, StrHeigth );
  18252. g.DrawString( recValue, ft10, b, rec3_E2 );
  18253. 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 ) );
  18254. #endregion
  18255. #region 预定日期
  18256. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "预定日期:" );
  18257. sizef = g.MeasureString( recValue, ft10 );
  18258. StrHeigth = Convert.ToInt32( sizef.Height );
  18259. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18260. Rectangle rec3_F1 = new Rectangle( rec3_B1.X, rec3_E1.Y, StrWidth, StrHeigth );
  18261. g.DrawString( recValue, ft10, b, rec3_F1 );
  18262. if ( tbl_order.Rows[0]["Dsro_CreateDateTime"].ToString().Trim() != "" )
  18263. {
  18264. recValue = Convert.ToDateTime( tbl_order.Rows[0]["Dsro_CreateDateTime"] ).ToString( "yyyy-MM-dd" );
  18265. }
  18266. else { recValue = ""; }
  18267. Rectangle rec3_F2 = new Rectangle( rec3_F1.X + rec3_F1.Width, rec3_E2.Y, rec3_B2.Width, StrHeigth );
  18268. g.DrawString( recValue, ft10, b, rec3_F2 );
  18269. 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 ) );
  18270. #endregion
  18271. #region 取衣日期
  18272. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "取衣日期:" );
  18273. sizef = g.MeasureString( recValue, ft10 );
  18274. StrHeigth = Convert.ToInt32( sizef.Height );
  18275. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18276. Rectangle rec3_G1 = new Rectangle( rec3_C1.X, rec3_F1.Y, StrWidth, StrHeigth );
  18277. g.DrawString( recValue, ft10, b, rec3_G1 );
  18278. if ( tbl_order.Rows[0]["Dsro_TakeDressTime"].ToString().Trim() != "" )
  18279. {
  18280. recValue = Convert.ToDateTime( tbl_order.Rows[0]["Dsro_TakeDressTime"] ).ToString( "yyyy-MM-dd" );
  18281. }
  18282. else { recValue = ""; }
  18283. Rectangle rec3_G2 = new Rectangle( rec3_G1.X + rec3_G1.Width, rec3_E2.Y, rec3_C2.Width, StrHeigth );
  18284. g.DrawString( recValue, ft10, b, rec3_G2 );
  18285. 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 ) );
  18286. #endregion
  18287. #endregion
  18288. #region 服务项
  18289. string recValue3 = "";
  18290. for ( int i = 0; i < tbl_Detail.Rows.Count; i++ )
  18291. {
  18292. 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";
  18293. }
  18294. sizef = g.MeasureString( recValue3.TrimEnd( 'n', '/', 'r', '/' ), ft10 );
  18295. int StrHeigth3 = 0;
  18296. int rec4Height = 0;
  18297. if ( tbl_Detail.Rows.Count > 13 )
  18298. {
  18299. StrHeigth3 = Convert.ToInt32( sizef.Height );
  18300. rec4Height = StrHeigth3 + TopAdd;
  18301. }
  18302. else
  18303. {
  18304. StrHeigth3 = StrHeigth;
  18305. rec4Height = 236;
  18306. }
  18307. int StrWidth3 = Convert.ToInt32( sizef.Width ) + 5;
  18308. Rectangle rec4 = new Rectangle( LeftWidth, rec3.Y + rec3.Height, TableWidth, rec4Height );
  18309. g.DrawRectangle( p, rec4 );//画标题矩形
  18310. #region 服务项目
  18311. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "服务项目:" );
  18312. sizef = g.MeasureString( recValue, ft10 );
  18313. StrHeigth = Convert.ToInt32( sizef.Height );
  18314. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18315. Rectangle rec4_A1 = new Rectangle( rec4.X + LeftAdd, rec4.Y + TopAdd, StrWidth, StrHeigth );
  18316. g.DrawString( recValue, ft10, b, rec4_A1 );
  18317. #endregion
  18318. #region 项目内容
  18319. Rectangle rec4_A2 = new Rectangle( rec3_A1.X + rec3_A1.Width, rec4.Y + TopAdd, TableWidth - rec4_A1.Width - LeftAdd, rec4Height );
  18320. g.DrawString( recValue3.TrimEnd( 'n', '/', 'r', '/' ), ft10, b, rec4_A2 );
  18321. #endregion
  18322. #endregion
  18323. #region 备注
  18324. recValue = "测试:";
  18325. sizef = g.MeasureString( recValue, ft10 );
  18326. StrHeigth = Convert.ToInt32( sizef.Height );
  18327. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18328. Rectangle rec5 = new Rectangle( LeftWidth, rec4.Y + rec4.Height, TableWidth, StrHeigth * 2 + TopAdd );
  18329. g.DrawRectangle( p, rec5 );//画标题矩形
  18330. #region 备注
  18331. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "备 注:" );
  18332. sizef = g.MeasureString( recValue, ft10 );
  18333. StrHeigth = Convert.ToInt32( sizef.Height );
  18334. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18335. Rectangle rec5_A1 = new Rectangle( rec5.X + LeftAdd, rec5.Y + TopAdd, StrWidth, StrHeigth );
  18336. g.DrawString( recValue, ft10, b, rec5_A1 );
  18337. #endregion
  18338. #region 项目内容
  18339. recValue = tbl_order.Rows[0]["Dsro_Remark"].ToString().Trim();
  18340. sizef = g.MeasureString( recValue, ft10 );
  18341. StrHeigth = Convert.ToInt32( sizef.Height );
  18342. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18343. Rectangle rec5_A2 = new Rectangle( rec3_A1.X + rec3_A1.Width, rec5.Y + TopAdd, rec4_A2.Width, StrHeigth * 2 );
  18344. g.DrawString( recValue, ft10, b, rec5_A2 );
  18345. #endregion
  18346. #endregion
  18347. #region 注意事项
  18348. string recValue2 = "";
  18349. if ( PrintOtherData.ContainsKey( "礼服单说明" ) && PrintOtherData["礼服单说明"].ToString().Trim().Length > 0 )
  18350. {
  18351. recValue2 = PrintOtherData["礼服单说明"].ToString().Trim();
  18352. sizef = g.MeasureString( recValue2, ft10 );
  18353. }
  18354. else
  18355. {
  18356. sizef = g.MeasureString( "测试", ft10 );
  18357. }
  18358. int StrHeigth2 = Convert.ToInt32( sizef.Height );
  18359. int StrWidth2 = Convert.ToInt32( sizef.Width ) + 5;
  18360. Rectangle rec6 = new Rectangle( LeftWidth, rec5.Y + rec5.Height, TableWidth, StrHeigth2 + (TopAdd * 3) / 2 );
  18361. g.DrawRectangle( p, rec6 );//画标题矩形
  18362. #region 事项说明
  18363. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "注意事项:" );
  18364. sizef = g.MeasureString( recValue, ft10 );
  18365. StrHeigth = Convert.ToInt32( sizef.Height );
  18366. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18367. Rectangle rec6_A1 = new Rectangle( rec6.X + LeftAdd, rec6.Y + TopAdd, StrWidth, StrHeigth );
  18368. g.DrawString( recValue, ft10, b, rec6_A1 );
  18369. Rectangle rec6_A2 = new Rectangle( rec6_A1.X + rec6_A1.Width, rec6.Y + TopAdd, rec4_A2.Width, StrHeigth2 );
  18370. g.DrawString( recValue2, ft10, b, rec6_A2 );
  18371. #endregion
  18372. #endregion
  18373. #region 尾
  18374. Rectangle rec7 = new Rectangle( LeftWidth, rec6.Y + rec6.Height, TableWidth, 55 );
  18375. g.DrawRectangle( p, rec7 );//画标题矩形
  18376. #region 第一行
  18377. #region 本店电话
  18378. string StrPhone = tbl.Rows[0]["Company_Telephone"].ToString().Trim();
  18379. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "本店电话:" ) + StrPhone;
  18380. sizef = g.MeasureString( recValue, ft10 );
  18381. StrHeigth = Convert.ToInt32( sizef.Height );
  18382. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18383. Rectangle rec7_B1 = new Rectangle( TableWidth + LeftWidth - 20 - StrWidth, rec7.Y + TopAdd, StrWidth, StrHeigth );
  18384. g.DrawString( recValue, ft10, b, rec7_B1 );
  18385. 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 ) );
  18386. #endregion
  18387. #region 本店地址
  18388. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "本店地址:" ) + tbl.Rows[0]["Company_Address"].ToString().Trim();
  18389. sizef = g.MeasureString( recValue, ft10 );
  18390. StrHeigth = Convert.ToInt32( sizef.Height );
  18391. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18392. Rectangle rec7_A1 = new Rectangle( rec7.X + LeftAdd, rec7.Y + TopAdd, TableWidth - LeftWidth - rec7_B1.Width - 20, StrHeigth );
  18393. g.DrawString( recValue, ft10, b, rec7_A1 );
  18394. 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 ) );
  18395. #endregion
  18396. #endregion
  18397. #region 第二行
  18398. #region 客户地址
  18399. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "客户地址:" ) + tbl_Cus.Rows[0]["Cus_Address"].ToString().Trim();
  18400. sizef = g.MeasureString( recValue, ft10 );
  18401. StrHeigth = Convert.ToInt32( sizef.Height );
  18402. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18403. Rectangle rec7_E1 = new Rectangle( rec7_A1.X, rec7_B1.Y + rec7_B1.Height + TopAdd, StrWidth, StrHeigth );
  18404. g.DrawString( recValue, ft10, b, rec7_E1 );
  18405. 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 ) );
  18406. #endregion
  18407. #region 客户签名
  18408. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "客户签名:" );
  18409. sizef = g.MeasureString( recValue, ft10 );
  18410. StrHeigth = Convert.ToInt32( sizef.Height );
  18411. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18412. Rectangle rec7_F1 = new Rectangle( rec7_B1.X, rec7_E1.Y, StrWidth, StrHeigth );
  18413. g.DrawString( recValue, ft10, b, rec7_F1 );
  18414. 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 ) );
  18415. #endregion
  18416. #endregion
  18417. #endregion
  18418. }
  18419. #endregion
  18420. #region 库存管理
  18421. /// <summary>
  18422. /// 库存管理——采购申请单
  18423. /// </summary>
  18424. /// <returns></returns>
  18425. public static void InventoryManagement_PurchaseRequisition_Print( object OrdNumber, Graphics g, Size size )
  18426. {
  18427. 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];
  18428. string StrTableName = "tb_ErpPurchaseProduct Left Join tb_ErpProduct on Prod_Number = Ppt_ProductNumber Left Join tb_ErpSystemCategory on Sc_ClassCode = Ppt_ProductCategory";
  18429. string StrColumnName = "Prod_Name,Sc_ClassName,Ppt_PurchaseQuantity,Ppt_PurchaseStatus,dbo.fn_CheckDateTime(Ppt_PurchaseTime) AS Ppt_PurchaseTime";
  18430. DataTable dtoroduct = orbll.GetView_Custom( StrTableName, StrWhere: "Ppt_PurchaseNumber = '" + OrdNumber.ToString().Trim() + "'", ShowColumnName: StrColumnName ).Tables[0];
  18431. Font ft18 = new Font( "宋体", 18 );
  18432. Font ft11 = new Font( "宋体", 11 );
  18433. Font ft9 = new Font( "宋体", 9 );
  18434. Brush b = Brushes.Black;
  18435. Pen p = GetPen;
  18436. int LeftWidth = 30;
  18437. int TableWidth = size.Width - LeftWidth * 2;
  18438. int LeftAdd = 3;
  18439. int TopAdd = 5;
  18440. int RowHeight = 25;
  18441. int RowContentHeight = 18;
  18442. #region 头
  18443. //金色童年收据凭据
  18444. SizeF sizef = g.MeasureString( DefaultPrintTitle, ft18 );
  18445. int StrHeigth = Convert.ToInt32( sizef.Height );
  18446. int StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18447. Rectangle rec1 = new Rectangle( (size.Width - StrWidth) / 2, 50, StrWidth, StrHeigth );
  18448. g.DrawString( DefaultPrintTitle, ft18, b, rec1 );
  18449. string recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "采购单号:" ) + dtorder.Rows[0]["Pord_PurchaseNumber"].ToString().Trim();
  18450. sizef = g.MeasureString( recValue, ft9 );
  18451. StrHeigth = Convert.ToInt32( sizef.Height );
  18452. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18453. Rectangle rec2 = new Rectangle( LeftWidth, rec1.Y + rec1.Height + 10, StrWidth, StrHeigth );
  18454. g.DrawString( recValue, ft9, b, rec2 );
  18455. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "申请人:" ) + dtorder.Rows[0]["User_Name"].ToString().Trim();
  18456. sizef = g.MeasureString( recValue, ft9 );
  18457. StrHeigth = Convert.ToInt32( sizef.Height );
  18458. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18459. Rectangle rec2_A1 = new Rectangle( TableWidth / 2 - StrWidth / 2, rec2.Y, StrWidth, StrHeigth );
  18460. g.DrawString( recValue, ft9, b, rec2_A1 );
  18461. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "申请时间:" ) + dtorder.Rows[0]["Pord_RequisitionTime"].ToString().Trim() + LYFZ.BLL.OtherCommonModel.FontConversion( " 页:" ) + "1/1";
  18462. sizef = g.MeasureString( recValue, ft9 );
  18463. StrHeigth = Convert.ToInt32( sizef.Height );
  18464. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18465. Rectangle rec2_A2 = new Rectangle( TableWidth + LeftWidth - StrWidth, rec2.Y, StrWidth, StrHeigth );
  18466. g.DrawString( recValue, ft9, b, rec2_A2 );
  18467. #endregion
  18468. #region 列标题
  18469. Rectangle rec3 = new Rectangle( LeftWidth, rec2.Y + rec2.Height, TableWidth, RowHeight );
  18470. g.DrawRectangle( p, rec3 );//画标题矩形
  18471. int ColumnWidth2 = TableWidth / 11;
  18472. int ColumnWidth3 = TableWidth / 5;
  18473. int ColumnWidth4 = TableWidth / 8;
  18474. int ColumnWidth5 = TableWidth / 5 - 20;
  18475. int ColumnWidth1 = TableWidth - ColumnWidth2 - ColumnWidth3 - ColumnWidth4 - ColumnWidth5;
  18476. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "商品名称" );
  18477. sizef = g.MeasureString( recValue, ft11 );
  18478. StrHeigth = Convert.ToInt32( sizef.Height );
  18479. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18480. Rectangle rec3_A1 = new Rectangle( ColumnWidth1 / 2 - StrWidth / 2 + rec2.X, rec3.Y + TopAdd, ColumnWidth1, RowContentHeight );
  18481. g.DrawString( recValue, ft11, b, rec3_A1 );//画第一列的列标题
  18482. Point pA1_1 = new Point( rec3.X + ColumnWidth1, rec3.Y );
  18483. Point pA1_2 = new Point( rec3.X + ColumnWidth1, rec3.Y + rec3.Height );
  18484. g.DrawLine( p, pA1_1, pA1_2 );//画第一表与第二列的界线
  18485. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "数量" );
  18486. sizef = g.MeasureString( recValue, ft11 );
  18487. StrHeigth = Convert.ToInt32( sizef.Height );
  18488. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18489. Rectangle rec3_A2 = new Rectangle( ColumnWidth2 / 2 - StrWidth / 2 + pA1_1.X, rec3_A1.Y, ColumnWidth2, rec3_A1.Height );
  18490. g.DrawString( recValue, ft11, b, rec3_A2 );//画第一列的列标题
  18491. Point pA2_1 = new Point( pA1_1.X + ColumnWidth2, rec3.Y );
  18492. Point pA2_2 = new Point( pA1_1.X + ColumnWidth2, rec3.Y + rec3.Height );
  18493. g.DrawLine( p, pA2_1, pA2_2 );//画第一表与第二列的界线
  18494. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "商品类别" );
  18495. sizef = g.MeasureString( recValue, ft11 );
  18496. StrHeigth = Convert.ToInt32( sizef.Height );
  18497. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18498. Rectangle rec3_A3 = new Rectangle( ColumnWidth3 / 2 - StrWidth / 2 + pA2_1.X, rec3_A1.Y, ColumnWidth3, rec3_A1.Height );
  18499. g.DrawString( recValue, ft11, b, rec3_A3 );//画第一列的列标题
  18500. Point pA3_1 = new Point( pA2_1.X + ColumnWidth3, rec3.Y );
  18501. Point pA3_2 = new Point( pA2_1.X + ColumnWidth3, rec3.Y + rec3.Height );
  18502. g.DrawLine( p, pA3_1, pA3_2 );//画第一表与第二列的界线
  18503. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "采购状态" );
  18504. sizef = g.MeasureString( recValue, ft11 );
  18505. StrHeigth = Convert.ToInt32( sizef.Height );
  18506. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18507. Rectangle rec3_A4 = new Rectangle( ColumnWidth4 / 2 - StrWidth / 2 + pA3_1.X, rec3_A1.Y, ColumnWidth4, rec3_A1.Height );
  18508. g.DrawString( recValue, ft11, b, rec3_A4 );//画第一列的列标题
  18509. Point pA4_1 = new Point( pA3_1.X + ColumnWidth4, rec3.Y );
  18510. Point pA4_2 = new Point( pA3_1.X + ColumnWidth4, rec3.Y + rec3.Height );
  18511. g.DrawLine( p, pA4_1, pA4_2 );//画第一表与第二列的界线
  18512. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "采购时间" );
  18513. sizef = g.MeasureString( recValue, ft11 );
  18514. StrHeigth = Convert.ToInt32( sizef.Height );
  18515. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18516. Rectangle rec3_A5 = new Rectangle( ColumnWidth5 / 2 - StrWidth / 2 + pA4_1.X, rec3_A1.Y, ColumnWidth5, rec3_A1.Height );
  18517. g.DrawString( recValue, ft11, b, rec3_A5 );//画第一列的列标题
  18518. #endregion
  18519. #region 画内容
  18520. int ForRowHeight = 22;
  18521. int ForRowContentHeight = RowHeight - (TopAdd * 2);
  18522. int IntPoint_X = rec3.X;
  18523. int IntPoint_Y = rec3.Y + rec3.Height;
  18524. for ( int i = 0; i < dtoroduct.Rows.Count; i++ )
  18525. {
  18526. if ( i >= 44 )
  18527. {
  18528. break;
  18529. }
  18530. Rectangle recfor = new Rectangle( IntPoint_X, IntPoint_Y, TableWidth, ForRowHeight );
  18531. g.DrawRectangle( p, recfor );//画标题矩形
  18532. Rectangle recforA = new Rectangle( recfor.X + LeftAdd, recfor.Y + TopAdd, ColumnWidth1 - (LeftAdd * 2), ForRowContentHeight );
  18533. g.DrawString( dtoroduct.Rows[i]["Prod_Name"].ToString().Trim(), ft9, b, recforA );//画第一列的列标题
  18534. Point pforA_1 = new Point( recfor.X + ColumnWidth1, recfor.Y );
  18535. Point pforA_2 = new Point( recfor.X + ColumnWidth1, recfor.Y + recfor.Height );
  18536. g.DrawLine( p, pforA_1, pforA_2 );//画第一表与第二列的界线
  18537. Rectangle recforB = new Rectangle( pforA_1.X + LeftAdd, recfor.Y + TopAdd, ColumnWidth2 - (LeftAdd * 2), ForRowContentHeight );
  18538. g.DrawString( dtoroduct.Rows[i]["Ppt_PurchaseQuantity"].ToString().Trim(), ft9, b, recforB );//画第一列的列标题
  18539. Point pforB_1 = new Point( pA2_2.X, recfor.Y );
  18540. Point pforB_2 = new Point( pA2_2.X, recfor.Y + recfor.Height );
  18541. g.DrawLine( p, pforB_1, pforB_2 );//画第一表与第二列的界线
  18542. Rectangle recforC = new Rectangle( pforB_1.X + LeftAdd, recfor.Y + TopAdd, ColumnWidth3 - (LeftAdd * 2), ForRowContentHeight );
  18543. g.DrawString( dtoroduct.Rows[i]["Sc_ClassName"].ToString().Trim(), ft9, b, recforC );//画第一列的列标题
  18544. Point pforC_1 = new Point( pA3_2.X, recfor.Y );
  18545. Point pforC_2 = new Point( pA3_2.X, recfor.Y + recfor.Height );
  18546. g.DrawLine( p, pforC_1, pforC_2 );//画第一表与第二列的界线
  18547. Rectangle recforD = new Rectangle( pforC_1.X + LeftAdd, recfor.Y + TopAdd, ColumnWidth3 - (LeftAdd * 2), ForRowContentHeight );
  18548. g.DrawString( Enum.GetName( typeof( LYFZ.EnumPublic.Ppt_PurchaseStatus ), Convert.ToInt32( dtoroduct.Rows[i]["Ppt_PurchaseStatus"] ) ), ft9, b, recforD );//画第一列的列标题
  18549. Point pforD_1 = new Point( pA4_2.X, recfor.Y );
  18550. Point pforD_2 = new Point( pA4_2.X, recfor.Y + recfor.Height );
  18551. g.DrawLine( p, pforD_1, pforD_2 );//画第一表与第二列的界线
  18552. Rectangle recforE = new Rectangle( pforD_1.X + LeftAdd, recfor.Y + TopAdd, ColumnWidth3 - (LeftAdd * 2), ForRowContentHeight );
  18553. g.DrawString( LYFZ.Command.Command_Validate.DateTimeToString2( dtoroduct.Rows[i]["Ppt_PurchaseTime"] ), ft9, b, recforE );//画第一列的列标题
  18554. IntPoint_Y += recfor.Height;
  18555. }
  18556. #endregion
  18557. }
  18558. /// <summary>
  18559. /// 库存管理——库存采购单
  18560. /// </summary>
  18561. /// <returns></returns>
  18562. public static void InventoryManagement_PurchaseOrder_Print( object OrdNumber, Graphics g, Size size )
  18563. {
  18564. Font ft18 = new Font( "宋体", 18 );
  18565. Font ft9 = new Font( "宋体", 9 );
  18566. Brush b = Brushes.Black;
  18567. Pen p = GetPen;
  18568. int LeftWidth = 30;
  18569. int TableWidth = size.Width - LeftWidth * 2;
  18570. int LeftAdd = 3;
  18571. int TopAdd = 5;
  18572. int RowHeight = 25;
  18573. int RowContentHeight = 18;
  18574. string StrTableName = "tb_ErpPurchaseProduct Left Join tb_ErpProduct on Prod_Number = Ppt_ProductNumber Left Join tb_ErpSystemCategory on Sc_ClassCode = Ppt_ProductCategory";
  18575. string StrColumnName = "Prod_Number,Prod_Name,Prod_Class,Sc_ClassName,Ppt_PurchaseQuantity,Ppt_PurchaseStatus,Ppt_PurchasePerson,Ppt_Remark,Prod_Thumbnail," +
  18576. "case when Ppt_PurchaseStatus = '3' then case when Prod_CostPrice > 0 then Prod_CostPrice else Ppt_PurchasePrice end else Ppt_PurchasePrice end Ppt_PurchasePrice," +
  18577. "case when Ppt_PurchaseStatus = '3' then Prod_Vendor else Ppt_PurchaseVendor end AS Ppt_PurchaseVendor,dbo.fn_CheckDateTime(Ppt_PurchaseTime) AS Ppt_PurchaseTime";
  18578. DataTable dt = orbll.GetView_Custom( StrTableName, StrWhere: "Ppt_PurchaseNumber = '" + OrdNumber + "'", ShowColumnName: StrColumnName ).Tables[0];
  18579. #region 头
  18580. SizeF sizef = g.MeasureString( DefaultPrintTitle, ft18 );
  18581. int StrHeigth = Convert.ToInt32( sizef.Height );
  18582. int StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18583. Rectangle rec1 = new Rectangle( (size.Width - StrWidth) / 2, 50, StrWidth, StrHeigth );
  18584. g.DrawString( DefaultPrintTitle, ft18, b, rec1 );
  18585. string recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "采购单号:" ) + OrdNumber;
  18586. sizef = g.MeasureString( recValue, ft9 );
  18587. StrHeigth = Convert.ToInt32( sizef.Height );
  18588. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18589. Rectangle rec2 = new Rectangle( LeftWidth, rec1.Y + rec1.Height + 3, StrWidth, StrHeigth );
  18590. g.DrawString( recValue, ft9, b, rec2 );
  18591. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "打印时间:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy-MM-dd HH:mm" ) + LYFZ.BLL.OtherCommonModel.FontConversion( " 页:" ) + "1/1";
  18592. sizef = g.MeasureString( recValue, ft9 );
  18593. StrHeigth = Convert.ToInt32( sizef.Height );
  18594. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18595. Rectangle rec2_A1 = new Rectangle( TableWidth + LeftWidth - StrWidth, rec1.Y + rec1.Height + 3, StrWidth, StrHeigth );
  18596. g.DrawString( recValue, ft9, b, rec2_A1 );
  18597. #endregion
  18598. #region 列标题
  18599. Rectangle rec3 = new Rectangle( LeftWidth, rec2.Y + rec2.Height, TableWidth, RowHeight );
  18600. g.DrawRectangle( p, rec3 );//画标题矩形
  18601. int ColumnWidth2 = TableWidth / 16;
  18602. int ColumnWidth3 = TableWidth / 8;
  18603. int ColumnWidth4 = TableWidth / 10;
  18604. int ColumnWidth5 = TableWidth / 6;
  18605. int ColumnWidth6 = TableWidth / 12;
  18606. int ColumnWidth7 = TableWidth / 14 + 10;
  18607. int ColumnWidth8 = TableWidth / 7 + 15;
  18608. int ColumnWidth1 = TableWidth - ColumnWidth2 - ColumnWidth3 - ColumnWidth4 - ColumnWidth5 - ColumnWidth6 - ColumnWidth7 - ColumnWidth8;
  18609. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "商品名称" );
  18610. sizef = g.MeasureString( recValue, ft9 );
  18611. StrHeigth = Convert.ToInt32( sizef.Height );
  18612. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18613. Rectangle rec3_A1 = new Rectangle( ColumnWidth1 / 2 - StrWidth / 2 + rec2.X, rec3.Y + TopAdd + 2, ColumnWidth1, RowContentHeight );
  18614. g.DrawString( recValue, ft9, b, rec3_A1 );//画第一列的列标题
  18615. Point pA1_1 = new Point( rec3.X + ColumnWidth1, rec3.Y );
  18616. Point pA1_2 = new Point( rec3.X + ColumnWidth1, rec3.Y + rec3.Height );
  18617. g.DrawLine( p, pA1_1, pA1_2 );//画第一表与第二列的界线
  18618. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "数量" );
  18619. sizef = g.MeasureString( recValue, ft9 );
  18620. StrHeigth = Convert.ToInt32( sizef.Height );
  18621. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18622. Rectangle rec3_A2 = new Rectangle( ColumnWidth2 / 2 - StrWidth / 2 + pA1_1.X, rec3_A1.Y, ColumnWidth2, rec3_A1.Height );
  18623. g.DrawString( recValue, ft9, b, rec3_A2 );//画第一列的列标题
  18624. Point pA2_1 = new Point( pA1_1.X + ColumnWidth2, rec3.Y );
  18625. Point pA2_2 = new Point( pA1_1.X + ColumnWidth2, rec3.Y + rec3.Height );
  18626. g.DrawLine( p, pA2_1, pA2_2 );//画第一表与第二列的界线
  18627. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "商品类别" );
  18628. sizef = g.MeasureString( recValue, ft9 );
  18629. StrHeigth = Convert.ToInt32( sizef.Height );
  18630. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18631. Rectangle rec3_A3 = new Rectangle( ColumnWidth3 / 2 - StrWidth / 2 + pA2_1.X, rec3_A1.Y, ColumnWidth3, rec3_A1.Height );
  18632. g.DrawString( recValue, ft9, b, rec3_A3 );//画第一列的列标题
  18633. Point pA3_1 = new Point( pA2_1.X + ColumnWidth3, rec3.Y );
  18634. Point pA3_2 = new Point( pA2_1.X + ColumnWidth3, rec3.Y + rec3.Height );
  18635. g.DrawLine( p, pA3_1, pA3_2 );//画第一表与第二列的界线
  18636. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "商品单价" );
  18637. sizef = g.MeasureString( recValue, ft9 );
  18638. StrHeigth = Convert.ToInt32( sizef.Height );
  18639. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18640. Rectangle rec3_A4 = new Rectangle( ColumnWidth4 / 2 - StrWidth / 2 + pA3_1.X, rec3_A1.Y, ColumnWidth4, rec3_A1.Height );
  18641. g.DrawString( recValue, ft9, b, rec3_A4 );//画第一列的列标题
  18642. Point pA4_1 = new Point( pA3_1.X + ColumnWidth4, rec3.Y );
  18643. Point pA4_2 = new Point( pA3_1.X + ColumnWidth4, rec3.Y + rec3.Height );
  18644. g.DrawLine( p, pA4_1, pA4_2 );//画第一表与第二列的界线
  18645. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "商品厂商" );
  18646. sizef = g.MeasureString( recValue, ft9 );
  18647. StrHeigth = Convert.ToInt32( sizef.Height );
  18648. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18649. Rectangle rec3_A5 = new Rectangle( ColumnWidth5 / 2 - StrWidth / 2 + pA4_1.X, rec3_A1.Y, ColumnWidth5, rec3_A1.Height );
  18650. g.DrawString( recValue, ft9, b, rec3_A5 );//画第一列的列标题
  18651. Point pA5_1 = new Point( pA4_1.X + ColumnWidth5, rec3.Y );
  18652. Point pA5_2 = new Point( pA4_1.X + ColumnWidth5, rec3.Y + rec3.Height );
  18653. g.DrawLine( p, pA5_1, pA5_2 );//画第一表与第二列的界线
  18654. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "采购状态" );
  18655. sizef = g.MeasureString( recValue, ft9 );
  18656. StrHeigth = Convert.ToInt32( sizef.Height );
  18657. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18658. Rectangle rec3_A6 = new Rectangle( ColumnWidth6 / 2 - StrWidth / 2 + pA5_1.X, rec3_A1.Y, ColumnWidth6, rec3_A1.Height );
  18659. g.DrawString( recValue, ft9, b, rec3_A6 );//画第一列的列标题
  18660. Point pA6_1 = new Point( pA5_1.X + ColumnWidth6, rec3.Y );
  18661. Point pA6_2 = new Point( pA5_1.X + ColumnWidth6, rec3.Y + rec3.Height );
  18662. g.DrawLine( p, pA6_1, pA6_2 );//画第一表与第二列的界线
  18663. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "采购人" );
  18664. sizef = g.MeasureString( recValue, ft9 );
  18665. StrHeigth = Convert.ToInt32( sizef.Height );
  18666. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18667. Rectangle rec3_A7 = new Rectangle( ColumnWidth7 / 2 - StrWidth / 2 + pA6_1.X, rec3_A1.Y, ColumnWidth7, rec3_A1.Height );
  18668. g.DrawString( recValue, ft9, b, rec3_A7 );//画第一列的列标题
  18669. Point pA7_1 = new Point( pA6_1.X + ColumnWidth7, rec3.Y );
  18670. Point pA7_2 = new Point( pA6_1.X + ColumnWidth7, rec3.Y + rec3.Height );
  18671. g.DrawLine( p, pA7_1, pA7_2 );//画第一表与第二列的界线
  18672. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "采购时间" );
  18673. sizef = g.MeasureString( recValue, ft9 );
  18674. StrHeigth = Convert.ToInt32( sizef.Height );
  18675. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18676. Rectangle rec3_A8 = new Rectangle( ColumnWidth8 / 2 - StrWidth / 2 + pA7_1.X, rec3_A1.Y, ColumnWidth8, rec3_A1.Height );
  18677. g.DrawString( recValue, ft9, b, rec3_A8 );//画第一列的列标题
  18678. #endregion
  18679. #region 画内容
  18680. int ForRowHeight = 22;
  18681. int ForRowContentHeight = RowHeight - (TopAdd * 2);
  18682. int IntPoint_X = rec3.X;
  18683. int IntPoint_Y = rec3.Y + rec3.Height;
  18684. for ( int i = 0; i < dt.Rows.Count; i++ )
  18685. {
  18686. if ( i >= 44 )
  18687. {
  18688. break;
  18689. }
  18690. Rectangle recfor = new Rectangle( IntPoint_X, IntPoint_Y, TableWidth, ForRowHeight );
  18691. g.DrawRectangle( p, recfor );//画标题矩形
  18692. Rectangle recforA = new Rectangle( recfor.X + LeftAdd, recfor.Y + TopAdd, ColumnWidth1 - (LeftAdd * 2), ForRowContentHeight );
  18693. g.DrawString( dt.Rows[i]["Prod_Name"].ToString().Trim(), ft9, b, recforA );//画第一列的列标题
  18694. Point pforA_1 = new Point( recfor.X + ColumnWidth1, recfor.Y );
  18695. Point pforA_2 = new Point( recfor.X + ColumnWidth1, recfor.Y + recfor.Height );
  18696. g.DrawLine( p, pforA_1, pforA_2 );//画第一表与第二列的界线
  18697. recValue = dt.Rows[i]["Ppt_PurchaseQuantity"].ToString().Trim();
  18698. sizef = g.MeasureString( recValue, ft9 );
  18699. StrHeigth = Convert.ToInt32( sizef.Height );
  18700. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18701. Rectangle recforB = new Rectangle( pforA_1.X + ColumnWidth2 - StrWidth - LeftAdd * 3, recfor.Y + TopAdd, ColumnWidth2 - (LeftAdd * 2), ForRowContentHeight );
  18702. g.DrawString( recValue, ft9, b, recforB );//画第一列的列标题
  18703. Point pforB_1 = new Point( pA2_2.X, recfor.Y );
  18704. Point pforB_2 = new Point( pA2_2.X, recfor.Y + recfor.Height );
  18705. g.DrawLine( p, pforB_1, pforB_2 );//画第一表与第二列的界线
  18706. Rectangle recforC = new Rectangle( pforB_1.X + LeftAdd, recfor.Y + TopAdd, ColumnWidth3 - (LeftAdd * 2), ForRowContentHeight );
  18707. g.DrawString( dt.Rows[i]["Sc_ClassName"].ToString().Trim(), ft9, b, recforC );//画第一列的列标题
  18708. Point pforC_1 = new Point( pA3_2.X, recfor.Y );
  18709. Point pforC_2 = new Point( pA3_2.X, recfor.Y + recfor.Height );
  18710. g.DrawLine( p, pforC_1, pforC_2 );//画第一表与第二列的界线
  18711. recValue = Convert.ToDecimal( dt.Rows[i]["Ppt_PurchasePrice"] ).ToString( "0.00" ).Trim();
  18712. sizef = g.MeasureString( recValue, ft9 );
  18713. StrHeigth = Convert.ToInt32( sizef.Height );
  18714. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18715. Rectangle recforD = new Rectangle( pforC_1.X + ColumnWidth4 - StrWidth - LeftAdd, recfor.Y + TopAdd, ColumnWidth4 - (LeftAdd * 2), ForRowContentHeight );
  18716. g.DrawString( recValue, ft9, b, recforD );//画第一列的列标题
  18717. Point pforD_1 = new Point( pA4_2.X, recfor.Y );
  18718. Point pforD_2 = new Point( pA4_2.X, recfor.Y + recfor.Height );
  18719. g.DrawLine( p, pforD_1, pforD_2 );//画第一表与第二列的界线
  18720. Rectangle recforE = new Rectangle( pforD_1.X + LeftAdd, recfor.Y + TopAdd, ColumnWidth5 - (LeftAdd * 2), ForRowContentHeight );
  18721. g.DrawString( dt.Rows[i]["Ppt_PurchaseVendor"].ToString().Trim(), ft9, b, recforE );//画第一列的列标题
  18722. Point pforE_1 = new Point( pA5_2.X, recfor.Y );
  18723. Point pforE_2 = new Point( pA5_2.X, recfor.Y + recfor.Height );
  18724. g.DrawLine( p, pforE_1, pforE_2 );//画第一表与第二列的界线
  18725. Rectangle recforF = new Rectangle( pforE_1.X + LeftAdd, recfor.Y + TopAdd, ColumnWidth6 - LeftAdd, ForRowContentHeight );
  18726. g.DrawString( Enum.GetName( typeof( LYFZ.EnumPublic.Ppt_PurchaseStatus ), Convert.ToInt32( dt.Rows[i]["Ppt_PurchaseStatus"] ) ), ft9, b, recforF );//画第一列的列标题
  18727. Point pforF_1 = new Point( pA6_2.X, recfor.Y );
  18728. Point pforF_2 = new Point( pA6_2.X, recfor.Y + recfor.Height );
  18729. g.DrawLine( p, pforF_1, pforF_2 );//画第一表与第二列的界线
  18730. Rectangle recforG = new Rectangle( pforF_1.X + LeftAdd, recfor.Y + TopAdd, ColumnWidth7 - (LeftAdd * 2), ForRowContentHeight );
  18731. g.DrawString( dt.Rows[i]["Ppt_PurchasePerson"].ToString().Trim(), ft9, b, recforG );//画第一列的列标题
  18732. Point pforG_1 = new Point( pA7_2.X, recfor.Y );
  18733. Point pforG_2 = new Point( pA7_2.X, recfor.Y + recfor.Height );
  18734. g.DrawLine( p, pforG_1, pforG_2 );//画第一表与第二列的界线
  18735. Rectangle recforH = new Rectangle( pforG_1.X + LeftAdd, recfor.Y + TopAdd, ColumnWidth8 - (LeftAdd * 2), ForRowContentHeight );
  18736. g.DrawString( dt.Rows[i]["Ppt_PurchaseTime"].ToString().Trim(), ft9, b, recforH );//画第一列的列标题
  18737. IntPoint_Y += recfor.Height;
  18738. }
  18739. #endregion
  18740. }
  18741. /// <summary>
  18742. /// 库存管理——库存验收单
  18743. /// </summary>
  18744. /// <returns></returns>
  18745. public static void InventoryManagement_PurchasingAcceptance_Print( object OrdNumber, Graphics g, Size size )
  18746. {
  18747. Font ft16 = new Font( "宋体", 14 );
  18748. Font ft9 = new Font( "宋体", 9 );
  18749. Brush b = Brushes.Black;
  18750. Pen p = GetPen;
  18751. int LeftWidth = 30;
  18752. int TableWidth = size.Width - LeftWidth * 2;
  18753. int LeftAdd = 3;
  18754. int TopAdd = 4;
  18755. int RowHeight = 26;
  18756. int RowContentHeight = 26;
  18757. string StrTableName = "tb_ErpPurchaseProduct Left Join tb_ErpProduct on Prod_Number = Ppt_ProductNumber Left Join tb_ErpSystemCategory on Sc_ClassCode = Ppt_ProductCategory ";
  18758. string StrColumnName = "Prod_Name AS 商品名称,Sc_ClassName AS 商品类别,Ppt_PurchaseQuantity AS 采购数量,Ppt_PurchasePrice AS 采购单价,Ppt_PurchaseVendor AS 商品厂商,Ppt_PurchaseStatus AS 采购状态," +
  18759. "dbo.fn_CheckUserIDGetUserName(Ppt_PurchasePerson) AS 采购人,Ppt_AcceptanceQuantity AS 验收数量,dbo.fn_CheckDateTime(Ppt_PurchaseTime) AS 采购时间";
  18760. DataTable dt = orbll.GetView_Custom( StrTableName, StrWhere: "Ppt_PurchaseNumber = '" + OrdNumber + "'", ShowColumnName: StrColumnName ).Tables[0];
  18761. #region 头
  18762. //金色童年收据凭据
  18763. SizeF sizef = g.MeasureString( DefaultPrintTitle, ft16 );
  18764. int StrHeigth = Convert.ToInt32( sizef.Height );
  18765. int StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18766. Rectangle rec1 = new Rectangle( (size.Width - StrWidth) / 2, 50, StrWidth, StrHeigth );
  18767. g.DrawString( DefaultPrintTitle, ft16, b, rec1 );
  18768. string recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "采购单号:" ) + OrdNumber;
  18769. sizef = g.MeasureString( recValue, ft9 );
  18770. StrHeigth = Convert.ToInt32( sizef.Height );
  18771. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18772. Rectangle rec2 = new Rectangle( LeftWidth, rec1.Y + rec1.Height + 3, StrWidth, StrHeigth );
  18773. g.DrawString( recValue, ft9, b, rec2 );
  18774. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "打印时间:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy-MM-dd HH:mm" ) + LYFZ.BLL.OtherCommonModel.FontConversion( " 页:" ) + "1/1";
  18775. sizef = g.MeasureString( recValue, ft9 );
  18776. StrHeigth = Convert.ToInt32( sizef.Height );
  18777. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18778. Rectangle rec2_A1 = new Rectangle( TableWidth + LeftWidth - StrWidth, rec1.Y + rec1.Height + 3, StrWidth, StrHeigth );
  18779. g.DrawString( recValue, ft9, b, rec2_A1 );
  18780. #endregion
  18781. #region 列标题
  18782. Rectangle rec3 = new Rectangle( LeftWidth, rec2.Y + rec2.Height, TableWidth, RowHeight + 10 );
  18783. g.DrawRectangle( p, rec3 );//画标题矩形
  18784. int ColumnWidth2 = 30;
  18785. int ColumnWidth3 = TableWidth / 10;
  18786. int ColumnWidth4 = 65;
  18787. int ColumnWidth5 = TableWidth / 8;
  18788. int ColumnWidth6 = 50;
  18789. int ColumnWidth7 = TableWidth / 12;
  18790. int ColumnWidth8 = 50;
  18791. int ColumnWidth9 = 115;
  18792. int ColumnWidth1 = TableWidth - ColumnWidth2 - ColumnWidth3 - ColumnWidth4 - ColumnWidth5 - ColumnWidth6 - ColumnWidth7 - ColumnWidth8 - ColumnWidth9;
  18793. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "商品名称" );
  18794. sizef = g.MeasureString( recValue, ft9 );
  18795. StrHeigth = Convert.ToInt32( sizef.Height );
  18796. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18797. Rectangle rec3_A1 = new Rectangle( ColumnWidth1 / 2 - StrWidth / 2 + rec2.X, rec3.Y + ((rec3.Height / 2) - (StrHeigth / 2)), ColumnWidth1, RowContentHeight );
  18798. g.DrawString( recValue, ft9, b, rec3_A1 );//画第一列的列标题
  18799. Point pA1_1 = new Point( rec3.X + ColumnWidth1, rec3.Y );
  18800. Point pA1_2 = new Point( rec3.X + ColumnWidth1, rec3.Y + rec3.Height );
  18801. g.DrawLine( p, pA1_1, pA1_2 );//画第一表与第二列的界线
  18802. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "数\r\n量" );
  18803. sizef = g.MeasureString( recValue, ft9 );
  18804. StrHeigth = Convert.ToInt32( sizef.Height );
  18805. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18806. Rectangle rec3_A2 = new Rectangle( ColumnWidth2 / 2 - StrWidth / 2 + pA1_1.X, rec3_A1.Y - TopAdd, ColumnWidth2, rec3_A1.Height );
  18807. g.DrawString( recValue, ft9, b, rec3_A2 );//画第一列的列标题
  18808. Point pA2_1 = new Point( pA1_1.X + ColumnWidth2, rec3.Y );
  18809. Point pA2_2 = new Point( pA1_1.X + ColumnWidth2, rec3.Y + rec3.Height );
  18810. g.DrawLine( p, pA2_1, pA2_2 );//画第一表与第二列的界线
  18811. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "商品类别" );
  18812. sizef = g.MeasureString( recValue, ft9 );
  18813. StrHeigth = Convert.ToInt32( sizef.Height );
  18814. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18815. Rectangle rec3_A3 = new Rectangle( ColumnWidth3 / 2 - StrWidth / 2 + pA2_1.X, rec3_A1.Y, ColumnWidth3, rec3_A1.Height );
  18816. g.DrawString( recValue, ft9, b, rec3_A3 );//画第一列的列标题
  18817. Point pA3_1 = new Point( pA2_1.X + ColumnWidth3, rec3.Y );
  18818. Point pA3_2 = new Point( pA2_1.X + ColumnWidth3, rec3.Y + rec3.Height );
  18819. g.DrawLine( p, pA3_1, pA3_2 );//画第一表与第二列的界线
  18820. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "采购\r\n单价" );
  18821. sizef = g.MeasureString( recValue, ft9 );
  18822. StrHeigth = Convert.ToInt32( sizef.Height );
  18823. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18824. Rectangle rec3_A4 = new Rectangle( ColumnWidth4 / 2 - StrWidth / 2 + pA3_1.X, rec3.Y + TopAdd, ColumnWidth4, rec3_A1.Height );
  18825. g.DrawString( recValue, ft9, b, rec3_A4 );//画第一列的列标题
  18826. Point pA4_1 = new Point( pA3_1.X + ColumnWidth4, rec3.Y );
  18827. Point pA4_2 = new Point( pA3_1.X + ColumnWidth4, rec3.Y + rec3.Height );
  18828. g.DrawLine( p, pA4_1, pA4_2 );//画第一表与第二列的界线
  18829. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "商品厂商" );
  18830. sizef = g.MeasureString( recValue, ft9 );
  18831. StrHeigth = Convert.ToInt32( sizef.Height );
  18832. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18833. Rectangle rec3_A5 = new Rectangle( ColumnWidth5 / 2 - StrWidth / 2 + pA4_1.X, rec3_A1.Y, ColumnWidth5, rec3_A1.Height );
  18834. g.DrawString( recValue, ft9, b, rec3_A5 );//画第一列的列标题
  18835. Point pA5_1 = new Point( pA4_1.X + ColumnWidth5, rec3.Y );
  18836. Point pA5_2 = new Point( pA4_1.X + ColumnWidth5, rec3.Y + rec3.Height );
  18837. g.DrawLine( p, pA5_1, pA5_2 );//画第一表与第二列的界线
  18838. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "采购\r\n状态" );
  18839. sizef = g.MeasureString( recValue, ft9 );
  18840. StrHeigth = Convert.ToInt32( sizef.Height );
  18841. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18842. Rectangle rec3_A6 = new Rectangle( ColumnWidth6 / 2 - StrWidth / 2 + pA5_1.X, rec3.Y + TopAdd, ColumnWidth6, rec3_A1.Height );
  18843. g.DrawString( recValue, ft9, b, rec3_A6 );//画第一列的列标题
  18844. Point pA6_1 = new Point( pA5_1.X + ColumnWidth6, rec3.Y );
  18845. Point pA6_2 = new Point( pA5_1.X + ColumnWidth6, rec3.Y + rec3.Height );
  18846. g.DrawLine( p, pA6_1, pA6_2 );//画第一表与第二列的界线
  18847. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "采购人" );
  18848. sizef = g.MeasureString( recValue, ft9 );
  18849. StrHeigth = Convert.ToInt32( sizef.Height );
  18850. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18851. Rectangle rec3_A7 = new Rectangle( ColumnWidth7 / 2 - StrWidth / 2 + pA6_1.X, rec3_A1.Y, ColumnWidth7, rec3_A1.Height );
  18852. g.DrawString( recValue, ft9, b, rec3_A7 );//画第一列的列标题
  18853. Point pA7_1 = new Point( pA6_1.X + ColumnWidth7, rec3.Y );
  18854. Point pA7_2 = new Point( pA6_1.X + ColumnWidth7, rec3.Y + rec3.Height );
  18855. g.DrawLine( p, pA7_1, pA7_2 );//画第一表与第二列的界线
  18856. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "验收\r\n数量" );
  18857. sizef = g.MeasureString( recValue, ft9 );
  18858. StrHeigth = Convert.ToInt32( sizef.Height );
  18859. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18860. Rectangle rec3_A8 = new Rectangle( ColumnWidth8 / 2 - StrWidth / 2 + pA7_1.X, rec3.Y + TopAdd, ColumnWidth8, rec3_A1.Height );
  18861. g.DrawString( recValue, ft9, b, rec3_A8 );//画第一列的列标题
  18862. Point pA8_1 = new Point( pA7_1.X + ColumnWidth8, rec3.Y );
  18863. Point pA8_2 = new Point( pA7_1.X + ColumnWidth8, rec3.Y + rec3.Height );
  18864. g.DrawLine( p, pA8_1, pA8_2 );//画第一表与第二列的界线
  18865. recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "采购时间" );
  18866. sizef = g.MeasureString( recValue, ft9 );
  18867. StrHeigth = Convert.ToInt32( sizef.Height );
  18868. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18869. Rectangle rec3_A9 = new Rectangle( ColumnWidth9 / 2 - StrWidth / 2 + pA8_1.X, rec3_A1.Y, ColumnWidth9, rec3_A1.Height );
  18870. g.DrawString( recValue, ft9, b, rec3_A9 );//画第一列的列标题
  18871. #endregion
  18872. #region 画内容
  18873. int ForRowHeight = 20;
  18874. int ForRowContentHeight = ForRowHeight - (TopAdd * 2);
  18875. int IntPoint_X = rec3.X;
  18876. int IntPoint_Y = rec3.Y + rec3.Height;
  18877. for ( int i = 0; i < dt.Rows.Count; i++ )
  18878. {
  18879. if ( i >= 48 )
  18880. {
  18881. break;
  18882. }
  18883. Rectangle recfor = new Rectangle( IntPoint_X, IntPoint_Y, TableWidth, ForRowHeight );
  18884. g.DrawRectangle( p, recfor );//画标题矩形
  18885. Rectangle recforA = new Rectangle( recfor.X + LeftAdd, recfor.Y + TopAdd, ColumnWidth1 - (LeftAdd * 2), ForRowContentHeight );
  18886. g.DrawString( dt.Rows[i]["商品名称"].ToString().Trim(), ft9, b, recforA );//画第一列的列标题
  18887. Point pforA_1 = new Point( recfor.X + ColumnWidth1, recfor.Y );
  18888. Point pforA_2 = new Point( recfor.X + ColumnWidth1, recfor.Y + recfor.Height );
  18889. g.DrawLine( p, pforA_1, pforA_2 );//画第一表与第二列的界线
  18890. Rectangle recforB = new Rectangle( pforA_1.X + LeftAdd, recfor.Y + TopAdd, ColumnWidth2 - (LeftAdd * 2), ForRowContentHeight );
  18891. g.DrawString( dt.Rows[i]["采购数量"].ToString().Trim(), ft9, b, recforB );//画第一列的列标题
  18892. Point pforB_1 = new Point( pA2_2.X, recfor.Y );
  18893. Point pforB_2 = new Point( pA2_2.X, recfor.Y + recfor.Height );
  18894. g.DrawLine( p, pforB_1, pforB_2 );//画第一表与第二列的界线
  18895. Rectangle recforC = new Rectangle( pforB_1.X + LeftAdd, recfor.Y + TopAdd, ColumnWidth3 - (LeftAdd * 2), ForRowContentHeight );
  18896. g.DrawString( dt.Rows[i]["商品类别"].ToString().Trim(), ft9, b, recforC );//画第一列的列标题
  18897. Point pforC_1 = new Point( pA3_2.X, recfor.Y );
  18898. Point pforC_2 = new Point( pA3_2.X, recfor.Y + recfor.Height );
  18899. g.DrawLine( p, pforC_1, pforC_2 );//画第一表与第二列的界线
  18900. recValue = Convert.ToDecimal( dt.Rows[i]["采购单价"] ).ToString( "0.00" );
  18901. sizef = g.MeasureString( recValue, ft9 );
  18902. StrHeigth = Convert.ToInt32( sizef.Height );
  18903. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18904. Rectangle recforD = new Rectangle( pforC_1.X + ColumnWidth4 - StrWidth - LeftAdd, recfor.Y + TopAdd, ColumnWidth4 - (LeftAdd * 2), ForRowContentHeight );
  18905. g.DrawString( recValue, ft9, b, recforD );//画第一列的列标题
  18906. Point pforD_1 = new Point( pA4_2.X, recfor.Y );
  18907. Point pforD_2 = new Point( pA4_2.X, recfor.Y + recfor.Height );
  18908. g.DrawLine( p, pforD_1, pforD_2 );//画第一表与第二列的界线
  18909. Rectangle recforE = new Rectangle( pforD_1.X + LeftAdd, recfor.Y + TopAdd, ColumnWidth5 - (LeftAdd * 2), ForRowContentHeight );
  18910. g.DrawString( dt.Rows[i]["商品厂商"].ToString().Trim(), ft9, b, recforE );//画第一列的列标题
  18911. Point pforE_1 = new Point( pA5_2.X, recfor.Y );
  18912. Point pforE_2 = new Point( pA5_2.X, recfor.Y + recfor.Height );
  18913. g.DrawLine( p, pforE_1, pforE_2 );//画第一表与第二列的界线
  18914. Rectangle recforF = new Rectangle( pforE_1.X + LeftAdd, recfor.Y + TopAdd, ColumnWidth6 - (LeftAdd * 2), ForRowContentHeight );
  18915. g.DrawString( Enum.GetName( typeof( LYFZ.EnumPublic.Ppt_PurchaseStatus ), Convert.ToInt32( dt.Rows[i]["采购状态"] ) ), ft9, b, recforF );//画第一列的列标题
  18916. Point pforF_1 = new Point( pA6_2.X, recfor.Y );
  18917. Point pforF_2 = new Point( pA6_2.X, recfor.Y + recfor.Height );
  18918. g.DrawLine( p, pforF_1, pforF_2 );//画第一表与第二列的界线
  18919. Rectangle recforG = new Rectangle( pforF_1.X + LeftAdd, recfor.Y + TopAdd, ColumnWidth7 - (LeftAdd * 2), ForRowContentHeight );
  18920. g.DrawString( dt.Rows[i]["采购人"].ToString().Trim(), ft9, b, recforG );//画第一列的列标题
  18921. Point pforG_1 = new Point( pA7_2.X, recfor.Y );
  18922. Point pforG_2 = new Point( pA7_2.X, recfor.Y + recfor.Height );
  18923. g.DrawLine( p, pforG_1, pforG_2 );//画第一表与第二列的界线
  18924. Rectangle recforH = new Rectangle( pforG_1.X + LeftAdd, recfor.Y + TopAdd, ColumnWidth8 - (LeftAdd * 2), ForRowContentHeight );
  18925. g.DrawString( dt.Rows[i]["验收数量"].ToString().Trim(), ft9, b, recforH );//画第一列的列标题
  18926. Point pforH_1 = new Point( pA8_2.X, recfor.Y );
  18927. Point pforH_2 = new Point( pA8_2.X, recfor.Y + recfor.Height );
  18928. g.DrawLine( p, pforH_1, pforH_2 );//画第一表与第二列的界线
  18929. Rectangle recforI = new Rectangle( pforH_1.X + LeftAdd, recfor.Y + TopAdd, ColumnWidth9 - (LeftAdd * 2), ForRowContentHeight );
  18930. g.DrawString( dt.Rows[i]["采购时间"].ToString().Trim(), ft9, b, recforI );//画第一列的列标题
  18931. IntPoint_Y += recfor.Height;
  18932. }
  18933. #endregion
  18934. }
  18935. #endregion
  18936. #region 考勤统计
  18937. /// <summary>
  18938. /// 月统计
  18939. /// </summary>
  18940. /// <param name="dgvData">数据列表</param>
  18941. /// <param name="StrOrd_Number">数据总汇:</param>
  18942. public static void SchedulingMonthlyStatistics( object objValue, Graphics g, Size size )
  18943. {
  18944. Hashtable htData = (Hashtable)objValue;
  18945. DataGridViewEc dgvData = (DataGridViewEc)htData["dgvData"];
  18946. int time1 = Convert.ToInt32( htData["time1"] );
  18947. int time2 = Convert.ToInt32( htData["time2"] );
  18948. int chk = Convert.ToInt32( htData["chk"] );
  18949. Brush b = Brushes.Black;
  18950. Pen p = GetPen;
  18951. Font ft18 = new Font( "宋体", 18 );
  18952. Font ft10 = new Font( "宋体", 10 );
  18953. Font ft9 = new Font( "宋体", 9 );
  18954. int LeftWidth = 50;
  18955. int TableWidth = size.Width - LeftWidth * 2 - 20;
  18956. int LeftAdd = 2;
  18957. int TopAdd = 7;
  18958. int RowHeight = 27;
  18959. int RowContentHeight = RowHeight - (TopAdd * 2);
  18960. int ColumnWidth1 = (TableWidth - 30) / 4 + 10;
  18961. #region 打印多少页
  18962. int PageRows = 2;//每页多少人
  18963. int PageCount = dgvData.SelectedRows.Count / PageRows;
  18964. if ( dgvData.SelectedRows.Count % PageRows > 0 )
  18965. {
  18966. PageCount++;
  18967. }
  18968. #endregion
  18969. string StrName = time1 + "-" + time2 + "月";
  18970. if ( htData["chk"].ToString().Trim() == "1" )
  18971. {
  18972. string[] StrArray = dgvData.Columns[6].HeaderText.Trim().Replace( "\r\n", "_" ).Split( '_' );
  18973. string[] StrArray2 = dgvData.Columns[dgvData.Columns.Count - 1].HeaderText.Trim().Replace( "\r\n", "_" ).Split( '_' );
  18974. StrName = time1 + "-" + StrArray[1].Replace( "月", "-" ).Replace( "日", "" ).Trim() + "至" + time1 + "-" + StrArray2[1].Replace( "月", "-" ).Replace( "日", "" ).Trim();
  18975. }
  18976. StrName += LYFZ.BLL.OtherCommonModel.FontConversion( "考勤报表" );
  18977. SizeF sizef = g.MeasureString( StrName, ft18 );
  18978. int StrHeigth = Convert.ToInt32( sizef.Height );
  18979. int StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18980. Rectangle rec1_2 = new Rectangle( (size.Width - StrWidth) / 2, 50, StrWidth, StrHeigth );
  18981. g.DrawString( StrName, ft18, b, rec1_2 );
  18982. 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;
  18983. sizef = g.MeasureString( StrValue, ft9 );
  18984. StrHeigth = Convert.ToInt32( sizef.Height );
  18985. StrWidth = Convert.ToInt32( sizef.Width ) + 1;
  18986. Rectangle rec1_1 = new Rectangle( TableWidth + LeftWidth - StrWidth + 30, rec1_2.Y + rec1_2.Height + 5, StrWidth, StrHeigth );
  18987. g.DrawString( StrValue, ft9, b, rec1_1 );//画消费法规
  18988. bool IsNextPage = false;
  18989. int forintCount = 0;
  18990. int forLeftWidth = 0;
  18991. for ( int j = 0; j < dgvData.SelectedRows.Count; j++ )
  18992. {
  18993. if ( PrintForCount >= dgvData.SelectedRows.Count || forintCount == 2 )
  18994. {
  18995. break;
  18996. }
  18997. if ( forintCount == 0 )
  18998. {
  18999. forLeftWidth = LeftWidth;
  19000. forintCount++;
  19001. }
  19002. else if ( forintCount == 1 )
  19003. {
  19004. forLeftWidth += ColumnWidth1 * 2 + 20;
  19005. forintCount++;
  19006. }
  19007. else if ( forintCount == 2 )
  19008. {
  19009. forLeftWidth += ColumnWidth1 * 2 + 20;
  19010. forintCount++;
  19011. }
  19012. #region 画列标题
  19013. Rectangle rec2 = new Rectangle( forLeftWidth, rec1_1.Y + rec1_1.Height + 5, ColumnWidth1 * 2, 60 );
  19014. g.DrawRectangle( p, rec2 );//画标题矩形
  19015. Rectangle rec2_2 = new Rectangle( rec2.X + LeftAdd * 2, rec2.Y + TopAdd, ColumnWidth1 * 2 - LeftAdd, 55 );
  19016. 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 );//画第一列的列标题
  19017. #endregion
  19018. #region 画行
  19019. int IntPoint_Y = rec2.Y + rec2.Height;
  19020. int intDay = 1;
  19021. for ( int i = 0; i < dgvData.Columns.Count; i++ )
  19022. {
  19023. if ( i == 0 )
  19024. {
  19025. Rectangle recfor = new Rectangle( rec2.X, IntPoint_Y, ColumnWidth1 * 2, RowHeight );
  19026. g.DrawRectangle( p, recfor );//画标题矩形
  19027. Rectangle recfor2_1 = new Rectangle( recfor.X + LeftAdd + 10, recfor.Y + TopAdd, ColumnWidth1 - 120 - (LeftAdd * 2), RowContentHeight );
  19028. g.DrawString( "日期", ft9, b, recfor2_1 );//画第一列的列标题
  19029. Point pfor1_1 = new Point( recfor.X + ColumnWidth1 - 120, recfor.Y );
  19030. Point pfor1_2 = new Point( recfor.X + ColumnWidth1 - 120, recfor.Y + recfor.Height );
  19031. g.DrawLine( p, pfor1_1, pfor1_2 );//画第一表与第二列的界线
  19032. Rectangle recfor2_2 = new Rectangle( pfor1_1.X + LeftAdd, pfor1_1.Y + TopAdd, ColumnWidth1 + 120 - (LeftAdd * 2), RowContentHeight );
  19033. g.DrawString( " 考勤记录", ft9, b, recfor2_2 );//画第一列的列标题
  19034. IntPoint_Y = recfor.Y + recfor.Height;
  19035. }
  19036. if ( i > 5 && dgvData.Columns[i].Visible )
  19037. {
  19038. string[] StrArray = dgvData.Columns[i].HeaderText.Trim().Replace( "\r\n", "_" ).Split( '_' );
  19039. string StrTitle = StrArray[0].Trim();
  19040. if ( htData["chk"].ToString().Trim() == "1" )
  19041. {
  19042. StrTitle = StrArray[1].Trim().Replace( "月", "-" ).Replace( "日", "" );
  19043. }
  19044. Rectangle recfor = new Rectangle( rec2.X, IntPoint_Y, ColumnWidth1 * 2, RowHeight );
  19045. g.DrawRectangle( p, recfor );//画标题矩形
  19046. Rectangle recfor2_1 = new Rectangle( recfor.X + LeftAdd + 3, recfor.Y + TopAdd, ColumnWidth1 - 120 - (LeftAdd * 2), RowContentHeight );
  19047. g.DrawString( StrTitle, ft9, b, recfor2_1 );//画第一列的列标题
  19048. Point pfor1_1 = new Point( recfor.X + ColumnWidth1 - 120, recfor.Y );
  19049. Point pfor1_2 = new Point( recfor.X + ColumnWidth1 - 120, recfor.Y + recfor.Height );
  19050. g.DrawLine( p, pfor1_1, pfor1_2 );//画第一表与第二列的界线
  19051. sizef = g.MeasureString( dgvData.SelectedRows[PrintForCount].Cells[i].Value.ToString().Trim(), ft9 );
  19052. int FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  19053. Rectangle recfor2_2 = new Rectangle( pfor1_1.X + LeftAdd, pfor1_1.Y + TopAdd, ColumnWidth1 + 120 - (LeftAdd * 2), RowContentHeight );
  19054. g.DrawString( dgvData.SelectedRows[PrintForCount].Cells[i].Value.ToString().Trim(), ft9, b, recfor2_2 );//画第一列的列标题
  19055. intDay++;
  19056. IntPoint_Y = recfor.Y + recfor.Height;
  19057. }
  19058. }
  19059. #endregion
  19060. PrintForCount++;
  19061. }
  19062. if ( PrintForCount < dgvData.SelectedRows.Count )
  19063. {
  19064. PrintCurrentIndexPage++;
  19065. IsNextPage = true;
  19066. IsHasMorePages = true;
  19067. return;
  19068. }
  19069. if ( !IsNextPage )
  19070. {
  19071. IsHasMorePages = false;
  19072. }
  19073. }
  19074. #endregion
  19075. #region 热敏小票打印
  19076. /// <summary>
  19077. /// 小票打印订单收款
  19078. /// </summary>
  19079. public static void SmallTicket_OrderPayment( object objValue, Graphics g, Size size, bool IsPrintSerialNo )
  19080. {
  19081. Hashtable htData = (Hashtable)objValue;
  19082. DataGridViewEx dgvData = (DataGridViewEx)htData["dgvData"];
  19083. List<string> usNumber = new List<string>();
  19084. for ( int i = 0; i < dgvData.SelectedRows.Count; i++ )
  19085. {
  19086. DataRow dr = dgvData.SelectedRows[i].Tag as DataRow;
  19087. if ( dr != null )
  19088. {
  19089. if ( !string.IsNullOrEmpty( Convert.ToString( dr["Pay_McNumber"] ) ) )
  19090. {
  19091. usNumber.Add( Convert.ToString( dr["Pay_McNumber"] ) );
  19092. }
  19093. }
  19094. }
  19095. string memberDisInfo = "";
  19096. BLL.BLL_ErpMemberCard bllMember = new BLL.BLL_ErpMemberCard();
  19097. DataTable tableMember = bllMember.GetList( " Mc_Number in ('" + string.Join( "','", usNumber.ToArray() ) + "') " ).Tables[0];
  19098. /*for(int i=0;i<tableMember.Rows.Count;i++)
  19099. {
  19100. memberDisInfo += "[会员卡" + tableMember.Rows[i]["MC_CradNumber"] + " 的余额:" + tableMember.Rows[i]["mc_money"] + "]";
  19101. }*/
  19102. string StrNumber = htData["strNumber"].ToString().Trim();
  19103. string ExecuteSql = orbll.GetView_CustomReturnExecuteSql( "tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Telephone" );
  19104. 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" );
  19105. DataSet dtSet = orbll.GetView_Custom( ExecuteSql );
  19106. //获取影楼信息
  19107. DataTable tbl_Info = dtSet.Tables["ds"];
  19108. if ( tbl_Info.Rows.Count <= 0 )
  19109. {
  19110. MessageBoxCustom.Show( "未设置影楼信息" ); return;
  19111. }
  19112. DataTable tbl_Order = dtSet.Tables["ds1"];
  19113. Brush b = Brushes.Black;
  19114. Pen p = new Pen( b, float.Parse( "0.5" ) );
  19115. Pen pen = new Pen( b, 1 );
  19116. pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Custom;
  19117. pen.DashPattern = new float[] { 10, 10 };
  19118. string StrFont = "宋体";
  19119. Font ft17 = new Font( StrFont, 17, GraphicsUnit.Pixel );
  19120. Font ft12 = new Font( StrFont, 12, GraphicsUnit.Pixel );
  19121. int Underline = 3;
  19122. int ContentHeight = 2;
  19123. int TableWidth = size.Width;
  19124. int RowHeight = Convert.ToInt32( g.MeasureString( "调试行高", ft12 ).Height );
  19125. int StartRows_Y = 0;
  19126. string StrSmallTicketSerialNumber = "";
  19127. for ( int l = 0; l < PrintPageCount; l++ )
  19128. {
  19129. #region 收款标题
  19130. SizeF sizef = g.MeasureString( DefaultPrintTitle, ft17, TableWidth );
  19131. int FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  19132. int FtHeight = Convert.ToInt32( sizef.Height );
  19133. Rectangle rec1 = new Rectangle( TableWidth / 2 - FtWidth / 2, StartRows_Y, TableWidth, FtHeight );
  19134. g.DrawString( DefaultPrintTitle, ft17, b, rec1 );
  19135. #endregion
  19136. #region 客户资料
  19137. #region 第一行 流程单号
  19138. string rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "流程单号:" );
  19139. sizef = g.MeasureString( rec1Value, ft12 );
  19140. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  19141. FtHeight = Convert.ToInt32( sizef.Height );
  19142. Rectangle rec2 = new Rectangle( 0, rec1.Y + rec1.Height + 5, FtWidth, RowHeight );
  19143. g.DrawString( rec1Value, ft12, b, rec2 );
  19144. Rectangle rec2A = new Rectangle( rec2.X + rec2.Width, rec2.Y - ContentHeight, TableWidth - rec2.Width, rec2.Height );
  19145. g.DrawString( tbl_Order.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim(), ft12, b, rec2A );
  19146. Point rec2A_1 = new Point( rec2A.X, rec2A.Y + rec2A.Height - Underline );
  19147. Point rec2A_2 = new Point( rec2A.X + rec2A.Width, rec2A_1.Y );
  19148. g.DrawLine( p, rec2A_1, rec2A_2 );
  19149. #endregion
  19150. #region 第二行 积分卡号
  19151. //Rectangle rec3 = new Rectangle(rec2.X, rec2.Y + rec2.Height, rec2.Width, RowHeight);
  19152. //g.DrawString("积分卡号:", ft9, b, rec3);
  19153. //Rectangle rec3A = new Rectangle(rec3.X + rec3.Width, rec3.Y - ContentHeight, TableWidth - rec3.Width, rec3.Height);
  19154. //g.DrawString(tbl2.Rows[0]["Mc_CradNumber"].ToString().Trim(), ft9, b, rec3A);
  19155. //Point rec3A_1 = new Point(rec3A.X, rec3A.Y + rec3A.Height - Underline);
  19156. //Point rec3A_2 = new Point(rec3A.X + rec3A.Width, rec3A_1.Y);
  19157. //g.DrawLine(p, rec3A_1, rec3A_2);
  19158. #endregion
  19159. int IntPoint_Y = 0;
  19160. Hashtable htClient = GetClientInfo( StrNumber, tbl_Order.Rows[0]["Ord_Type"].ToString().Trim() );
  19161. if ( htClient == null )
  19162. {
  19163. MessageBoxCustom.Show( "获取客户信息无数据!" ); return;
  19164. }
  19165. if ( tbl_Order.Rows[0]["Ord_Type"].ToString().Trim() == "0" )
  19166. {
  19167. #region 婚纱客户
  19168. #region 第三行 主联系人姓名、性别
  19169. Rectangle rec4 = new Rectangle( rec2.X, rec2.Y + rec2.Height, rec2.Width, RowHeight );
  19170. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名:" ), ft12, b, rec4 );
  19171. Rectangle rec4A = new Rectangle( rec4.X + rec4.Width, rec4.Y - ContentHeight, TableWidth - TableWidth / 3 - rec4.Width - 5, rec4.Height );
  19172. g.DrawString( htClient["StrManName"].ToString(), ft12, b, rec4A );
  19173. Point rec4A_1 = new Point( rec4A.X, rec4A.Y + rec4A.Height - Underline );
  19174. Point rec4A_2 = new Point( rec4A.X + rec4A.Width, rec4A_1.Y );
  19175. g.DrawLine( p, rec4A_1, rec4A_2 );
  19176. rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "性别:" );
  19177. sizef = g.MeasureString( rec1Value, ft12 );
  19178. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  19179. Rectangle rec4B = new Rectangle( rec4A.X + rec4A.Width + 5, rec4.Y, FtWidth, RowHeight );
  19180. g.DrawString( rec1Value, ft12, b, rec4B );
  19181. Rectangle rec4C = new Rectangle( rec4B.X + rec4B.Width, rec4A.Y, FtWidth / 2, rec4B.Height );
  19182. g.DrawString( htClient["StrManSex"].ToString(), ft12, b, rec4C );
  19183. Point rec4C_1 = new Point( rec4C.X, rec4A_1.Y );
  19184. Point rec4C_2 = new Point( TableWidth, rec4C_1.Y );
  19185. g.DrawLine( p, rec4C_1, rec4C_2 );
  19186. #endregion
  19187. #region 第四行 主联系人电话
  19188. Rectangle rec5 = new Rectangle( rec4.X, rec4.Y + rec4.Height, rec4.Width, RowHeight );
  19189. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "联系电话:" ), ft12, b, rec5 );
  19190. Rectangle rec5A = new Rectangle( rec5.X + rec5.Width, rec5.Y - ContentHeight, TableWidth - rec5.Width, rec5.Height );
  19191. g.DrawString( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( htClient["StrManPhone"] ), ft12, b, rec5A );
  19192. Point rec5A_1 = new Point( rec5A.X, rec5A.Y + rec5A.Height - Underline );
  19193. Point rec5A_2 = new Point( rec5A.X + rec5A.Width, rec5A_1.Y );
  19194. g.DrawLine( p, rec5A_1, rec5A_2 );
  19195. #endregion
  19196. #region 第五行 副联系人姓名、性别
  19197. Rectangle rec6 = new Rectangle( rec5.X, rec5.Y + rec5.Height, rec5.Width, RowHeight );
  19198. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名:" ), ft12, b, rec6 );
  19199. Rectangle rec6A = new Rectangle( rec6.X + rec6.Width, rec6.Y - ContentHeight, TableWidth - TableWidth / 3 - rec6.Width - 5, rec6.Height );
  19200. g.DrawString( htClient["StrWoManName"].ToString(), ft12, b, rec6A );
  19201. Point rec6A_1 = new Point( rec6A.X, rec6A.Y + rec6A.Height - Underline );
  19202. Point rec6A_2 = new Point( rec6A.X + rec6A.Width, rec6A_1.Y );
  19203. g.DrawLine( p, rec6A_1, rec6A_2 );
  19204. rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "性别:" );
  19205. sizef = g.MeasureString( rec1Value, ft12 );
  19206. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  19207. Rectangle rec6B = new Rectangle( rec6A.X + rec6A.Width + 5, rec6A.Y, FtWidth, RowHeight );
  19208. g.DrawString( rec1Value, ft12, b, rec6B );
  19209. Rectangle rec6C = new Rectangle( rec6B.X + rec6B.Width, rec6A.Y, FtWidth / 2, rec6B.Height );
  19210. g.DrawString( htClient["StrWoManSex"].ToString(), ft12, b, rec6C );
  19211. Point rec6C_1 = new Point( rec6C.X, rec6A_1.Y );
  19212. Point rec6C_2 = new Point( TableWidth, rec6C_1.Y );
  19213. g.DrawLine( p, rec6C_1, rec6C_2 );
  19214. #endregion
  19215. #region 第六行 客户婚期
  19216. Rectangle rec7 = new Rectangle( rec6.X, rec6.Y + rec6.Height, rec6.Width, RowHeight );
  19217. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 婚 期:" ), ft12, b, rec7 );
  19218. Rectangle rec7A = new Rectangle( rec7.X + rec7.Width, rec7.Y - ContentHeight, TableWidth - rec7.Width, rec7.Height );
  19219. g.DrawString( htClient["StrManMarriage"].ToString(), ft12, b, rec7A );
  19220. Point rec7A_1 = new Point( rec7A.X, rec7A.Y + rec7A.Height - Underline );
  19221. Point rec7A_2 = new Point( rec7A.X + rec7A.Width, rec7A_1.Y );
  19222. g.DrawLine( p, rec7A_1, rec7A_2 );
  19223. #endregion
  19224. IntPoint_Y = rec7A_1.Y + rec7.Height / 3;
  19225. #endregion
  19226. }
  19227. else if ( tbl_Order.Rows[0]["Ord_Type"].ToString().Trim() == "1" )
  19228. {
  19229. #region 儿童客户
  19230. #region 第三行 宝贝姓名
  19231. Rectangle rec4 = new Rectangle( rec2.X, rec2.Y + rec2.Height, rec2.Width, RowHeight );
  19232. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "宝贝姓名:" ), ft12, b, rec4 );
  19233. Rectangle rec4A = new Rectangle( rec4.X + rec4.Width, rec4.Y - ContentHeight, TableWidth - rec4.Width, rec4.Height );
  19234. g.DrawString( htClient["StrChildName"].ToString(), ft12, b, rec4A );
  19235. Point rec4A_1 = new Point( rec4A.X, rec4A.Y + rec4A.Height - Underline );
  19236. Point rec4A_2 = new Point( rec4A.X + rec4A.Width, rec4A_1.Y );
  19237. g.DrawLine( p, rec4A_1, rec4A_2 );
  19238. #endregion
  19239. #region 第四行 性别、年龄
  19240. rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "性 别:" );
  19241. sizef = g.MeasureString( rec1Value, ft12 );
  19242. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  19243. FtHeight = Convert.ToInt32( sizef.Height );
  19244. Rectangle rec5 = new Rectangle( rec4.X, rec4.Y + rec4.Height, FtWidth, RowHeight );
  19245. g.DrawString( rec1Value, ft12, b, rec5 );
  19246. rec1Value = "性别";
  19247. sizef = g.MeasureString( rec1Value, ft12 );
  19248. FtWidth = Convert.ToInt32( sizef.Width );
  19249. FtHeight = Convert.ToInt32( sizef.Height );
  19250. Rectangle rec5A = new Rectangle( rec5.X + rec5.Width, rec5.Y - ContentHeight, FtWidth, rec5.Height );
  19251. g.DrawString( htClient["StrChildSex"].ToString(), ft12, b, rec5A );
  19252. Point rec5A_1 = new Point( rec5A.X, rec5.Y + rec5A.Height - Underline );
  19253. Point rec5A_2 = new Point( rec5A.X + rec5A.Width, rec5A_1.Y );
  19254. g.DrawLine( p, rec5A_1, rec5A_2 );
  19255. rec1Value = "年龄:";
  19256. sizef = g.MeasureString( rec1Value, ft12 );
  19257. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  19258. Rectangle rec5B = new Rectangle( rec5A.X + rec5A.Width + 10, rec5.Y, FtWidth, rec5.Height );
  19259. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "年龄:" ), ft12, b, rec5B );
  19260. Rectangle rec5C = new Rectangle( rec5B.X + rec5B.Width, rec5B.Y - ContentHeight, TableWidth - rec5B.X, rec5.Height );
  19261. g.DrawString( htClient["StrChildRAgeString"].ToString(), ft12, b, rec5C );
  19262. Point rec5C_1 = new Point( rec5C.X, rec5B.Y + rec5C.Height - Underline );
  19263. Point rec5C_2 = new Point( rec5C.X + rec5C.Width, rec5C_1.Y );
  19264. g.DrawLine( p, rec5C_1, rec5C_2 );
  19265. #endregion
  19266. #region 第五行 家长姓名
  19267. Rectangle rec6 = new Rectangle( rec5.X, rec5.Y + rec5.Height, rec2.Width, RowHeight );
  19268. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "家长姓名:" ), ft12, b, rec6 );
  19269. Rectangle rec6A = new Rectangle( rec6.X + rec6.Width, rec6.Y - ContentHeight, TableWidth - rec6.Width, rec6.Height );
  19270. g.DrawString( htClient["StrParentName"].ToString(), ft12, b, rec6A );
  19271. Point rec6A_1 = new Point( rec6A.X, rec6A.Y + rec6A.Height - Underline );
  19272. Point rec6A_2 = new Point( rec6A.X + rec6A.Width, rec6A_1.Y );
  19273. g.DrawLine( p, rec6A_1, rec6A_2 );
  19274. #endregion
  19275. #region 第六行 联系电话
  19276. Rectangle rec7 = new Rectangle( rec6.X, rec6.Y + rec6.Height, rec6.Width, RowHeight );
  19277. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "联系电话:" ), ft12, b, rec7 );
  19278. Rectangle rec7A = new Rectangle( rec7.X + rec7.Width, rec7.Y - ContentHeight, TableWidth - rec7.Width, rec7.Height );
  19279. g.DrawString( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( htClient["StrParentPhone"] ), ft12, b, rec7A );
  19280. Point rec7A_1 = new Point( rec7A.X, rec7A.Y + rec7A.Height - Underline );
  19281. Point rec7A_2 = new Point( rec7A.X + rec7A.Width, rec7A_1.Y );
  19282. g.DrawLine( p, rec7A_1, rec7A_2 );
  19283. #endregion
  19284. IntPoint_Y = rec7A_1.Y + rec7.Height / 3;
  19285. #endregion
  19286. }
  19287. else
  19288. {
  19289. #region 写真客户
  19290. #region 第三行 主联系人姓名
  19291. Rectangle rec4 = new Rectangle( rec2.X, rec2.Y + rec2.Height, rec2.Width, RowHeight );
  19292. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名:" ), ft12, b, rec4 );
  19293. Rectangle rec4A = new Rectangle( rec4.X + rec4.Width, rec4.Y - ContentHeight, TableWidth - rec4.Width, rec4.Height );
  19294. g.DrawString( htClient["StrMainName"].ToString(), ft12, b, rec4A );
  19295. Point rec4A_1 = new Point( rec4A.X, rec4A.Y + rec4A.Height - Underline );
  19296. Point rec4A_2 = new Point( rec4A.X + rec4A.Width, rec4A_1.Y );
  19297. g.DrawLine( p, rec4A_1, rec4A_2 );
  19298. #endregion
  19299. #region 第四行 性别
  19300. Rectangle rec5 = new Rectangle( rec4.X, rec4.Y + rec4.Height, rec4.Width, RowHeight );
  19301. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 性 别:" ), ft12, b, rec5 );
  19302. Rectangle rec5A = new Rectangle( rec5.X + rec5.Width, rec5.Y - ContentHeight, TableWidth - rec5.Width, rec5.Height );
  19303. g.DrawString( htClient["StrMainSex"].ToString(), ft12, b, rec5A );
  19304. Point rec5A_1 = new Point( rec5A.X, rec5A.Y + rec5A.Height - Underline );
  19305. Point rec5A_2 = new Point( rec5A.X + rec5A.Width, rec5A_1.Y );
  19306. g.DrawLine( p, rec5A_1, rec5A_2 );
  19307. #endregion
  19308. #region 第五行 联系电话
  19309. Rectangle rec6 = new Rectangle( rec5.X, rec5.Y + rec5.Height, rec5.Width, RowHeight );
  19310. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "联系电话:" ), ft12, b, rec6 );
  19311. Rectangle rec6A = new Rectangle( rec6.X + rec6.Width, rec6.Y - ContentHeight, TableWidth - rec6.Width, rec6.Height );
  19312. g.DrawString( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( htClient["StrMainPhone"] ), ft12, b, rec6A );
  19313. Point rec6A_1 = new Point( rec6A.X, rec6A.Y + rec6A.Height - Underline );
  19314. Point rec6A_2 = new Point( rec6A.X + rec6A.Width, rec6A_1.Y );
  19315. g.DrawLine( p, rec6A_1, rec6A_2 );
  19316. #endregion
  19317. IntPoint_Y = rec6A_1.Y + rec6.Height / 3;
  19318. #endregion
  19319. }
  19320. #endregion
  19321. Point rec7B_1 = new Point( 0, IntPoint_Y + RowHeight / 2 );
  19322. Point rec7B_2 = new Point( TableWidth, rec7B_1.Y );
  19323. g.DrawLine( pen, rec7B_1, rec7B_2 );
  19324. #region 第八行 产品
  19325. decimal ActualAmount = 0;//实付金额
  19326. decimal ActualOrd_Amount = 0;//实付订单金额
  19327. decimal Actualsale_Amount = 0;//实付二销金额
  19328. IntPoint_Y = rec7B_1.Y + RowHeight / 2;
  19329. decimal DiscountAmount = 0;
  19330. for ( int i = dgvData.SelectedRows.Count - 1; i >= 0; i-- )
  19331. {
  19332. DataRow dr = dgvData.SelectedRows[i].Tag as DataRow;
  19333. string tempMemberDisInfo = "";
  19334. if ( dr != null )
  19335. {
  19336. DataRow[] memberDataRows = tableMember.Select( " Mc_Number = '" + dr["Pay_McNumber"] + "'" );
  19337. if ( memberDataRows.Length > 0 )
  19338. {
  19339. if ( LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.MemberBalance )
  19340. {
  19341. tempMemberDisInfo += "[会员卡" + memberDataRows[0]["MC_CradNumber"] + " 的余额:" + memberDataRows[0]["mc_money"] + "]";
  19342. }
  19343. }
  19344. }
  19345. if ( !string.IsNullOrEmpty( dgvData.SelectedRows[i].Cells["DiscountAmount"].Value.ToString().Trim() ) )
  19346. {
  19347. if ( Convert.ToDecimal( dgvData.SelectedRows[i].Cells["DiscountAmount"].Value ) > 0 )
  19348. {
  19349. DiscountAmount += Convert.ToDecimal( dgvData.SelectedRows[i].Cells["DiscountAmount"].Value );
  19350. }
  19351. }
  19352. rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "收款项目:" );
  19353. sizef = g.MeasureString( rec1Value, ft12 );
  19354. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  19355. FtHeight = Convert.ToInt32( sizef.Height );
  19356. Rectangle recFor1 = new Rectangle( rec2.X, IntPoint_Y, FtWidth, rec2.Height );
  19357. g.DrawString( rec1Value, ft12, b, recFor1 );
  19358. 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();//收款项目
  19359. Rectangle recFor1A = new Rectangle( recFor1.Width, recFor1.Y, TableWidth - FtWidth, recFor1.Height );
  19360. g.DrawString( StrCategory, ft12, b, recFor1A );
  19361. Rectangle recFor2 = new Rectangle( recFor1.X, recFor1.Y + recFor1.Height, recFor1.Width, recFor1.Height );
  19362. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "支付方式:" ), ft12, b, recFor2 );
  19363. Rectangle recFor2A = new Rectangle( recFor1A.X, recFor2.Y, recFor1A.Width, recFor2.Height );
  19364. g.DrawString( dgvData.SelectedRows[i].Cells["Pay_PaymentMethod"].Value.ToString().Trim(), ft12, b, recFor2A );
  19365. Rectangle recFor3 = new Rectangle( recFor2.X, recFor2.Y + recFor2.Height, recFor1.Width, recFor2A.Height );
  19366. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 金 额:" ), ft12, b, recFor3 );
  19367. Rectangle recFor3A = new Rectangle( recFor1A.X, recFor3.Y, recFor2A.Width, recFor3.Height );
  19368. g.DrawString( dgvData.SelectedRows[i].Cells["Pay_AmountOf"].Value.ToString().Trim(), ft12, b, recFor3A );
  19369. Rectangle recFor4 = new Rectangle( recFor3.X, recFor3.Y + recFor3.Height, recFor1.Width, recFor3A.Height );
  19370. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 门 市:" ), ft12, b, recFor4 );
  19371. Rectangle recFor4A = new Rectangle( recFor3A.X, recFor4.Y, recFor3A.Width, recFor4.Height );
  19372. g.DrawString( dgvData.SelectedRows[i].Cells["Pay_OpenSingle"].Value.ToString().Trim(), ft12, b, recFor4A );
  19373. Rectangle recFor5 = new Rectangle( recFor4.X, recFor4.Y + recFor4.Height, recFor1.Width, recFor4.Height );
  19374. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 收 银:" ), ft12, b, recFor5 );
  19375. Rectangle recFor5A = new Rectangle( recFor4A.X, recFor5.Y, recFor4A.Width, recFor5.Height );
  19376. g.DrawString( dgvData.SelectedRows[i].Cells["Pay_ThePayee"].Value.ToString().Trim(), ft12, b, recFor5A );
  19377. rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( " 说 明: " ) + dgvData.SelectedRows[i].Cells["Pay_Remark"].Value.ToString().Trim() + tempMemberDisInfo;
  19378. sizef = g.MeasureString( rec1Value, ft12 );
  19379. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  19380. double fordbHeight = sizef.Height;
  19381. int forRowCount = FtWidth / TableWidth;
  19382. forRowCount++;
  19383. double forNewRowHeight = (fordbHeight * float.Parse( forRowCount.ToString() ));
  19384. Rectangle recFor6 = new Rectangle( recFor5.X, recFor5.Y + recFor5.Height, TableWidth, Convert.ToInt32( forNewRowHeight ) + 1 );
  19385. g.DrawString( rec1Value, ft12, b, recFor6 );
  19386. IntPoint_Y = recFor6.Y + recFor6.Height + RowHeight / 2;
  19387. string StrProjectName = dgvData.SelectedRows[i].Cells["Pay_ReceivableProject"].Value.ToString().Trim();
  19388. if ( StrProjectName.Trim() == LYFZ.EnumPublic.PaymentCategoryEnum.全款.ToString() || StrProjectName.Trim() == LYFZ.EnumPublic.PaymentCategoryEnum.后期收款.ToString() ||
  19389. StrProjectName.Trim() == LYFZ.EnumPublic.PaymentCategoryEnum.预约补款.ToString() || StrProjectName.Trim() == LYFZ.EnumPublic.PaymentCategoryEnum.预约收款.ToString() )
  19390. {
  19391. ActualOrd_Amount += Convert.ToDecimal( dgvData.SelectedRows[i].Cells["Pay_AmountOf"].Value );
  19392. }
  19393. else
  19394. {
  19395. Actualsale_Amount += Convert.ToDecimal( dgvData.SelectedRows[i].Cells["Pay_AmountOf"].Value );
  19396. }
  19397. }
  19398. #endregion
  19399. Point rec8_1 = new Point( rec2.X, IntPoint_Y );
  19400. Point rec8_2 = new Point( TableWidth, rec8_1.Y );
  19401. g.DrawLine( pen, rec8_1, rec8_2 );
  19402. ActualAmount = (ActualOrd_Amount + Actualsale_Amount);
  19403. #region 第十行 应付金额
  19404. Rectangle rec9 = new Rectangle( rec2.X, rec8_1.Y + RowHeight / 2, rec2.Width, RowHeight );
  19405. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "应付金额:" ), ft12, b, rec9 );
  19406. Rectangle rec9A = new Rectangle( rec9.X + rec9.Width, rec9.Y - ContentHeight, TableWidth - rec9.Width, rec9.Height );
  19407. g.DrawString( htData["CopeAmount"].ToString().Trim(), ft12, b, rec9A );
  19408. Point rec9A_1 = new Point( rec9A.X, rec9A.Y + rec9A.Height - Underline );
  19409. Point rec9A_2 = new Point( rec9A.X + rec9A.Width, rec9A_1.Y );
  19410. g.DrawLine( p, rec9A_1, rec9A_2 );
  19411. #endregion
  19412. #region 第十一行 实付金额
  19413. Rectangle rec10 = new Rectangle( rec9.X, rec9.Y + rec9.Height, rec9.Width, RowHeight );
  19414. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "实付金额:" ), ft12, b, rec10 );
  19415. Rectangle rec10A = new Rectangle( rec10.X + rec10.Width, rec10.Y - ContentHeight, TableWidth - rec10.Width, rec10.Height );
  19416. g.DrawString( (ActualAmount - DiscountAmount).ToString(), ft12, b, rec10A );
  19417. Point rec10A_1 = new Point( rec10A.X, rec10A.Y + rec10A.Height - Underline );
  19418. Point rec10A_2 = new Point( rec10A.X + rec10A.Width, rec10A_1.Y );
  19419. g.DrawLine( p, rec10A_1, rec10A_2 );
  19420. #endregion
  19421. #region 第十二行 欠款
  19422. Rectangle rec11 = new Rectangle( rec10.X, rec10.Y + rec10.Height, rec10.Width, RowHeight );
  19423. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 欠 款:" ), ft12, b, rec11 );
  19424. Rectangle rec11A = new Rectangle( rec11.X + rec11.Width, rec11.Y - ContentHeight, TableWidth - rec11.Width, rec11.Height );
  19425. g.DrawString( htData["Arrear"].ToString().Trim(), ft12, b, rec11A );
  19426. Point rec11A_1 = new Point( rec11A.X, rec11A.Y + rec11A.Height - Underline );
  19427. Point rec11A_2 = new Point( rec11A.X + rec11A.Width, rec11A_1.Y );
  19428. g.DrawLine( p, rec11A_1, rec11A_2 );
  19429. #endregion
  19430. #region 优惠
  19431. int rec11A_1_Y = rec11A_1.Y + rec11.Height / 2;
  19432. if ( DiscountAmount > 0 )
  19433. {
  19434. Rectangle rec11A1_0 = new Rectangle( rec11.X, rec11.Y + rec11.Height, rec11.Width, RowHeight );
  19435. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 优 惠:" ), ft12, b, rec11A1_0 );
  19436. Rectangle rec11A1_1 = new Rectangle( rec11A1_0.X + rec11A1_0.Width, rec11A1_0.Y - ContentHeight, TableWidth - rec11A1_0.Width, rec11A1_0.Height );
  19437. g.DrawString( DiscountAmount.ToString().Trim(), ft12, b, rec11A1_1 );
  19438. Point rec11A_11 = new Point( rec11A1_1.X, rec11A1_1.Y + rec11A1_1.Height - Underline );
  19439. Point rec11A_21 = new Point( rec11A1_1.X + rec11A1_1.Width, rec11A_11.Y );
  19440. g.DrawLine( p, rec11A_11, rec11A_21 );
  19441. rec11A_1_Y = rec11A_11.Y + rec11.Height / 2;
  19442. }
  19443. #endregion
  19444. #region 第十三行 备注
  19445. string PaymentExplain = "";
  19446. if ( PrintOtherData.ContainsKey( "收款单说明" ) && PrintOtherData["收款单说明"].ToString().Trim().Length > 0 )
  19447. {
  19448. PaymentExplain = PrintOtherData["收款单说明"].ToString().Trim();
  19449. }
  19450. rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( " 备 注: " ) + PaymentExplain;
  19451. sizef = g.MeasureString( rec1Value, ft12 );
  19452. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  19453. double dbHeight = sizef.Height;
  19454. int RowCount = FtWidth / TableWidth;
  19455. RowCount++;
  19456. double NewRowHeight = (dbHeight * float.Parse( RowCount.ToString() ));
  19457. Rectangle rec12 = new Rectangle( rec11.X, rec11A_1_Y, TableWidth + 7, Convert.ToInt32( NewRowHeight ) + 1 );
  19458. g.DrawString( rec1Value, ft12, b, rec12 );
  19459. #endregion
  19460. #region 第十四行 服务电话
  19461. Rectangle rec13 = new Rectangle( rec12.X, rec12.Y + rec12.Height, TableWidth, RowHeight );
  19462. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "服务电话:" ) + tbl_Info.Rows[0]["Company_Telephone"].ToString().Trim(), ft12, b, rec13 );
  19463. #endregion
  19464. #region 第十五行 客户确认
  19465. Rectangle rec14 = new Rectangle( rec13.X, rec13.Y + rec13.Height + rec13.Height, rec2.Width, RowHeight );
  19466. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客户确认" ), ft12, b, rec14 );
  19467. Point rec14_1 = new Point( rec14.Width, rec14.Y + rec14.Height + rec14.Height / 2 );
  19468. Point rec14_2 = new Point( TableWidth, rec14_1.Y );
  19469. g.DrawLine( p, rec14_1, rec14_2 );
  19470. #endregion
  19471. #region 第十六行 打印时间
  19472. Rectangle rec15 = new Rectangle( rec14.X, rec14.Y + rec14.Height + rec14.Height, TableWidth, RowHeight );
  19473. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "打印时间:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy-MM-dd HH:mm:ss" ), ft12, b, rec15 );
  19474. int TopHeight = rec15.Y + rec15.Height;
  19475. //if (IsPrintSerialNo && PrintPageCount > 1)
  19476. if ( IsPrintSerialNo )
  19477. {
  19478. if ( l == 0 )
  19479. {
  19480. StrSmallTicketSerialNumber = GetSmallTicketSerialNumber();
  19481. }
  19482. if ( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition )
  19483. {
  19484. StrSmallTicketSerialNumber = PrintReceiptSerial( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.CurrentCompanyInfoID );
  19485. }
  19486. Rectangle rec16 = new Rectangle( rec15.X, TopHeight, TableWidth, RowHeight );
  19487. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 流水号:SNO" ) + StrSmallTicketSerialNumber, ft12, b, rec16 );
  19488. TopHeight += rec15.Height;
  19489. }
  19490. #endregion
  19491. #region 尾
  19492. rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "谢谢惠顾!" );
  19493. sizef = g.MeasureString( rec1Value, ft12 );
  19494. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  19495. FtHeight = Convert.ToInt32( sizef.Height );
  19496. Rectangle rec17 = new Rectangle( TableWidth / 2 - FtWidth / 2, TopHeight + rec15.Height / 2, TableWidth, RowHeight );
  19497. g.DrawString( rec1Value, ft12, b, rec17 );
  19498. #endregion
  19499. StartRows_Y = rec17.Y + rec17.X + RowHeight * 2;
  19500. }
  19501. }
  19502. /// <summary>
  19503. /// 小票打印其他二销收款
  19504. /// </summary>
  19505. public static void SmallTicket_OtherTwoSalesPayment( object objValue, Graphics g, Size size, bool IsPrintSerialNo )
  19506. {
  19507. Hashtable htData = (Hashtable)objValue;
  19508. DataGridViewEx dgvData = (DataGridViewEx)htData["dgvData"];
  19509. string strText = htData["strText"].ToString().Trim();
  19510. string[] ObjStr = strText.Split( '|' );
  19511. string ExecuteSql = orbll.GetView_CustomReturnExecuteSql( "tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Telephone" );
  19512. ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql( "tb_ErpTwoSalesOrder", StrWhere: "Tsorder_Number = '" + ObjStr[0].Trim() + "'" );
  19513. DataSet dtSet = orbll.GetView_Custom( ExecuteSql );
  19514. DataTable tbl_Info = dtSet.Tables["ds"];//获取影楼信息
  19515. DataTable tbl2 = dtSet.Tables["ds1"]; //获取订单信息
  19516. if ( tbl_Info.Rows.Count <= 0 )
  19517. {
  19518. MessageBoxCustom.Show( "未设置影楼信息" ); return;
  19519. }
  19520. if ( tbl2.Rows.Count == 0 )
  19521. {
  19522. MessageBoxCustom.Show( "订单不存在" ); return;
  19523. }
  19524. Brush b = Brushes.Black;
  19525. Pen p = new Pen( b, 1 );
  19526. Pen pen = new Pen( b, 1 );
  19527. pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Custom;
  19528. pen.DashPattern = new float[] { 5, 5 };
  19529. string StrFont = "宋体";
  19530. Font ft10 = new Font( StrFont, 17, GraphicsUnit.Pixel );
  19531. Font ft9 = new Font( StrFont, 12, GraphicsUnit.Pixel );
  19532. int Underline = 3;
  19533. int ContentHeight = 2;
  19534. int TableWidth = size.Width;
  19535. int RowHeight = Convert.ToInt32( g.MeasureString( "调试行高", ft9 ).Height );
  19536. int StartRows_Y = 0;
  19537. string StrSmallTicketSerialNumber = "";
  19538. for ( int l = 0; l < PrintPageCount; l++ )
  19539. {
  19540. #region 收款标题
  19541. SizeF sizef = g.MeasureString( DefaultPrintTitle, ft10, TableWidth );
  19542. int FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  19543. int FtHeight = Convert.ToInt32( sizef.Height );
  19544. Rectangle rec1 = new Rectangle( TableWidth / 2 - FtWidth / 2, StartRows_Y, TableWidth, FtHeight );
  19545. g.DrawString( DefaultPrintTitle, ft10, b, rec1 );
  19546. #endregion
  19547. #region 客户资料
  19548. #region 第一行 流程单号
  19549. string rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "流程单号:" );
  19550. sizef = g.MeasureString( rec1Value, ft9 );
  19551. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  19552. FtHeight = Convert.ToInt32( sizef.Height );
  19553. Rectangle rec2 = new Rectangle( 0, rec1.Y + rec1.Height + 5, FtWidth, RowHeight );
  19554. g.DrawString( rec1Value, ft9, b, rec2 );
  19555. Rectangle rec2A = new Rectangle( rec2.X + rec2.Width, rec2.Y - ContentHeight, TableWidth - rec2.Width, rec2.Height );
  19556. g.DrawString( ObjStr[0].Trim(), ft9, b, rec2A );
  19557. Point rec2A_1 = new Point( rec2A.X, rec2A.Y + rec2A.Height - Underline );
  19558. Point rec2A_2 = new Point( rec2A.X + rec2A.Width, rec2A_1.Y );
  19559. g.DrawLine( p, rec2A_1, rec2A_2 );
  19560. #endregion
  19561. string StrSex = ""; //性别
  19562. string StrName = "";// 客户姓名
  19563. string StrPhone = "";// 联系电话
  19564. if ( tbl2.Rows[0]["Tsorder_CustomerName"].ToString().Trim() != "" )
  19565. {
  19566. StrName = tbl2.Rows[0]["Tsorder_CustomerName"].ToString().Trim();
  19567. sizef = g.MeasureString( StrName, ft10 );
  19568. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  19569. FtHeight = Convert.ToInt32( sizef.Height );
  19570. if ( tbl2.Rows[0]["Tsorder_Telephone"].ToString().Trim() != "" )
  19571. {
  19572. StrPhone = tbl2.Rows[0]["Tsorder_Telephone"].ToString().Trim();
  19573. }
  19574. }
  19575. else
  19576. {
  19577. 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];
  19578. if ( tblClient.Rows.Count > 0 )
  19579. {
  19580. StrName = tblClient.Rows[0]["Cus_Name"].ToString().Trim();
  19581. sizef = g.MeasureString( StrName, ft10 );
  19582. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  19583. FtHeight = Convert.ToInt32( sizef.Height );
  19584. StrPhone = tblClient.Rows[0]["Cus_Telephone"].ToString().Trim();
  19585. StrSex = LYFZ.Command.Command_Validate.GetChinaSex( tblClient.Rows[0]["Cus_Sex"] );
  19586. }
  19587. }
  19588. #region 第三行 主联系人姓名
  19589. Rectangle rec4 = new Rectangle( rec2.X, rec2.Y + rec2.Height, rec2.Width, RowHeight );
  19590. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名:" ), ft9, b, rec4 );
  19591. Rectangle rec4A = new Rectangle( rec4.X + rec4.Width, rec4.Y - ContentHeight, TableWidth - rec4.Width, rec4.Height );
  19592. g.DrawString( StrName, ft9, b, rec4A );
  19593. Point rec4A_1 = new Point( rec4A.X, rec4A.Y + rec4A.Height - Underline );
  19594. Point rec4A_2 = new Point( rec4A.X + rec4A.Width, rec4A_1.Y );
  19595. g.DrawLine( p, rec4A_1, rec4A_2 );
  19596. #endregion
  19597. #region 第四行 性别
  19598. Rectangle rec5 = new Rectangle( rec4.X, rec4.Y + rec4.Height, rec4.Width, RowHeight );
  19599. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 性 别:" ), ft9, b, rec5 );
  19600. Rectangle rec5A = new Rectangle( rec5.X + rec5.Width, rec5.Y - ContentHeight, TableWidth - rec5.Width, rec5.Height );
  19601. g.DrawString( StrSex, ft9, b, rec5A );
  19602. Point rec5A_1 = new Point( rec5A.X, rec5A.Y + rec5A.Height - Underline );
  19603. Point rec5A_2 = new Point( rec5A.X + rec5A.Width, rec5A_1.Y );
  19604. g.DrawLine( p, rec5A_1, rec5A_2 );
  19605. #endregion
  19606. #region 第五行 联系电话
  19607. Rectangle rec6 = new Rectangle( rec5.X, rec5.Y + rec5.Height, rec5.Width, RowHeight );
  19608. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "联系电话:" ), ft9, b, rec6 );
  19609. Rectangle rec6A = new Rectangle( rec6.X + rec6.Width, rec6.Y - ContentHeight, TableWidth - rec6.Width, rec6.Height );
  19610. g.DrawString( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( StrPhone ), ft9, b, rec6A );
  19611. Point rec6A_1 = new Point( rec6A.X, rec6A.Y + rec6A.Height - Underline );
  19612. Point rec6A_2 = new Point( rec6A.X + rec6A.Width, rec6A_1.Y );
  19613. g.DrawLine( p, rec6A_1, rec6A_2 );
  19614. #endregion
  19615. int IntPoint_Y = rec6A_1.Y + rec6.Height / 3;
  19616. #endregion
  19617. Point rec7B_1 = new Point( 0, IntPoint_Y + RowHeight / 2 );
  19618. Point rec7B_2 = new Point( TableWidth, rec7B_1.Y );
  19619. g.DrawLine( pen, rec7B_1, rec7B_2 );
  19620. #region 第八行 产品
  19621. IntPoint_Y = rec7B_1.Y + RowHeight / 2;
  19622. decimal DiscountAmount = 0;
  19623. for ( int i = dgvData.SelectedRows.Count - 1; i >= 0; i-- )
  19624. {
  19625. if ( !string.IsNullOrEmpty( dgvData.SelectedRows[i].Cells["DiscountAmount"].Value.ToString().Trim() ) )
  19626. {
  19627. if ( Convert.ToDecimal( dgvData.SelectedRows[i].Cells["DiscountAmount"].Value ) > 0 )
  19628. {
  19629. DiscountAmount += Convert.ToDecimal( dgvData.SelectedRows[i].Cells["DiscountAmount"].Value );
  19630. }
  19631. }
  19632. rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "收款项目:" );
  19633. sizef = g.MeasureString( rec1Value, ft9 );
  19634. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  19635. FtHeight = Convert.ToInt32( sizef.Height );
  19636. Rectangle recFor1 = new Rectangle( rec2.X, IntPoint_Y, FtWidth, rec2.Height );
  19637. g.DrawString( rec1Value, ft9, b, recFor1 );
  19638. 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();//收款项目
  19639. Rectangle recFor1A = new Rectangle( recFor1.Width, recFor1.Y, TableWidth - FtWidth, recFor1.Height );
  19640. g.DrawString( StrCategory, ft9, b, recFor1A );
  19641. Rectangle recFor2 = new Rectangle( recFor1.X, recFor1.Y + recFor1.Height, recFor1.Width, recFor1.Height );
  19642. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "支付方式:" ), ft9, b, recFor2 );
  19643. Rectangle recFor2A = new Rectangle( recFor1A.X, recFor2.Y, recFor1A.Width, recFor2.Height );
  19644. g.DrawString( dgvData.SelectedRows[i].Cells["Pay_PaymentMethod"].Value.ToString().Trim(), ft9, b, recFor2A );
  19645. Rectangle recFor3 = new Rectangle( recFor2.X, recFor2.Y + recFor2.Height, recFor1.Width, recFor2A.Height );
  19646. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 金 额:" ), ft9, b, recFor3 );
  19647. Rectangle recFor3A = new Rectangle( recFor1A.X, recFor3.Y, recFor2A.Width, recFor3.Height );
  19648. g.DrawString( dgvData.SelectedRows[i].Cells["Pay_AmountOf"].Value.ToString().Trim(), ft9, b, recFor3A );
  19649. Rectangle recFor4 = new Rectangle( recFor3.X, recFor3.Y + recFor3.Height, recFor1.Width, recFor3A.Height );
  19650. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 门 市:" ), ft9, b, recFor4 );
  19651. Rectangle recFor4A = new Rectangle( recFor3A.X, recFor4.Y, recFor3A.Width, recFor4.Height );
  19652. g.DrawString( dgvData.SelectedRows[i].Cells["Pay_OpenSingle"].Value.ToString().Trim(), ft9, b, recFor4A );
  19653. Rectangle recFor5 = new Rectangle( recFor4.X, recFor4.Y + recFor4.Height, recFor1.Width, recFor4.Height );
  19654. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 收 银:" ), ft9, b, recFor5 );
  19655. Rectangle recFor5A = new Rectangle( recFor4A.X, recFor5.Y, recFor4A.Width, recFor5.Height );
  19656. g.DrawString( dgvData.SelectedRows[i].Cells["Pay_ThePayee"].Value.ToString().Trim(), ft9, b, recFor5A );
  19657. rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( " 说 明: " ) + dgvData.SelectedRows[i].Cells["Pay_Remark"].Value.ToString().Trim();
  19658. sizef = g.MeasureString( rec1Value, ft9 );
  19659. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  19660. double fordbHeight = sizef.Height;
  19661. int forRowCount = FtWidth / TableWidth;
  19662. forRowCount++;
  19663. double forNewRowHeight = (fordbHeight * float.Parse( forRowCount.ToString() ));
  19664. Rectangle recFor6 = new Rectangle( recFor5.X, recFor5.Y + recFor5.Height, TableWidth, Convert.ToInt32( forNewRowHeight ) + 1 );
  19665. g.DrawString( rec1Value, ft9, b, recFor6 );
  19666. IntPoint_Y = recFor6.Y + recFor6.Height + RowHeight / 2;
  19667. }
  19668. #endregion
  19669. Point rec8_1 = new Point( rec2.X, IntPoint_Y );
  19670. Point rec8_2 = new Point( TableWidth, rec8_1.Y );
  19671. g.DrawLine( pen, rec8_1, rec8_2 );
  19672. #region 第十行 应付金额
  19673. Rectangle rec9 = new Rectangle( rec2.X, rec8_1.Y + RowHeight / 2, rec2.Width, RowHeight );
  19674. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "应付金额:" ), ft9, b, rec9 );
  19675. Rectangle rec9A = new Rectangle( rec9.X + rec9.Width, rec9.Y - ContentHeight, TableWidth - rec9.Width, rec9.Height );
  19676. g.DrawString( ObjStr[1].Trim(), ft9, b, rec9A );
  19677. Point rec9A_1 = new Point( rec9A.X, rec9A.Y + rec9A.Height - Underline );
  19678. Point rec9A_2 = new Point( rec9A.X + rec9A.Width, rec9A_1.Y );
  19679. g.DrawLine( p, rec9A_1, rec9A_2 );
  19680. #endregion
  19681. #region 第十一行 实付金额
  19682. Rectangle rec10 = new Rectangle( rec9.X, rec9.Y + rec9.Height, rec9.Width, RowHeight );
  19683. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "实付金额:" ), ft9, b, rec10 );
  19684. Rectangle rec10A = new Rectangle( rec10.X + rec10.Width, rec10.Y - ContentHeight, TableWidth - rec10.Width, rec10.Height );
  19685. g.DrawString( ObjStr[2].Trim(), ft9, b, rec10A );
  19686. Point rec10A_1 = new Point( rec10A.X, rec10A.Y + rec10A.Height - Underline );
  19687. Point rec10A_2 = new Point( rec10A.X + rec10A.Width, rec10A_1.Y );
  19688. g.DrawLine( p, rec10A_1, rec10A_2 );
  19689. #endregion
  19690. #region 第十二行 欠款
  19691. Rectangle rec11 = new Rectangle( rec10.X, rec10.Y + rec10.Height, rec10.Width, RowHeight );
  19692. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 欠 款:" ), ft9, b, rec11 );
  19693. Rectangle rec11A = new Rectangle( rec11.X + rec11.Width, rec11.Y - ContentHeight, TableWidth - rec11.Width, rec11.Height );
  19694. g.DrawString( ObjStr[3].Trim(), ft9, b, rec11A );
  19695. Point rec11A_1 = new Point( rec11A.X, rec11A.Y + rec11A.Height - Underline );
  19696. Point rec11A_2 = new Point( rec11A.X + rec11A.Width, rec11A_1.Y );
  19697. g.DrawLine( p, rec11A_1, rec11A_2 );
  19698. #endregion
  19699. #region 优惠
  19700. int rec11A_1_Y = rec11A_1.Y + rec11.Height / 2;
  19701. if ( DiscountAmount > 0 )
  19702. {
  19703. Rectangle rec11A1_0 = new Rectangle( rec11.X, rec11.Y + rec11.Height, rec11.Width, RowHeight );
  19704. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 优 惠:" ), ft9, b, rec11A1_0 );
  19705. Rectangle rec11A1_1 = new Rectangle( rec11A1_0.X + rec11A1_0.Width, rec11A1_0.Y - ContentHeight, TableWidth - rec11A1_0.Width, rec11A1_0.Height );
  19706. g.DrawString( DiscountAmount.ToString().Trim(), ft9, b, rec11A1_1 );
  19707. Point rec11A_11 = new Point( rec11A1_1.X, rec11A1_1.Y + rec11A1_1.Height - Underline );
  19708. Point rec11A_21 = new Point( rec11A1_1.X + rec11A1_1.Width, rec11A_11.Y );
  19709. g.DrawLine( p, rec11A_11, rec11A_21 );
  19710. rec11A_1_Y = rec11A_11.Y + rec11.Height / 2;
  19711. }
  19712. #endregion
  19713. #region 第十三行 备注
  19714. string PaymentExplain = "";
  19715. if ( PrintOtherData.ContainsKey( "收款单说明" ) && PrintOtherData["收款单说明"].ToString().Trim().Length > 0 )
  19716. {
  19717. PaymentExplain = PrintOtherData["收款单说明"].ToString().Trim();
  19718. }
  19719. rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( " 备 注: " ) + PaymentExplain;
  19720. sizef = g.MeasureString( rec1Value, ft9 );
  19721. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  19722. double dbHeight = sizef.Height;
  19723. int RowCount = FtWidth / TableWidth;
  19724. RowCount++;
  19725. double NewRowHeight = (dbHeight * float.Parse( RowCount.ToString() ));
  19726. Rectangle rec12 = new Rectangle( rec11.X, rec11A_1_Y, TableWidth + 7, Convert.ToInt32( NewRowHeight ) + 1 );
  19727. g.DrawString( rec1Value, ft9, b, rec12 );
  19728. #endregion
  19729. #region 第十四行 服务电话
  19730. Rectangle rec13 = new Rectangle( rec12.X, rec12.Y + rec12.Height, TableWidth, RowHeight );
  19731. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "服务电话:" ) + tbl_Info.Rows[0]["Company_Telephone"].ToString().Trim(), ft9, b, rec13 );
  19732. #endregion
  19733. #region 第十五行 客户确认
  19734. Rectangle rec14 = new Rectangle( rec13.X, rec13.Y + rec13.Height + rec13.Height, rec2.Width, RowHeight );
  19735. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客户确认" ), ft9, b, rec14 );
  19736. Point rec14_1 = new Point( rec14.Width, rec14.Y + rec14.Height + rec14.Height / 2 );
  19737. Point rec14_2 = new Point( TableWidth, rec14_1.Y );
  19738. g.DrawLine( p, rec14_1, rec14_2 );
  19739. #endregion
  19740. #region 第十六行 打印时间
  19741. Rectangle rec15 = new Rectangle( rec14.X, rec14.Y + rec14.Height + rec14.Height, TableWidth, RowHeight );
  19742. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "打印时间:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy-MM-dd HH:mm:ss" ), ft9, b, rec15 );
  19743. int TopHeight = rec15.Y + rec15.Height;
  19744. //if (IsPrintSerialNo && PrintPageCount > 1)
  19745. if ( IsPrintSerialNo )
  19746. {
  19747. if ( l == 0 )
  19748. {
  19749. StrSmallTicketSerialNumber = GetSmallTicketSerialNumber();
  19750. }
  19751. if ( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition )
  19752. {
  19753. StrSmallTicketSerialNumber = PrintReceiptSerial( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.CurrentCompanyInfoID );
  19754. }
  19755. Rectangle rec16 = new Rectangle( rec15.X, TopHeight, TableWidth, RowHeight );
  19756. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 流水号:SNO" ) + StrSmallTicketSerialNumber, ft9, b, rec16 );
  19757. TopHeight += rec15.Height;
  19758. }
  19759. #endregion
  19760. #region 尾
  19761. rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "谢谢惠顾!" );
  19762. sizef = g.MeasureString( rec1Value, ft9 );
  19763. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  19764. FtHeight = Convert.ToInt32( sizef.Height );
  19765. Rectangle rec17 = new Rectangle( TableWidth / 2 - FtWidth / 2, TopHeight + rec15.Height / 2, TableWidth, RowHeight );
  19766. g.DrawString( rec1Value, ft9, b, rec17 );
  19767. #endregion
  19768. StartRows_Y = rec17.Y + rec17.X + RowHeight * 2;
  19769. }
  19770. }
  19771. /// <summary>
  19772. /// 小票打印店面、现金支出
  19773. /// </summary>
  19774. public static void SmallTicket_CashOutlayPayment( object objValue, Graphics g, Size size, bool IsPrintSerialNo )
  19775. {
  19776. Hashtable htData = (Hashtable)objValue;
  19777. DataGridViewEc dgvData = (DataGridViewEc)htData["dgvData"];
  19778. string ExecuteSql = orbll.GetView_CustomReturnExecuteSql( "tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Telephone" );
  19779. DataSet dtSet = orbll.GetView_Custom( ExecuteSql );
  19780. //获取影楼信息
  19781. DataTable tbl_Info = dtSet.Tables["ds"];
  19782. if ( tbl_Info.Rows.Count <= 0 )
  19783. {
  19784. MessageBoxCustom.Show( "未设置影楼信息" ); return;
  19785. }
  19786. Brush b = Brushes.Black;
  19787. Pen p = new Pen( b, 1 );
  19788. Pen pen = new Pen( b, 1 );
  19789. pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Custom;
  19790. pen.DashPattern = new float[] { 5, 5 };
  19791. string StrFont = "宋体";
  19792. Font ft10 = new Font( StrFont, 17, GraphicsUnit.Pixel );
  19793. Font ft9 = new Font( StrFont, 12, GraphicsUnit.Pixel );
  19794. int Underline = 3;
  19795. int ContentHeight = 2;
  19796. int TableWidth = size.Width;
  19797. int RowHeight = Convert.ToInt32( g.MeasureString( "调试行高", ft9 ).Height );
  19798. int StartRows_Y = 0;
  19799. string StrSmallTicketSerialNumber = "";
  19800. for ( int l = 0; l < PrintPageCount; l++ )
  19801. {
  19802. #region 收款标题
  19803. SizeF sizef = g.MeasureString( DefaultPrintTitle, ft10, TableWidth );
  19804. int FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  19805. int FtHeight = Convert.ToInt32( sizef.Height );
  19806. Rectangle rec1 = new Rectangle( TableWidth / 2 - FtWidth / 2, StartRows_Y, TableWidth, FtHeight );
  19807. g.DrawString( DefaultPrintTitle, ft10, b, rec1 );
  19808. #endregion
  19809. #region 第一行 支付人
  19810. string rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "流程单号:" );
  19811. sizef = g.MeasureString( rec1Value, ft9 );
  19812. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  19813. FtHeight = Convert.ToInt32( sizef.Height );
  19814. Rectangle rec2 = new Rectangle( 0, rec1.Y + rec1.Height + 5, FtWidth, RowHeight );
  19815. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 支付人:" ), ft9, b, rec2 );
  19816. Rectangle rec2A = new Rectangle( rec2.X + rec2.Width, rec2.Y - ContentHeight, TableWidth - rec2.Width, rec2.Height );
  19817. g.DrawString( dgvData.SelectedRows[0].Cells["取款人"].Value.ToString().Trim(), ft9, b, rec2A );
  19818. Point rec2A_1 = new Point( rec2A.X, rec2A.Y + rec2A.Height - Underline );
  19819. Point rec2A_2 = new Point( rec2A.X + rec2A.Width, rec2A_1.Y );
  19820. g.DrawLine( p, rec2A_1, rec2A_2 );
  19821. #endregion
  19822. int IntPoint_Y = rec2A_1.Y + rec2.Height / 3;
  19823. Point rec7B_1 = new Point( 0, IntPoint_Y + RowHeight / 2 );
  19824. Point rec7B_2 = new Point( TableWidth, rec7B_1.Y );
  19825. g.DrawLine( pen, rec7B_1, rec7B_2 );
  19826. decimal ActualAmount = 0;//实付金额
  19827. #region 第八行 产品
  19828. IntPoint_Y = rec7B_1.Y + RowHeight / 2;
  19829. for ( int i = dgvData.SelectedRows.Count - 1; i >= 0; i-- )
  19830. {
  19831. rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "收款项目:" );
  19832. sizef = g.MeasureString( rec1Value, ft9 );
  19833. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  19834. FtHeight = Convert.ToInt32( sizef.Height );
  19835. Rectangle recFor1 = new Rectangle( rec2.X, IntPoint_Y, FtWidth, rec2.Height );
  19836. g.DrawString( rec1Value, ft9, b, recFor1 );
  19837. string StrCategory = dgvData.SelectedRows[i].Cells["费用项目"].Value.ToString().Trim();//收款项目
  19838. Rectangle recFor1A = new Rectangle( recFor1.Width, recFor1.Y, TableWidth - FtWidth, recFor1.Height );
  19839. g.DrawString( StrCategory, ft9, b, recFor1A );
  19840. Rectangle recFor2 = new Rectangle( recFor1.X, recFor1.Y + recFor1.Height, recFor1.Width, recFor1.Height );
  19841. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 金 额:" ), ft9, b, recFor2 );
  19842. Rectangle recFor2A = new Rectangle( recFor1A.X, recFor2.Y, recFor1A.Width, recFor2.Height );
  19843. g.DrawString( dgvData.SelectedRows[i].Cells["费用金额"].Value.ToString().Trim(), ft9, b, recFor2A );
  19844. Rectangle recFor3 = new Rectangle( recFor2.X, recFor2.Y + recFor2.Height, recFor1.Width, recFor2A.Height );
  19845. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 经手人:" ), ft9, b, recFor3 );
  19846. Rectangle recFor3A = new Rectangle( recFor1A.X, recFor3.Y, recFor2A.Width, recFor3.Height );
  19847. g.DrawString( dgvData.SelectedRows[i].Cells["录单人"].Value.ToString().Trim(), ft9, b, recFor3A );
  19848. rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( " 说 明: " ) + dgvData.SelectedRows[i].Cells["支出说明"].Value.ToString().Trim();
  19849. sizef = g.MeasureString( rec1Value, ft9 );
  19850. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  19851. double fordbHeight = sizef.Height;
  19852. int forRowCount = FtWidth / TableWidth;
  19853. forRowCount++;
  19854. double forNewRowHeight = (fordbHeight * float.Parse( forRowCount.ToString() ));
  19855. Rectangle recFor6 = new Rectangle( recFor3.X, recFor3.Y + recFor3.Height, TableWidth, Convert.ToInt32( forNewRowHeight ) + 1 );
  19856. g.DrawString( rec1Value, ft9, b, recFor6 );
  19857. IntPoint_Y = recFor6.Y + recFor6.Height + RowHeight / 2;
  19858. ActualAmount += Convert.ToDecimal( dgvData.SelectedRows[i].Cells["费用金额"].Value );
  19859. }
  19860. #endregion
  19861. decimal CopeAmount = ActualAmount;//总额
  19862. Point rec8_1 = new Point( rec2.X, IntPoint_Y );
  19863. Point rec8_2 = new Point( TableWidth, rec8_1.Y );
  19864. g.DrawLine( pen, rec8_1, rec8_2 );
  19865. #region 第十行 应付金额
  19866. Rectangle rec9 = new Rectangle( rec2.X, rec8_1.Y + RowHeight / 2, rec2.Width, RowHeight );
  19867. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 总 额:" ), ft9, b, rec9 );
  19868. Rectangle rec9A = new Rectangle( rec9.X + rec9.Width, rec9.Y - ContentHeight, TableWidth - rec9.Width, rec9.Height );
  19869. g.DrawString( CopeAmount.ToString(), ft9, b, rec9A );
  19870. Point rec9A_1 = new Point( rec9A.X, rec9A.Y + rec9A.Height - Underline );
  19871. Point rec9A_2 = new Point( rec9A.X + rec9A.Width, rec9A_1.Y );
  19872. g.DrawLine( p, rec9A_1, rec9A_2 );
  19873. #endregion
  19874. #region 第十一行 实付金额
  19875. Rectangle rec10 = new Rectangle( rec9.X, rec9.Y + rec9.Height, rec9.Width, RowHeight );
  19876. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 实 付:" ), ft9, b, rec10 );
  19877. Rectangle rec10A = new Rectangle( rec10.X + rec10.Width, rec10.Y - ContentHeight, TableWidth - rec10.Width, rec10.Height );
  19878. g.DrawString( ActualAmount.ToString(), ft9, b, rec10A );
  19879. Point rec10A_1 = new Point( rec10A.X, rec10A.Y + rec10A.Height - Underline );
  19880. Point rec10A_2 = new Point( rec10A.X + rec10A.Width, rec10A_1.Y );
  19881. g.DrawLine( p, rec10A_1, rec10A_2 );
  19882. #endregion
  19883. #region 第十三行 备注
  19884. string PaymentExplain = "";
  19885. if ( PrintOtherData.ContainsKey( "收款单说明" ) && PrintOtherData["收款单说明"].ToString().Trim().Length > 0 )
  19886. {
  19887. PaymentExplain = PrintOtherData["收款单说明"].ToString().Trim();
  19888. }
  19889. rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( " 备 注: " ) + PaymentExplain;
  19890. sizef = g.MeasureString( rec1Value, ft9 );
  19891. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  19892. double dbHeight = sizef.Height;
  19893. int RowCount = FtWidth / TableWidth;
  19894. RowCount++;
  19895. double NewRowHeight = (dbHeight * float.Parse( RowCount.ToString() ));
  19896. Rectangle rec12 = new Rectangle( rec10.X, rec10.Y + rec10.Height + rec10.Height / 2, TableWidth + 7, Convert.ToInt32( NewRowHeight ) + 1 );
  19897. g.DrawString( rec1Value, ft9, b, rec12 );
  19898. #endregion
  19899. #region 第十四行 服务电话
  19900. Rectangle rec13 = new Rectangle( rec12.X, rec12.Y + rec12.Height, TableWidth, RowHeight );
  19901. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "服务电话:" ) + tbl_Info.Rows[0]["Company_Telephone"].ToString().Trim(), ft9, b, rec13 );
  19902. #endregion
  19903. #region 第十五行 客户确认
  19904. Rectangle rec14 = new Rectangle( rec13.X, rec13.Y + rec13.Height + rec13.Height, rec2.Width, RowHeight );
  19905. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "支款确认" ), ft9, b, rec14 );
  19906. Point rec14_1 = new Point( rec14.Width, rec14.Y + rec14.Height + rec14.Height / 2 );
  19907. Point rec14_2 = new Point( TableWidth, rec14_1.Y );
  19908. g.DrawLine( p, rec14_1, rec14_2 );
  19909. #endregion
  19910. #region 第十六行 打印时间
  19911. Rectangle rec15 = new Rectangle( rec14.X, rec14.Y + rec14.Height + rec14.Height, TableWidth, RowHeight );
  19912. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "打印时间:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy-MM-dd HH:mm:ss" ), ft9, b, rec15 );
  19913. int TopHeight = rec15.Y + rec15.Height;
  19914. //if (IsPrintSerialNo && PrintPageCount > 1)
  19915. if ( IsPrintSerialNo )
  19916. {
  19917. if ( l == 0 )
  19918. {
  19919. StrSmallTicketSerialNumber = GetSmallTicketSerialNumber();
  19920. }
  19921. if ( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition )
  19922. {
  19923. StrSmallTicketSerialNumber = PrintReceiptSerial( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.CurrentCompanyInfoID );
  19924. }
  19925. Rectangle rec16 = new Rectangle( rec15.X, TopHeight, TableWidth, RowHeight );
  19926. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 流水号:SNO" ) + StrSmallTicketSerialNumber, ft9, b, rec16 );
  19927. TopHeight += rec15.Height;
  19928. }
  19929. #endregion
  19930. #region 尾
  19931. rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "谢谢惠顾!" );
  19932. sizef = g.MeasureString( rec1Value, ft9 );
  19933. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  19934. FtHeight = Convert.ToInt32( sizef.Height );
  19935. Rectangle rec17 = new Rectangle( TableWidth / 2 - FtWidth / 2, TopHeight + rec15.Height / 2, TableWidth, RowHeight );
  19936. g.DrawString( rec1Value, ft9, b, rec17 );
  19937. #endregion
  19938. StartRows_Y = rec17.Y + rec17.X + RowHeight * 2;
  19939. }
  19940. }
  19941. /// <summary>
  19942. /// 小票打印其它收入收款
  19943. /// </summary>
  19944. public static void SmallTicket_OtherIncomePayment( object objValue, Graphics g, Size size, bool IsPrintSerialNo )
  19945. {
  19946. Hashtable htData = (Hashtable)objValue;
  19947. DataGridViewEc dgvData = (DataGridViewEc)htData["dgvData"];
  19948. string ExecuteSql = orbll.GetView_CustomReturnExecuteSql( "tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Telephone" );
  19949. DataSet dtSet = orbll.GetView_Custom( ExecuteSql );
  19950. //获取影楼信息
  19951. DataTable tbl_Info = dtSet.Tables["ds"];
  19952. if ( tbl_Info.Rows.Count <= 0 )
  19953. {
  19954. MessageBoxCustom.Show( "未设置影楼信息" ); return;
  19955. }
  19956. Brush b = Brushes.Black;
  19957. Pen p = new Pen( b, 1 );
  19958. Pen pen = new Pen( b, 1 );
  19959. pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Custom;
  19960. pen.DashPattern = new float[] { 5, 5 };
  19961. string StrFont = "宋体";
  19962. Font ft10 = new Font( StrFont, 17, GraphicsUnit.Pixel );
  19963. Font ft9 = new Font( StrFont, 12, GraphicsUnit.Pixel );
  19964. int Underline = 3;
  19965. int ContentHeight = 2;
  19966. int TableWidth = size.Width;
  19967. int RowHeight = Convert.ToInt32( g.MeasureString( "调试行高", ft9 ).Height );
  19968. int StartRows_Y = 0;
  19969. string StrSmallTicketSerialNumber = "";
  19970. for ( int l = 0; l < PrintPageCount; l++ )
  19971. {
  19972. #region 收款标题
  19973. SizeF sizef = g.MeasureString( DefaultPrintTitle, ft10, TableWidth );
  19974. int FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  19975. int FtHeight = Convert.ToInt32( sizef.Height );
  19976. Rectangle rec1 = new Rectangle( TableWidth / 2 - FtWidth / 2, StartRows_Y, TableWidth, FtHeight );
  19977. g.DrawString( DefaultPrintTitle, ft10, b, rec1 );
  19978. #endregion
  19979. #region 第一行 支付人
  19980. string rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "流程单号:" );
  19981. sizef = g.MeasureString( rec1Value, ft9 );
  19982. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  19983. FtHeight = Convert.ToInt32( sizef.Height );
  19984. Rectangle rec2 = new Rectangle( 0, rec1.Y + rec1.Height + 5, FtWidth, RowHeight );
  19985. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 支付人:" ), ft9, b, rec2 );
  19986. Rectangle rec2A = new Rectangle( rec2.X + rec2.Width, rec2.Y - ContentHeight, TableWidth - rec2.Width, rec2.Height );
  19987. g.DrawString( dgvData.SelectedRows[0].Cells["付款人"].Value.ToString().Trim(), ft9, b, rec2A );
  19988. Point rec2A_1 = new Point( rec2A.X, rec2A.Y + rec2A.Height - Underline );
  19989. Point rec2A_2 = new Point( rec2A.X + rec2A.Width, rec2A_1.Y );
  19990. g.DrawLine( p, rec2A_1, rec2A_2 );
  19991. #endregion
  19992. int IntPoint_Y = rec2A_1.Y + rec2.Height / 3;
  19993. Point rec7B_1 = new Point( 0, IntPoint_Y + RowHeight / 2 );
  19994. Point rec7B_2 = new Point( TableWidth, rec7B_1.Y );
  19995. g.DrawLine( pen, rec7B_1, rec7B_2 );
  19996. decimal ActualAmount = 0;//实付金额
  19997. #region 第八行 产品
  19998. IntPoint_Y = rec7B_1.Y + RowHeight / 2;
  19999. for ( int i = dgvData.SelectedRows.Count - 1; i >= 0; i-- )
  20000. {
  20001. rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "收款项目:" );
  20002. sizef = g.MeasureString( rec1Value, ft9 );
  20003. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  20004. FtHeight = Convert.ToInt32( sizef.Height );
  20005. Rectangle recFor1 = new Rectangle( rec2.X, IntPoint_Y, FtWidth, rec2.Height );
  20006. g.DrawString( rec1Value, ft9, b, recFor1 );
  20007. string StrCategory = dgvData.SelectedRows[i].Cells["项目名称"].Value.ToString().Trim();//收款项目
  20008. Rectangle recFor1A = new Rectangle( recFor1.Width, recFor1.Y, TableWidth - FtWidth, recFor1.Height );
  20009. g.DrawString( StrCategory, ft9, b, recFor1A );
  20010. Rectangle recFor2 = new Rectangle( recFor1.X, recFor1.Y + recFor1.Height, recFor1.Width, recFor1.Height );
  20011. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 金 额:" ), ft9, b, recFor2 );
  20012. Rectangle recFor2A = new Rectangle( recFor1A.X, recFor2.Y, recFor1A.Width, recFor2.Height );
  20013. g.DrawString( dgvData.SelectedRows[i].Cells["项目金额"].Value.ToString().Trim(), ft9, b, recFor2A );
  20014. Rectangle recFor3 = new Rectangle( recFor2.X, recFor2.Y + recFor2.Height, recFor1.Width, recFor2A.Height );
  20015. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 经手人:" ), ft9, b, recFor3 );
  20016. Rectangle recFor3A = new Rectangle( recFor1A.X, recFor3.Y, recFor2A.Width, recFor3.Height );
  20017. g.DrawString( dgvData.SelectedRows[i].Cells["录单人"].Value.ToString().Trim(), ft9, b, recFor3A );
  20018. rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( " 说 明: " ) + dgvData.SelectedRows[i].Cells["项目说明"].Value.ToString().Trim();
  20019. sizef = g.MeasureString( rec1Value, ft9 );
  20020. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  20021. double fordbHeight = sizef.Height;
  20022. int forRowCount = FtWidth / TableWidth;
  20023. forRowCount++;
  20024. double forNewRowHeight = (fordbHeight * float.Parse( forRowCount.ToString() ));
  20025. Rectangle recFor6 = new Rectangle( recFor3.X, recFor3.Y + recFor3.Height, TableWidth, Convert.ToInt32( forNewRowHeight ) + 1 );
  20026. g.DrawString( rec1Value, ft9, b, recFor6 );
  20027. IntPoint_Y = recFor6.Y + recFor6.Height + RowHeight / 2;
  20028. ActualAmount += Convert.ToDecimal( dgvData.SelectedRows[i].Cells["项目金额"].Value );
  20029. }
  20030. #endregion
  20031. decimal CopeAmount = ActualAmount;//总额
  20032. Point rec8_1 = new Point( rec2.X, IntPoint_Y );
  20033. Point rec8_2 = new Point( TableWidth, rec8_1.Y );
  20034. g.DrawLine( pen, rec8_1, rec8_2 );
  20035. #region 第十行 应付金额
  20036. Rectangle rec9 = new Rectangle( rec2.X, rec8_1.Y + RowHeight / 2, rec2.Width, RowHeight );
  20037. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "应付金额:" ), ft9, b, rec9 );
  20038. Rectangle rec9A = new Rectangle( rec9.X + rec9.Width, rec9.Y - ContentHeight, TableWidth - rec9.Width, rec9.Height );
  20039. g.DrawString( CopeAmount.ToString(), ft9, b, rec9A );
  20040. Point rec9A_1 = new Point( rec9A.X, rec9A.Y + rec9A.Height - Underline );
  20041. Point rec9A_2 = new Point( rec9A.X + rec9A.Width, rec9A_1.Y );
  20042. g.DrawLine( p, rec9A_1, rec9A_2 );
  20043. #endregion
  20044. #region 第十一行 实付金额
  20045. Rectangle rec10 = new Rectangle( rec9.X, rec9.Y + rec9.Height, rec9.Width, RowHeight );
  20046. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "实付金额:" ), ft9, b, rec10 );
  20047. Rectangle rec10A = new Rectangle( rec10.X + rec10.Width, rec10.Y - ContentHeight, TableWidth - rec10.Width, rec10.Height );
  20048. g.DrawString( ActualAmount.ToString(), ft9, b, rec10A );
  20049. Point rec10A_1 = new Point( rec10A.X, rec10A.Y + rec10A.Height - Underline );
  20050. Point rec10A_2 = new Point( rec10A.X + rec10A.Width, rec10A_1.Y );
  20051. g.DrawLine( p, rec10A_1, rec10A_2 );
  20052. #endregion
  20053. #region 第十二行 欠款
  20054. Rectangle rec11 = new Rectangle( rec10.X, rec10.Y + rec10.Height, rec10.Width, RowHeight );
  20055. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 欠 款:" ), ft9, b, rec11 );
  20056. Rectangle rec11A = new Rectangle( rec11.X + rec11.Width, rec11.Y - ContentHeight, TableWidth - rec11.Width, rec11.Height );
  20057. g.DrawString( "0", ft9, b, rec11A );
  20058. Point rec11A_1 = new Point( rec11A.X, rec11A.Y + rec11A.Height - Underline );
  20059. Point rec11A_2 = new Point( rec11A.X + rec11A.Width, rec11A_1.Y );
  20060. g.DrawLine( p, rec11A_1, rec11A_2 );
  20061. #endregion
  20062. #region 第十三行 备注
  20063. string PaymentExplain = "";
  20064. if ( PrintOtherData.ContainsKey( "收款单说明" ) && PrintOtherData["收款单说明"].ToString().Trim().Length > 0 )
  20065. {
  20066. PaymentExplain = PrintOtherData["收款单说明"].ToString().Trim();
  20067. }
  20068. rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( " 备 注: " ) + PaymentExplain;
  20069. sizef = g.MeasureString( rec1Value, ft9 );
  20070. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  20071. double dbHeight = sizef.Height;
  20072. int RowCount = FtWidth / TableWidth;
  20073. RowCount++;
  20074. double NewRowHeight = (dbHeight * float.Parse( RowCount.ToString() ));
  20075. Rectangle rec12 = new Rectangle( rec11.X, rec11.Y + rec11.Height + rec11.Height / 2, TableWidth + 7, Convert.ToInt32( NewRowHeight ) + 1 );
  20076. g.DrawString( rec1Value, ft9, b, rec12 );
  20077. #endregion
  20078. #region 第十四行 服务电话
  20079. Rectangle rec13 = new Rectangle( rec12.X, rec12.Y + rec12.Height, TableWidth, RowHeight );
  20080. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "服务电话:" ) + tbl_Info.Rows[0]["Company_Telephone"].ToString().Trim(), ft9, b, rec13 );
  20081. #endregion
  20082. #region 第十五行 客户确认
  20083. Rectangle rec14 = new Rectangle( rec13.X, rec13.Y + rec13.Height + rec13.Height, rec2.Width, RowHeight );
  20084. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客户确认" ), ft9, b, rec14 );
  20085. Point rec14_1 = new Point( rec14.Width, rec14.Y + rec14.Height + rec14.Height / 2 );
  20086. Point rec14_2 = new Point( TableWidth, rec14_1.Y );
  20087. g.DrawLine( p, rec14_1, rec14_2 );
  20088. #endregion
  20089. #region 第十六行 打印时间
  20090. Rectangle rec15 = new Rectangle( rec14.X, rec14.Y + rec14.Height + rec14.Height, TableWidth, RowHeight );
  20091. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "打印时间:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy-MM-dd HH:mm:ss" ), ft9, b, rec15 );
  20092. int TopHeight = rec15.Y + rec15.Height;
  20093. //if (IsPrintSerialNo && PrintPageCount > 1)
  20094. if ( IsPrintSerialNo )
  20095. {
  20096. if ( l == 0 )
  20097. {
  20098. StrSmallTicketSerialNumber = GetSmallTicketSerialNumber();
  20099. }
  20100. if ( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition )
  20101. {
  20102. StrSmallTicketSerialNumber = PrintReceiptSerial( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.CurrentCompanyInfoID );
  20103. }
  20104. Rectangle rec16 = new Rectangle( rec15.X, TopHeight, TableWidth, RowHeight );
  20105. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 流水号:SNO" ) + StrSmallTicketSerialNumber, ft9, b, rec16 );
  20106. TopHeight += rec15.Height;
  20107. }
  20108. #endregion
  20109. #region 尾
  20110. rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "谢谢惠顾!" );
  20111. sizef = g.MeasureString( rec1Value, ft9 );
  20112. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  20113. FtHeight = Convert.ToInt32( sizef.Height );
  20114. Rectangle rec17 = new Rectangle( TableWidth / 2 - FtWidth / 2, TopHeight + rec15.Height / 2, TableWidth, RowHeight );
  20115. g.DrawString( rec1Value, ft9, b, rec17 );
  20116. #endregion
  20117. StartRows_Y = rec17.Y + rec17.X + RowHeight * 2;
  20118. }
  20119. }
  20120. /// <summary>
  20121. /// 小票打印礼服出租收款
  20122. /// </summary>
  20123. public static void SmallTicket_GownsPayment( object objValue, Graphics g, Size size, bool IsPrintSerialNo )
  20124. {
  20125. Hashtable htData = (Hashtable)objValue;
  20126. DataGridViewEx dgvData = (DataGridViewEx)htData["dgvData"];
  20127. string ExecuteSql = orbll.GetView_CustomReturnExecuteSql( "tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Telephone" );
  20128. DataSet dtSet = orbll.GetView_Custom( ExecuteSql );
  20129. DataTable tbl_Info = dtSet.Tables["ds"]; //获取影楼信息
  20130. if ( tbl_Info.Rows.Count <= 0 )
  20131. {
  20132. MessageBoxCustom.Show( "未设置影楼信息" ); return;
  20133. }
  20134. Brush b = Brushes.Black;
  20135. Pen p = new Pen( b, 1 );
  20136. Pen pen = new Pen( b, 1 );
  20137. pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Custom;
  20138. pen.DashPattern = new float[] { 5, 5 };
  20139. string StrFont = "宋体";
  20140. Font ft10 = new Font( StrFont, 17, GraphicsUnit.Pixel );
  20141. Font ft9 = new Font( StrFont, 12, GraphicsUnit.Pixel );
  20142. int Underline = 3;
  20143. int ContentHeight = 2;
  20144. int TableWidth = size.Width;
  20145. int RowHeight = Convert.ToInt32( g.MeasureString( "调试行高", ft9 ).Height );
  20146. int StartRows_Y = 0;
  20147. string StrSmallTicketSerialNumber = "";
  20148. for ( int l = 0; l < PrintPageCount; l++ )
  20149. {
  20150. #region 收款标题
  20151. SizeF sizef = g.MeasureString( DefaultPrintTitle, ft10, TableWidth );
  20152. int FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  20153. int FtHeight = Convert.ToInt32( sizef.Height );
  20154. Rectangle rec1 = new Rectangle( TableWidth / 2 - FtWidth / 2, StartRows_Y, TableWidth, FtHeight );
  20155. g.DrawString( DefaultPrintTitle, ft10, b, rec1 );
  20156. #endregion
  20157. #region 客户资料
  20158. #region 第一行 流程单号
  20159. string rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( " 单 号:" );
  20160. sizef = g.MeasureString( rec1Value, ft9 );
  20161. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  20162. FtHeight = Convert.ToInt32( sizef.Height );
  20163. Rectangle rec2 = new Rectangle( 0, rec1.Y + rec1.Height + 5, FtWidth, RowHeight );
  20164. g.DrawString( rec1Value, ft9, b, rec2 );
  20165. Rectangle rec2A = new Rectangle( rec2.X + rec2.Width, rec2.Y - ContentHeight, TableWidth - rec2.Width, rec2.Height );
  20166. g.DrawString( StrRandom( htData["ordNumber"].ToString().Trim() ), ft9, b, rec2A );
  20167. Point rec2A_1 = new Point( rec2A.X, rec2A.Y + rec2A.Height - Underline );
  20168. Point rec2A_2 = new Point( rec2A.X + rec2A.Width, rec2A_1.Y );
  20169. g.DrawLine( p, rec2A_1, rec2A_2 );
  20170. #endregion
  20171. #region 第三行 主联系人姓名
  20172. Rectangle rec4 = new Rectangle( rec2.X, rec2.Y + rec2.Height, rec2.Width, RowHeight );
  20173. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名:" ), ft9, b, rec4 );
  20174. Rectangle rec4A = new Rectangle( rec4.X + rec4.Width, rec4.Y - ContentHeight, TableWidth - rec4.Width, rec4.Height );
  20175. g.DrawString( htData["CustomerName"].ToString().Trim(), ft9, b, rec4A );
  20176. Point rec4A_1 = new Point( rec4A.X, rec4A.Y + rec4A.Height - Underline );
  20177. Point rec4A_2 = new Point( rec4A.X + rec4A.Width, rec4A_1.Y );
  20178. g.DrawLine( p, rec4A_1, rec4A_2 );
  20179. #endregion
  20180. #region 第四行 性别
  20181. //Rectangle rec5 = new Rectangle(rec4.X, rec4.Y + rec4.Height, rec4.Width, RowHeight);
  20182. //g.DrawString(" 性 别:", ft9, b, rec5);
  20183. //Rectangle rec5A = new Rectangle(rec5.X + rec5.Width, rec5.Y - ContentHeight, TableWidth - rec5.Width, rec5.Height);
  20184. //g.DrawString(htClient["StrMainSex"].ToString(), ft9, b, rec5A);
  20185. //Point rec5A_1 = new Point(rec5A.X, rec5A.Y + rec5A.Height - Underline);
  20186. //Point rec5A_2 = new Point(rec5A.X + rec5A.Width, rec5A_1.Y);
  20187. //g.DrawLine(p, rec5A_1, rec5A_2);
  20188. #endregion
  20189. #region 第五行 联系电话
  20190. Rectangle rec6 = new Rectangle( rec4.X, rec4.Y + rec4.Height, rec4.Width, RowHeight );
  20191. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "联系电话:" ), ft9, b, rec6 );
  20192. Rectangle rec6A = new Rectangle( rec6.X + rec6.Width, rec6.Y - ContentHeight, TableWidth - rec6.Width, rec6.Height );
  20193. g.DrawString( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( htData["Telephone"] ), ft9, b, rec6A );
  20194. Point rec6A_1 = new Point( rec6A.X, rec6A.Y + rec6A.Height - Underline );
  20195. Point rec6A_2 = new Point( rec6A.X + rec6A.Width, rec6A_1.Y );
  20196. g.DrawLine( p, rec6A_1, rec6A_2 );
  20197. #endregion
  20198. #endregion
  20199. Point rec7B_1 = new Point( 0, rec6A_1.Y + rec6.Height / 3 + RowHeight / 2 );
  20200. Point rec7B_2 = new Point( TableWidth, rec7B_1.Y );
  20201. g.DrawLine( pen, rec7B_1, rec7B_2 );
  20202. #region 第八行 产品
  20203. decimal CopeAmount = 0;//租金
  20204. decimal MortgageAmount = 0;//押金
  20205. int IntPoint_Y = rec7B_1.Y + RowHeight / 2;
  20206. for ( int i = dgvData.SelectedRows.Count - 1; i >= 0; i-- )
  20207. {
  20208. rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "收款项目:" );
  20209. sizef = g.MeasureString( rec1Value, ft9 );
  20210. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  20211. FtHeight = Convert.ToInt32( sizef.Height );
  20212. Rectangle recFor1 = new Rectangle( rec2.X, IntPoint_Y, FtWidth, rec2.Height );
  20213. g.DrawString( rec1Value, ft9, b, recFor1 );
  20214. string StrCategory = dgvData.SelectedRows[i].Cells["type"].Value.ToString().Trim();//收款项目
  20215. Rectangle recFor1A = new Rectangle( recFor1.Width, recFor1.Y, TableWidth - FtWidth, recFor1.Height );
  20216. g.DrawString( StrCategory, ft9, b, recFor1A );
  20217. Rectangle recFor2 = new Rectangle( recFor1.X, recFor1.Y + recFor1.Height, recFor1.Width, recFor1.Height );
  20218. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "支付方式:" ), ft9, b, recFor2 );
  20219. Rectangle recFor2A = new Rectangle( recFor1A.X, recFor2.Y, recFor1A.Width, recFor2.Height );
  20220. g.DrawString( dgvData.SelectedRows[i].Cells["Pay_PaymentMethod"].Value.ToString().Trim(), ft9, b, recFor2A );
  20221. Rectangle recFor3 = new Rectangle( recFor2.X, recFor2.Y + recFor2.Height, recFor1.Width, recFor2A.Height );
  20222. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 金 额:" ), ft9, b, recFor3 );
  20223. Rectangle recFor3A = new Rectangle( recFor1A.X, recFor3.Y, recFor2A.Width, recFor3.Height );
  20224. g.DrawString( dgvData.SelectedRows[i].Cells["Pay_AmountOf"].Value.ToString().Trim(), ft9, b, recFor3A );
  20225. Rectangle recFor4 = new Rectangle( recFor3.X, recFor3.Y + recFor3.Height, recFor1.Width, recFor3A.Height );
  20226. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "收款时间:" ), ft9, b, recFor4 );
  20227. Rectangle recFor4A = new Rectangle( recFor3A.X, recFor4.Y, recFor3A.Width, recFor4.Height );
  20228. g.DrawString( dgvData.SelectedRows[i].Cells["Pay_CreateDatetime"].Value.ToString().Trim(), ft9, b, recFor4A );
  20229. Rectangle recFor5 = new Rectangle( recFor4.X, recFor4.Y + recFor4.Height, recFor1.Width, recFor4.Height );
  20230. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 收 银:" ), ft9, b, recFor5 );
  20231. Rectangle recFor5A = new Rectangle( recFor4A.X, recFor5.Y, recFor4A.Width, recFor5.Height );
  20232. g.DrawString( dgvData.SelectedRows[i].Cells["Pay_ThePayee"].Value.ToString().Trim(), ft9, b, recFor5A );
  20233. #region 2017-03-30 刘工添加 接单人
  20234. Rectangle recFor5_1 = new Rectangle( recFor4.X, recFor5.Y + recFor5.Height, recFor1.Width, recFor5.Height );
  20235. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 接单人:" ), ft9, b, recFor5_1 );
  20236. Rectangle recFor5A_1 = new Rectangle( recFor4A.X, recFor5_1.Y, recFor5_1.Width, recFor5_1.Height );
  20237. g.DrawString( dgvData.SelectedRows[i].Cells["Pay_OpenSingle"].Value.ToString().Trim(), ft9, b, recFor5A_1 );
  20238. recFor5 = recFor5_1;
  20239. recFor5A = recFor5A_1;
  20240. #endregion
  20241. rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "收款说明: " ) + dgvData.SelectedRows[i].Cells["Pay_Remark"].Value.ToString().Trim();
  20242. sizef = g.MeasureString( rec1Value, ft9 );
  20243. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  20244. double fordbHeight = sizef.Height;
  20245. int forRowCount = FtWidth / TableWidth;
  20246. forRowCount++;
  20247. double forNewRowHeight = (fordbHeight * float.Parse( forRowCount.ToString() ));
  20248. Rectangle recFor6 = new Rectangle( recFor5.X, recFor5.Y + recFor5.Height, TableWidth, Convert.ToInt32( forNewRowHeight ) + 1 );
  20249. g.DrawString( rec1Value, ft9, b, recFor6 );
  20250. IntPoint_Y = recFor6.Y + recFor6.Height + RowHeight / 2;
  20251. if ( dgvData.SelectedRows[i].Cells["type"].Value.ToString().Trim() == "押金" )
  20252. {
  20253. MortgageAmount += Convert.ToDecimal( dgvData.SelectedRows[i].Cells["Pay_AmountOf"].Value );
  20254. }
  20255. else if ( dgvData.SelectedRows[i].Cells["type"].Value.ToString().Trim() == "租金" )
  20256. {
  20257. CopeAmount += Convert.ToDecimal( dgvData.SelectedRows[i].Cells["Pay_AmountOf"].Value );
  20258. }
  20259. }
  20260. #endregion
  20261. Point rec8_1 = new Point( rec2.X, IntPoint_Y );
  20262. Point rec8_2 = new Point( TableWidth, rec8_1.Y );
  20263. g.DrawLine( pen, rec8_1, rec8_2 );
  20264. #region 第十行 应付金额
  20265. Rectangle rec9 = new Rectangle( rec2.X, rec8_1.Y + RowHeight / 2, rec2.Width, RowHeight );
  20266. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "应付金额:" ), ft9, b, rec9 );
  20267. Rectangle rec9A = new Rectangle( rec9.X + rec9.Width, rec9.Y - ContentHeight, TableWidth - rec9.Width, rec9.Height );
  20268. g.DrawString( (Convert.ToDecimal( htData["StrCope"] ) + Convert.ToDecimal( htData["StrDetain"] )).ToString(), ft9, b, rec9A );
  20269. Point rec9A_1 = new Point( rec9A.X, rec9A.Y + rec9A.Height - Underline );
  20270. Point rec9A_2 = new Point( rec9A.X + rec9A.Width, rec9A_1.Y );
  20271. g.DrawLine( p, rec9A_1, rec9A_2 );
  20272. #endregion
  20273. #region 第十一行 实付金额
  20274. Rectangle rec10 = new Rectangle( rec9.X, rec9.Y + rec9.Height, rec9.Width, RowHeight );
  20275. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "实付金额:" ), ft9, b, rec10 );
  20276. Rectangle rec10A = new Rectangle( rec10.X + rec10.Width, rec10.Y - ContentHeight, TableWidth - rec10.Width, rec10.Height );
  20277. g.DrawString( (MortgageAmount + CopeAmount).ToString( "0.00" ).ToString(), ft9, b, rec10A );
  20278. Point rec10A_1 = new Point( rec10A.X, rec10A.Y + rec10A.Height - Underline );
  20279. Point rec10A_2 = new Point( rec10A.X + rec10A.Width, rec10A_1.Y );
  20280. g.DrawLine( p, rec10A_1, rec10A_2 );
  20281. #endregion
  20282. #region 第十二行 欠款
  20283. Rectangle rec11 = new Rectangle( rec10.X, rec10.Y + rec10.Height, rec10.Width, RowHeight );
  20284. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 欠 款:" ), ft9, b, rec11 );
  20285. Rectangle rec11A = new Rectangle( rec11.X + rec11.Width, rec11.Y - ContentHeight, TableWidth - rec11.Width, rec11.Height );
  20286. g.DrawString( (Convert.ToDecimal( htData["StrCope"] ) - CopeAmount).ToString( "0.00" ), ft9, b, rec11A );
  20287. Point rec11A_1 = new Point( rec11A.X, rec11A.Y + rec11A.Height - Underline );
  20288. Point rec11A_2 = new Point( rec11A.X + rec11A.Width, rec11A_1.Y );
  20289. g.DrawLine( p, rec11A_1, rec11A_2 );
  20290. #endregion
  20291. #region 第十二行 租金
  20292. Rectangle rec11_A = new Rectangle( rec11.X, rec11.Y + rec11.Height, rec11.Width, RowHeight );
  20293. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 租 金:" ), ft9, b, rec11_A );
  20294. Rectangle rec11A_A = new Rectangle( rec11_A.X + rec11_A.Width, rec11_A.Y - ContentHeight, TableWidth - rec11_A.Width, rec11_A.Height );
  20295. g.DrawString( CopeAmount.ToString( "0.00" ), ft9, b, rec11A_A );
  20296. Point rec11A_A_1 = new Point( rec11A_A.X, rec11A_A.Y + rec11A_A.Height - Underline );
  20297. Point rec11A_A_2 = new Point( rec11A_A.X + rec11A_A.Width, rec11A_A_1.Y );
  20298. g.DrawLine( p, rec11A_A_1, rec11A_A_2 );
  20299. #endregion
  20300. #region 第十二行 押金
  20301. Rectangle rec11_B = new Rectangle( rec11_A.X, rec11_A.Y + rec11_A.Height, rec11_A.Width, RowHeight );
  20302. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 押 金:" ), ft9, b, rec11_B );
  20303. Rectangle rec11B_A = new Rectangle( rec11_B.X + rec11_B.Width, rec11_B.Y - ContentHeight, TableWidth - rec11_B.Width, rec11_B.Height );
  20304. g.DrawString( MortgageAmount.ToString( "0.00" ), ft9, b, rec11B_A );
  20305. Point rec11B_A_1 = new Point( rec11B_A.X, rec11B_A.Y + rec11B_A.Height - Underline );
  20306. Point rec11B_A_2 = new Point( rec11B_A.X + rec11B_A.Width, rec11B_A_1.Y );
  20307. g.DrawLine( p, rec11B_A_1, rec11B_A_2 );
  20308. #endregion
  20309. #region 第十三行 备注
  20310. string PaymentExplain = "";
  20311. if ( PrintOtherData.ContainsKey( "收款单说明" ) && PrintOtherData["收款单说明"].ToString().Trim().Length > 0 )
  20312. {
  20313. PaymentExplain = PrintOtherData["收款单说明"].ToString().Trim();
  20314. }
  20315. rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( " 备 注: " ) + PaymentExplain;
  20316. sizef = g.MeasureString( rec1Value, ft9 );
  20317. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  20318. double dbHeight = sizef.Height;
  20319. int RowCount = FtWidth / TableWidth;
  20320. RowCount++;
  20321. double NewRowHeight = (dbHeight * float.Parse( RowCount.ToString() ));
  20322. Rectangle rec12 = new Rectangle( rec11_B.X, rec11_B.Y + rec11_B.Height + rec11_B.Height / 2, TableWidth + 7, Convert.ToInt32( NewRowHeight ) + 1 );
  20323. g.DrawString( rec1Value, ft9, b, rec12 );
  20324. #endregion
  20325. #region 第十四行 服务电话
  20326. Rectangle rec13 = new Rectangle( rec12.X, rec12.Y + rec12.Height, TableWidth, RowHeight );
  20327. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "服务电话:" ) + tbl_Info.Rows[0]["Company_Telephone"].ToString().Trim(), ft9, b, rec13 );
  20328. #endregion
  20329. #region 第十五行 客户确认
  20330. Rectangle rec14 = new Rectangle( rec13.X, rec13.Y + rec13.Height + rec13.Height, rec2.Width, RowHeight );
  20331. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客户确认" ), ft9, b, rec14 );
  20332. Point rec14_1 = new Point( rec14.Width, rec14.Y + rec14.Height + rec14.Height / 2 );
  20333. Point rec14_2 = new Point( TableWidth, rec14_1.Y );
  20334. g.DrawLine( p, rec14_1, rec14_2 );
  20335. #endregion
  20336. #region 第十六行 打印时间
  20337. Rectangle rec15 = new Rectangle( rec14.X, rec14.Y + rec14.Height + rec14.Height, TableWidth, RowHeight );
  20338. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "打印时间:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy-MM-dd HH:mm:ss" ), ft9, b, rec15 );
  20339. int TopHeight = rec15.Y + rec15.Height;
  20340. //if (IsPrintSerialNo && PrintPageCount > 1)
  20341. if ( IsPrintSerialNo )
  20342. {
  20343. if ( l == 0 )
  20344. {
  20345. StrSmallTicketSerialNumber = GetSmallTicketSerialNumber();
  20346. }
  20347. if ( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition )
  20348. {
  20349. StrSmallTicketSerialNumber = PrintReceiptSerial( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.CurrentCompanyInfoID );
  20350. }
  20351. Rectangle rec16 = new Rectangle( rec15.X, TopHeight, TableWidth, RowHeight );
  20352. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 流水号:SNO" ) + StrSmallTicketSerialNumber, ft9, b, rec16 );
  20353. TopHeight += rec15.Height;
  20354. }
  20355. #endregion
  20356. #region 尾
  20357. rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "谢谢惠顾!" );
  20358. sizef = g.MeasureString( rec1Value, ft9 );
  20359. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  20360. FtHeight = Convert.ToInt32( sizef.Height );
  20361. Rectangle rec17 = new Rectangle( TableWidth / 2 - FtWidth / 2, TopHeight + rec15.Height / 2, TableWidth, RowHeight );
  20362. g.DrawString( rec1Value, ft9, b, rec17 );
  20363. #endregion
  20364. StartRows_Y = rec17.Y + rec17.X + RowHeight * 2;
  20365. }
  20366. }
  20367. /// <summary>
  20368. /// 小票打印礼服出售收款
  20369. /// </summary>
  20370. public static void SmallTicket_SoldPayment( object objValue, Graphics g, Size size, bool IsPrintSerialNo )
  20371. {
  20372. Hashtable htData = (Hashtable)objValue;
  20373. DataGridViewEx dgvData = (DataGridViewEx)htData["dgvData"];
  20374. string ExecuteSql = orbll.GetView_CustomReturnExecuteSql( "tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Telephone" );
  20375. DataSet dtSet = orbll.GetView_Custom( ExecuteSql );
  20376. //获取影楼信息
  20377. DataTable tbl_Info = dtSet.Tables["ds"];
  20378. if ( tbl_Info.Rows.Count <= 0 )
  20379. {
  20380. MessageBoxCustom.Show( "未设置影楼信息" ); return;
  20381. }
  20382. Brush b = Brushes.Black;
  20383. Pen p = new Pen( b, 1 );
  20384. Pen pen = new Pen( b, 1 );
  20385. pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Custom;
  20386. pen.DashPattern = new float[] { 5, 5 };
  20387. string StrFont = "宋体";
  20388. Font ft10 = new Font( StrFont, 17, GraphicsUnit.Pixel );
  20389. Font ft9 = new Font( StrFont, 12, GraphicsUnit.Pixel );
  20390. int Underline = 3;
  20391. int ContentHeight = 2;
  20392. int TableWidth = size.Width;
  20393. int RowHeight = Convert.ToInt32( g.MeasureString( "调试行高", ft9 ).Height );
  20394. int StartRows_Y = 0;
  20395. string StrSmallTicketSerialNumber = "";
  20396. for ( int l = 0; l < PrintPageCount; l++ )
  20397. {
  20398. #region 收款标题
  20399. SizeF sizef = g.MeasureString( DefaultPrintTitle, ft10, TableWidth );
  20400. int FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  20401. int FtHeight = Convert.ToInt32( sizef.Height );
  20402. Rectangle rec1 = new Rectangle( TableWidth / 2 - FtWidth / 2, StartRows_Y, TableWidth, FtHeight );
  20403. g.DrawString( DefaultPrintTitle, ft10, b, rec1 );
  20404. #endregion
  20405. #region 客户资料
  20406. #region 第一行 流程单号
  20407. string rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( " 单 号:" );
  20408. sizef = g.MeasureString( rec1Value, ft9 );
  20409. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  20410. FtHeight = Convert.ToInt32( sizef.Height );
  20411. Rectangle rec2 = new Rectangle( 0, rec1.Y + rec1.Height + 5, FtWidth, RowHeight );
  20412. g.DrawString( rec1Value, ft9, b, rec2 );
  20413. Rectangle rec2A = new Rectangle( rec2.X + rec2.Width, rec2.Y - ContentHeight, TableWidth - rec2.Width, rec2.Height );
  20414. g.DrawString( StrRandom( htData["ordNumber"].ToString().Trim() ), ft9, b, rec2A );
  20415. Point rec2A_1 = new Point( rec2A.X, rec2A.Y + rec2A.Height - Underline );
  20416. Point rec2A_2 = new Point( rec2A.X + rec2A.Width, rec2A_1.Y );
  20417. g.DrawLine( p, rec2A_1, rec2A_2 );
  20418. #endregion
  20419. #region 第三行 主联系人姓名
  20420. Rectangle rec4 = new Rectangle( rec2.X, rec2.Y + rec2.Height, rec2.Width, RowHeight );
  20421. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名:" ), ft9, b, rec4 );
  20422. Rectangle rec4A = new Rectangle( rec4.X + rec4.Width, rec4.Y - ContentHeight, TableWidth - rec4.Width, rec4.Height );
  20423. g.DrawString( htData["CustomerName"].ToString().Trim(), ft9, b, rec4A );
  20424. Point rec4A_1 = new Point( rec4A.X, rec4A.Y + rec4A.Height - Underline );
  20425. Point rec4A_2 = new Point( rec4A.X + rec4A.Width, rec4A_1.Y );
  20426. g.DrawLine( p, rec4A_1, rec4A_2 );
  20427. #endregion
  20428. #region 第四行 性别
  20429. //Rectangle rec5 = new Rectangle(rec4.X, rec4.Y + rec4.Height, rec4.Width, RowHeight);
  20430. //g.DrawString(" 性 别:", ft9, b, rec5);
  20431. //Rectangle rec5A = new Rectangle(rec5.X + rec5.Width, rec5.Y - ContentHeight, TableWidth - rec5.Width, rec5.Height);
  20432. //g.DrawString(htClient["StrMainSex"].ToString(), ft9, b, rec5A);
  20433. //Point rec5A_1 = new Point(rec5A.X, rec5A.Y + rec5A.Height - Underline);
  20434. //Point rec5A_2 = new Point(rec5A.X + rec5A.Width, rec5A_1.Y);
  20435. //g.DrawLine(p, rec5A_1, rec5A_2);
  20436. #endregion
  20437. #region 第五行 联系电话
  20438. Rectangle rec6 = new Rectangle( rec4.X, rec4.Y + rec4.Height, rec4.Width, RowHeight );
  20439. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "联系电话:" ), ft9, b, rec6 );
  20440. Rectangle rec6A = new Rectangle( rec6.X + rec6.Width, rec6.Y - ContentHeight, TableWidth - rec6.Width, rec6.Height );
  20441. g.DrawString( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( htData["Telephone"] ), ft9, b, rec6A );
  20442. Point rec6A_1 = new Point( rec6A.X, rec6A.Y + rec6A.Height - Underline );
  20443. Point rec6A_2 = new Point( rec6A.X + rec6A.Width, rec6A_1.Y );
  20444. g.DrawLine( p, rec6A_1, rec6A_2 );
  20445. #endregion
  20446. #endregion
  20447. Point rec7B_1 = new Point( 0, rec6A_1.Y + rec6.Height / 3 + RowHeight / 2 );
  20448. Point rec7B_2 = new Point( TableWidth, rec7B_1.Y );
  20449. g.DrawLine( pen, rec7B_1, rec7B_2 );
  20450. #region 第八行 产品
  20451. decimal CopeAmount = 0;//应付金额
  20452. //decimal ActualAmount = 0;//实付金额
  20453. int IntPoint_Y = rec7B_1.Y + RowHeight / 2;
  20454. for ( int i = dgvData.SelectedRows.Count - 1; i >= 0; i-- )
  20455. {
  20456. CopeAmount += Convert.ToDecimal( dgvData.SelectedRows[i].Cells["Pay_AmountOf"].Value );
  20457. rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "收款项目:" );
  20458. sizef = g.MeasureString( rec1Value, ft9 );
  20459. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  20460. FtHeight = Convert.ToInt32( sizef.Height );
  20461. Rectangle recFor1 = new Rectangle( rec2.X, IntPoint_Y, FtWidth, rec2.Height );
  20462. g.DrawString( rec1Value, ft9, b, recFor1 );
  20463. string StrCategory = dgvData.SelectedRows[i].Cells["Pay_ReceivableProject"].Value.ToString().Trim();//收款项目
  20464. Rectangle recFor1A = new Rectangle( recFor1.Width, recFor1.Y, TableWidth - FtWidth, recFor1.Height );
  20465. g.DrawString( StrCategory, ft9, b, recFor1A );
  20466. Rectangle recFor2 = new Rectangle( recFor1.X, recFor1.Y + recFor1.Height, recFor1.Width, recFor1.Height );
  20467. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "支付方式:" ), ft9, b, recFor2 );
  20468. Rectangle recFor2A = new Rectangle( recFor1A.X, recFor2.Y, recFor1A.Width, recFor2.Height );
  20469. g.DrawString( dgvData.SelectedRows[i].Cells["Pay_PaymentMethod"].Value.ToString().Trim(), ft9, b, recFor2A );
  20470. Rectangle recFor3 = new Rectangle( recFor2.X, recFor2.Y + recFor2.Height, recFor1.Width, recFor2A.Height );
  20471. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 金 额:" ), ft9, b, recFor3 );
  20472. Rectangle recFor3A = new Rectangle( recFor1A.X, recFor3.Y, recFor2A.Width, recFor3.Height );
  20473. g.DrawString( dgvData.SelectedRows[i].Cells["Pay_AmountOf"].Value.ToString().Trim(), ft9, b, recFor3A );
  20474. Rectangle recFor4 = new Rectangle( recFor3.X, recFor3.Y + recFor3.Height, recFor1.Width, recFor3A.Height );
  20475. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "收款时间:" ), ft9, b, recFor4 );
  20476. Rectangle recFor4A = new Rectangle( recFor3A.X, recFor4.Y, recFor3A.Width, recFor4.Height );
  20477. g.DrawString( dgvData.SelectedRows[i].Cells["Pay_CreateDatetime"].Value.ToString().Trim(), ft9, b, recFor4A );
  20478. Rectangle recFor5 = new Rectangle( recFor4.X, recFor4.Y + recFor4.Height, recFor1.Width, recFor4.Height );
  20479. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 收 银:" ), ft9, b, recFor5 );
  20480. Rectangle recFor5A = new Rectangle( recFor4A.X, recFor5.Y, recFor4A.Width, recFor5.Height );
  20481. g.DrawString( dgvData.SelectedRows[i].Cells["Pay_ThePayee"].Value.ToString().Trim(), ft9, b, recFor5A );
  20482. #region 2017-03-30 刘工添加 接单人
  20483. Rectangle recFor5_1 = new Rectangle( recFor4.X, recFor5.Y + recFor5.Height, recFor1.Width, recFor5.Height );
  20484. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 接单人:" ), ft9, b, recFor5_1 );
  20485. Rectangle recFor5A_1 = new Rectangle( recFor4A.X, recFor5_1.Y, recFor5_1.Width, recFor5_1.Height );
  20486. g.DrawString( dgvData.SelectedRows[i].Cells["Pay_OpenSingle"].Value.ToString().Trim(), ft9, b, recFor5A_1 );
  20487. recFor5 = recFor5_1;
  20488. recFor5A = recFor5A_1;
  20489. #endregion
  20490. rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( " 说 明: " ) + dgvData.SelectedRows[i].Cells["Pay_Remark"].Value.ToString().Trim();
  20491. sizef = g.MeasureString( rec1Value, ft9 );
  20492. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  20493. double fordbHeight = sizef.Height;
  20494. int forRowCount = FtWidth / TableWidth;
  20495. forRowCount++;
  20496. double forNewRowHeight = (fordbHeight * float.Parse( forRowCount.ToString() ));
  20497. Rectangle recFor6 = new Rectangle( recFor5.X, recFor5.Y + recFor5.Height, TableWidth, Convert.ToInt32( forNewRowHeight ) + 1 );
  20498. g.DrawString( rec1Value, ft9, b, recFor6 );
  20499. IntPoint_Y = recFor6.Y + recFor6.Height + RowHeight / 2;
  20500. }
  20501. #endregion
  20502. Point rec8_1 = new Point( rec2.X, IntPoint_Y );
  20503. Point rec8_2 = new Point( TableWidth, rec8_1.Y );
  20504. g.DrawLine( pen, rec8_1, rec8_2 );
  20505. #region 第十行 应付金额
  20506. Rectangle rec9 = new Rectangle( rec2.X, rec8_1.Y + RowHeight / 2, rec2.Width, RowHeight );
  20507. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "应付金额:" ), ft9, b, rec9 );
  20508. Rectangle rec9A = new Rectangle( rec9.X + rec9.Width, rec9.Y - ContentHeight, TableWidth - rec9.Width, rec9.Height );
  20509. g.DrawString( (Convert.ToDecimal( htData["StrCope"] ) + Convert.ToDecimal( htData["StrDetain"] )).ToString( "0.00" ), ft9, b, rec9A );
  20510. Point rec9A_1 = new Point( rec9A.X, rec9A.Y + rec9A.Height - Underline );
  20511. Point rec9A_2 = new Point( rec9A.X + rec9A.Width, rec9A_1.Y );
  20512. g.DrawLine( p, rec9A_1, rec9A_2 );
  20513. #endregion
  20514. #region 第十一行 实付金额
  20515. Rectangle rec10 = new Rectangle( rec9.X, rec9.Y + rec9.Height, rec9.Width, RowHeight );
  20516. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "实付金额:" ), ft9, b, rec10 );
  20517. Rectangle rec10A = new Rectangle( rec10.X + rec10.Width, rec10.Y - ContentHeight, TableWidth - rec10.Width, rec10.Height );
  20518. g.DrawString( CopeAmount.ToString( "0.00" ), ft9, b, rec10A );
  20519. Point rec10A_1 = new Point( rec10A.X, rec10A.Y + rec10A.Height - Underline );
  20520. Point rec10A_2 = new Point( rec10A.X + rec10A.Width, rec10A_1.Y );
  20521. g.DrawLine( p, rec10A_1, rec10A_2 );
  20522. #endregion
  20523. #region 第十二行 欠款
  20524. Rectangle rec11 = new Rectangle( rec10.X, rec10.Y + rec10.Height, rec10.Width, RowHeight );
  20525. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 欠 款:" ), ft9, b, rec11 );
  20526. Rectangle rec11A = new Rectangle( rec11.X + rec11.Width, rec11.Y - ContentHeight, TableWidth - rec11.Width, rec11.Height );
  20527. g.DrawString( (Convert.ToDecimal( htData["StrCope"] ) - CopeAmount).ToString( "0.00" ), ft9, b, rec11A );
  20528. Point rec11A_1 = new Point( rec11A.X, rec11A.Y + rec11A.Height - Underline );
  20529. Point rec11A_2 = new Point( rec11A.X + rec11A.Width, rec11A_1.Y );
  20530. g.DrawLine( p, rec11A_1, rec11A_2 );
  20531. #endregion
  20532. #region 第十三行 备注
  20533. string PaymentExplain = "";
  20534. if ( PrintOtherData.ContainsKey( "收款单说明" ) && PrintOtherData["收款单说明"].ToString().Trim().Length > 0 )
  20535. {
  20536. PaymentExplain = PrintOtherData["收款单说明"].ToString().Trim();
  20537. }
  20538. rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( " 备 注: " ) + PaymentExplain;
  20539. sizef = g.MeasureString( rec1Value, ft9 );
  20540. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  20541. double dbHeight = sizef.Height;
  20542. int RowCount = FtWidth / TableWidth;
  20543. RowCount++;
  20544. double NewRowHeight = (dbHeight * float.Parse( RowCount.ToString() ));
  20545. Rectangle rec12 = new Rectangle( rec11.X, rec11.Y + rec11.Height + rec11.Height / 2, TableWidth + 7, Convert.ToInt32( NewRowHeight ) + 1 );
  20546. g.DrawString( rec1Value, ft9, b, rec12 );
  20547. #endregion
  20548. #region 第十四行 服务电话
  20549. Rectangle rec13 = new Rectangle( rec12.X, rec12.Y + rec12.Height, TableWidth, RowHeight );
  20550. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "服务电话:" ) + tbl_Info.Rows[0]["Company_Telephone"].ToString().Trim(), ft9, b, rec13 );
  20551. #endregion
  20552. #region 第十五行 客户确认
  20553. Rectangle rec14 = new Rectangle( rec13.X, rec13.Y + rec13.Height + rec13.Height, rec2.Width, RowHeight );
  20554. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客户确认" ), ft9, b, rec14 );
  20555. Point rec14_1 = new Point( rec14.Width, rec14.Y + rec14.Height + rec14.Height / 2 );
  20556. Point rec14_2 = new Point( TableWidth, rec14_1.Y );
  20557. g.DrawLine( p, rec14_1, rec14_2 );
  20558. #endregion
  20559. #region 第十六行 打印时间
  20560. Rectangle rec15 = new Rectangle( rec14.X, rec14.Y + rec14.Height + rec14.Height, TableWidth, RowHeight );
  20561. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "打印时间:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy-MM-dd HH:mm:ss" ), ft9, b, rec15 );
  20562. int TopHeight = rec15.Y + rec15.Height;
  20563. //if (IsPrintSerialNo && PrintPageCount > 1)
  20564. if ( IsPrintSerialNo )
  20565. {
  20566. if ( l == 0 )
  20567. {
  20568. StrSmallTicketSerialNumber = GetSmallTicketSerialNumber();
  20569. }
  20570. if ( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition )
  20571. {
  20572. StrSmallTicketSerialNumber = PrintReceiptSerial( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.CurrentCompanyInfoID );
  20573. }
  20574. Rectangle rec16 = new Rectangle( rec15.X, TopHeight, TableWidth, RowHeight );
  20575. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 流水号:SNO" ) + StrSmallTicketSerialNumber, ft9, b, rec16 );
  20576. TopHeight += rec15.Height;
  20577. }
  20578. #endregion
  20579. #region 尾
  20580. rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "谢谢惠顾!" );
  20581. sizef = g.MeasureString( rec1Value, ft9 );
  20582. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  20583. FtHeight = Convert.ToInt32( sizef.Height );
  20584. Rectangle rec17 = new Rectangle( TableWidth / 2 - FtWidth / 2, TopHeight + rec15.Height / 2, TableWidth, RowHeight );
  20585. g.DrawString( rec1Value, ft9, b, rec17 );
  20586. #endregion
  20587. StartRows_Y = rec17.Y + rec17.X + RowHeight * 2;
  20588. }
  20589. }
  20590. /// <summary>
  20591. /// 小票打印礼服出租退押金
  20592. /// </summary>
  20593. public static void SmallTicket_SoldRefundPayment( object objValue, Graphics g, Size size, bool IsPrintSerialNo )
  20594. {
  20595. Hashtable htData = (Hashtable)objValue;
  20596. DataGridViewEc dgvData = (DataGridViewEc)htData["dgvData"];
  20597. string ExecuteSql = orbll.GetView_CustomReturnExecuteSql( "tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Telephone" );
  20598. ExecuteSql += orbll.GetView_CustomReturnExecuteSql( "tb_ErpCustomer", StrWhere: "Cus_CustomerNumber = '" + htData["CustomerNumber"].ToString().Trim() + "'", ShowColumnName: "Cus_Name,Cus_Sex,Cus_Telephone" );
  20599. DataSet dtSet = orbll.GetView_Custom( ExecuteSql );
  20600. //获取影楼信息
  20601. DataTable tbl_Info = dtSet.Tables["ds"];
  20602. if ( tbl_Info.Rows.Count <= 0 )
  20603. {
  20604. MessageBoxCustom.Show( "未设置影楼信息" ); return;
  20605. }
  20606. DataTable tblorder = dtSet.Tables["ds1"];
  20607. Brush b = Brushes.Black;
  20608. Pen p = new Pen( b, 1 );
  20609. Pen pen = new Pen( b, 1 );
  20610. pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Custom;
  20611. pen.DashPattern = new float[] { 5, 5 };
  20612. string StrFont = "宋体";
  20613. Font ft10 = new Font( StrFont, 17, GraphicsUnit.Pixel );
  20614. Font ft9 = new Font( StrFont, 12, GraphicsUnit.Pixel );
  20615. int Underline = 3;
  20616. int ContentHeight = 2;
  20617. int TableWidth = size.Width;
  20618. int RowHeight = Convert.ToInt32( g.MeasureString( "调试行高", ft9 ).Height );
  20619. int StartRows_Y = 0;
  20620. string StrSmallTicketSerialNumber = "";
  20621. for ( int l = 0; l < PrintPageCount; l++ )
  20622. {
  20623. #region 收款标题
  20624. SizeF sizef = g.MeasureString( DefaultPrintTitle, ft10, TableWidth );
  20625. int FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  20626. int FtHeight = Convert.ToInt32( sizef.Height );
  20627. Rectangle rec1 = new Rectangle( TableWidth / 2 - FtWidth / 2, StartRows_Y, TableWidth, FtHeight );
  20628. g.DrawString( DefaultPrintTitle, ft10, b, rec1 );
  20629. #endregion
  20630. #region 客户资料
  20631. #region 第一行 流程单号
  20632. string rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( " 单 号:" );
  20633. sizef = g.MeasureString( rec1Value, ft9 );
  20634. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  20635. FtHeight = Convert.ToInt32( sizef.Height );
  20636. Rectangle rec2 = new Rectangle( 0, rec1.Y + rec1.Height + 5, FtWidth, RowHeight );
  20637. g.DrawString( rec1Value, ft9, b, rec2 );
  20638. Rectangle rec2A = new Rectangle( rec2.X + rec2.Width, rec2.Y - ContentHeight, TableWidth - rec2.Width, rec2.Height );
  20639. g.DrawString( StrRandom( htData["DressOrderNumber"].ToString().Trim() ), ft9, b, rec2A );//dgvData.Rows[0].Cells["Dsro_Number"].Value.ToString().Trim()
  20640. Point rec2A_1 = new Point( rec2A.X, rec2A.Y + rec2A.Height - Underline );
  20641. Point rec2A_2 = new Point( rec2A.X + rec2A.Width, rec2A_1.Y );
  20642. g.DrawLine( p, rec2A_1, rec2A_2 );
  20643. #endregion
  20644. #region 第三行 主联系人姓名
  20645. Rectangle rec4 = new Rectangle( rec2.X, rec2.Y + rec2.Height, rec2.Width, RowHeight );
  20646. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名:" ), ft9, b, rec4 );
  20647. Rectangle rec4A = new Rectangle( rec4.X + rec4.Width, rec4.Y - ContentHeight, TableWidth - rec4.Width, rec4.Height );
  20648. g.DrawString( tblorder.Rows[0]["Cus_Name"].ToString().Trim(), ft9, b, rec4A );
  20649. Point rec4A_1 = new Point( rec4A.X, rec4A.Y + rec4A.Height - Underline );
  20650. Point rec4A_2 = new Point( rec4A.X + rec4A.Width, rec4A_1.Y );
  20651. g.DrawLine( p, rec4A_1, rec4A_2 );
  20652. #endregion
  20653. #region 第四行 性别
  20654. Rectangle rec5 = new Rectangle( rec4.X, rec4.Y + rec4.Height, rec4.Width, RowHeight );
  20655. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 性 别:" ), ft9, b, rec5 );
  20656. Rectangle rec5A = new Rectangle( rec5.X + rec5.Width, rec5.Y - ContentHeight, TableWidth - rec5.Width, rec5.Height );
  20657. g.DrawString( LYFZ.Command.Command_Validate.GetChinaSex( tblorder.Rows[0]["Cus_Sex"] ), ft9, b, rec5A );
  20658. Point rec5A_1 = new Point( rec5A.X, rec5A.Y + rec5A.Height - Underline );
  20659. Point rec5A_2 = new Point( rec5A.X + rec5A.Width, rec5A_1.Y );
  20660. g.DrawLine( p, rec5A_1, rec5A_2 );
  20661. #endregion
  20662. #region 第五行 联系电话
  20663. Rectangle rec6 = new Rectangle( rec5.X, rec5.Y + rec5.Height, rec5.Width, RowHeight );
  20664. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "联系电话:" ), ft9, b, rec6 );
  20665. Rectangle rec6A = new Rectangle( rec6.X + rec6.Width, rec6.Y - ContentHeight, TableWidth - rec6.Width, rec6.Height );
  20666. g.DrawString( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( tblorder.Rows[0]["Cus_Telephone"] ), ft9, b, rec6A );
  20667. Point rec6A_1 = new Point( rec6A.X, rec6A.Y + rec6A.Height - Underline );
  20668. Point rec6A_2 = new Point( rec6A.X + rec6A.Width, rec6A_1.Y );
  20669. g.DrawLine( p, rec6A_1, rec6A_2 );
  20670. #endregion
  20671. #endregion
  20672. Point rec7B_1 = new Point( 0, rec6A_1.Y + rec6.Height / 3 + RowHeight / 2 );
  20673. Point rec7B_2 = new Point( TableWidth, rec7B_1.Y );
  20674. g.DrawLine( pen, rec7B_1, rec7B_2 );
  20675. #region 第八行 产品
  20676. decimal CopeAmount = 0;//应付金额
  20677. int IntPoint_Y = rec7B_1.Y + RowHeight / 2;
  20678. for ( int i = dgvData.SelectedRows.Count - 1; i >= 0; i-- )
  20679. {
  20680. rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "收款项目:" );
  20681. sizef = g.MeasureString( rec1Value, ft9 );
  20682. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  20683. FtHeight = Convert.ToInt32( sizef.Height );
  20684. Rectangle recFor1 = new Rectangle( rec2.X, IntPoint_Y, FtWidth, rec2.Height );
  20685. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 金 额:" ), ft9, b, recFor1 );
  20686. string StrCategory = dgvData.SelectedRows[i].Cells["金额"].Value.ToString().Trim();//收款项目
  20687. Rectangle recFor1A = new Rectangle( recFor1.Width, recFor1.Y, TableWidth - FtWidth, recFor1.Height );
  20688. g.DrawString( StrCategory, ft9, b, recFor1A );
  20689. Rectangle recFor2 = new Rectangle( recFor1.X, recFor1.Y + recFor1.Height, recFor1.Width, recFor1.Height );
  20690. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 类 型:" ), ft9, b, recFor2 );
  20691. Rectangle recFor2A = new Rectangle( recFor1A.X, recFor2.Y, recFor1A.Width, recFor2.Height );
  20692. g.DrawString( dgvData.SelectedRows[i].Cells["退款类型"].Value.ToString().Trim(), ft9, b, recFor2A );
  20693. Rectangle recFor3 = new Rectangle( recFor2.X, recFor2.Y + recFor2.Height, recFor1.Width, recFor2A.Height );
  20694. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "交易时间:" ), ft9, b, recFor3 );
  20695. Rectangle recFor3A = new Rectangle( recFor1A.X, recFor3.Y, recFor2A.Width, recFor3.Height );
  20696. g.DrawString( LYFZ.Command.Command_Validate.DateTimeToString( dgvData.SelectedRows[i].Cells["录入时间"].Value, "yyyy-MM-dd HH:mm" ), ft9, b, recFor3A );
  20697. Rectangle recFor4 = new Rectangle( recFor3.X, recFor3.Y + recFor3.Height, recFor1.Width, recFor3A.Height );
  20698. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 经手人:" ), ft9, b, recFor4 );
  20699. Rectangle recFor4A = new Rectangle( recFor3A.X, recFor4.Y, recFor3A.Width, recFor4.Height );
  20700. g.DrawString( dgvData.SelectedRows[i].Cells["退款人"].Value.ToString().Trim(), ft9, b, recFor4A );
  20701. rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( " 备 注: " ) + dgvData.SelectedRows[i].Cells["退款备注"].Value.ToString().Trim();
  20702. sizef = g.MeasureString( rec1Value, ft9 );
  20703. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  20704. double fordbHeight = sizef.Height;
  20705. int forRowCount = FtWidth / TableWidth;
  20706. forRowCount++;
  20707. double forNewRowHeight = (fordbHeight * float.Parse( forRowCount.ToString() ));
  20708. Rectangle recFor6 = new Rectangle( recFor4.X, recFor4.Y + recFor4.Height, TableWidth, Convert.ToInt32( forNewRowHeight ) + 1 );
  20709. g.DrawString( rec1Value, ft9, b, recFor6 );
  20710. IntPoint_Y = recFor6.Y + recFor6.Height + RowHeight / 2;
  20711. CopeAmount += Convert.ToDecimal( dgvData.SelectedRows[i].Cells["金额"].Value );
  20712. }
  20713. #endregion
  20714. Point rec8_1 = new Point( rec2.X, IntPoint_Y );
  20715. Point rec8_2 = new Point( TableWidth, rec8_1.Y );
  20716. g.DrawLine( pen, rec8_1, rec8_2 );
  20717. #region 第十行 原押金
  20718. Rectangle rec9 = new Rectangle( rec2.X, rec8_1.Y + RowHeight / 2, rec2.Width, RowHeight );
  20719. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 原押金:" ), ft9, b, rec9 );
  20720. Rectangle rec9A = new Rectangle( rec9.X + rec9.Width, rec9.Y - ContentHeight, TableWidth - rec9.Width, rec9.Height );
  20721. g.DrawString( Convert.ToDecimal( htData["DepositAmount"] ).ToString( "0.00" ), ft9, b, rec9A );
  20722. Point rec9A_1 = new Point( rec9A.X, rec9A.Y + rec9A.Height - Underline );
  20723. Point rec9A_2 = new Point( rec9A.X + rec9A.Width, rec9A_1.Y );
  20724. g.DrawLine( p, rec9A_1, rec9A_2 );
  20725. #endregion
  20726. #region 第十一行 已退
  20727. Rectangle rec10 = new Rectangle( rec9.X, rec9.Y + rec9.Height, rec9.Width, RowHeight );
  20728. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 已 退:" ), ft9, b, rec10 );
  20729. Rectangle rec10A = new Rectangle( rec10.X + rec10.Width, rec10.Y - ContentHeight, TableWidth - rec10.Width, rec10.Height );
  20730. g.DrawString( CopeAmount.ToString( "0.00" ), ft9, b, rec10A );
  20731. Point rec10A_1 = new Point( rec10A.X, rec10A.Y + rec10A.Height - Underline );
  20732. Point rec10A_2 = new Point( rec10A.X + rec10A.Width, rec10A_1.Y );
  20733. g.DrawLine( p, rec10A_1, rec10A_2 );
  20734. #endregion
  20735. #region 第十二行 未退
  20736. Rectangle rec11 = new Rectangle( rec10.X, rec10.Y + rec10.Height, rec10.Width, RowHeight );
  20737. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 未 退:" ), ft9, b, rec11 );
  20738. Rectangle rec11A = new Rectangle( rec11.X + rec11.Width, rec11.Y - ContentHeight, TableWidth - rec11.Width, rec11.Height );
  20739. g.DrawString( Convert.ToDecimal( htData["NotRefundAmount"] ).ToString( "0.00" ), ft9, b, rec11A );
  20740. Point rec11A_1 = new Point( rec11A.X, rec11A.Y + rec11A.Height - Underline );
  20741. Point rec11A_2 = new Point( rec11A.X + rec11A.Width, rec11A_1.Y );
  20742. g.DrawLine( p, rec11A_1, rec11A_2 );
  20743. #endregion
  20744. #region 第十三行 备注
  20745. string PaymentExplain = "";
  20746. if ( PrintOtherData.ContainsKey( "收款单说明" ) && PrintOtherData["收款单说明"].ToString().Trim().Length > 0 )
  20747. {
  20748. PaymentExplain = PrintOtherData["收款单说明"].ToString().Trim();
  20749. }
  20750. rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( " 备 注: " ) + PaymentExplain;
  20751. sizef = g.MeasureString( rec1Value, ft9 );
  20752. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  20753. double dbHeight = sizef.Height;
  20754. int RowCount = FtWidth / TableWidth;
  20755. RowCount++;
  20756. double NewRowHeight = (dbHeight * float.Parse( RowCount.ToString() ));
  20757. Rectangle rec12 = new Rectangle( rec11.X, rec11.Y + rec11.Height + rec11.Height / 2, TableWidth + 7, Convert.ToInt32( NewRowHeight ) + 1 );
  20758. g.DrawString( rec1Value, ft9, b, rec12 );
  20759. #endregion
  20760. #region 第十四行 服务电话
  20761. Rectangle rec13 = new Rectangle( rec12.X, rec12.Y + rec12.Height, TableWidth, RowHeight );
  20762. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "服务电话:" ) + tbl_Info.Rows[0]["Company_Telephone"].ToString().Trim(), ft9, b, rec13 );
  20763. #endregion
  20764. #region 第十五行 客户确认
  20765. Rectangle rec14 = new Rectangle( rec13.X, rec13.Y + rec13.Height + rec13.Height, rec2.Width, RowHeight );
  20766. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客户确认" ), ft9, b, rec14 );
  20767. Point rec14_1 = new Point( rec14.Width, rec14.Y + rec14.Height + rec14.Height / 2 );
  20768. Point rec14_2 = new Point( TableWidth, rec14_1.Y );
  20769. g.DrawLine( p, rec14_1, rec14_2 );
  20770. #endregion
  20771. #region 第十六行 打印时间
  20772. Rectangle rec15 = new Rectangle( rec14.X, rec14.Y + rec14.Height + rec14.Height, TableWidth, RowHeight );
  20773. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "打印时间:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy-MM-dd HH:mm:ss" ), ft9, b, rec15 );
  20774. int TopHeight = rec15.Y + rec15.Height;
  20775. //if (IsPrintSerialNo && PrintPageCount > 1)
  20776. if ( IsPrintSerialNo )
  20777. {
  20778. if ( l == 0 )
  20779. {
  20780. StrSmallTicketSerialNumber = GetSmallTicketSerialNumber();
  20781. }
  20782. if ( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition )
  20783. {
  20784. StrSmallTicketSerialNumber = PrintReceiptSerial( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.CurrentCompanyInfoID );
  20785. }
  20786. Rectangle rec16 = new Rectangle( rec15.X, TopHeight, TableWidth, RowHeight );
  20787. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 流水号:SNO" ) + StrSmallTicketSerialNumber, ft9, b, rec16 );
  20788. TopHeight += rec15.Height;
  20789. }
  20790. #endregion
  20791. #region 尾
  20792. rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "谢谢惠顾!" );
  20793. sizef = g.MeasureString( rec1Value, ft9 );
  20794. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  20795. FtHeight = Convert.ToInt32( sizef.Height );
  20796. Rectangle rec17 = new Rectangle( TableWidth / 2 - FtWidth / 2, TopHeight + rec15.Height / 2, TableWidth, RowHeight );
  20797. g.DrawString( rec1Value, ft9, b, rec17 );
  20798. #endregion
  20799. StartRows_Y = rec17.Y + rec17.X + RowHeight * 2;
  20800. }
  20801. }
  20802. /// <summary>
  20803. /// 小票打印会员充值收款
  20804. /// </summary>
  20805. public static void SmallTicket_MemberRechargePayment( object objValue, Graphics g, Size size, bool IsPrintSerialNo )
  20806. {
  20807. //Hashtable htData = (Hashtable)objValue;
  20808. Hashtable htDataObj = (Hashtable)objValue;
  20809. List<dynamic> dyObjList = htDataObj["PrintDataList"] as List<dynamic>;
  20810. DataGridViewEx dgvData = (DataGridViewEx)htDataObj["dgvData"];
  20811. string ExecuteSql = orbll.GetView_CustomReturnExecuteSql( "tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Telephone" );
  20812. ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql( "BView_MemberMain_GoldMember", StrWhere: "Mc_Number = '" + htDataObj["McNumber"] + "' " );
  20813. DataSet dtSet = orbll.GetView_Custom( ExecuteSql );
  20814. DataTable tbl_Info = dtSet.Tables["ds"];//获取影楼信息
  20815. if ( tbl_Info.Rows.Count <= 0 )
  20816. {
  20817. MessageBoxCustom.Show( "未设置影楼信息" ); return;
  20818. }
  20819. DataTable tbl2 = dtSet.Tables["ds1"];
  20820. Brush b = Brushes.Black;
  20821. Pen p = new Pen( b, 1 );
  20822. Pen pen = new Pen( b, 1 );
  20823. pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Custom;
  20824. pen.DashPattern = new float[] { 5, 5 };
  20825. string StrFont = "宋体";
  20826. Font ft10 = new Font( StrFont, 17, GraphicsUnit.Pixel );
  20827. Font ft9 = new Font( StrFont, 12, GraphicsUnit.Pixel );
  20828. int Underline = 3;
  20829. int ContentHeight = 2;
  20830. int TableWidth = size.Width;
  20831. int RowHeight = Convert.ToInt32( g.MeasureString( "调试行高", ft9 ).Height );
  20832. int StartRows_Y = 0;
  20833. string StrSmallTicketSerialNumber = "";
  20834. for ( int l = 0; l < PrintPageCount; l++ )
  20835. {
  20836. #region 收款标题
  20837. SizeF sizef = g.MeasureString( DefaultPrintTitle, ft10, TableWidth );
  20838. int FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  20839. int FtHeight = Convert.ToInt32( sizef.Height );
  20840. Rectangle rec1 = new Rectangle( TableWidth / 2 - FtWidth / 2, StartRows_Y, TableWidth, FtHeight );
  20841. g.DrawString( DefaultPrintTitle, ft10, b, rec1 );
  20842. #endregion
  20843. #region 客户资料
  20844. #region 第一行 流程单号
  20845. string rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "会员卡号:" );
  20846. sizef = g.MeasureString( rec1Value, ft9 );
  20847. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  20848. FtHeight = Convert.ToInt32( sizef.Height );
  20849. Rectangle rec2 = new Rectangle( 0, rec1.Y + rec1.Height + 5, FtWidth, RowHeight );
  20850. g.DrawString( rec1Value, ft9, b, rec2 );
  20851. Rectangle rec2A = new Rectangle( rec2.X + rec2.Width, rec2.Y - ContentHeight, TableWidth - rec2.Width, rec2.Height );
  20852. g.DrawString( tbl2.Rows[0]["会员卡号"].ToString().Trim(), ft9, b, rec2A );
  20853. Point rec2A_1 = new Point( rec2A.X, rec2A.Y + rec2A.Height - Underline );
  20854. Point rec2A_2 = new Point( rec2A.X + rec2A.Width, rec2A_1.Y );
  20855. g.DrawLine( p, rec2A_1, rec2A_2 );
  20856. #endregion
  20857. #region 第三行 主联系人姓名
  20858. Rectangle rec4 = new Rectangle( rec2.X, rec2.Y + rec2.Height, rec2.Width, RowHeight );
  20859. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名:" ), ft9, b, rec4 );
  20860. Rectangle rec4A = new Rectangle( rec4.X + rec4.Width, rec4.Y - ContentHeight, TableWidth - rec4.Width, rec4.Height );
  20861. g.DrawString( tbl2.Rows[0]["姓名"].ToString().Trim(), ft9, b, rec4A );
  20862. Point rec4A_1 = new Point( rec4A.X, rec4A.Y + rec4A.Height - Underline );
  20863. Point rec4A_2 = new Point( rec4A.X + rec4A.Width, rec4A_1.Y );
  20864. g.DrawLine( p, rec4A_1, rec4A_2 );
  20865. #endregion
  20866. #region 第四行 性别
  20867. Rectangle rec5 = new Rectangle( rec4.X, rec4.Y + rec4.Height, rec4.Width, RowHeight );
  20868. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 性 别:" ), ft9, b, rec5 );
  20869. Rectangle rec5A = new Rectangle( rec5.X + rec5.Width, rec5.Y - ContentHeight, TableWidth - rec5.Width, rec5.Height );
  20870. g.DrawString( tbl2.Rows[0]["性别"].ToString().Trim(), ft9, b, rec5A );
  20871. Point rec5A_1 = new Point( rec5A.X, rec5A.Y + rec5A.Height - Underline );
  20872. Point rec5A_2 = new Point( rec5A.X + rec5A.Width, rec5A_1.Y );
  20873. g.DrawLine( p, rec5A_1, rec5A_2 );
  20874. #endregion
  20875. #region 第五行 联系电话
  20876. Rectangle rec6 = new Rectangle( rec5.X, rec5.Y + rec5.Height, rec5.Width, RowHeight );
  20877. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "联系电话:" ), ft9, b, rec6 );
  20878. Rectangle rec6A = new Rectangle( rec6.X + rec6.Width, rec6.Y - ContentHeight, TableWidth - rec6.Width, rec6.Height );
  20879. g.DrawString( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( tbl2.Rows[0]["电话"] ), ft9, b, rec6A );
  20880. Point rec6A_1 = new Point( rec6A.X, rec6A.Y + rec6A.Height - Underline );
  20881. Point rec6A_2 = new Point( rec6A.X + rec6A.Width, rec6A_1.Y );
  20882. g.DrawLine( p, rec6A_1, rec6A_2 );
  20883. #endregion
  20884. #endregion
  20885. Point rec7B_1 = new Point( 0, rec6A_1.Y + rec6.Height / 3 + RowHeight / 2 );
  20886. Point rec7B_2 = new Point( TableWidth, rec7B_1.Y );
  20887. g.DrawLine( pen, rec7B_1, rec7B_2 );
  20888. #region 第八行 产品
  20889. IDictionary<string, object> htData = null;
  20890. Rectangle tempRecFor = new Rectangle(rec2.X, rec7B_1.Y + RowHeight / 2, FtWidth, rec2.Height);
  20891. Rectangle recFor5 = new Rectangle();
  20892. string RechargeType = "";
  20893. decimal totalPaymentAmount = 0;
  20894. rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion("收款项目:");
  20895. sizef = g.MeasureString(rec1Value, ft9);
  20896. FtWidth = Convert.ToInt32(sizef.Width) + 1;
  20897. FtHeight = Convert.ToInt32(sizef.Height);
  20898. Rectangle disRecFor1= new Rectangle(tempRecFor.X, tempRecFor.Y, tempRecFor.Width, tempRecFor.Height);
  20899. Rectangle valRecFor1 = new Rectangle(disRecFor1.Width, disRecFor1.Y, TableWidth - FtWidth, disRecFor1.Height);
  20900. foreach (dynamic dyObj in dyObjList)
  20901. {
  20902. htData = dyObj;
  20903. RechargeType = htData["RechargeType"].ToString_s();
  20904. g.DrawString(rec1Value, ft9, b, disRecFor1);
  20905. g.DrawString(htData["PaymentItem"].ToString().Trim().Split('(')[0], ft9, b, valRecFor1);
  20906. disRecFor1 = new Rectangle(disRecFor1.X, disRecFor1.Y + disRecFor1.Height, disRecFor1.Width, disRecFor1.Height);
  20907. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("支付方式:"), ft9, b, disRecFor1);
  20908. valRecFor1 = new Rectangle(valRecFor1.X, disRecFor1.Y, valRecFor1.Width, disRecFor1.Height);
  20909. g.DrawString(htData["PaymentMethod"].ToString().Trim(), ft9, b, valRecFor1);
  20910. disRecFor1 = new Rectangle(disRecFor1.X, disRecFor1.Y + disRecFor1.Height, disRecFor1.Width, disRecFor1.Height);
  20911. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion(" 金 额:"), ft9, b, disRecFor1);
  20912. valRecFor1 = new Rectangle(valRecFor1.X, disRecFor1.Y, valRecFor1.Width, valRecFor1.Height);
  20913. g.DrawString(htData["PaymentAmount"].ToString().Trim(), ft9, b, valRecFor1);
  20914. totalPaymentAmount += Convert.ToDecimal(htData["PaymentAmount"].ToString());
  20915. disRecFor1 = new Rectangle(disRecFor1.X, disRecFor1.Y + disRecFor1.Height, disRecFor1.Width, disRecFor1.Height);
  20916. g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion(" 收 银:"), ft9, b, disRecFor1);
  20917. valRecFor1 = new Rectangle(valRecFor1.X, disRecFor1.Y, valRecFor1.Width, valRecFor1.Height);
  20918. g.DrawString(htData["PaymentPeople"].ToString().Trim(), ft9, b, valRecFor1);
  20919. if(dyObjList.Count-1!= dyObjList.IndexOf(dyObj))
  20920. {
  20921. disRecFor1 = new Rectangle(disRecFor1.X, disRecFor1.Y + disRecFor1.Height + 5, disRecFor1.Width, disRecFor1.Height);
  20922. valRecFor1 = new Rectangle(valRecFor1.X, valRecFor1.Y + valRecFor1.Height + 5, valRecFor1.Width, valRecFor1.Height);
  20923. }
  20924. }
  20925. #endregion
  20926. recFor5 = new Rectangle(valRecFor1.X, valRecFor1.Y, valRecFor1.Width, valRecFor1.Height);
  20927. Point rec8_1 = new Point( rec2.X, recFor5.Y + recFor5.Height + RowHeight / 2 );
  20928. Point rec8_2 = new Point( TableWidth, rec8_1.Y );
  20929. g.DrawLine( pen, rec8_1, rec8_2 );
  20930. decimal totalValue = 0;
  20931. decimal totalSerAmoun = 0;
  20932. if(RechargeType.Equals("会员充值定金"))
  20933. {
  20934. totalValue = Convert.ToDecimal(htData["TotalRechargeAmoun"]);
  20935. totalSerAmoun = Convert.ToDecimal(htData["TotalSerAmoun"]);
  20936. }
  20937. #region 第十行 应付金额
  20938. Rectangle rec9 = new Rectangle( rec2.X, rec8_1.Y + RowHeight / 2, rec2.Width, RowHeight );
  20939. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "应付金额:" ), ft9, b, rec9 );
  20940. Rectangle rec9A = new Rectangle( rec9.X + rec9.Width, rec9.Y - ContentHeight, TableWidth - rec9.Width, rec9.Height );
  20941. if (RechargeType.Equals( "会员充值定金" ) )
  20942. {
  20943. g.DrawString( totalSerAmoun.ToString().Trim(), ft9, b, rec9A );
  20944. }
  20945. else
  20946. {
  20947. g.DrawString(totalPaymentAmount.ToString().Trim(), ft9, b, rec9A );
  20948. }
  20949. Point rec9A_1 = new Point( rec9A.X, rec9A.Y + rec9A.Height - Underline );
  20950. Point rec9A_2 = new Point( rec9A.X + rec9A.Width, rec9A_1.Y );
  20951. g.DrawLine( p, rec9A_1, rec9A_2 );
  20952. #endregion
  20953. #region 第十一行 实付金额
  20954. Rectangle rec10 = new Rectangle( rec9.X, rec9.Y + rec9.Height, rec9.Width, RowHeight );
  20955. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "实付金额:" ), ft9, b, rec10 );
  20956. Rectangle rec10A = new Rectangle( rec10.X + rec10.Width, rec10.Y - ContentHeight, TableWidth - rec10.Width, rec10.Height );
  20957. if (RechargeType.Equals( "会员充值定金" ) )
  20958. {
  20959. g.DrawString( totalValue.ToString().Trim(), ft9, b, rec10A );
  20960. }
  20961. else
  20962. {
  20963. g.DrawString(totalPaymentAmount.ToString().Trim(), ft9, b, rec10A );
  20964. }
  20965. Point rec10A_1 = new Point( rec10A.X, rec10A.Y + rec10A.Height - Underline );
  20966. Point rec10A_2 = new Point( rec10A.X + rec10A.Width, rec10A_1.Y );
  20967. g.DrawLine( p, rec10A_1, rec10A_2 );
  20968. #endregion
  20969. #region 第十三行 备注
  20970. string PaymentExplain = "";
  20971. if ( PrintOtherData.ContainsKey( "收款单说明" ) && PrintOtherData["收款单说明"].ToString().Trim().Length > 0 )
  20972. {
  20973. PaymentExplain = PrintOtherData["收款单说明"].ToString().Trim();
  20974. }
  20975. if (RechargeType.Equals( "会员充值定金" ) && (totalValue - totalPaymentAmount) > 0 )
  20976. {
  20977. PaymentExplain += "【已缴纳金额(定金):" + (totalValue - totalPaymentAmount) + "】";
  20978. }
  20979. rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( " 备 注: " ) + PaymentExplain;
  20980. sizef = g.MeasureString( rec1Value, ft9 );
  20981. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  20982. double dbHeight = sizef.Height;
  20983. int RowCount = FtWidth / TableWidth;
  20984. RowCount++;
  20985. double NewRowHeight = (dbHeight * float.Parse( RowCount.ToString() ));
  20986. Rectangle rec12 = new Rectangle( rec10.X, rec10.Y + rec10.Height + rec10.Height / 2, TableWidth + 7, Convert.ToInt32( NewRowHeight ) + 1 );
  20987. g.DrawString( rec1Value, ft9, b, rec12 );
  20988. #endregion
  20989. #region 第十四行 服务电话
  20990. Rectangle rec13 = new Rectangle( rec12.X, rec12.Y + rec12.Height, TableWidth, RowHeight );
  20991. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "服务电话:" ) + tbl_Info.Rows[0]["Company_Telephone"].ToString().Trim(), ft9, b, rec13 );
  20992. #endregion
  20993. #region 第十五行 客户确认
  20994. Rectangle rec14 = new Rectangle( rec13.X, rec13.Y + rec13.Height + rec13.Height, rec2.Width, RowHeight );
  20995. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客户确认" ), ft9, b, rec14 );
  20996. Point rec14_1 = new Point( rec14.Width, rec14.Y + rec14.Height + rec14.Height / 2 );
  20997. Point rec14_2 = new Point( TableWidth, rec14_1.Y );
  20998. g.DrawLine( p, rec14_1, rec14_2 );
  20999. #endregion
  21000. #region 第十六行 打印时间
  21001. Rectangle rec15 = new Rectangle( rec14.X, rec14.Y + rec14.Height + rec14.Height, TableWidth, RowHeight );
  21002. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "打印时间:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy-MM-dd HH:mm:ss" ), ft9, b, rec15 );
  21003. int TopHeight = rec15.Y + rec15.Height;
  21004. //if (IsPrintSerialNo && PrintPageCount > 1)
  21005. if ( IsPrintSerialNo )
  21006. {
  21007. if ( l == 0 )
  21008. {
  21009. StrSmallTicketSerialNumber = GetSmallTicketSerialNumber();
  21010. }
  21011. if ( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition )
  21012. {
  21013. StrSmallTicketSerialNumber = PrintReceiptSerial( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.CurrentCompanyInfoID );
  21014. }
  21015. Rectangle rec16 = new Rectangle( rec15.X, TopHeight, TableWidth, RowHeight );
  21016. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 流水号:SNO" ) + StrSmallTicketSerialNumber, ft9, b, rec16 );
  21017. TopHeight += rec15.Height;
  21018. }
  21019. #endregion
  21020. #region 尾
  21021. rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "谢谢惠顾!" );
  21022. sizef = g.MeasureString( rec1Value, ft9 );
  21023. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  21024. FtHeight = Convert.ToInt32( sizef.Height );
  21025. Rectangle rec17 = new Rectangle( TableWidth / 2 - FtWidth / 2, TopHeight + rec15.Height / 2, TableWidth, RowHeight );
  21026. g.DrawString( rec1Value, ft9, b, rec17 );
  21027. #endregion
  21028. StartRows_Y = rec17.Y + rec17.X + RowHeight * 2;
  21029. }
  21030. }
  21031. /// <summary>
  21032. /// 小票打印新摄会收款
  21033. /// </summary>
  21034. public static void SmallTicket_PhotographerPayment( object objValue, Graphics g, Size size, bool IsPrintSerialNo )
  21035. {
  21036. Hashtable htData = (Hashtable)objValue;
  21037. DataGridViewEx dgvData = (DataGridViewEx)htData["dgvData"];
  21038. string strNumber = htData["strNumber"].ToString().Trim();
  21039. string strMyNumber = htData["strMyNumber"].ToString().Trim();
  21040. string ExecuteSql = "select Company_Telephone from dbo.tb_ErpCompanyInfo where Company_DividedShop = '" + StrDividedShop + "';";
  21041. ExecuteSql += "select 会员卡号,姓名,性别,电话 from BView_MemberMain_GoldMember where Mc_Number = '" + strNumber + "' ;";
  21042. 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 + "';";
  21043. ExecuteSql += "select Mcpv_GiftName from tb_ErpMemberCardPhotographerVice where Mcpv_MyNumber = '" + strMyNumber + "';";
  21044. DataSet dsData = new BLL.BLL_ErpOrder().GetView_Custom( ExecuteSql );
  21045. DataTable tbl_Info = dsData.Tables["ds"];
  21046. DataTable tbl2 = dsData.Tables["ds1"];
  21047. DataTable tbl3 = dsData.Tables["ds2"];
  21048. DataTable tbl4 = dsData.Tables["ds3"];
  21049. if ( tbl_Info.Rows.Count <= 0 )
  21050. {
  21051. MessageBoxCustom.Show( "未设置影楼信息" ); return;
  21052. }
  21053. if ( tbl2.Rows.Count == 0 )
  21054. {
  21055. MessageBoxCustom.Show( "会员卡号不存在" ); return;
  21056. }
  21057. Brush b = Brushes.Black;
  21058. Pen p = new Pen( b, 1 );
  21059. Pen pen = new Pen( b, 1 );
  21060. pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Custom;
  21061. pen.DashPattern = new float[] { 5, 5 };
  21062. string StrFont = "宋体";
  21063. Font ft10 = new Font( StrFont, 17, GraphicsUnit.Pixel );
  21064. Font ft9 = new Font( StrFont, 12, GraphicsUnit.Pixel );
  21065. int Underline = 3;
  21066. int ContentHeight = 2;
  21067. int TableWidth = size.Width;
  21068. int RowHeight = Convert.ToInt32( g.MeasureString( "调试行高", ft9 ).Height );
  21069. int StartRows_Y = 0;
  21070. string StrSmallTicketSerialNumber = "";
  21071. for ( int l = 0; l < PrintPageCount; l++ )
  21072. {
  21073. #region 收款标题
  21074. SizeF sizef = g.MeasureString( DefaultPrintTitle, ft10, TableWidth );
  21075. int FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  21076. int FtHeight = Convert.ToInt32( sizef.Height );
  21077. Rectangle rec1 = new Rectangle( TableWidth / 2 - FtWidth / 2, StartRows_Y, TableWidth, FtHeight );
  21078. g.DrawString( DefaultPrintTitle, ft10, b, rec1 );
  21079. #endregion
  21080. #region 客户资料
  21081. #region 第一行 流程单号
  21082. string rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "会员卡号:" );
  21083. sizef = g.MeasureString( rec1Value, ft9 );
  21084. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  21085. FtHeight = Convert.ToInt32( sizef.Height );
  21086. Rectangle rec2 = new Rectangle( 0, rec1.Y + rec1.Height + 5, FtWidth, RowHeight );
  21087. g.DrawString( rec1Value, ft9, b, rec2 );
  21088. Rectangle rec2A = new Rectangle( rec2.X + rec2.Width, rec2.Y - ContentHeight, TableWidth - rec2.Width, rec2.Height );
  21089. g.DrawString( tbl2.Rows[0]["会员卡号"].ToString().Trim(), ft9, b, rec2A );
  21090. Point rec2A_1 = new Point( rec2A.X, rec2A.Y + rec2A.Height - Underline );
  21091. Point rec2A_2 = new Point( rec2A.X + rec2A.Width, rec2A_1.Y );
  21092. g.DrawLine( p, rec2A_1, rec2A_2 );
  21093. #endregion
  21094. #region 第三行 主联系人姓名
  21095. Rectangle rec4 = new Rectangle( rec2.X, rec2.Y + rec2.Height, rec2.Width, RowHeight );
  21096. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名:" ), ft9, b, rec4 );
  21097. Rectangle rec4A = new Rectangle( rec4.X + rec4.Width, rec4.Y - ContentHeight, TableWidth - rec4.Width, rec4.Height );
  21098. g.DrawString( tbl2.Rows[0]["姓名"].ToString().Trim(), ft9, b, rec4A );
  21099. Point rec4A_1 = new Point( rec4A.X, rec4A.Y + rec4A.Height - Underline );
  21100. Point rec4A_2 = new Point( rec4A.X + rec4A.Width, rec4A_1.Y );
  21101. g.DrawLine( p, rec4A_1, rec4A_2 );
  21102. #endregion
  21103. #region 第四行 性别
  21104. Rectangle rec5 = new Rectangle( rec4.X, rec4.Y + rec4.Height, rec4.Width, RowHeight );
  21105. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 性 别:" ), ft9, b, rec5 );
  21106. Rectangle rec5A = new Rectangle( rec5.X + rec5.Width, rec5.Y - ContentHeight, TableWidth - rec5.Width, rec5.Height );
  21107. g.DrawString( tbl2.Rows[0]["性别"].ToString().Trim(), ft9, b, rec5A );
  21108. Point rec5A_1 = new Point( rec5A.X, rec5A.Y + rec5A.Height - Underline );
  21109. Point rec5A_2 = new Point( rec5A.X + rec5A.Width, rec5A_1.Y );
  21110. g.DrawLine( p, rec5A_1, rec5A_2 );
  21111. #endregion
  21112. #region 第五行 联系电话
  21113. Rectangle rec6 = new Rectangle( rec5.X, rec5.Y + rec5.Height, rec5.Width, RowHeight );
  21114. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "联系电话:" ), ft9, b, rec6 );
  21115. Rectangle rec6A = new Rectangle( rec6.X + rec6.Width, rec6.Y - ContentHeight, TableWidth - rec6.Width, rec6.Height );
  21116. g.DrawString( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( tbl2.Rows[0]["电话"] ), ft9, b, rec6A );
  21117. Point rec6A_1 = new Point( rec6A.X, rec6A.Y + rec6A.Height - Underline );
  21118. Point rec6A_2 = new Point( rec6A.X + rec6A.Width, rec6A_1.Y );
  21119. g.DrawLine( p, rec6A_1, rec6A_2 );
  21120. #endregion
  21121. #endregion
  21122. Point rec7B_1 = new Point( 0, rec6A_1.Y + rec6.Height / 3 + RowHeight / 2 );
  21123. Point rec7B_2 = new Point( TableWidth, rec7B_1.Y );
  21124. g.DrawLine( pen, rec7B_1, rec7B_2 );
  21125. #region 第八行 产品
  21126. decimal CopeAmount = 0;//应付金额
  21127. decimal ActualAmount = 0;//实付金额
  21128. rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "收款项目:" );
  21129. sizef = g.MeasureString( rec1Value, ft9 );
  21130. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  21131. FtHeight = Convert.ToInt32( sizef.Height );
  21132. Rectangle recFor1 = new Rectangle( rec2.X, rec7B_1.Y + RowHeight / 2, FtWidth, rec2.Height );
  21133. g.DrawString( rec1Value, ft9, b, recFor1 );
  21134. string StrCategory = tbl3.Rows[0]["Mcpm_GradeName"].ToString().Trim();//收款项目
  21135. Rectangle recFor1A = new Rectangle( recFor1.Width, recFor1.Y, TableWidth - FtWidth, recFor1.Height );
  21136. g.DrawString( StrCategory, ft9, b, recFor1A );
  21137. Rectangle recFor2 = new Rectangle( recFor1.X, recFor1.Y + recFor1.Height, recFor1.Width, recFor1.Height );
  21138. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "支付方式:" ), ft9, b, recFor2 );
  21139. Rectangle recFor2A = new Rectangle( recFor1A.X, recFor2.Y, recFor1A.Width, recFor2.Height );
  21140. g.DrawString( tbl3.Rows[0]["Mcpm_PaymentMethod"].ToString().Trim(), ft9, b, recFor2A );
  21141. Rectangle recFor3 = new Rectangle( recFor2.X, recFor2.Y + recFor2.Height, recFor1.Width, recFor2A.Height );
  21142. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 金 额:" ), ft9, b, recFor3 );
  21143. Rectangle recFor3A = new Rectangle( recFor1A.X, recFor3.Y, recFor2A.Width, recFor3.Height );
  21144. g.DrawString( tbl3.Rows[0]["Mcpm_UpgradeAoumnt"].ToString().Trim(), ft9, b, recFor3A );
  21145. Rectangle recFor4 = new Rectangle( recFor3.X, recFor3.Y + recFor3.Height, recFor1.Width, recFor3A.Height );
  21146. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 门 市:" ), ft9, b, recFor4 );
  21147. Rectangle recFor4A = new Rectangle( recFor3A.X, recFor4.Y, recFor3A.Width, recFor4.Height );
  21148. g.DrawString( tbl3.Rows[0]["Mcpm_CreateName"].ToString().Trim(), ft9, b, recFor4A );
  21149. Rectangle recFor5 = new Rectangle( recFor4.X, recFor4.Y + recFor4.Height, recFor1.Width, recFor4.Height );
  21150. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 收 银:" ), ft9, b, recFor5 );
  21151. Rectangle recFor5A = new Rectangle( recFor4A.X, recFor5.Y, recFor4A.Width, recFor5.Height );
  21152. g.DrawString( tbl3.Rows[0]["Mcpm_PaymentName"].ToString().Trim(), ft9, b, recFor5A );
  21153. Rectangle recFor6 = new Rectangle( recFor5.X, recFor5.Y + recFor5.Height, recFor5.Width, recFor5.Height );
  21154. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "赠品详情:" ), ft9, b, recFor6 );
  21155. rec1Value = "";
  21156. for ( int j = 0; j < tbl4.Rows.Count; j++ )
  21157. {
  21158. rec1Value += (j + 1) + "." + tbl4.Rows[j]["Mcpv_GiftName"].ToString().Trim() + "\r\n";
  21159. }
  21160. int forNewRowHeight = recFor5.Height;
  21161. if ( rec1Value != "" )
  21162. {
  21163. sizef = g.MeasureString( rec1Value, ft9 );
  21164. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  21165. double fordbHeight = sizef.Height;
  21166. int forRowCount = FtWidth / TableWidth;
  21167. forRowCount++;
  21168. forNewRowHeight = Convert.ToInt32( fordbHeight * float.Parse( forRowCount.ToString() ) ) + 1;
  21169. }
  21170. Rectangle recFor6A = new Rectangle( recFor6.Width / 4, recFor6.Y + recFor6.Height, TableWidth - recFor6.Width / 4, forNewRowHeight );
  21171. g.DrawString( rec1Value, ft9, b, recFor6A );
  21172. CopeAmount = Convert.ToDecimal( tbl3.Rows[0]["Mcpm_UpgradeAoumnt"] );
  21173. ActualAmount = Convert.ToDecimal( tbl3.Rows[0]["Mcpm_UpgradeAoumnt"] );
  21174. #endregion
  21175. Point rec8_1 = new Point( rec2.X, recFor6A.Y + recFor6A.Height + RowHeight / 2 );
  21176. Point rec8_2 = new Point( TableWidth, rec8_1.Y );
  21177. g.DrawLine( pen, rec8_1, rec8_2 );
  21178. #region 第十行 应付金额
  21179. Rectangle rec9 = new Rectangle( rec2.X, rec8_1.Y + RowHeight / 2, rec2.Width, RowHeight );
  21180. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "应付金额:" ), ft9, b, rec9 );
  21181. Rectangle rec9A = new Rectangle( rec9.X + rec9.Width, rec9.Y - ContentHeight, TableWidth - rec9.Width, rec9.Height );
  21182. g.DrawString( CopeAmount.ToString( "0.00" ), ft9, b, rec9A );
  21183. Point rec9A_1 = new Point( rec9A.X, rec9A.Y + rec9A.Height - Underline );
  21184. Point rec9A_2 = new Point( rec9A.X + rec9A.Width, rec9A_1.Y );
  21185. g.DrawLine( p, rec9A_1, rec9A_2 );
  21186. #endregion
  21187. #region 第十一行 实付金额
  21188. Rectangle rec10 = new Rectangle( rec9.X, rec9.Y + rec9.Height, rec9.Width, RowHeight );
  21189. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "实付金额:" ), ft9, b, rec10 );
  21190. Rectangle rec10A = new Rectangle( rec10.X + rec10.Width, rec10.Y - ContentHeight, TableWidth - rec10.Width, rec10.Height );
  21191. g.DrawString( ActualAmount.ToString( "0.00" ), ft9, b, rec10A );
  21192. Point rec10A_1 = new Point( rec10A.X, rec10A.Y + rec10A.Height - Underline );
  21193. Point rec10A_2 = new Point( rec10A.X + rec10A.Width, rec10A_1.Y );
  21194. g.DrawLine( p, rec10A_1, rec10A_2 );
  21195. #endregion
  21196. #region 第十三行 备注
  21197. string PaymentExplain = "";
  21198. if ( PrintOtherData.ContainsKey( "收款单说明" ) && PrintOtherData["收款单说明"].ToString().Trim().Length > 0 )
  21199. {
  21200. PaymentExplain = PrintOtherData["收款单说明"].ToString().Trim();
  21201. }
  21202. rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( " 备 注: " ) + PaymentExplain;
  21203. sizef = g.MeasureString( rec1Value, ft9 );
  21204. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  21205. double dbHeight = sizef.Height;
  21206. int RowCount = FtWidth / TableWidth;
  21207. RowCount++;
  21208. double NewRowHeight = (dbHeight * float.Parse( RowCount.ToString() ));
  21209. Rectangle rec12 = new Rectangle( rec10.X, rec10.Y + rec10.Height + rec10.Height / 2, TableWidth + 7, Convert.ToInt32( NewRowHeight ) + 1 );
  21210. g.DrawString( rec1Value, ft9, b, rec12 );
  21211. #endregion
  21212. #region 第十四行 服务电话
  21213. Rectangle rec13 = new Rectangle( rec12.X, rec12.Y + rec12.Height, TableWidth, RowHeight );
  21214. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "服务电话:" ) + tbl_Info.Rows[0]["Company_Telephone"].ToString().Trim(), ft9, b, rec13 );
  21215. #endregion
  21216. #region 第十五行 客户确认
  21217. Rectangle rec14 = new Rectangle( rec13.X, rec13.Y + rec13.Height + rec13.Height, rec2.Width, RowHeight );
  21218. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客户确认" ), ft9, b, rec14 );
  21219. Point rec14_1 = new Point( rec14.Width, rec14.Y + rec14.Height + rec14.Height / 2 );
  21220. Point rec14_2 = new Point( TableWidth, rec14_1.Y );
  21221. g.DrawLine( p, rec14_1, rec14_2 );
  21222. #endregion
  21223. #region 第十六行 打印时间
  21224. Rectangle rec15 = new Rectangle( rec14.X, rec14.Y + rec14.Height + rec14.Height, TableWidth, RowHeight );
  21225. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "打印时间:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy-MM-dd HH:mm:ss" ), ft9, b, rec15 );
  21226. int TopHeight = rec15.Y + rec15.Height;
  21227. //if (IsPrintSerialNo && PrintPageCount > 1)
  21228. if ( IsPrintSerialNo )
  21229. {
  21230. if ( l == 0 )
  21231. {
  21232. StrSmallTicketSerialNumber = GetSmallTicketSerialNumber();
  21233. }
  21234. if ( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition )
  21235. {
  21236. StrSmallTicketSerialNumber = PrintReceiptSerial( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.CurrentCompanyInfoID );
  21237. }
  21238. Rectangle rec16 = new Rectangle( rec15.X, TopHeight, TableWidth, RowHeight );
  21239. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 流水号:SNO" ) + StrSmallTicketSerialNumber, ft9, b, rec16 );
  21240. TopHeight += rec15.Height;
  21241. }
  21242. #endregion
  21243. #region 尾
  21244. rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "谢谢惠顾!" );
  21245. sizef = g.MeasureString( rec1Value, ft9 );
  21246. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  21247. FtHeight = Convert.ToInt32( sizef.Height );
  21248. Rectangle rec17 = new Rectangle( TableWidth / 2 - FtWidth / 2, TopHeight + rec15.Height / 2, TableWidth, RowHeight );
  21249. g.DrawString( rec1Value, ft9, b, rec17 );
  21250. #endregion
  21251. StartRows_Y = rec17.Y + rec17.X + RowHeight * 2;
  21252. }
  21253. }
  21254. /// <summary>
  21255. /// 小票打印新摄会返还款
  21256. /// </summary>
  21257. public static void SmallTicket_PhotographerRefundPayment( object objValue, Graphics g, Size size, bool IsPrintSerialNo )
  21258. {
  21259. Hashtable htData = (Hashtable)objValue;
  21260. DataGridViewEx dgvData = (DataGridViewEx)htData["dgvData"];
  21261. string strNumber = htData["strNumber"].ToString().Trim();
  21262. string strMyNumber = htData["strMyNumber"].ToString().Trim();
  21263. string ExecuteSql = "select Company_Telephone from dbo.tb_ErpCompanyInfo where Company_DividedShop = '" + StrDividedShop + "';";
  21264. ExecuteSql += "select 会员卡号,姓名,性别,电话 from BView_MemberMain_GoldMember where Mc_Number = '" + strNumber + "' ;";
  21265. 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 + "';";
  21266. DataSet dsData = new BLL.BLL_ErpOrder().GetView_Custom( ExecuteSql );
  21267. DataTable tbl_Info = dsData.Tables["ds"];
  21268. DataTable tbl2 = dsData.Tables["ds1"];
  21269. DataTable tbl3 = dsData.Tables["ds2"];
  21270. if ( tbl_Info.Rows.Count <= 0 )
  21271. {
  21272. MessageBoxCustom.Show( "未设置影楼信息" ); return;
  21273. }
  21274. if ( tbl2.Rows.Count == 0 )
  21275. {
  21276. MessageBoxCustom.Show( "会员卡号不存在" ); return;
  21277. }
  21278. Brush b = Brushes.Black;
  21279. Pen p = new Pen( b, 1 );
  21280. Pen pen = new Pen( b, 1 );
  21281. pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Custom;
  21282. pen.DashPattern = new float[] { 5, 5 };
  21283. string StrFont = "宋体";
  21284. Font ft10 = new Font( StrFont, 17, GraphicsUnit.Pixel );
  21285. Font ft9 = new Font( StrFont, 12, GraphicsUnit.Pixel );
  21286. int Underline = 3;
  21287. int ContentHeight = 2;
  21288. int TableWidth = size.Width;
  21289. int RowHeight = Convert.ToInt32( g.MeasureString( "调试行高", ft9 ).Height );
  21290. int StartRows_Y = 0;
  21291. string StrSmallTicketSerialNumber = "";
  21292. for ( int l = 0; l < PrintPageCount; l++ )
  21293. {
  21294. #region 收款标题
  21295. SizeF sizef = g.MeasureString( DefaultPrintTitle, ft10, TableWidth );
  21296. int FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  21297. int FtHeight = Convert.ToInt32( sizef.Height );
  21298. Rectangle rec1 = new Rectangle( TableWidth / 2 - FtWidth / 2, StartRows_Y, TableWidth, FtHeight );
  21299. g.DrawString( DefaultPrintTitle, ft10, b, rec1 );
  21300. #endregion
  21301. #region 客户资料
  21302. #region 第一行 流程单号
  21303. string rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "会员卡号:" );
  21304. sizef = g.MeasureString( rec1Value, ft9 );
  21305. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  21306. FtHeight = Convert.ToInt32( sizef.Height );
  21307. Rectangle rec2 = new Rectangle( 0, rec1.Y + rec1.Height + 5, FtWidth, RowHeight );
  21308. g.DrawString( rec1Value, ft9, b, rec2 );
  21309. Rectangle rec2A = new Rectangle( rec2.X + rec2.Width, rec2.Y - ContentHeight, TableWidth - rec2.Width, rec2.Height );
  21310. g.DrawString( tbl2.Rows[0]["会员卡号"].ToString().Trim(), ft9, b, rec2A );
  21311. Point rec2A_1 = new Point( rec2A.X, rec2A.Y + rec2A.Height - Underline );
  21312. Point rec2A_2 = new Point( rec2A.X + rec2A.Width, rec2A_1.Y );
  21313. g.DrawLine( p, rec2A_1, rec2A_2 );
  21314. #endregion
  21315. #region 第三行 主联系人姓名
  21316. Rectangle rec4 = new Rectangle( rec2.X, rec2.Y + rec2.Height, rec2.Width, RowHeight );
  21317. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名:" ), ft9, b, rec4 );
  21318. Rectangle rec4A = new Rectangle( rec4.X + rec4.Width, rec4.Y - ContentHeight, TableWidth - rec4.Width, rec4.Height );
  21319. g.DrawString( tbl2.Rows[0]["姓名"].ToString().Trim(), ft9, b, rec4A );
  21320. Point rec4A_1 = new Point( rec4A.X, rec4A.Y + rec4A.Height - Underline );
  21321. Point rec4A_2 = new Point( rec4A.X + rec4A.Width, rec4A_1.Y );
  21322. g.DrawLine( p, rec4A_1, rec4A_2 );
  21323. #endregion
  21324. #region 第四行 性别
  21325. Rectangle rec5 = new Rectangle( rec4.X, rec4.Y + rec4.Height, rec4.Width, RowHeight );
  21326. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 性 别:" ), ft9, b, rec5 );
  21327. Rectangle rec5A = new Rectangle( rec5.X + rec5.Width, rec5.Y - ContentHeight, TableWidth - rec5.Width, rec5.Height );
  21328. g.DrawString( tbl2.Rows[0]["性别"].ToString().Trim(), ft9, b, rec5A );
  21329. Point rec5A_1 = new Point( rec5A.X, rec5A.Y + rec5A.Height - Underline );
  21330. Point rec5A_2 = new Point( rec5A.X + rec5A.Width, rec5A_1.Y );
  21331. g.DrawLine( p, rec5A_1, rec5A_2 );
  21332. #endregion
  21333. #region 第五行 联系电话
  21334. Rectangle rec6 = new Rectangle( rec5.X, rec5.Y + rec5.Height, rec5.Width, RowHeight );
  21335. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "联系电话:" ), ft9, b, rec6 );
  21336. Rectangle rec6A = new Rectangle( rec6.X + rec6.Width, rec6.Y - ContentHeight, TableWidth - rec6.Width, rec6.Height );
  21337. g.DrawString( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( tbl2.Rows[0]["电话"] ), ft9, b, rec6A );
  21338. Point rec6A_1 = new Point( rec6A.X, rec6A.Y + rec6A.Height - Underline );
  21339. Point rec6A_2 = new Point( rec6A.X + rec6A.Width, rec6A_1.Y );
  21340. g.DrawLine( p, rec6A_1, rec6A_2 );
  21341. #endregion
  21342. #endregion
  21343. Point rec7B_1 = new Point( 0, rec6A_1.Y + rec6.Height / 3 + RowHeight / 2 );
  21344. Point rec7B_2 = new Point( TableWidth, rec7B_1.Y );
  21345. g.DrawLine( pen, rec7B_1, rec7B_2 );
  21346. #region 第八行 产品
  21347. rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "收款项目:" );
  21348. sizef = g.MeasureString( rec1Value, ft9 );
  21349. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  21350. FtHeight = Convert.ToInt32( sizef.Height );
  21351. Rectangle recFor1 = new Rectangle( rec2.X, rec7B_1.Y + RowHeight / 2, FtWidth, rec2.Height );
  21352. g.DrawString( rec1Value, ft9, b, recFor1 );
  21353. string StrCategory = tbl3.Rows[0]["Mcpm_GradeName"].ToString().Trim();//收款项目
  21354. Rectangle recFor1A = new Rectangle( recFor1.Width, recFor1.Y, TableWidth - FtWidth, recFor1.Height );
  21355. g.DrawString( StrCategory, ft9, b, recFor1A );
  21356. Rectangle recFor2 = new Rectangle( recFor1.X, recFor1.Y + recFor1.Height, recFor1.Width, recFor1.Height );
  21357. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "支付方式:" ), ft9, b, recFor2 );
  21358. Rectangle recFor2A = new Rectangle( recFor1A.X, recFor2.Y, recFor1A.Width, recFor2.Height );
  21359. g.DrawString( "现金", ft9, b, recFor2A );
  21360. Rectangle recFor3 = new Rectangle( recFor2.X, recFor2.Y + recFor2.Height, recFor1.Width, recFor2A.Height );
  21361. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 金 额:" ), ft9, b, recFor3 );
  21362. Rectangle recFor3A = new Rectangle( recFor1A.X, recFor3.Y, recFor2A.Width, recFor3.Height );
  21363. g.DrawString( tbl3.Rows[0]["Mcpm_OKBackAoumnt"].ToString().Trim(), ft9, b, recFor3A );
  21364. Rectangle recFor5 = new Rectangle( recFor3.X, recFor3.Y + recFor3.Height, recFor1.Width, recFor3.Height );
  21365. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 经手人:" ), ft9, b, recFor5 );
  21366. Rectangle recFor5A = new Rectangle( recFor3A.X, recFor5.Y, recFor3A.Width, recFor5.Height );
  21367. g.DrawString( tbl3.Rows[0]["Mcpm_JingShouRen"].ToString().Trim(), ft9, b, recFor5A );
  21368. #endregion
  21369. Point rec8_1 = new Point( rec2.X, recFor5.Y + recFor5.Height + RowHeight / 2 );
  21370. Point rec8_2 = new Point( TableWidth, rec8_1.Y );
  21371. g.DrawLine( pen, rec8_1, rec8_2 );
  21372. #region 第十行 应付金额
  21373. Rectangle rec9 = new Rectangle( rec2.X, rec8_1.Y + RowHeight / 2, rec2.Width, RowHeight );
  21374. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 应 还:" ), ft9, b, rec9 );
  21375. Rectangle rec9A = new Rectangle( rec9.X + rec9.Width, rec9.Y - ContentHeight, TableWidth - rec9.Width, rec9.Height );
  21376. g.DrawString( tbl3.Rows[0]["Mcpm_BackAoumnt"].ToString().Trim(), ft9, b, rec9A );
  21377. Point rec9A_1 = new Point( rec9A.X, rec9A.Y + rec9A.Height - Underline );
  21378. Point rec9A_2 = new Point( rec9A.X + rec9A.Width, rec9A_1.Y );
  21379. g.DrawLine( p, rec9A_1, rec9A_2 );
  21380. #endregion
  21381. #region 第十一行 实付金额
  21382. Rectangle rec10 = new Rectangle( rec9.X, rec9.Y + rec9.Height, rec9.Width, RowHeight );
  21383. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 实 还:" ), ft9, b, rec10 );
  21384. Rectangle rec10A = new Rectangle( rec10.X + rec10.Width, rec10.Y - ContentHeight, TableWidth - rec10.Width, rec10.Height );
  21385. g.DrawString( Convert.ToDecimal( tbl3.Rows[0]["Mcpm_UpgradeAoumnt"] ).ToString( "0.00" ), ft9, b, rec10A );
  21386. Point rec10A_1 = new Point( rec10A.X, rec10A.Y + rec10A.Height - Underline );
  21387. Point rec10A_2 = new Point( rec10A.X + rec10A.Width, rec10A_1.Y );
  21388. g.DrawLine( p, rec10A_1, rec10A_2 );
  21389. #endregion
  21390. #region 第十三行 备注
  21391. string PaymentExplain = "";
  21392. if ( PrintOtherData.ContainsKey( "收款单说明" ) && PrintOtherData["收款单说明"].ToString().Trim().Length > 0 )
  21393. {
  21394. PaymentExplain = PrintOtherData["收款单说明"].ToString().Trim();
  21395. }
  21396. rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( " 备 注: " ) + PaymentExplain;
  21397. sizef = g.MeasureString( rec1Value, ft9 );
  21398. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  21399. double dbHeight = sizef.Height;
  21400. int RowCount = FtWidth / TableWidth;
  21401. RowCount++;
  21402. double NewRowHeight = (dbHeight * float.Parse( RowCount.ToString() ));
  21403. Rectangle rec12 = new Rectangle( rec10.X, rec10.Y + rec10.Height + rec10.Height / 2, TableWidth + 7, Convert.ToInt32( NewRowHeight ) + 1 );
  21404. g.DrawString( rec1Value, ft9, b, rec12 );
  21405. #endregion
  21406. #region 第十四行 服务电话
  21407. Rectangle rec13 = new Rectangle( rec12.X, rec12.Y + rec12.Height, TableWidth, RowHeight );
  21408. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "服务电话:" ) + tbl_Info.Rows[0]["Company_Telephone"].ToString().Trim(), ft9, b, rec13 );
  21409. #endregion
  21410. #region 第十五行 客户确认
  21411. Rectangle rec14 = new Rectangle( rec13.X, rec13.Y + rec13.Height + rec13.Height, rec2.Width, RowHeight );
  21412. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客户确认" ), ft9, b, rec14 );
  21413. Point rec14_1 = new Point( rec14.Width, rec14.Y + rec14.Height + rec14.Height / 2 );
  21414. Point rec14_2 = new Point( TableWidth, rec14_1.Y );
  21415. g.DrawLine( p, rec14_1, rec14_2 );
  21416. #endregion
  21417. #region 第十六行 打印时间
  21418. Rectangle rec15 = new Rectangle( rec14.X, rec14.Y + rec14.Height + rec14.Height, TableWidth, RowHeight );
  21419. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "打印时间:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy-MM-dd HH:mm:ss" ), ft9, b, rec15 );
  21420. int TopHeight = rec15.Y + rec15.Height;
  21421. //if (IsPrintSerialNo && PrintPageCount > 1)
  21422. if ( IsPrintSerialNo )
  21423. {
  21424. if ( l == 0 )
  21425. {
  21426. StrSmallTicketSerialNumber = GetSmallTicketSerialNumber();
  21427. }
  21428. if ( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition )
  21429. {
  21430. StrSmallTicketSerialNumber = PrintReceiptSerial( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.CurrentCompanyInfoID );
  21431. }
  21432. Rectangle rec16 = new Rectangle( rec15.X, TopHeight, TableWidth, RowHeight );
  21433. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 流水号:SNO" ) + StrSmallTicketSerialNumber, ft9, b, rec16 );
  21434. TopHeight += rec15.Height;
  21435. }
  21436. #endregion
  21437. #region 尾
  21438. rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "谢谢惠顾!" );
  21439. sizef = g.MeasureString( rec1Value, ft9 );
  21440. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  21441. FtHeight = Convert.ToInt32( sizef.Height );
  21442. Rectangle rec17 = new Rectangle( TableWidth / 2 - FtWidth / 2, TopHeight + rec15.Height / 2, TableWidth, RowHeight );
  21443. g.DrawString( rec1Value, ft9, b, rec17 );
  21444. #endregion
  21445. StartRows_Y = rec17.Y + rec17.X + RowHeight * 2;
  21446. }
  21447. }
  21448. /// <summary>
  21449. /// 小票打印服务充值收款
  21450. /// </summary>
  21451. public static void SmallTicket_MemberServicePayment( object objValue, Graphics g, Size size, bool IsPrintSerialNo )
  21452. {
  21453. Hashtable htData = (Hashtable)objValue;
  21454. string ExecuteSql = "select Company_Telephone from dbo.tb_ErpCompanyInfo where Company_DividedShop = '" + StrDividedShop + "';";
  21455. ExecuteSql += "select 会员卡号,姓名,性别,电话 from BView_MemberMain_GoldMember where Mc_Number = '" + htData["strMcNumber"] + "' ;";
  21456. 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"] + "';";
  21457. ExecuteSql += "select Mcpcd_PaymentNumber,Mcpcd_ServiceNumber,Mcpcd_ServiceContent,Mcpcd_Count,Mcpcd_SalePrice from tb_ErpMemberCardPaymentContentDetail where Mcpcd_PaymentNumber = '" + htData["strNumber"] + "' ;";
  21458. DataSet dsData = new BLL.BLL_ErpOrder().GetView_Custom( ExecuteSql );
  21459. DataTable tbl_Info = dsData.Tables["ds"];
  21460. DataTable tblA = dsData.Tables["ds1"];
  21461. if ( tbl_Info.Rows.Count <= 0 )
  21462. {
  21463. MessageBoxCustom.Show( "未设置影楼信息" ); return;
  21464. }
  21465. if ( tblA.Rows.Count == 0 )
  21466. {
  21467. MessageBoxCustom.Show( "会员卡号不存在" ); return;
  21468. }
  21469. DataTable tblB = dsData.Tables["ds2"];
  21470. DataTable tblC = dsData.Tables["ds3"];
  21471. Brush b = Brushes.Black;
  21472. Pen p = new Pen( b, 1 );
  21473. Pen pen = new Pen( b, 1 );
  21474. pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Custom;
  21475. pen.DashPattern = new float[] { 5, 5 };
  21476. string StrFont = "宋体";
  21477. Font ft10 = new Font( StrFont, 17, GraphicsUnit.Pixel );
  21478. Font ft9 = new Font( StrFont, 12, GraphicsUnit.Pixel );
  21479. int Underline = 3;
  21480. int ContentHeight = 2;
  21481. int TableWidth = size.Width;
  21482. int RowHeight = Convert.ToInt32( g.MeasureString( "调试行高", ft9 ).Height );
  21483. int StartRows_Y = 0;
  21484. string StrSmallTicketSerialNumber = "";
  21485. for ( int l = 0; l < PrintPageCount; l++ )
  21486. {
  21487. #region 收款标题
  21488. SizeF sizef = g.MeasureString( DefaultPrintTitle, ft10, TableWidth );
  21489. int FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  21490. int FtHeight = Convert.ToInt32( sizef.Height );
  21491. Rectangle rec1 = new Rectangle( TableWidth / 2 - FtWidth / 2, StartRows_Y, TableWidth, FtHeight );
  21492. g.DrawString( DefaultPrintTitle, ft10, b, rec1 );
  21493. #endregion
  21494. #region 客户资料
  21495. #region 第一行 流程单号
  21496. string rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "会员卡号:" );
  21497. sizef = g.MeasureString( rec1Value, ft9 );
  21498. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  21499. FtHeight = Convert.ToInt32( sizef.Height );
  21500. Rectangle rec2 = new Rectangle( 0, rec1.Y + rec1.Height + 5, FtWidth, RowHeight );
  21501. g.DrawString( rec1Value, ft9, b, rec2 );
  21502. Rectangle rec2A = new Rectangle( rec2.X + rec2.Width, rec2.Y - ContentHeight, TableWidth - rec2.Width, rec2.Height );
  21503. g.DrawString( tblA.Rows[0]["会员卡号"].ToString().Trim(), ft9, b, rec2A );
  21504. Point rec2A_1 = new Point( rec2A.X, rec2A.Y + rec2A.Height - Underline );
  21505. Point rec2A_2 = new Point( rec2A.X + rec2A.Width, rec2A_1.Y );
  21506. g.DrawLine( p, rec2A_1, rec2A_2 );
  21507. #endregion
  21508. #region 第三行 主联系人姓名
  21509. Rectangle rec4 = new Rectangle( rec2.X, rec2.Y + rec2.Height, rec2.Width, RowHeight );
  21510. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名:" ), ft9, b, rec4 );
  21511. Rectangle rec4A = new Rectangle( rec4.X + rec4.Width, rec4.Y - ContentHeight, TableWidth - rec4.Width, rec4.Height );
  21512. g.DrawString( tblA.Rows[0]["姓名"].ToString().Trim(), ft9, b, rec4A );
  21513. Point rec4A_1 = new Point( rec4A.X, rec4A.Y + rec4A.Height - Underline );
  21514. Point rec4A_2 = new Point( rec4A.X + rec4A.Width, rec4A_1.Y );
  21515. g.DrawLine( p, rec4A_1, rec4A_2 );
  21516. #endregion
  21517. #region 第四行 性别
  21518. Rectangle rec5 = new Rectangle( rec4.X, rec4.Y + rec4.Height, rec4.Width, RowHeight );
  21519. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 性 别:" ), ft9, b, rec5 );
  21520. Rectangle rec5A = new Rectangle( rec5.X + rec5.Width, rec5.Y - ContentHeight, TableWidth - rec5.Width, rec5.Height );
  21521. g.DrawString( tblA.Rows[0]["性别"].ToString().Trim(), ft9, b, rec5A );
  21522. Point rec5A_1 = new Point( rec5A.X, rec5A.Y + rec5A.Height - Underline );
  21523. Point rec5A_2 = new Point( rec5A.X + rec5A.Width, rec5A_1.Y );
  21524. g.DrawLine( p, rec5A_1, rec5A_2 );
  21525. #endregion
  21526. #region 第五行 联系电话
  21527. Rectangle rec6 = new Rectangle( rec5.X, rec5.Y + rec5.Height, rec5.Width, RowHeight );
  21528. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "联系电话:" ), ft9, b, rec6 );
  21529. Rectangle rec6A = new Rectangle( rec6.X + rec6.Width, rec6.Y - ContentHeight, TableWidth - rec6.Width, rec6.Height );
  21530. g.DrawString( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( tblA.Rows[0]["电话"] ), ft9, b, rec6A );
  21531. Point rec6A_1 = new Point( rec6A.X, rec6A.Y + rec6A.Height - Underline );
  21532. Point rec6A_2 = new Point( rec6A.X + rec6A.Width, rec6A_1.Y );
  21533. g.DrawLine( p, rec6A_1, rec6A_2 );
  21534. #endregion
  21535. #endregion
  21536. Point rec7B_1 = new Point( 0, rec6A_1.Y + rec6.Height / 3 + RowHeight / 2 );
  21537. Point rec7B_2 = new Point( TableWidth, rec7B_1.Y );
  21538. g.DrawLine( pen, rec7B_1, rec7B_2 );
  21539. #region 第八行 产品
  21540. decimal CopeAmount = 0;//应付金额
  21541. int IntPoint_Y = rec7B_1.Y + RowHeight / 2;
  21542. for ( int i = 0; i < tblC.Rows.Count; i++ )
  21543. {
  21544. rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "收款项目:" );
  21545. sizef = g.MeasureString( rec1Value, ft9 );
  21546. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  21547. FtHeight = Convert.ToInt32( sizef.Height );
  21548. Rectangle recFor1 = new Rectangle( rec2.X, IntPoint_Y, FtWidth, rec2.Height );
  21549. g.DrawString( rec1Value, ft9, b, recFor1 );
  21550. Rectangle recFor1A = new Rectangle( recFor1.Width, recFor1.Y, TableWidth - FtWidth, recFor1.Height );
  21551. g.DrawString( tblC.Rows[i]["Mcpcd_ServiceContent"].ToString().Trim(), ft9, b, recFor1A );
  21552. Rectangle recFor2 = new Rectangle( recFor1.X, recFor1.Y + recFor1.Height, recFor1.Width, recFor1.Height );
  21553. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "支付方式:" ), ft9, b, recFor2 );
  21554. Rectangle recFor2A = new Rectangle( recFor1A.X, recFor2.Y, recFor1A.Width, recFor2.Height );
  21555. g.DrawString( tblB.Rows[0]["Mcpt_PaymentMethod"].ToString().Trim(), ft9, b, recFor2A );
  21556. Rectangle recFor3 = new Rectangle( recFor2.X, recFor2.Y + recFor2.Height, recFor1.Width, recFor2A.Height );
  21557. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 金 额:" ), ft9, b, recFor3 );
  21558. Rectangle recFor3A = new Rectangle( recFor1A.X, recFor3.Y, recFor2A.Width, recFor3.Height );
  21559. g.DrawString( tblC.Rows[i]["Mcpcd_SalePrice"].ToString().Trim(), ft9, b, recFor3A );
  21560. Rectangle recFor4 = new Rectangle( recFor3.X, recFor3.Y + recFor3.Height, recFor1.Width, recFor3A.Height );
  21561. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 次 数:" ), ft9, b, recFor4 );
  21562. Rectangle recFor4A = new Rectangle( recFor3A.X, recFor4.Y, recFor3A.Width, recFor4.Height );
  21563. g.DrawString( tblC.Rows[i]["Mcpcd_Count"].ToString().Trim(), ft9, b, recFor4A );
  21564. Rectangle recFor5 = new Rectangle( recFor4.X, recFor4.Y + recFor4.Height, recFor1.Width, recFor4.Height );
  21565. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 收 银:" ), ft9, b, recFor5 );
  21566. Rectangle recFor5A = new Rectangle( recFor4A.X, recFor5.Y, recFor4A.Width, recFor5.Height );
  21567. g.DrawString( tblB.Rows[0]["Mcpt_CreateName"].ToString().Trim(), ft9, b, recFor5A );
  21568. IntPoint_Y = recFor5.Y + recFor5.Height + RowHeight / 2;
  21569. CopeAmount += Convert.ToDecimal( tblC.Rows[i]["Mcpcd_SalePrice"] ) * Convert.ToDecimal( tblC.Rows[i]["Mcpcd_Count"] );
  21570. }
  21571. #endregion
  21572. Point rec8_1 = new Point( rec2.X, IntPoint_Y );
  21573. Point rec8_2 = new Point( TableWidth, rec8_1.Y );
  21574. g.DrawLine( pen, rec8_1, rec8_2 );
  21575. #region 第十行 应付金额
  21576. Rectangle rec9 = new Rectangle( rec2.X, rec8_1.Y + RowHeight / 2, rec2.Width, RowHeight );
  21577. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 应 付:" ), ft9, b, rec9 );
  21578. if ( !string.IsNullOrEmpty( tblB.Rows[0]["Mcpt_PackagePrice"].ToString() ) )
  21579. {
  21580. if ( Convert.ToDecimal( tblB.Rows[0]["Mcpt_PackagePrice"] ) > 0 )
  21581. {
  21582. CopeAmount = Convert.ToDecimal( tblB.Rows[0]["Mcpt_PackagePrice"] );
  21583. }
  21584. }
  21585. Rectangle rec9A = new Rectangle( rec9.X + rec9.Width, rec9.Y - ContentHeight, TableWidth - rec9.Width, rec9.Height );
  21586. g.DrawString( CopeAmount.ToString( "0.00" ), ft9, b, rec9A );
  21587. Point rec9A_1 = new Point( rec9A.X, rec9A.Y + rec9A.Height - Underline );
  21588. Point rec9A_2 = new Point( rec9A.X + rec9A.Width, rec9A_1.Y );
  21589. g.DrawLine( p, rec9A_1, rec9A_2 );
  21590. #endregion
  21591. #region 第十一行 实付金额
  21592. Rectangle rec10 = new Rectangle( rec9.X, rec9.Y + rec9.Height, rec9.Width, RowHeight );
  21593. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 总付款:" ), ft9, b, rec10 );
  21594. decimal totalAmount = 0;
  21595. foreach ( DataRow dr in tblB.Rows )
  21596. {
  21597. totalAmount += Convert.ToDecimal( dr["Mcpt_PaymentAmount"] );
  21598. }
  21599. decimal ActualOrd_Amount = totalAmount;
  21600. Rectangle rec10A = new Rectangle( rec10.X + rec10.Width, rec10.Y - ContentHeight, TableWidth - rec10.Width, rec10.Height );
  21601. g.DrawString( ActualOrd_Amount.ToString( "0.00" ), ft9, b, rec10A );
  21602. Point rec10A_1 = new Point( rec10A.X, rec10A.Y + rec10A.Height - Underline );
  21603. Point rec10A_2 = new Point( rec10A.X + rec10A.Width, rec10A_1.Y );
  21604. g.DrawLine( p, rec10A_1, rec10A_2 );
  21605. #endregion
  21606. #region 第十二行 欠款
  21607. Rectangle rec11 = new Rectangle( rec10.X, rec10.Y + rec10.Height, rec10.Width, RowHeight );
  21608. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 欠 款:" ), ft9, b, rec11 );
  21609. decimal MSAoumnt = CopeAmount - ActualOrd_Amount;
  21610. if ( Convert.ToDecimal( tblB.Rows[0]["Mcpt_Discount"] ) > 0 )
  21611. {
  21612. MSAoumnt -= (CopeAmount - Convert.ToDecimal( tblB.Rows[0]["Mcpt_Discount"] ) / 10 * CopeAmount);
  21613. }
  21614. Rectangle rec11A = new Rectangle( rec11.X + rec11.Width, rec11.Y - ContentHeight, TableWidth - rec11.Width, rec11.Height );
  21615. g.DrawString( MSAoumnt.ToString( "0.00" ), ft9, b, rec11A );
  21616. Point rec11A_1 = new Point( rec11A.X, rec11A.Y + rec11A.Height - Underline );
  21617. Point rec11A_2 = new Point( rec11A.X + rec11A.Width, rec11A_1.Y );
  21618. g.DrawLine( p, rec11A_1, rec11A_2 );
  21619. #endregion
  21620. #region 第十三行 备注
  21621. string PaymentExplain = "";
  21622. if ( PrintOtherData.ContainsKey( "收款单说明" ) && PrintOtherData["收款单说明"].ToString().Trim().Length > 0 )
  21623. {
  21624. PaymentExplain = PrintOtherData["收款单说明"].ToString().Trim();
  21625. }
  21626. rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( " 备 注: " ) + PaymentExplain;
  21627. sizef = g.MeasureString( rec1Value, ft9 );
  21628. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  21629. double dbHeight = sizef.Height;
  21630. int RowCount = FtWidth / TableWidth;
  21631. RowCount++;
  21632. double NewRowHeight = (dbHeight * float.Parse( RowCount.ToString() ));
  21633. Rectangle rec12 = new Rectangle( rec11.X, rec11.Y + rec11.Height + rec11.Height / 2, TableWidth + 7, Convert.ToInt32( NewRowHeight ) + 1 );
  21634. g.DrawString( rec1Value, ft9, b, rec12 );
  21635. #endregion
  21636. #region 第十四行 服务电话
  21637. Rectangle rec13 = new Rectangle( rec12.X, rec12.Y + rec12.Height, TableWidth, RowHeight );
  21638. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "服务电话:" ) + tbl_Info.Rows[0]["Company_Telephone"].ToString().Trim(), ft9, b, rec13 );
  21639. #endregion
  21640. #region 第十五行 客户确认
  21641. Rectangle rec14 = new Rectangle( rec13.X, rec13.Y + rec13.Height + rec13.Height, rec2.Width, RowHeight );
  21642. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客户确认" ), ft9, b, rec14 );
  21643. Point rec14_1 = new Point( rec14.Width, rec14.Y + rec14.Height + rec14.Height / 2 );
  21644. Point rec14_2 = new Point( TableWidth, rec14_1.Y );
  21645. g.DrawLine( p, rec14_1, rec14_2 );
  21646. #endregion
  21647. #region 第十六行 打印时间
  21648. Rectangle rec15 = new Rectangle( rec14.X, rec14.Y + rec14.Height + rec14.Height, TableWidth, RowHeight );
  21649. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "打印时间:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy-MM-dd HH:mm:ss" ), ft9, b, rec15 );
  21650. int TopHeight = rec15.Y + rec15.Height;
  21651. //if (IsPrintSerialNo && PrintPageCount > 1)
  21652. if ( IsPrintSerialNo )
  21653. {
  21654. if ( l == 0 )
  21655. {
  21656. StrSmallTicketSerialNumber = GetSmallTicketSerialNumber();
  21657. }
  21658. if ( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition )
  21659. {
  21660. StrSmallTicketSerialNumber = PrintReceiptSerial( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.CurrentCompanyInfoID );
  21661. }
  21662. Rectangle rec16 = new Rectangle( rec15.X, TopHeight, TableWidth, RowHeight );
  21663. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 流水号:SNO" ) + StrSmallTicketSerialNumber, ft9, b, rec16 );
  21664. TopHeight += rec15.Height;
  21665. }
  21666. #endregion
  21667. #region 尾
  21668. rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "谢谢惠顾!" );
  21669. sizef = g.MeasureString( rec1Value, ft9 );
  21670. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  21671. FtHeight = Convert.ToInt32( sizef.Height );
  21672. Rectangle rec17 = new Rectangle( TableWidth / 2 - FtWidth / 2, TopHeight + rec15.Height / 2, TableWidth, RowHeight );
  21673. g.DrawString( rec1Value, ft9, b, rec17 );
  21674. #endregion
  21675. StartRows_Y = rec17.Y + rec17.X + RowHeight * 2;
  21676. }
  21677. }
  21678. /// <summary>
  21679. /// 小票打印服务消费
  21680. /// </summary>
  21681. public static void SmallTicket_MemberServiceUse( object objValue, Graphics g, Size size, bool IsPrintSerialNo )
  21682. {
  21683. Hashtable htData = (Hashtable)objValue;
  21684. List<Hashtable> hlist = (List<Hashtable>)htData["hlist"];
  21685. string ExecuteSql = "select Company_Telephone from dbo.tb_ErpCompanyInfo where Company_DividedShop = '" + StrDividedShop + "';";
  21686. ExecuteSql += "select 会员卡号,姓名,性别,电话 from BView_MemberMain_GoldMember where Mc_Number = '" + htData["strNumber"] + "' ;";
  21687. DataSet dsData = new BLL.BLL_ErpOrder().GetView_Custom( ExecuteSql );
  21688. DataTable tbl_Info = dsData.Tables["ds"];
  21689. DataTable tblA = dsData.Tables["ds1"];
  21690. if ( tbl_Info.Rows.Count <= 0 )
  21691. {
  21692. MessageBoxCustom.Show( "未设置影楼信息" ); return;
  21693. }
  21694. if ( tblA.Rows.Count == 0 )
  21695. {
  21696. MessageBoxCustom.Show( "会员卡号不存在" ); return;
  21697. }
  21698. Brush b = Brushes.Black;
  21699. Pen p = new Pen( b, 1 );
  21700. Pen pen = new Pen( b, 1 );
  21701. pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Custom;
  21702. pen.DashPattern = new float[] { 5, 5 };
  21703. string StrFont = "宋体";
  21704. Font ft10 = new Font( StrFont, 17, GraphicsUnit.Pixel );
  21705. Font ft9 = new Font( StrFont, 12, GraphicsUnit.Pixel );
  21706. int Underline = 3;
  21707. int ContentHeight = 2;
  21708. int TableWidth = size.Width;
  21709. int RowHeight = Convert.ToInt32( g.MeasureString( "调试行高", ft9 ).Height );
  21710. int StartRows_Y = 0;
  21711. string StrSmallTicketSerialNumber = "";
  21712. for ( int l = 0; l < PrintPageCount; l++ )
  21713. {
  21714. #region 收款标题
  21715. SizeF sizef = g.MeasureString( DefaultPrintTitle, ft10, TableWidth );
  21716. int FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  21717. int FtHeight = Convert.ToInt32( sizef.Height );
  21718. Rectangle rec1 = new Rectangle( TableWidth / 2 - FtWidth / 2, StartRows_Y, TableWidth, FtHeight );
  21719. g.DrawString( DefaultPrintTitle, ft10, b, rec1 );
  21720. #endregion
  21721. #region 客户资料
  21722. #region 第一行 流程单号
  21723. string rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "会员卡号:" );
  21724. sizef = g.MeasureString( rec1Value, ft9 );
  21725. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  21726. FtHeight = Convert.ToInt32( sizef.Height );
  21727. Rectangle rec2 = new Rectangle( 0, rec1.Y + rec1.Height + 5, FtWidth, RowHeight );
  21728. g.DrawString( rec1Value, ft9, b, rec2 );
  21729. Rectangle rec2A = new Rectangle( rec2.X + rec2.Width, rec2.Y - ContentHeight, TableWidth - rec2.Width, rec2.Height );
  21730. g.DrawString( tblA.Rows[0]["会员卡号"].ToString().Trim(), ft9, b, rec2A );
  21731. Point rec2A_1 = new Point( rec2A.X, rec2A.Y + rec2A.Height - Underline );
  21732. Point rec2A_2 = new Point( rec2A.X + rec2A.Width, rec2A_1.Y );
  21733. g.DrawLine( p, rec2A_1, rec2A_2 );
  21734. #endregion
  21735. #region 第三行 主联系人姓名
  21736. Rectangle rec4 = new Rectangle( rec2.X, rec2.Y + rec2.Height, rec2.Width, RowHeight );
  21737. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名:" ), ft9, b, rec4 );
  21738. Rectangle rec4A = new Rectangle( rec4.X + rec4.Width, rec4.Y - ContentHeight, TableWidth - rec4.Width, rec4.Height );
  21739. g.DrawString( tblA.Rows[0]["姓名"].ToString().Trim(), ft9, b, rec4A );
  21740. Point rec4A_1 = new Point( rec4A.X, rec4A.Y + rec4A.Height - Underline );
  21741. Point rec4A_2 = new Point( rec4A.X + rec4A.Width, rec4A_1.Y );
  21742. g.DrawLine( p, rec4A_1, rec4A_2 );
  21743. #endregion
  21744. #region 第四行 性别
  21745. Rectangle rec5 = new Rectangle( rec4.X, rec4.Y + rec4.Height, rec4.Width, RowHeight );
  21746. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 性 别:" ), ft9, b, rec5 );
  21747. Rectangle rec5A = new Rectangle( rec5.X + rec5.Width, rec5.Y - ContentHeight, TableWidth - rec5.Width, rec5.Height );
  21748. g.DrawString( tblA.Rows[0]["性别"].ToString().Trim(), ft9, b, rec5A );
  21749. Point rec5A_1 = new Point( rec5A.X, rec5A.Y + rec5A.Height - Underline );
  21750. Point rec5A_2 = new Point( rec5A.X + rec5A.Width, rec5A_1.Y );
  21751. g.DrawLine( p, rec5A_1, rec5A_2 );
  21752. #endregion
  21753. #region 第五行 联系电话
  21754. Rectangle rec6 = new Rectangle( rec5.X, rec5.Y + rec5.Height, rec5.Width, RowHeight );
  21755. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "联系电话:" ), ft9, b, rec6 );
  21756. Rectangle rec6A = new Rectangle( rec6.X + rec6.Width, rec6.Y - ContentHeight, TableWidth - rec6.Width, rec6.Height );
  21757. g.DrawString( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( tblA.Rows[0]["电话"] ), ft9, b, rec6A );
  21758. Point rec6A_1 = new Point( rec6A.X, rec6A.Y + rec6A.Height - Underline );
  21759. Point rec6A_2 = new Point( rec6A.X + rec6A.Width, rec6A_1.Y );
  21760. g.DrawLine( p, rec6A_1, rec6A_2 );
  21761. #endregion
  21762. #endregion
  21763. Point rec7B_1 = new Point( 0, rec6A_1.Y + rec6.Height / 3 + RowHeight / 2 );
  21764. Point rec7B_2 = new Point( TableWidth, rec7B_1.Y );
  21765. g.DrawLine( pen, rec7B_1, rec7B_2 );
  21766. #region 第八行 产品
  21767. int IntPoint_Y = rec7B_1.Y + RowHeight / 2;
  21768. for ( int i = 0; i < hlist.Count; i++ )
  21769. {
  21770. Hashtable htData2 = (Hashtable)hlist[i];
  21771. rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "消费项目:" );
  21772. sizef = g.MeasureString( rec1Value, ft9 );
  21773. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  21774. FtHeight = Convert.ToInt32( sizef.Height );
  21775. Rectangle recFor1 = new Rectangle( rec2.X, IntPoint_Y, FtWidth, rec2.Height );
  21776. g.DrawString( rec1Value, ft9, b, recFor1 );
  21777. Rectangle recFor1A = new Rectangle( recFor1.Width, recFor1.Y, TableWidth - FtWidth, recFor1.Height );
  21778. g.DrawString( htData2["ItemName"].ToString().Trim(), ft9, b, recFor1A );
  21779. Rectangle recFor2 = new Rectangle( recFor1.X, recFor1.Y + recFor1.Height, recFor1.Width, recFor1.Height );
  21780. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "消费次数:" ), ft9, b, recFor2 );
  21781. Rectangle recFor2A = new Rectangle( recFor1A.X, recFor2.Y, recFor1A.Width, recFor2.Height );
  21782. g.DrawString( htData2["UseCount"].ToString().Trim(), ft9, b, recFor2A );
  21783. Rectangle recFor3 = new Rectangle( recFor2.X, recFor2.Y + recFor2.Height, recFor1.Width, recFor2A.Height );
  21784. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "剩余次数:" ), ft9, b, recFor3 );
  21785. Rectangle recFor3A = new Rectangle( recFor1A.X, recFor3.Y, recFor2A.Width, recFor3.Height );
  21786. g.DrawString( htData2["UseAfterCount"].ToString().Trim(), ft9, b, recFor3A );
  21787. Rectangle recFor4 = new Rectangle( recFor3.X, recFor3.Y + recFor3.Height, recFor1.Width, recFor3A.Height );
  21788. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "消费时间:" ), ft9, b, recFor4 );
  21789. Rectangle recFor4A = new Rectangle( recFor3A.X, recFor4.Y, recFor3A.Width, recFor4.Height );
  21790. g.DrawString( htData2["UseTime"].ToString().Trim(), ft9, b, recFor4A );
  21791. Rectangle recFor5 = new Rectangle( recFor4.X, recFor4.Y + recFor4.Height, recFor1.Width, recFor4.Height );
  21792. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 经手人:" ), ft9, b, recFor5 );
  21793. Rectangle recFor5A = new Rectangle( recFor4A.X, recFor5.Y, recFor4A.Width, recFor5.Height );
  21794. g.DrawString( htData2["JingShouRen"].ToString().Trim(), ft9, b, recFor5A );
  21795. IntPoint_Y = recFor5.Y + recFor5.Height + RowHeight / 2;
  21796. }
  21797. #endregion
  21798. Point rec8_1 = new Point( rec2.X, IntPoint_Y );
  21799. Point rec8_2 = new Point( TableWidth, rec8_1.Y );
  21800. g.DrawLine( pen, rec8_1, rec8_2 );
  21801. #region 第十三行 备注
  21802. string PaymentExplain = "";
  21803. if ( PrintOtherData.ContainsKey( "收款单说明" ) && PrintOtherData["收款单说明"].ToString().Trim().Length > 0 )
  21804. {
  21805. PaymentExplain = PrintOtherData["收款单说明"].ToString().Trim();
  21806. }
  21807. rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( " 备 注: " ) + PaymentExplain;
  21808. sizef = g.MeasureString( rec1Value, ft9 );
  21809. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  21810. double dbHeight = sizef.Height;
  21811. int RowCount = FtWidth / TableWidth;
  21812. RowCount++;
  21813. double NewRowHeight = (dbHeight * float.Parse( RowCount.ToString() ));
  21814. Rectangle rec12 = new Rectangle( rec2.X, rec8_1.Y + RowHeight / 2, TableWidth + 7, Convert.ToInt32( NewRowHeight ) + 1 );
  21815. g.DrawString( rec1Value, ft9, b, rec12 );
  21816. #endregion
  21817. #region 第十四行 服务电话
  21818. Rectangle rec13 = new Rectangle( rec12.X, rec12.Y + rec12.Height, TableWidth, RowHeight );
  21819. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "服务电话:" ) + tbl_Info.Rows[0]["Company_Telephone"].ToString().Trim(), ft9, b, rec13 );
  21820. #endregion
  21821. #region 第十五行 客户确认
  21822. Rectangle rec14 = new Rectangle( rec13.X, rec13.Y + rec13.Height + rec13.Height, rec2.Width, RowHeight );
  21823. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客户确认" ), ft9, b, rec14 );
  21824. Point rec14_1 = new Point( rec14.Width, rec14.Y + rec14.Height + rec14.Height / 2 );
  21825. Point rec14_2 = new Point( TableWidth, rec14_1.Y );
  21826. g.DrawLine( p, rec14_1, rec14_2 );
  21827. #endregion
  21828. #region 第十六行 打印时间
  21829. Rectangle rec15 = new Rectangle( rec14.X, rec14.Y + rec14.Height + rec14.Height, TableWidth, RowHeight );
  21830. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "打印时间:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy-MM-dd HH:mm:ss" ), ft9, b, rec15 );
  21831. int TopHeight = rec15.Y + rec15.Height;
  21832. //if (IsPrintSerialNo && PrintPageCount > 1)
  21833. if ( IsPrintSerialNo )
  21834. {
  21835. if ( l == 0 )
  21836. {
  21837. StrSmallTicketSerialNumber = GetSmallTicketSerialNumber();
  21838. }
  21839. if ( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition )
  21840. {
  21841. StrSmallTicketSerialNumber = PrintReceiptSerial( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.CurrentCompanyInfoID );
  21842. }
  21843. Rectangle rec16 = new Rectangle( rec15.X, TopHeight, TableWidth, RowHeight );
  21844. g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 流水号:SNO" ) + StrSmallTicketSerialNumber, ft9, b, rec16 );
  21845. TopHeight += rec15.Height;
  21846. }
  21847. #endregion
  21848. #region 尾
  21849. rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "谢谢惠顾!" );
  21850. sizef = g.MeasureString( rec1Value, ft9 );
  21851. FtWidth = Convert.ToInt32( sizef.Width ) + 1;
  21852. FtHeight = Convert.ToInt32( sizef.Height );
  21853. Rectangle rec17 = new Rectangle( TableWidth / 2 - FtWidth / 2, TopHeight + rec15.Height / 2, TableWidth, RowHeight );
  21854. g.DrawString( rec1Value, ft9, b, rec17 );
  21855. #endregion
  21856. StartRows_Y = rec17.Y + rec17.X + RowHeight * 2;
  21857. }
  21858. }
  21859. public static void SmallTicket_StaffRewardAndPunishment( object objValue, Graphics g, Size size, bool IsPrintSerialNo )
  21860. {
  21861. int nLastY = -1;
  21862. // 解析要打印的数据;
  21863. Hashtable hashtable = (Hashtable)objValue;
  21864. DataGridViewRow dgvr = (DataGridViewRow)hashtable["CurrentRow"];
  21865. // 画刷;
  21866. Brush b = Brushes.Black;
  21867. Pen p = new Pen( b, 1 );
  21868. Pen pen = new Pen( b, 1 );
  21869. pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Custom;
  21870. pen.DashPattern = new float[] { 5, 5 };
  21871. string StrFont = "宋体";
  21872. Font ft10 = new Font( StrFont, 17, GraphicsUnit.Pixel );
  21873. Font ft9 = new Font( StrFont, 12, GraphicsUnit.Pixel );
  21874. Font ft5 = new Font( StrFont, 5, GraphicsUnit.Pixel );
  21875. int Underline = 3;
  21876. int ContentHeight = 2;
  21877. int TableWidth = size.Width - 5 * 2;/* 5做为边距值 */
  21878. int RowHeight = Convert.ToInt32( g.MeasureString( "调试行高", ft9 ).Height );
  21879. int StartRows_Y = 0;
  21880. // 获取影楼店信息;
  21881. string strQuery = orbll.GetView_CustomReturnExecuteSql( "tb_ErpCompanyInfo",
  21882. StrWhere: "Company_DividedShop = '" + StrDividedShop + "'",
  21883. ShowColumnName: "Company_Address, Company_Telephone, Company_UpdateDatetime" );
  21884. DataSet dtCompany = orbll.GetView_Custom( strQuery );
  21885. DataTable tbl = dtCompany.Tables["ds"];
  21886. #region 打印票据标题
  21887. Rectangle rcConfig = PrinterDrawMethod.ComputeTextCell( g, DefaultPrintTitle, new Rectangle( size.Width / 4, 5, size.Width / 2, 60 ), ft10 );
  21888. g.DrawString( DefaultPrintTitle, ft10, b, rcConfig );
  21889. #endregion
  21890. #region 相关人员;
  21891. string strValue = LYFZ.BLL.OtherCommonModel.FontConversion( "相关人员:" );
  21892. rcConfig = new Rectangle( 0, rcConfig.Bottom + 5, (int)g.MeasureString( strValue, ft9 ).Width + 2, RowHeight );
  21893. g.DrawString( strValue, ft9, b, rcConfig );
  21894. strValue = dgvr.Cells["相关人员"].Value.ToString();
  21895. rcConfig = new Rectangle( rcConfig.X + rcConfig.Width, rcConfig.Y, TableWidth - (int)g.MeasureString( strValue, ft9 ).Width + 2, RowHeight );
  21896. g.DrawString( strValue, ft9, b, rcConfig );
  21897. #endregion
  21898. #region 奖罚类型;
  21899. strValue = LYFZ.BLL.OtherCommonModel.FontConversion( "奖罚类型:" );
  21900. rcConfig = new Rectangle( 0, rcConfig.Bottom + 2, (int)g.MeasureString( strValue, ft9 ).Width + 2, RowHeight );
  21901. g.DrawString( strValue, ft9, b, rcConfig );
  21902. strValue = dgvr.Cells["奖罚类型"].Value.ToString();
  21903. rcConfig = new Rectangle( rcConfig.X + rcConfig.Width, rcConfig.Y, TableWidth - (int)g.MeasureString( strValue, ft9 ).Width + 2, RowHeight );
  21904. g.DrawString( strValue, ft9, b, rcConfig );
  21905. #endregion
  21906. #region 执行方式;
  21907. strValue = LYFZ.BLL.OtherCommonModel.FontConversion( "执行方式:" );
  21908. rcConfig = new Rectangle( 0, rcConfig.Bottom + 2, (int)g.MeasureString( strValue, ft9 ).Width + 2, RowHeight );
  21909. g.DrawString( strValue, ft9, b, rcConfig );
  21910. strValue = dgvr.Cells["是否执行"].Value.ToString();
  21911. rcConfig = new Rectangle( rcConfig.X + rcConfig.Width, rcConfig.Y, TableWidth - (int)g.MeasureString( strValue, ft9 ).Width + 2, RowHeight );
  21912. g.DrawString( strValue, ft9, b, rcConfig );
  21913. #endregion
  21914. #region 虚线;
  21915. Point rec7B_1 = new Point( 0, rcConfig.Bottom + 2 );
  21916. Point rec7B_2 = new Point( TableWidth, rcConfig.Bottom + 2 );
  21917. g.DrawLine( pen, rec7B_1, rec7B_2 );
  21918. #endregion
  21919. #region 金额;
  21920. strValue = LYFZ.BLL.OtherCommonModel.FontConversion( "金 额:" );
  21921. rcConfig = new Rectangle( 0, rcConfig.Bottom + 6, (int)g.MeasureString( strValue, ft9 ).Width + 2, RowHeight );
  21922. g.DrawString( strValue, ft9, b, rcConfig );
  21923. strValue = dgvr.Cells["奖罚金额"].Value.ToString();
  21924. rcConfig = new Rectangle( rcConfig.X + rcConfig.Width, rcConfig.Y, TableWidth - (int)g.MeasureString( strValue, ft9 ).Width + 2, RowHeight );
  21925. g.DrawString( strValue, ft9, b, rcConfig );
  21926. #endregion
  21927. #region 录单人员;
  21928. strValue = LYFZ.BLL.OtherCommonModel.FontConversion( "录单人员:" );
  21929. rcConfig = new Rectangle( 0, rcConfig.Bottom + 2, (int)g.MeasureString( strValue, ft9 ).Width + 2, RowHeight );
  21930. g.DrawString( strValue, ft9, b, rcConfig );
  21931. strValue = dgvr.Cells["录单人"].Value.ToString();
  21932. rcConfig = new Rectangle( rcConfig.X + rcConfig.Width, rcConfig.Y, TableWidth - (int)g.MeasureString( strValue, ft9 ).Width + 2, RowHeight );
  21933. g.DrawString( strValue, ft9, b, rcConfig );
  21934. #endregion
  21935. #region 执行日期;
  21936. strValue = LYFZ.BLL.OtherCommonModel.FontConversion( "执行日期:" );
  21937. rcConfig = new Rectangle( 0, rcConfig.Bottom + 2, (int)g.MeasureString( strValue, ft9 ).Width + 2, RowHeight );
  21938. g.DrawString( strValue, ft9, b, rcConfig );
  21939. strValue = dgvr.Cells["执行日期"].Value.ToString();
  21940. rcConfig = new Rectangle( rcConfig.X + rcConfig.Width, rcConfig.Y, TableWidth - (int)g.MeasureString( strValue, ft9 ).Width + 2, RowHeight );
  21941. g.DrawString( strValue, ft9, b, rcConfig );
  21942. #endregion
  21943. #region 备注;
  21944. strValue = LYFZ.BLL.OtherCommonModel.FontConversion( "备 注:" );
  21945. rcConfig = new Rectangle( 0, rcConfig.Bottom + 2, (int)g.MeasureString( strValue, ft9 ).Width + 2, RowHeight );
  21946. g.DrawString( strValue, ft9, b, rcConfig );
  21947. // 备注内容;
  21948. strValue = dgvr.Cells["备注"].Value.ToString();
  21949. rcConfig = PrinterDrawMethod.ComputeTextCell( g, strValue, new Rectangle( rcConfig.X + rcConfig.Width, rcConfig.Y, TableWidth - rcConfig.Width, RowHeight ), ft9 );
  21950. g.DrawString( strValue, ft9, b, rcConfig );
  21951. #endregion
  21952. #region 虚线;
  21953. rec7B_1 = new Point( 0, rcConfig.Bottom + 2 );
  21954. rec7B_2 = new Point( TableWidth, rcConfig.Bottom + 2 );
  21955. g.DrawLine( pen, rec7B_1, rec7B_2 );
  21956. #endregion
  21957. #region 领导审批;
  21958. strValue = LYFZ.BLL.OtherCommonModel.FontConversion( "领导审批:" );
  21959. rcConfig = new Rectangle( 0, rcConfig.Bottom + 10, (int)g.MeasureString( strValue, ft9 ).Width + 2, RowHeight );
  21960. g.DrawString( strValue, ft9, b, rcConfig );
  21961. #endregion
  21962. #region 相关人员签字;
  21963. strValue = LYFZ.BLL.OtherCommonModel.FontConversion( "相关人员签字:" );
  21964. rcConfig = new Rectangle( 0, rcConfig.Bottom + 10, (int)g.MeasureString( strValue, ft9 ).Width + 2, RowHeight );
  21965. g.DrawString( strValue, ft9, b, rcConfig );
  21966. #endregion
  21967. #region 打印日期;
  21968. strValue = LYFZ.BLL.OtherCommonModel.FontConversion( "打印日期: " ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy年MM月dd日" );
  21969. rcConfig = new Rectangle( 0, rcConfig.Bottom + 10, (int)g.MeasureString( strValue, ft9 ).Width + 2, RowHeight );
  21970. g.DrawString( strValue, ft9, b, rcConfig );
  21971. #endregion
  21972. #region 虚线;
  21973. rec7B_1 = new Point( 0, rcConfig.Bottom + 2 );
  21974. rec7B_2 = new Point( TableWidth, rcConfig.Bottom + 2 );
  21975. g.DrawLine( pen, rec7B_1, rec7B_2 );
  21976. #endregion
  21977. }
  21978. /// <summary>
  21979. /// 获取订单客户资料
  21980. /// </summary>
  21981. /// <param name="StrNumber">订单号</param>
  21982. /// <param name="StrOrderType">订单类型</param>
  21983. static Hashtable GetClientInfo( string StrNumber, string StrOrderType )
  21984. {
  21985. Hashtable htData = new Hashtable();
  21986. htData["StrChildName"] = "";
  21987. htData["StrChildSex"] = "";
  21988. htData["StrChildRAgeString"] = "";
  21989. htData["StrParentName"] = "";
  21990. htData["StrParentSex"] = "";
  21991. htData["StrParentPhone"] = "";
  21992. htData["StrManName"] = "";
  21993. htData["StrManSex"] = "";
  21994. htData["StrManPhone"] = "";
  21995. htData["StrManMarriage"] = "";
  21996. htData["StrWoManName"] = "";
  21997. htData["StrWoManSex"] = "";
  21998. htData["StrWoManPhone"] = "";
  21999. htData["StrMainName"] = "";
  22000. htData["StrMainPhone"] = "";
  22001. htData["StrMainSex"] = "";
  22002. DataTable tbl_Client = GetClientData( StrNumber );
  22003. if ( tbl_Client.Rows.Count > 0 )
  22004. {
  22005. if ( StrOrderType.Trim() == "0" )
  22006. {
  22007. #region 婚纱
  22008. for ( int i = 0; i < tbl_Client.Rows.Count; i++ )
  22009. {
  22010. if ( i == 0 )
  22011. {
  22012. htData["StrManName"] = tbl_Client.Rows[i]["Cus_Name"].ToString().Trim();
  22013. htData["StrManSex"] = tbl_Client.Rows[i]["Cus_Sex_cs"].ToString().Trim();
  22014. htData["StrManPhone"] = tbl_Client.Rows[i]["Cus_Telephone"].ToString().Trim();
  22015. if ( LYFZ.Command.Command_Validate.DateTimeToString( tbl_Client.Rows[i]["Cus_DayForMarriage"] ) != "" )
  22016. {
  22017. htData["StrManMarriage"] = LYFZ.Command.Command_Validate.DateTimeToString( tbl_Client.Rows[i]["Cus_DayForMarriage"] );
  22018. if ( !string.IsNullOrEmpty( tbl_Client.Rows[i]["Cus_DayForMarriageLunar"].ToString().Trim() ) && tbl_Client.Rows[i]["Cus_DayForMarriageLunar"].ToString().Trim() == "1" )
  22019. {
  22020. htData["StrManMarriage"] += " (农历)";
  22021. }
  22022. }
  22023. }
  22024. else if ( i == 1 )
  22025. {
  22026. htData["StrWoManName"] = tbl_Client.Rows[i]["Cus_Name"].ToString().Trim();
  22027. htData["StrWoManSex"] = tbl_Client.Rows[i]["Cus_Sex_cs"].ToString().Trim();
  22028. htData["StrWoManPhone"] = tbl_Client.Rows[i]["Cus_Telephone"].ToString().Trim();
  22029. if ( LYFZ.Command.Command_Validate.DateTimeToString( tbl_Client.Rows[i]["Cus_DayForMarriage"] ) != "" )
  22030. {
  22031. htData["StrManMarriage"] = LYFZ.Command.Command_Validate.DateTimeToString( tbl_Client.Rows[i]["Cus_DayForMarriage"] );
  22032. if ( !string.IsNullOrEmpty( tbl_Client.Rows[i]["Cus_DayForMarriageLunar"].ToString().Trim() ) && tbl_Client.Rows[i]["Cus_DayForMarriageLunar"].ToString().Trim() == "1" )
  22033. {
  22034. htData["StrManMarriage"] += " (农历)";
  22035. }
  22036. }
  22037. }
  22038. }
  22039. #endregion
  22040. }
  22041. else if ( StrOrderType.Trim() == "1" )
  22042. {
  22043. #region 儿童
  22044. for ( int i = 0; i < tbl_Client.Rows.Count; i++ )
  22045. {
  22046. if ( tbl_Client.Rows[i]["GM_Master"].ToString().Trim() == "1" && tbl_Client.Rows[i]["GM_ProtagonistCustomer"].ToString().Trim() == "0" )
  22047. {
  22048. htData["StrParentName"] = tbl_Client.Rows[i]["Cus_Name"].ToString().Trim();
  22049. htData["StrParentPhone"] = tbl_Client.Rows[i]["Cus_Telephone"].ToString().Trim();
  22050. htData["StrParentSex"] = tbl_Client.Rows[i]["Cus_Sex_cs"].ToString().Trim();
  22051. }
  22052. else if ( tbl_Client.Rows[i]["GM_Master"].ToString().Trim() == "0" && tbl_Client.Rows[i]["GM_ProtagonistCustomer"].ToString().Trim() == "1" )
  22053. {
  22054. htData["StrChildName"] = tbl_Client.Rows[i]["Cus_Name"].ToString().Trim();
  22055. htData["StrChildSex"] = tbl_Client.Rows[i]["Cus_Sex_cs"].ToString().Trim();
  22056. htData["StrChildRAgeString"] = tbl_Client.Rows[i]["Age_String"].ToString().Trim();
  22057. }
  22058. }
  22059. #endregion
  22060. }
  22061. else if ( StrOrderType.Trim() == "2" || StrOrderType.Trim() == "3" || StrOrderType.Trim() == "4" )
  22062. {
  22063. #region 写真、其他
  22064. if ( tbl_Client.Rows.Count > 0 )
  22065. {
  22066. htData["StrMainName"] = tbl_Client.Rows[0]["Cus_Name"].ToString().Trim();
  22067. htData["StrMainPhone"] = tbl_Client.Rows[0]["Cus_Telephone"].ToString().Trim();
  22068. htData["StrMainSex"] = tbl_Client.Rows[0]["Cus_Sex_cs"].ToString().Trim();
  22069. }
  22070. #endregion
  22071. }
  22072. return htData;
  22073. }
  22074. else
  22075. {
  22076. MessageBoxCustom.Show( "获取订单客户资料失败!" ); return null;
  22077. }
  22078. }
  22079. /// <summary>
  22080. /// 获取客户数据
  22081. /// </summary>
  22082. /// <param name="StrNumber"></param>
  22083. /// <returns></returns>
  22084. private static DataTable GetClientData( string StrNumber )
  22085. {
  22086. 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" ) );
  22087. return dtSet.Tables["ds"];
  22088. }
  22089. /// <summary>
  22090. /// 获取小票流水号
  22091. /// </summary>
  22092. /// <returns></returns>
  22093. private static string GetSmallTicketSerialNumber()
  22094. {
  22095. LYFZ.BLL.BLL_ErpSystemConfigure sgbll = new BLL.BLL_ErpSystemConfigure();
  22096. LYFZ.Model.Model_ErpSystemConfigure model = sgbll.GetModel( "Sconfig_Code", "SmallTicketSerialNumber" );
  22097. if ( model.ID <= 0 )
  22098. {
  22099. model = new Model.Model_ErpSystemConfigure();
  22100. model.Sconfig_Code = "SmallTicketSerialNumber";
  22101. model.Sconfig_Name = "小票收款打印流水号";
  22102. model.Sconfig_Value = "0000001";
  22103. model.Sconfig_IsEnabled = true;
  22104. model.Sconfig_Remark = "小票收款单打印时候的序号(每张的号码重覆,每打一张这里垒加一)";
  22105. model.Sconfig_Type = "";
  22106. model.Sconfig_Order = 1;
  22107. model.Sconfig_CreateDatetime = SDateTime.Now;
  22108. model.Sconfig_CreateName = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;
  22109. sgbll.Add( model );
  22110. }
  22111. else
  22112. {
  22113. model.Sconfig_Value = (Convert.ToInt32( model.Sconfig_Value ) + 1).ToString( "d7" );
  22114. model.Sconfig_CreateDatetime = SDateTime.Now;
  22115. model.Sconfig_CreateName = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;
  22116. sgbll.Update( model );
  22117. }
  22118. return model.Sconfig_Value;
  22119. }
  22120. #endregion
  22121. }
  22122. }