DataGridOrderView.cs 502 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.ComponentModel;
  5. using System.Data;
  6. using System.Drawing;
  7. using System.Dynamic;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Windows.Forms;
  11. namespace LYFZ.ComponentLibrary
  12. {
  13. public partial class DataGridOrderView
  14. {
  15. /// <summary>
  16. /// 会员服务欠款
  17. /// </summary>
  18. /// <param name="StrColumns"></param>
  19. /// <param name="StrQueryCondition"></param>
  20. /// <param name="StrQueryCondition2"></param>
  21. /// <returns></returns>
  22. public static DataTable GetData_MemberMainGoldMember( DataGridViewEc dgvData, string StrQueryCondition, int inTopCount )
  23. {
  24. Dictionary<string, string> dictColumns = dgvData.dictShowColumName;
  25. DataSet dtSet = new DataSet();
  26. DataTable dtTable = new DataTable();
  27. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  28. {
  29. dtSet = LYFZ.BLL.BLL_ErpOrderView.GetData_MemberViceCardAndServiceContent();
  30. dtTable = LYFZ.BLL.BLL_ErpOrderView.GetData_MemberMainGoldMember( StrQueryCondition, inTopCount );
  31. } );
  32. #region 组合数据
  33. DataTable newtable = new DataTable();
  34. newtable.Columns.Add( "Mc_Number", typeof( string ) );
  35. newtable.Columns.Add( "会员卡号", typeof( string ) );
  36. newtable.Columns.Add( "持卡人", typeof( string ) );
  37. if ( dictColumns.Keys.Contains( "性别" ) )
  38. {
  39. newtable.Columns.Add( "性别", typeof( string ) );
  40. }
  41. if ( dictColumns.Keys.Contains( "电话" ) )
  42. {
  43. newtable.Columns.Add( "电话", typeof( string ) );
  44. }
  45. if ( dictColumns.Keys.Contains( "类型" ) )
  46. {
  47. newtable.Columns.Add( "类型", typeof( string ) );
  48. }
  49. if ( dictColumns.Keys.Contains( "等级" ) )
  50. {
  51. newtable.Columns.Add( "等级", typeof( string ) );
  52. }
  53. if ( dictColumns.Keys.Contains( "总积分" ) )
  54. {
  55. newtable.Columns.Add( "总积分", typeof( int ) );
  56. }
  57. if ( dictColumns.Keys.Contains( "当前积分" ) )
  58. {
  59. newtable.Columns.Add( "当前积分", typeof( int ) );
  60. }
  61. if ( dictColumns.Keys.Contains( "储值欠款" ) )
  62. {
  63. newtable.Columns.Add( "储值欠款", typeof( decimal ) );
  64. }
  65. if ( dictColumns.Keys.Contains( "服务卡欠款" ) )
  66. {
  67. newtable.Columns.Add( "服务卡欠款", typeof( decimal ) );
  68. }
  69. if ( dictColumns.Keys.Contains( "总充值金额" ) )
  70. {
  71. newtable.Columns.Add( "总充值金额", typeof( decimal ) );
  72. }
  73. if ( dictColumns.Keys.Contains( "金额" ) )
  74. {
  75. newtable.Columns.Add( "金额", typeof( decimal ) );
  76. }
  77. if ( dictColumns.Keys.Contains( "折扣" ) )
  78. {
  79. newtable.Columns.Add( "折扣", typeof( decimal ) );
  80. }
  81. if ( dictColumns.Keys.Contains( "套系金额" ) )
  82. {
  83. newtable.Columns.Add( "套系金额", typeof( decimal ) );
  84. }
  85. if ( dictColumns.Keys.Contains( "已返金额" ) )
  86. {
  87. newtable.Columns.Add( "已返金额", typeof( decimal ) );
  88. }
  89. if ( dictColumns.Keys.Contains( "已取出金额" ) )
  90. {
  91. newtable.Columns.Add( "已取出金额", typeof( decimal ) );
  92. }
  93. if ( dictColumns.Keys.Contains( "返现副卡" ) )
  94. {
  95. newtable.Columns.Add( "返现副卡", typeof( int ) );
  96. }
  97. if ( dictColumns.Keys.Contains( "积分副卡" ) )
  98. {
  99. newtable.Columns.Add( "积分副卡", typeof( int ) );
  100. }
  101. if ( dictColumns.Keys.Contains( "服务次数" ) )
  102. {
  103. newtable.Columns.Add( "服务次数", typeof( int ) );
  104. }
  105. if ( dictColumns.Keys.Contains( "备注" ) )
  106. {
  107. newtable.Columns.Add( "备注", typeof( string ) );
  108. }
  109. if ( dictColumns.Keys.Contains( "客户生日" ) )
  110. {
  111. newtable.Columns.Add( "客户生日", typeof( string ) );
  112. }
  113. if ( dictColumns.Keys.Contains( "办卡日期" ) )
  114. {
  115. newtable.Columns.Add( "办卡日期", typeof( string ) );
  116. }
  117. if ( dictColumns.Keys.Contains( "卡未使用天数" ) )
  118. {
  119. newtable.Columns.Add( "卡未使用天数", typeof( string ) );
  120. }
  121. DataTable dtA = dtTable;
  122. DataTable dtB = dtSet.Tables["ds"];
  123. dtB.PrimaryKey = new DataColumn[] { dtB.Columns["Mvc_Number"] };
  124. DataTable dtC = dtSet.Tables["ds1"];
  125. dtC.PrimaryKey = new DataColumn[] { dtC.Columns["Mcse_Number"] };
  126. for ( int i = 0; i < dtA.Rows.Count; i++ )
  127. {
  128. DataRow newRow = newtable.NewRow();
  129. newRow["Mc_Number"] = dtA.Rows[i]["Mc_Number"].ToString().Trim();
  130. newRow["会员卡号"] = dtA.Rows[i]["会员卡号"].ToString().Trim();
  131. newRow["持卡人"] = dtA.Rows[i]["持卡人"].ToString().Trim();
  132. if ( newtable.Columns.Contains( "性别" ) && !string.IsNullOrEmpty( dtA.Rows[i]["性别"].ToString().Trim() ) )
  133. {
  134. newRow["性别"] = Convert.ToBoolean( dtA.Rows[i]["性别"] ) ? "女" : "男";
  135. }
  136. else
  137. {
  138. newRow["性别"] = "";
  139. }
  140. if ( newtable.Columns.Contains( "电话" ) )
  141. {
  142. newRow["电话"] = dtA.Rows[i]["电话"].ToString().Trim();
  143. }
  144. if ( newtable.Columns.Contains( "类型" ) )
  145. {
  146. string StrCardType = dtA.Rows[i]["类型"].ToString().Trim();
  147. if ( Convert.ToDecimal( dtA.Rows[i]["金额"] ) > 0 )
  148. {
  149. StrCardType = "储值卡," + StrCardType;
  150. }
  151. DataRow dtRow = dtB.Rows.Find( dtA.Rows[i]["Mc_Number"].ToString().Trim() );
  152. if ( dtRow != null )
  153. {
  154. StrCardType += ",返现卡";
  155. }
  156. dtRow = dtC.Rows.Find( dtA.Rows[i]["Mc_Number"].ToString().Trim() );
  157. if ( dtRow != null )
  158. {
  159. StrCardType += ",服务卡";
  160. }
  161. newRow["类型"] = StrCardType;
  162. }
  163. if ( newtable.Columns.Contains( "等级" ) )
  164. {
  165. newRow["等级"] = dtA.Rows[i]["等级"].ToString().Trim();
  166. }
  167. if ( newtable.Columns.Contains( "总积分" ) )
  168. {
  169. newRow["总积分"] = Convert.ToInt32( dtA.Rows[i]["总积分"] );
  170. }
  171. if ( newtable.Columns.Contains( "当前积分" ) )
  172. {
  173. newRow["当前积分"] = Convert.ToInt32( dtA.Rows[i]["积分"] );
  174. }
  175. if ( newtable.Columns.Contains( "储值欠款" ) )
  176. {
  177. newRow["储值欠款"] = Convert.ToDecimal( dtA.Rows[i]["储值欠款"] );
  178. }
  179. if ( newtable.Columns.Contains( "服务卡欠款" ) )
  180. {
  181. newRow["服务卡欠款"] = Convert.ToDecimal( dtA.Rows[i]["服务卡欠款"] );
  182. }
  183. if ( newtable.Columns.Contains( "总充值金额" ) )
  184. {
  185. newRow["总充值金额"] = Convert.ToDecimal( dtA.Rows[i]["总充值金额"] );
  186. }
  187. if ( newtable.Columns.Contains( "金额" ) )
  188. {
  189. newRow["金额"] = Convert.ToDecimal( dtA.Rows[i]["金额"] );
  190. }
  191. if ( newtable.Columns.Contains( "折扣" ) )
  192. {
  193. newRow["折扣"] = Convert.ToDecimal( dtA.Rows[i]["折扣"] );
  194. }
  195. if ( newtable.Columns.Contains( "套系金额" ) )
  196. {
  197. newRow["套系金额"] = Convert.ToDecimal( dtA.Rows[i]["套系金额"] );
  198. }
  199. if ( newtable.Columns.Contains( "已返金额" ) )
  200. {
  201. newRow["已返金额"] = Convert.ToDecimal( dtA.Rows[i]["已返金额"] );
  202. }
  203. if ( newtable.Columns.Contains( "已取出金额" ) )
  204. {
  205. newRow["已取出金额"] = Convert.ToDecimal( dtA.Rows[i]["已取出金额"] );
  206. }
  207. if ( newtable.Columns.Contains( "返现副卡" ) )
  208. {
  209. newRow["返现副卡"] = Convert.ToInt32( dtA.Rows[i]["返现副卡"] );
  210. }
  211. if ( newtable.Columns.Contains( "积分副卡" ) )
  212. {
  213. newRow["积分副卡"] = Convert.ToInt32( dtA.Rows[i]["积分副卡"] );
  214. }
  215. if ( newtable.Columns.Contains( "服务次数" ) )
  216. {
  217. newRow["服务次数"] = Convert.ToInt32( dtA.Rows[i]["服务次数"] );
  218. }
  219. if ( newtable.Columns.Contains( "备注" ) )
  220. {
  221. newRow["备注"] = dtA.Rows[i]["备注"].ToString().Trim();
  222. }
  223. if ( newtable.Columns.Contains( "客户生日" ) )
  224. {
  225. string StrClientBirthday = dtA.Rows[i]["客户生日"].ToString().Trim();
  226. if ( StrClientBirthday.Trim().Length > 0 && dtA.Rows[i]["客户生日"].ToString().Trim().Length > 0 && dtA.Rows[i]["客户生日"].ToString().Trim() == "1" )
  227. {
  228. StrClientBirthday += "_农历";
  229. }
  230. newRow["客户生日"] = StrClientBirthday;
  231. }
  232. if ( newtable.Columns.Contains( "办卡日期" ) )
  233. {
  234. newRow["办卡日期"] = LYFZ.BLL.OtherCommonModel.DateTimeToString( dtA.Rows[i]["办卡日期"] );
  235. }
  236. if ( newtable.Columns.Contains( "卡未使用天数" ) )
  237. {
  238. string dateTime = "";
  239. if ( dtA.Rows[i]["最后使用时间"] != null && !string.IsNullOrEmpty( dtA.Rows[i]["最后使用时间"].ToString() ) )
  240. {
  241. dateTime = LYFZ.BLL.OtherCommonModel.DateTimeToString( ((dtA.Rows[i]["最后使用时间"])) );
  242. }
  243. else
  244. {
  245. dateTime = LYFZ.BLL.OtherCommonModel.DateTimeToString( ((dtA.Rows[i]["办卡日期"])) );
  246. }
  247. string totalDays = Math.Round( (DateTime.Now - Convert.ToDateTime( dateTime )).TotalDays ).ToString();
  248. newRow["卡未使用天数"] = Convert.ToInt32( totalDays ).ToString();
  249. }
  250. newtable.Rows.Add( newRow );
  251. }
  252. #endregion
  253. return newtable;
  254. }
  255. /// <summary>
  256. /// 获取订单报表数据(除服务订单外的所有数据)
  257. /// </summary>
  258. /// <param name="dgvData"></param>
  259. /// <param name="dictColumns"></param>
  260. /// <param name="StrQueryCondition"></param>
  261. /// <param name="inTopCount"></param>
  262. /// <param name="StrOrderBy"></param>
  263. /// <param name="IschkWeddingCelebration"></param>
  264. public static Hashtable GetData_OrderOtherConsume( DataGridViewEc dgvData, string StrQueryCondition, int inTopCount )
  265. {
  266. DataSet dtSet = new DataSet();
  267. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  268. {
  269. dtSet = LYFZ.BLL.BLL_ErpOrderView.GetData_OrderOtherConsume( StrQueryCondition, inTopCount );
  270. } );
  271. #region 重组DataTable
  272. DataTable dt = dtSet.Tables["ds"];
  273. DataTable newtable = new DataTable();
  274. foreach ( var item in dt.Columns )
  275. {
  276. if ( dt.Columns.Contains( item.ToString().Trim() ) )
  277. newtable.Columns.Add( item.ToString().Trim(), typeof( string ) );
  278. }
  279. for ( int i = 0; i < dt.Rows.Count; i++ )
  280. {
  281. DataRow newRow = newtable.NewRow();
  282. for ( int j = 0; j < newtable.Columns.Count; j++ )
  283. {
  284. string StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  285. switch ( newtable.Columns[j].ColumnName.Trim() )
  286. {
  287. case "订单时间":
  288. case "拍摄时间":
  289. case "取件时间":
  290. StrRowValue = LYFZ.BLL.OtherCommonModel.DateTimeToString( StrRowValue );
  291. break;
  292. case "录单人":
  293. case "摄影师":
  294. case "取件师":
  295. if ( !string.IsNullOrEmpty( StrRowValue ) )
  296. {
  297. DataRow dtRows = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrRowValue );
  298. if ( dtRows != null )
  299. {
  300. StrRowValue = dtRows["User_Name"].ToString().Trim();
  301. }
  302. else
  303. {
  304. StrRowValue = "";
  305. }
  306. }
  307. break;
  308. case "取件状态":
  309. if ( Convert.ToInt32( StrRowValue ) > 0 )
  310. {
  311. StrRowValue = "已取";
  312. }
  313. else
  314. {
  315. StrRowValue = "未取";
  316. }
  317. break;
  318. case "证件照":
  319. if ( !string.IsNullOrEmpty( StrRowValue ) )
  320. {
  321. StrRowValue = "已导片";
  322. }
  323. else
  324. {
  325. StrRowValue = "";
  326. }
  327. break;
  328. }
  329. newRow[newtable.Columns[j].ColumnName.Trim()] = StrRowValue;
  330. }
  331. newtable.Rows.Add( newRow );
  332. }
  333. #endregion
  334. dgvData.Rows.Clear();
  335. if ( dgvData.Columns.Count <= 0 )
  336. {
  337. string StrHideName = "Tsorder_Category";
  338. if ( !LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.OtherConsumerPassportManagement )
  339. {
  340. StrHideName += ",证件照,取件状态";
  341. }
  342. dgvData.DataColumns( newtable.Columns, strHideField: StrHideName );
  343. dgvData.Columns["订单时间"].Width = 110;
  344. dgvData.Columns["消费备注"].Width = 200;
  345. }
  346. for ( int t = 0; t < newtable.Rows.Count; t++ )
  347. {
  348. DataGridViewRow dgvr = new DataGridViewRow();
  349. DataGridViewCell cell = null;
  350. decimal qiankuan = 0;
  351. if ( newtable.Rows[t]["欠款"] != null && !string.IsNullOrEmpty( newtable.Rows[t]["欠款"].ToString() ) )
  352. {
  353. if ( !decimal.TryParse( newtable.Rows[t]["欠款"].ToString(), out qiankuan ) )
  354. {
  355. newtable.Rows[t]["欠款"] = 0.00;
  356. }
  357. }
  358. else
  359. {
  360. newtable.Rows[t]["欠款"] = 0.00;
  361. }
  362. if ( qiankuan < 0 || qiankuan > 0 )
  363. {
  364. dgvr.DefaultCellStyle.ForeColor = Color.Red;
  365. }
  366. else
  367. {
  368. dgvr.DefaultCellStyle.ForeColor = Color.Blue;
  369. }
  370. for ( int j = 0; j < newtable.Columns.Count; j++ )
  371. {
  372. cell = new DataGridViewTextBoxCell();
  373. cell.Value = newtable.Rows[t][j].ToString().Trim();
  374. dgvr.Cells.Add( cell );
  375. }
  376. if ( (t % 2) > 0 )
  377. {
  378. dgvr.DefaultCellStyle.BackColor = dgvData.DataGridViewRowsBackColor_Double();
  379. }
  380. else
  381. {
  382. dgvr.DefaultCellStyle.BackColor = dgvData.DataGridViewRowsBackColor_Single();
  383. }
  384. dgvData.Rows.Add( dgvr );
  385. }
  386. dgvData.ClearSelection();
  387. dgvData.Columns["客户姓名"].Frozen = true;
  388. Hashtable htData = new Hashtable();
  389. htData["DataTable"] = newtable;
  390. htData["TotalCount"] = Convert.ToInt32( dtSet.Tables["ds1"].Rows[0]["CountID"] );
  391. htData["CurrentCount"] = newtable.Rows.Count;
  392. return htData;
  393. }
  394. /// <summary>
  395. /// 获取订单报表的数据
  396. /// </summary>
  397. /// <param name="dictColumns">显示行数</param>
  398. /// <param name="pageIndex">页面数</param>
  399. /// <param name="pageSize">单页大小</param>
  400. /// <param name="isOpen">是否开单数据既拍照</param>
  401. /// <param name="isWedding">是否服务订单</param>
  402. /// <param name="whereDataList">传入的搜索条件</param>
  403. /// <returns></returns>
  404. public static Hashtable GetData_OrderReportNew( Dictionary<string, string> dictColumns, int pageIndex, int pageSize, bool isOpen, bool isWedding,
  405. Dictionary<string, string> whereDataList,
  406. ComponentLibrary.DataGridViewEc dgvData,
  407. string field, string sort )
  408. {
  409. Dictionary<string, string> dicBindData = new Dictionary<string, string>();
  410. LYFZ.BLL.BLL_ErpOrder bllErpOrder = new BLL.BLL_ErpOrder();
  411. DataTable newtable = new DataTable();
  412. dicBindData = BindOrderDictionaryKeyList( newtable, dictColumns );
  413. int TotalCount = 0;
  414. LYFZ.Command.Result dataResult = new Command.Result();
  415. string countWhere = "";
  416. string ordField = "";
  417. string cusField = "";
  418. string ditgitField = "";
  419. string photoField = "";
  420. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  421. {
  422. switch ( field )
  423. {
  424. case "订单号":
  425. ordField = "Ord_Number";
  426. break;
  427. case "订单类型":
  428. ordField = "Ord_Type";
  429. break;
  430. case "订单类别":
  431. ordField = "Ord_OrderClass";
  432. break;
  433. case "客户来源":
  434. ordField = "Ord_CustomerSource";
  435. break;
  436. case "套系类别":
  437. ordField = "Ord_SeriesName";
  438. break;
  439. case "套系价格":
  440. ordField = "Ord_SeriesPrice";
  441. break;
  442. case "接单人":
  443. ordField = "Ord_OrderPersonName";
  444. break;
  445. case "备注":
  446. ordField = "Ord_Remark";
  447. break;
  448. case "下单日期":
  449. ordField = "Ord_CreateDateTime";
  450. break;
  451. case "婚期":
  452. cusField = "Cus_DayForMarriage";
  453. break;
  454. case "客户姓名":
  455. cusField = "Cus_Name";
  456. break;
  457. case "客户性别":
  458. cusField = "Cus_Sex_cs";
  459. break;
  460. case "客户电话":
  461. cusField = "Cus_Telephone";
  462. break;
  463. case "年龄":
  464. cusField = "Age_String";
  465. break;
  466. case "客户区域":
  467. cusField = "Cus_Region";
  468. break;
  469. case "客户地址":
  470. cusField = "Cus_Address";
  471. break;
  472. //case "拍摄名称":
  473. // ditgitField = "Age_String";
  474. // break;
  475. //case "摄影师":
  476. // ditgitField = "Ordpg_Photographer";
  477. // break;
  478. //case "化妆师":
  479. // ditgitField = "Ordpg_MakeupArtist";
  480. // break;
  481. //case "引导师":
  482. // ditgitField = "Ordpg_BootDivision";
  483. // break;
  484. //case "拍摄时间":
  485. // ditgitField = "Ordpg_PhotographyTime";
  486. // break;
  487. //case "拍摄状态":
  488. // ditgitField = "Ordpg_PhotographyStatus";
  489. // break;
  490. case "初修师":
  491. ditgitField = "Ordv_EarlyRepairName";
  492. break;
  493. case "初修时间":
  494. ditgitField = "Ordv_EarlyRepairTime";
  495. break;
  496. case "初修状态":
  497. ditgitField = "Ordv_EarlyRepairStatus";
  498. break;
  499. case "选片师":
  500. ditgitField = "Ordv_FilmSelectionName";
  501. break;
  502. case "选片时间":
  503. ditgitField = "Ordv_FilmSelectionTime";
  504. break;
  505. case "选片状态":
  506. ditgitField = "Ordv_FilmSelectionStatus";
  507. break;
  508. case "设计师":
  509. ditgitField = "Ordv_DesignerName";
  510. break;
  511. case "设计时间":
  512. ditgitField = "Ordv_DesignerTime";
  513. break;
  514. case "设计状态":
  515. ditgitField = "Ordv_DesignerStatus";
  516. break;
  517. case "精修师":
  518. ditgitField = "Ordv_RefinementName";
  519. break;
  520. case "精修时间":
  521. ditgitField = "Ordv_RefinementTime";
  522. break;
  523. case "精修状态":
  524. ditgitField = "Ordv_RefinementStatus";
  525. break;
  526. case "看版师":
  527. ditgitField = "Ordv_LookDesignName";
  528. break;
  529. case "看版时间":
  530. ditgitField = "Ordv_LookDesignTime";
  531. break;
  532. case "看版状态":
  533. ditgitField = "Ordv_LookDesignStatus";
  534. break;
  535. case "看版要求":
  536. ditgitField = "Ordv_LookDesignClaim";
  537. break;
  538. default:
  539. field = "";
  540. break;
  541. }
  542. dataResult = bllErpOrder.SearchErpOrderData1( pageIndex, TotalCount, pageSize, false, false, whereDataList, ref countWhere, ordField, ditgitField, cusField, photoField, sort );
  543. //dataResult = bllErpOrder.SearchErpOrderData(pageIndex, TotalCount, pageSize, false, false, whereDataList);
  544. string str = "";
  545. } );
  546. dynamic data = new System.Dynamic.ExpandoObject();
  547. if ( !dataResult.Status )
  548. {
  549. throw new Exception( dataResult.StatusMsg );
  550. }
  551. else
  552. {
  553. data = ((LYFZ.Command.Result<dynamic>)dataResult).Data;
  554. }
  555. List<string> keyList = new List<string>();
  556. List<string> valueList = new List<string>();
  557. List<string> columKeyList = new List<string>();
  558. columKeyList.AddRange( dictColumns.Keys );
  559. keyList.AddRange( dicBindData.Keys.ToArray() );
  560. valueList.AddRange( dicBindData.Values.ToArray() );
  561. dgvData.DataSource( newtable.Columns );
  562. DataGridViewRow dgvr = null;
  563. DataGridViewCell cell = null;
  564. int i = 0;
  565. Color CurrentColor = dgvData.DataGridViewRowsBackColor_Single();
  566. List<string> firstList = valueList.FindAll( p => p.IndexOf( "|0" ) != -1 );
  567. List<string> childList = valueList.FindAll( p => p.IndexOf( "|1" ) != -1 );
  568. foreach ( dynamic dyData in data.List )
  569. {
  570. dgvr = BindDataGridRows( newtable.Columns.Count );
  571. dgvr.Height = 25;
  572. if ( i == 0 )
  573. {
  574. CurrentColor = dgvData.DataGridViewRowsBackColor_Single();
  575. }
  576. else
  577. {
  578. if ( CurrentColor == dgvData.DataGridViewRowsBackColor_Single() )
  579. {
  580. CurrentColor = dgvData.DataGridViewRowsBackColor_Double();
  581. }
  582. else
  583. {
  584. CurrentColor = dgvData.DataGridViewRowsBackColor_Single();
  585. }
  586. }
  587. try
  588. {
  589. foreach (string firstValue in firstList)
  590. {
  591. string key = keyList[valueList.IndexOf(firstValue)];
  592. string value = GetColumData(key, firstValue.Split('|')[0], dyData);
  593. if (!dictColumns.ContainsKey(key))
  594. {
  595. continue;
  596. }
  597. else
  598. {
  599. dgvr.Cells[columKeyList.IndexOf(key)].Value = value;
  600. }
  601. }
  602. }
  603. catch(Exception ex)
  604. {
  605. string exMsg = ex.ToString();
  606. }
  607. if ( dyData.Child.Count == 0 )
  608. {
  609. dgvData.Rows.Add( dgvr );
  610. dgvr.DefaultCellStyle.BackColor = CurrentColor;
  611. }
  612. else
  613. {
  614. bool bfirst = true;
  615. foreach ( dynamic childDyData in dyData.Child )
  616. {
  617. if ( !bfirst )
  618. {
  619. dgvr = BindDataGridRows( newtable.Columns.Count );
  620. string value = GetColumData( "Ord_Number", "Ord_Number", dyData );
  621. dgvr.Cells[0].Value = value;
  622. value = GetColumData( "Ord_Type", "Ord_Type", dyData );
  623. dgvr.Cells[2].Value = value;
  624. }
  625. foreach ( string childValue in childList )
  626. {
  627. string key = keyList[valueList.IndexOf( childValue )];
  628. string value = GetColumData( key, childValue.Split( '|' )[0], childDyData );
  629. if ( !dictColumns.ContainsKey( key ) )
  630. {
  631. continue;
  632. }
  633. else
  634. {
  635. dgvr.Cells[columKeyList.IndexOf( key )].Value = value;
  636. }
  637. }
  638. if ( bfirst )
  639. {
  640. bfirst = false;
  641. }
  642. dgvData.Rows.Add( dgvr );
  643. dgvr.DefaultCellStyle.BackColor = CurrentColor;
  644. }
  645. }
  646. i++;
  647. /*DataRow newRow = newtable.NewRow();
  648. List<string> firstList=valueList.FindAll(p=>p.IndexOf("|0")!=-1);
  649. List<string> childList=valueList.FindAll(p=>p.IndexOf("|1")!=-1);
  650. foreach (string firstValue in firstList)
  651. {
  652. string value=GetColumData(keyList[valueList.LastIndexOf(firstValue)], firstValue.Split('|')[0], dyData);
  653. List<string> tempKeyList = valueList.FindAll(p=>p==firstValue);
  654. newRow[keyList[valueList.LastIndexOf(firstValue)]] = value;
  655. }
  656. if (dyData.Child.Count==0)
  657. {
  658. newtable.Rows.Add(newRow);
  659. }
  660. else
  661. {
  662. bool bfirst=true;
  663. foreach(dynamic childDyData in dyData.Child)
  664. {
  665. if(!bfirst)
  666. {
  667. newRow = newtable.NewRow();
  668. }
  669. foreach (string childValue in childList)
  670. {
  671. string txt = keyList[valueList.IndexOf(childValue)];
  672. newRow[txt] = GetColumData(keyList[valueList.IndexOf(childValue)], childValue.Split('|')[0], childDyData);
  673. }
  674. if (bfirst)
  675. {
  676. bfirst = false;
  677. }
  678. newtable.Rows.Add(newRow);
  679. }
  680. }*/
  681. // dgvData.Rows.Add();
  682. }
  683. dgvData.IsCompleteBonding = true;
  684. Hashtable htCount = new Hashtable();
  685. //htCount["DataTable"] = newtable;
  686. htCount["TotalPage"] = data.PageCount;
  687. htCount["TotalCount"] = data.TotalCount;
  688. htCount["CurrentCount"] = Convert.ToInt32( (data.TotalCount - (data.PageIndex - 1) * pageSize) > pageSize ? pageSize : (data.TotalCount - (data.PageIndex - 1) * pageSize) );
  689. htCount["PageSql"] = countWhere;
  690. return htCount;
  691. }
  692. public static dynamic GetData_MemberMainGoldMemberNew( DataGridViewEc dgvData, string strQueryCondition, int pageCurrent, int pageSize )
  693. {
  694. Dictionary<string, string> dictColumns = dgvData.dictShowColumName;
  695. DataSet dtSet = new DataSet();
  696. DataTable dtTable = new DataTable();
  697. dynamic dyObj = new ExpandoObject();
  698. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  699. {
  700. dtSet = LYFZ.BLL.BLL_ErpOrderView.GetData_MemberViceCardAndServiceContent();
  701. dyObj = LYFZ.BLL.BLL_ErpOrderView.GetData_MemberMainGoldMemberNew( strQueryCondition, pageCurrent, pageSize );
  702. dtTable = dyObj.DataTable;
  703. } );
  704. #region 组合数据
  705. DataTable newtable = new DataTable();
  706. newtable.Columns.Add( "Mc_Number", typeof( string ) );
  707. newtable.Columns.Add( "会员卡号", typeof( string ) );
  708. newtable.Columns.Add( "持卡人", typeof( string ) );
  709. if ( dictColumns.Keys.Contains( "性别" ) )
  710. {
  711. newtable.Columns.Add( "性别", typeof( string ) );
  712. }
  713. if ( dictColumns.Keys.Contains( "电话" ) )
  714. {
  715. newtable.Columns.Add( "电话", typeof( string ) );
  716. }
  717. if ( dictColumns.Keys.Contains( "类型" ) )
  718. {
  719. newtable.Columns.Add( "类型", typeof( string ) );
  720. }
  721. if ( dictColumns.Keys.Contains( "等级" ) )
  722. {
  723. newtable.Columns.Add( "等级", typeof( string ) );
  724. }
  725. if ( dictColumns.Keys.Contains( "总积分" ) )
  726. {
  727. newtable.Columns.Add( "总积分", typeof( int ) );
  728. }
  729. if ( dictColumns.Keys.Contains( "当前积分" ) )
  730. {
  731. newtable.Columns.Add( "当前积分", typeof( int ) );
  732. }
  733. if ( dictColumns.Keys.Contains( "储值欠款" ) )
  734. {
  735. newtable.Columns.Add( "储值欠款", typeof( decimal ) );
  736. }
  737. if ( dictColumns.Keys.Contains( "服务卡欠款" ) )
  738. {
  739. newtable.Columns.Add( "服务卡欠款", typeof( decimal ) );
  740. }
  741. if ( dictColumns.Keys.Contains( "总充值金额" ) )
  742. {
  743. newtable.Columns.Add( "总充值金额", typeof( decimal ) );
  744. }
  745. if ( dictColumns.Keys.Contains( "金额" ) )
  746. {
  747. newtable.Columns.Add( "金额", typeof( decimal ) );
  748. }
  749. if ( dictColumns.Keys.Contains( "折扣" ) )
  750. {
  751. newtable.Columns.Add( "折扣", typeof( decimal ) );
  752. }
  753. if ( dictColumns.Keys.Contains( "套系金额" ) )
  754. {
  755. newtable.Columns.Add( "套系金额", typeof( decimal ) );
  756. }
  757. if ( dictColumns.Keys.Contains( "已返金额" ) )
  758. {
  759. newtable.Columns.Add( "已返金额", typeof( decimal ) );
  760. }
  761. if ( dictColumns.Keys.Contains( "已取出金额" ) )
  762. {
  763. newtable.Columns.Add( "已取出金额", typeof( decimal ) );
  764. }
  765. if ( dictColumns.Keys.Contains( "返现副卡" ) )
  766. {
  767. newtable.Columns.Add( "返现副卡", typeof( int ) );
  768. }
  769. if ( dictColumns.Keys.Contains( "积分副卡" ) )
  770. {
  771. newtable.Columns.Add( "积分副卡", typeof( int ) );
  772. }
  773. if ( dictColumns.Keys.Contains( "服务次数" ) )
  774. {
  775. newtable.Columns.Add( "服务次数", typeof( int ) );
  776. }
  777. if ( dictColumns.Keys.Contains( "备注" ) )
  778. {
  779. newtable.Columns.Add( "备注", typeof( string ) );
  780. }
  781. if ( dictColumns.Keys.Contains( "客户生日" ) )
  782. {
  783. newtable.Columns.Add( "客户生日", typeof( string ) );
  784. }
  785. if ( dictColumns.Keys.Contains( "办卡日期" ) )
  786. {
  787. newtable.Columns.Add( "办卡日期", typeof( string ) );
  788. }
  789. if ( dictColumns.Keys.Contains( "卡未使用天数" ) )
  790. {
  791. newtable.Columns.Add( "卡未使用天数", typeof( string ) );
  792. }
  793. DataTable dtA = dtTable;
  794. DataTable dtB = dtSet.Tables["ds"];
  795. dtB.PrimaryKey = new DataColumn[] { dtB.Columns["Mvc_Number"] };
  796. DataTable dtC = dtSet.Tables["ds1"];
  797. dtC.PrimaryKey = new DataColumn[] { dtC.Columns["Mcse_Number"] };
  798. for ( int i = 0; i < dtA.Rows.Count; i++ )
  799. {
  800. DataRow newRow = newtable.NewRow();
  801. newRow["Mc_Number"] = dtA.Rows[i]["Mc_Number"].ToString().Trim();
  802. newRow["会员卡号"] = dtA.Rows[i]["会员卡号"].ToString().Trim();
  803. newRow["持卡人"] = dtA.Rows[i]["持卡人"].ToString().Trim();
  804. if ( newtable.Columns.Contains( "性别" ) && !string.IsNullOrEmpty( dtA.Rows[i]["性别"].ToString().Trim() ) )
  805. {
  806. newRow["性别"] = Convert.ToBoolean( dtA.Rows[i]["性别"] ) ? "女" : "男";
  807. }
  808. else
  809. {
  810. newRow["性别"] = "";
  811. }
  812. if ( newtable.Columns.Contains( "电话" ) )
  813. {
  814. newRow["电话"] = dtA.Rows[i]["电话"].ToString().Trim();
  815. }
  816. if ( newtable.Columns.Contains( "类型" ) )
  817. {
  818. string StrCardType = dtA.Rows[i]["类型"].ToString().Trim();
  819. if ( Convert.ToDecimal( dtA.Rows[i]["金额"] ) > 0 )
  820. {
  821. StrCardType = "储值卡," + StrCardType;
  822. }
  823. DataRow dtRow = dtB.Rows.Find( dtA.Rows[i]["Mc_Number"].ToString().Trim() );
  824. if ( dtRow != null )
  825. {
  826. StrCardType += ",返现卡";
  827. }
  828. dtRow = dtC.Rows.Find( dtA.Rows[i]["Mc_Number"].ToString().Trim() );
  829. if ( dtRow != null )
  830. {
  831. StrCardType += ",服务卡";
  832. }
  833. newRow["类型"] = StrCardType;
  834. }
  835. if ( newtable.Columns.Contains( "等级" ) )
  836. {
  837. newRow["等级"] = dtA.Rows[i]["等级"].ToString().Trim();
  838. }
  839. if ( newtable.Columns.Contains( "总积分" ) )
  840. {
  841. newRow["总积分"] = Convert.ToInt32( dtA.Rows[i]["总积分"] );
  842. }
  843. if ( newtable.Columns.Contains( "当前积分" ) )
  844. {
  845. newRow["当前积分"] = Convert.ToInt32( dtA.Rows[i]["积分"] );
  846. }
  847. if ( newtable.Columns.Contains( "储值欠款" ) )
  848. {
  849. newRow["储值欠款"] = Convert.ToDecimal( dtA.Rows[i]["储值欠款"] );
  850. }
  851. if ( newtable.Columns.Contains( "服务卡欠款" ) )
  852. {
  853. newRow["服务卡欠款"] = Convert.ToDecimal( dtA.Rows[i]["服务卡欠款"] );
  854. }
  855. if ( newtable.Columns.Contains( "总充值金额" ) )
  856. {
  857. newRow["总充值金额"] = Convert.ToDecimal( dtA.Rows[i]["总充值金额"] );
  858. }
  859. if ( newtable.Columns.Contains( "金额" ) )
  860. {
  861. newRow["金额"] = Convert.ToDecimal( dtA.Rows[i]["金额"] );
  862. }
  863. if ( newtable.Columns.Contains( "折扣" ) )
  864. {
  865. newRow["折扣"] = Convert.ToDecimal( dtA.Rows[i]["折扣"] );
  866. }
  867. if ( newtable.Columns.Contains( "套系金额" ) )
  868. {
  869. newRow["套系金额"] = Convert.ToDecimal( dtA.Rows[i]["套系金额"] );
  870. }
  871. if ( newtable.Columns.Contains( "已返金额" ) )
  872. {
  873. newRow["已返金额"] = Convert.ToDecimal( dtA.Rows[i]["已返金额"] );
  874. }
  875. if ( newtable.Columns.Contains( "已取出金额" ) )
  876. {
  877. newRow["已取出金额"] = Convert.ToDecimal( dtA.Rows[i]["已取出金额"] );
  878. }
  879. if ( newtable.Columns.Contains( "返现副卡" ) )
  880. {
  881. newRow["返现副卡"] = Convert.ToInt32( dtA.Rows[i]["返现副卡"] );
  882. }
  883. if ( newtable.Columns.Contains( "积分副卡" ) )
  884. {
  885. newRow["积分副卡"] = Convert.ToInt32( dtA.Rows[i]["积分副卡"] );
  886. }
  887. if ( newtable.Columns.Contains( "服务次数" ) )
  888. {
  889. newRow["服务次数"] = Convert.ToInt32( dtA.Rows[i]["服务次数"] );
  890. }
  891. if ( newtable.Columns.Contains( "备注" ) )
  892. {
  893. newRow["备注"] = dtA.Rows[i]["备注"].ToString().Trim();
  894. }
  895. if ( newtable.Columns.Contains( "客户生日" ) )
  896. {
  897. string StrClientBirthday = dtA.Rows[i]["客户生日"].ToString().Trim();
  898. if ( StrClientBirthday.Trim().Length > 0 && dtA.Rows[i]["客户生日"].ToString().Trim().Length > 0 && dtA.Rows[i]["客户生日"].ToString().Trim() == "1" )
  899. {
  900. StrClientBirthday += "_农历";
  901. }
  902. newRow["客户生日"] = StrClientBirthday;
  903. }
  904. if ( newtable.Columns.Contains( "办卡日期" ) )
  905. {
  906. newRow["办卡日期"] = LYFZ.BLL.OtherCommonModel.DateTimeToString( dtA.Rows[i]["办卡日期"] );
  907. }
  908. if ( newtable.Columns.Contains( "卡未使用天数" ) )
  909. {
  910. string dateTime = "";
  911. if ( dtA.Rows[i]["最后使用时间"] != null && !string.IsNullOrEmpty( dtA.Rows[i]["最后使用时间"].ToString() ) )
  912. {
  913. dateTime = LYFZ.BLL.OtherCommonModel.DateTimeToString( ((dtA.Rows[i]["最后使用时间"])) );
  914. }
  915. else
  916. {
  917. dateTime = LYFZ.BLL.OtherCommonModel.DateTimeToString( ((dtA.Rows[i]["办卡日期"])) );
  918. }
  919. string totalDays = Math.Round( (DateTime.Now - Convert.ToDateTime( dateTime )).TotalDays ).ToString();
  920. newRow["卡未使用天数"] = Convert.ToInt32( totalDays ).ToString();
  921. }
  922. newtable.Rows.Add( newRow );
  923. }
  924. #endregion
  925. dyObj.DataTable = newtable;
  926. return dyObj;
  927. }
  928. static DataGridViewRow BindDataGridRows( int count )
  929. {
  930. DataGridViewRow dgvr = new DataGridViewRow();
  931. for ( int i = 0; i < count; i++ )
  932. {
  933. DataGridViewTextBoxCell cell = new DataGridViewTextBoxCell();
  934. dgvr.Cells.Add( cell );
  935. cell.Value = "";
  936. }
  937. return dgvr;
  938. }
  939. static string GetColumData( string key, string dykey, IDictionary<string, Object> dyData )
  940. {
  941. if ( dyData[dykey] == null )
  942. {
  943. return "";
  944. }
  945. string StrRowValue = "";
  946. switch ( key.Trim() )
  947. {
  948. case "婚期":
  949. StrRowValue = LYFZ.BLL.OtherCommonModel.DateTimeToString( dyData[dykey], LYFZ.DateTimeType.StryyyyMMdd );
  950. if ( !string.IsNullOrEmpty( StrRowValue ) )
  951. {
  952. if ( dyData["Cus_DayForMarriageLunar"].ToString().Trim() == "1" )
  953. {
  954. StrRowValue += "_农历";
  955. }
  956. }
  957. break;
  958. case "拍摄时间":
  959. case "初修时间":
  960. case "选片时间":
  961. case "设计时间":
  962. case "精修时间":
  963. case "看版时间":
  964. case "下单日期":
  965. case "取件日期":
  966. StrRowValue = dyData[dykey].ToString().Trim();
  967. StrRowValue = LYFZ.BLL.OtherCommonModel.DateTimeToString( StrRowValue );
  968. break;
  969. case "摄影师":
  970. case "化妆师":
  971. case "引导师":
  972. case "初修师":
  973. case "选片师":
  974. case "设计师":
  975. case "精修师":
  976. case "看版师":
  977. case "服务人员1":
  978. case "服务人员2":
  979. case "录入员":
  980. StrRowValue = dyData[dykey].ToString().ToString().Trim();
  981. if ( !string.IsNullOrEmpty( StrRowValue ) )
  982. {
  983. string[] userRows = StrRowValue.Split( ',' );
  984. StrRowValue = "";
  985. foreach ( string userKey in userRows )
  986. {
  987. DataRow dtRows = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( userKey );
  988. if ( dtRows != null )
  989. {
  990. if ( !string.IsNullOrEmpty( StrRowValue ) )
  991. {
  992. StrRowValue += ",";
  993. }
  994. StrRowValue += dtRows["User_Name"].ToString().Trim();
  995. }
  996. //else
  997. //{
  998. // StrRowValue = "";
  999. //}
  1000. }
  1001. }
  1002. break;
  1003. case "拍照状态":
  1004. StrRowValue = dyData[dykey].ToString().Trim();
  1005. if ( !string.IsNullOrEmpty( StrRowValue ) )
  1006. {
  1007. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.PhotographyStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  1008. }
  1009. else
  1010. {
  1011. StrRowValue = "";
  1012. }
  1013. break;
  1014. case "初修状态":
  1015. StrRowValue = dyData[dykey].ToString().Trim();
  1016. if ( !string.IsNullOrEmpty( StrRowValue ) )
  1017. {
  1018. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.EarlyRepairStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  1019. }
  1020. else
  1021. {
  1022. StrRowValue = "";
  1023. }
  1024. break;
  1025. case "选片状态":
  1026. StrRowValue = dyData[dykey].ToString().Trim();
  1027. if ( !string.IsNullOrEmpty( StrRowValue ) )
  1028. {
  1029. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.FilmSelectionStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  1030. }
  1031. else
  1032. {
  1033. StrRowValue = "";
  1034. }
  1035. break;
  1036. case "设计状态":
  1037. StrRowValue = dyData[dykey].ToString().Trim();
  1038. if ( !string.IsNullOrEmpty( StrRowValue ) )
  1039. {
  1040. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.DesignerStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  1041. }
  1042. else
  1043. {
  1044. StrRowValue = "";
  1045. }
  1046. break;
  1047. case "精修状态":
  1048. StrRowValue = dyData[dykey].ToString().Trim();
  1049. if ( !string.IsNullOrEmpty( StrRowValue ) )
  1050. {
  1051. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.RefinementStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  1052. }
  1053. else
  1054. {
  1055. StrRowValue = "";
  1056. }
  1057. break;
  1058. case "看版状态":
  1059. StrRowValue = dyData[dykey].ToString().Trim();
  1060. if ( !string.IsNullOrEmpty( StrRowValue ) )
  1061. {
  1062. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.LookDesignStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  1063. }
  1064. else
  1065. {
  1066. StrRowValue = "";
  1067. }
  1068. break;
  1069. case "订单类型":
  1070. StrRowValue = dyData[dykey].ToString().Trim();
  1071. break;
  1072. default:
  1073. StrRowValue = dyData[dykey].ToString().Trim();
  1074. break;
  1075. }
  1076. return StrRowValue;
  1077. }
  1078. /// <summary>
  1079. /// 表格列转查询返回的数据列
  1080. /// </summary>
  1081. /// <param name="newtable"></param>
  1082. /// <param name="dictColumns"></param>
  1083. /// <returns></returns>
  1084. static Dictionary<string, string> BindOrderDictionaryKeyList( DataTable newtable, Dictionary<string, string> dictColumns )
  1085. {
  1086. Dictionary<string, string> dicBindData = new Dictionary<string, string>();
  1087. foreach ( var item in dictColumns )
  1088. {
  1089. newtable.Columns.Add( item.Key.Trim(), typeof( string ) );
  1090. switch ( item.Key.Trim() )
  1091. {
  1092. case "订单号":
  1093. dicBindData.Add( item.Key, "Ord_SinceOrderNumber|0" );
  1094. break;
  1095. case "客户区域":
  1096. dicBindData.Add( item.Key, "Cus_Region|0" );
  1097. break;
  1098. case "客户地址":
  1099. dicBindData.Add(item.Key, "Cus_Address|0");
  1100. break;
  1101. case "客户姓名":
  1102. dicBindData.Add( item.Key, "Cus_Name|0" );
  1103. break;
  1104. case "客户性别":
  1105. dicBindData.Add( item.Key, "Cus_Sex_cs|0" );
  1106. break;
  1107. case "客户电话":
  1108. dicBindData.Add( item.Key, "Cus_Telephone|0" );
  1109. break;
  1110. case "年龄":
  1111. dicBindData.Add( item.Key, "Age_String|0" );
  1112. break;
  1113. case "婚期":
  1114. dicBindData.Add( item.Key, "Cus_DayForMarriage|0" );
  1115. break;
  1116. case "宝宝生日":
  1117. dicBindData.Add(item.Key, "Cus_BadyBirthday|0");
  1118. break;
  1119. case "订单类型":
  1120. dicBindData.Add( item.Key, "Ord_TypeName|0" );
  1121. break;
  1122. case "订单类别":
  1123. dicBindData.Add( item.Key, "Ord_OrderClass|0" );
  1124. break;
  1125. case "客户来源":
  1126. dicBindData.Add( item.Key, "Ord_CustomerSource|0" );
  1127. break;
  1128. case "套系类别":
  1129. dicBindData.Add( item.Key, "Ord_PhotographyCategory|0" );
  1130. break;
  1131. case "套系名称":
  1132. dicBindData.Add( item.Key, "Ord_SeriesName|0" );
  1133. break;
  1134. case "接单人":
  1135. dicBindData.Add( item.Key, "Ord_OrderPersonName|0" );
  1136. break;
  1137. case "拍摄名称":
  1138. dicBindData.Add( item.Key, "Ords_SightsName|1" );
  1139. break;
  1140. case "摄影师":
  1141. dicBindData.Add( item.Key, "Ords_Photographer|1" );
  1142. break;
  1143. case "化妆师":
  1144. dicBindData.Add( item.Key, "Ords_MakeupArtist|1" );
  1145. break;
  1146. case "引导师":
  1147. dicBindData.Add( item.Key, "Ords_BootDivision|1" );
  1148. break;
  1149. case "拍摄时间":
  1150. dicBindData.Add( item.Key, "Ords_PhotographMinTime|1" );
  1151. break;
  1152. case "拍照状态":
  1153. dicBindData.Add( item.Key, "Ords_PhotographStatus|1" );
  1154. break;
  1155. case "初修师":
  1156. dicBindData.Add( item.Key, "Ordv_EarlyRepairName|1" );
  1157. break;
  1158. case "初修时间":
  1159. dicBindData.Add( item.Key, "Ordv_EarlyRepairTime|1" );
  1160. break;
  1161. case "初修状态":
  1162. dicBindData.Add( item.Key, "Ordv_EarlyRepairStatus|1" );
  1163. break;
  1164. case "选片师":
  1165. dicBindData.Add( item.Key, "Ordv_FilmSelectionName|1" );
  1166. break;
  1167. case "选片时间":
  1168. dicBindData.Add( item.Key, "Ordv_FilmSelectionTime|1" );
  1169. break;
  1170. case "选片状态":
  1171. dicBindData.Add( item.Key, "Ordv_FilmSelectionStatus|1" );
  1172. break;
  1173. case "设计师":
  1174. dicBindData.Add( item.Key, "Ordv_DesignerName|1" );
  1175. break;
  1176. case "设计时间":
  1177. dicBindData.Add( item.Key, "Ordv_DesignerTime|1" );
  1178. break;
  1179. case "设计状态":
  1180. dicBindData.Add( item.Key, "Ordv_DesignerStatus|1" );
  1181. break;
  1182. case "精修师":
  1183. dicBindData.Add( item.Key, "Ordv_RefinementName|1" );
  1184. break;
  1185. case "精修时间":
  1186. dicBindData.Add( item.Key, "Ordv_RefinementTime|1" );
  1187. break;
  1188. case "精修状态":
  1189. dicBindData.Add( item.Key, "Ordv_RefinementStatus|1" );
  1190. break;
  1191. case "看版师":
  1192. dicBindData.Add( item.Key, "Ordv_LookDesignName|1" );
  1193. break;
  1194. case "看版时间":
  1195. dicBindData.Add( item.Key, "Ordv_LookDesignTime|1" );
  1196. break;
  1197. case "看版状态":
  1198. dicBindData.Add( item.Key, "Ordv_LookDesignStatus|1" );
  1199. break;
  1200. case "看版要求":
  1201. dicBindData.Add( item.Key, "Ordv_LookDesignClaim|1" );
  1202. break;
  1203. case "取件状态":
  1204. dicBindData.Add( item.Key, "Ords_ProductPickupStatus|1" );
  1205. break;
  1206. case "取件日期":
  1207. dicBindData.Add( item.Key, "Ords_ProductPickupTime|1" );
  1208. break;
  1209. case "备注":
  1210. dicBindData.Add( item.Key, "Ord_Remark|0" );
  1211. break;
  1212. case "录入员":
  1213. dicBindData.Add( item.Key, "Ord_CreateName|0" );
  1214. break;
  1215. case "套系价格":
  1216. dicBindData.Add( item.Key, "Ord_SeriesPrice|0" );
  1217. break;
  1218. case "下单日期":
  1219. dicBindData.Add( item.Key, "Ord_CreateDateTime|0" );
  1220. break;
  1221. case "会员卡号":
  1222. dicBindData.Add( item.Key, "Mc_CradNumber|0" );
  1223. break;
  1224. case "客户QQ":
  1225. dicBindData.Add( item.Key, "M_Cus_QQ|0" );
  1226. break;
  1227. case "服务状态":
  1228. dicBindData.Add( item.Key, "Ords_ServiceStatus|1" );
  1229. break;
  1230. case "Ordv_ViceNumber":
  1231. dicBindData.Add( item.Key, "Ordv_ViceNumber|1" );
  1232. break;
  1233. case "服务名称":
  1234. dicBindData.Add( item.Key, "Ws_ProdName|1" );
  1235. break;
  1236. case "数量":
  1237. dicBindData.Add( item.Key, "Ws_ProdQuantity|1" );
  1238. break;
  1239. case "服务时间":
  1240. dicBindData.Add( item.Key, "Ws_WeddingDate|1" );
  1241. break;
  1242. case "服务人员1":
  1243. dicBindData.Add( item.Key, "Ws_Serviceman1|1" );
  1244. break;
  1245. case "服务人员2":
  1246. dicBindData.Add( item.Key, "Ws_Serviceman2|1" );
  1247. break;
  1248. default:
  1249. dicBindData.Add( item.Key, item.Key + "|0" );
  1250. break;
  1251. }
  1252. }
  1253. return dicBindData;
  1254. }
  1255. /// <summary>
  1256. /// 获取订单报表数据(除服务订单外的所有数据)
  1257. /// </summary>
  1258. /// <param name="dgvData"></param>
  1259. /// <param name="dictColumns"></param>
  1260. /// <param name="StrQueryCondition"></param>
  1261. /// <param name="inTopCount"></param>
  1262. /// <param name="StrOrderBy"></param>
  1263. /// <param name="IschkWeddingCelebration"></param>
  1264. public static Hashtable GetData_OrderReport( Dictionary<string, string> dictColumns, string StrQueryCondition, int inTopCount, string StrOrderBy, bool IschkWeddingCelebration )
  1265. {
  1266. DataSet dtSet = new DataSet();
  1267. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  1268. {
  1269. dtSet = LYFZ.BLL.BLL_ErpOrderView.GetData_OrderReport( dictColumns, StrQueryCondition, inTopCount, StrOrderBy, IschkWeddingCelebration );
  1270. } );
  1271. #region 重组DataTable
  1272. DataTable dt = dtSet.Tables["ds"];
  1273. DataTable newtable = new DataTable();
  1274. foreach ( var item in dictColumns )
  1275. {
  1276. if ( dt.Columns.Contains( item.Key.Trim() ) )
  1277. newtable.Columns.Add( item.Key.Trim(), typeof( string ) );
  1278. }
  1279. string ordNumber = "";
  1280. for ( int i = 0; i < dt.Rows.Count; i++ )
  1281. {
  1282. DataRow newRow = newtable.NewRow();
  1283. for ( int j = 0; j < newtable.Columns.Count; j++ )
  1284. {
  1285. string StrRowValue = "";
  1286. switch ( newtable.Columns[j].ColumnName.Trim() )
  1287. {
  1288. case "婚期":
  1289. StrRowValue = LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["Cus_DayForMarriage"], LYFZ.DateTimeType.StryyyyMMdd );
  1290. if ( !string.IsNullOrEmpty( StrRowValue ) )
  1291. {
  1292. if ( dt.Rows[i]["Cus_DayForMarriageLunar"].ToString().Trim() == "1" )
  1293. {
  1294. StrRowValue += "_农历";
  1295. }
  1296. }
  1297. break;
  1298. case "拍摄时间":
  1299. case "初修时间":
  1300. case "选片时间":
  1301. case "设计时间":
  1302. case "精修时间":
  1303. case "看版时间":
  1304. case "下单日期":
  1305. case "取件日期":
  1306. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  1307. StrRowValue = LYFZ.BLL.OtherCommonModel.DateTimeToString( StrRowValue );
  1308. break;
  1309. case "摄影师":
  1310. case "化妆师":
  1311. case "引导师":
  1312. case "初修师":
  1313. case "选片师":
  1314. case "设计师":
  1315. case "精修师":
  1316. case "看版师":
  1317. case "录入员":
  1318. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  1319. if ( !string.IsNullOrEmpty( StrRowValue ) )
  1320. {
  1321. DataRow dtRows = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrRowValue );
  1322. if ( dtRows != null )
  1323. {
  1324. StrRowValue = dtRows["User_Name"].ToString().Trim();
  1325. }
  1326. else
  1327. {
  1328. StrRowValue = "";
  1329. }
  1330. }
  1331. break;
  1332. case "拍照状态":
  1333. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  1334. if ( !string.IsNullOrEmpty( StrRowValue ) )
  1335. {
  1336. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.PhotographyStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  1337. }
  1338. else
  1339. {
  1340. StrRowValue = "";
  1341. }
  1342. break;
  1343. case "取件状态":
  1344. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  1345. if ( !string.IsNullOrEmpty( StrRowValue ) )
  1346. {
  1347. StrRowValue = Convert.ToInt32( StrRowValue ) == 0 ? "未取" : Convert.ToInt32( StrRowValue ) == 1 ? "取件中" : Convert.ToInt32( StrRowValue ) == 2 ? "OK" : "";
  1348. }
  1349. else
  1350. {
  1351. StrRowValue = "";
  1352. }
  1353. break;
  1354. case "服务状态":
  1355. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  1356. if ( !string.IsNullOrEmpty( StrRowValue ) )
  1357. {
  1358. StrRowValue = Convert.ToInt32( StrRowValue ) == 0 ? "未服" : Convert.ToInt32( StrRowValue ) == 1 ? "服务中" : Convert.ToInt32( StrRowValue ) == 2 ? "OK" : "";
  1359. }
  1360. else
  1361. {
  1362. StrRowValue = "";
  1363. }
  1364. break;
  1365. case "初修状态":
  1366. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  1367. if ( !string.IsNullOrEmpty( StrRowValue ) )
  1368. {
  1369. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.EarlyRepairStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  1370. }
  1371. else
  1372. {
  1373. StrRowValue = "";
  1374. }
  1375. break;
  1376. case "选片状态":
  1377. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  1378. if ( !string.IsNullOrEmpty( StrRowValue ) )
  1379. {
  1380. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.FilmSelectionStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  1381. }
  1382. else
  1383. {
  1384. StrRowValue = "";
  1385. }
  1386. break;
  1387. case "设计状态":
  1388. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  1389. if ( !string.IsNullOrEmpty( StrRowValue ) )
  1390. {
  1391. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.DesignerStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  1392. }
  1393. else
  1394. {
  1395. StrRowValue = "";
  1396. }
  1397. break;
  1398. case "精修状态":
  1399. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  1400. if ( !string.IsNullOrEmpty( StrRowValue ) )
  1401. {
  1402. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.RefinementStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  1403. }
  1404. else
  1405. {
  1406. StrRowValue = "";
  1407. }
  1408. break;
  1409. case "看版状态":
  1410. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  1411. if ( !string.IsNullOrEmpty( StrRowValue ) )
  1412. {
  1413. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.LookDesignStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  1414. }
  1415. else
  1416. {
  1417. StrRowValue = "";
  1418. }
  1419. break;
  1420. case "订单类型":
  1421. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  1422. if ( !string.IsNullOrEmpty( StrRowValue ) )
  1423. {
  1424. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.OrderType ), Convert.ToInt32( StrRowValue ) ).ToString();
  1425. }
  1426. else
  1427. {
  1428. StrRowValue = "";
  1429. }
  1430. break;
  1431. default:
  1432. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  1433. break;
  1434. }
  1435. newRow[newtable.Columns[j].ColumnName.Trim()] = StrRowValue;
  1436. if ( ordNumber == newRow["订单号"].ToString_s() )
  1437. {
  1438. if ( newtable.Columns[j].ColumnName == "客户姓名" )
  1439. {
  1440. newRow[newtable.Columns[j].ColumnName.Trim()] = "";
  1441. }
  1442. else if (newtable.Columns[j].ColumnName == "宝宝生日")
  1443. {
  1444. newRow[newtable.Columns[j].ColumnName.Trim()] = "";
  1445. }
  1446. else if( newtable.Columns[j].ColumnName == "客户性别" )
  1447. {
  1448. newRow[newtable.Columns[j].ColumnName.Trim()] = "";
  1449. }
  1450. else if ( newtable.Columns[j].ColumnName == "客户电话" )
  1451. {
  1452. newRow[newtable.Columns[j].ColumnName.Trim()] = "";
  1453. }
  1454. else if ( newtable.Columns[j].ColumnName == "年龄" )
  1455. {
  1456. newRow[newtable.Columns[j].ColumnName.Trim()] = "";
  1457. }
  1458. else if ( newtable.Columns[j].ColumnName == "订单类型" )
  1459. {
  1460. newRow[newtable.Columns[j].ColumnName.Trim()] = "";
  1461. }
  1462. else if ( newtable.Columns[j].ColumnName == "订单类别" )
  1463. {
  1464. newRow[newtable.Columns[j].ColumnName.Trim()] = "";
  1465. }
  1466. else if ( newtable.Columns[j].ColumnName == "客户来源" )
  1467. {
  1468. newRow[newtable.Columns[j].ColumnName.Trim()] = "";
  1469. }
  1470. else if ( newtable.Columns[j].ColumnName == "套系类别" )
  1471. {
  1472. newRow[newtable.Columns[j].ColumnName.Trim()] = "";
  1473. }
  1474. else if ( newtable.Columns[j].ColumnName == "套系名称" )
  1475. {
  1476. newRow[newtable.Columns[j].ColumnName.Trim()] = "";
  1477. }
  1478. else if ( newtable.Columns[j].ColumnName == "接单人" )
  1479. {
  1480. newRow[newtable.Columns[j].ColumnName.Trim()] = "";
  1481. }
  1482. }
  1483. }
  1484. newtable.Rows.Add( newRow );
  1485. if ( ordNumber == newRow["Ord_Number"].ToString_s() )
  1486. {
  1487. newRow["订单号"] = "";
  1488. }
  1489. if ( ordNumber != newRow["Ord_Number"].ToString_s() )
  1490. {
  1491. ordNumber = newRow["Ord_Number"].ToString_s();
  1492. }
  1493. }
  1494. #endregion
  1495. Hashtable htCount = new Hashtable();
  1496. for ( int i = 0; i < newtable.Rows.Count; i++ )
  1497. {
  1498. htCount[newtable.Rows[i]["Ord_Number"].ToString().Trim()] = newtable.Rows[i]["Ord_Number"].ToString().Trim();
  1499. }
  1500. Hashtable htData = new Hashtable();
  1501. htData["DataTable"] = newtable;
  1502. htData["TotalCount"] = Convert.ToInt32( dtSet.Tables["ds1"].Rows[0]["CountID"] );
  1503. htData["CurrentCount"] = htCount.Count;
  1504. return htData;
  1505. }
  1506. /// <summary>
  1507. /// 获取订单报表服务订单数据
  1508. /// </summary>
  1509. /// <param name="dgvData"></param>
  1510. /// <param name="dictColumns"></param>
  1511. /// <param name="StrQueryCondition"></param>
  1512. /// <param name="inTopCount"></param>
  1513. /// <param name="StrOrderBy"></param>
  1514. /// <returns></returns>
  1515. public static Hashtable GetData_OrderReportService( Dictionary<string, string> dictColumns, string StrQueryCondition, int inTopCount, string StrOrderBy )
  1516. {
  1517. DataSet dtSet = new DataSet();
  1518. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  1519. {
  1520. dtSet = LYFZ.BLL.BLL_ErpOrderView.GetData_OrderReportService( dictColumns, StrQueryCondition, inTopCount, StrOrderBy );
  1521. } );
  1522. Hashtable htCount = new Hashtable();
  1523. for ( int i = 0; i < dtSet.Tables["ds"].Rows.Count; i++ )
  1524. {
  1525. htCount[dtSet.Tables["ds"].Rows[i]["Ord_Number"].ToString().Trim()] = dtSet.Tables["ds"].Rows[i]["Ord_Number"].ToString().Trim();
  1526. }
  1527. Hashtable htData = new Hashtable();
  1528. htData["DataTable"] = dtSet.Tables["ds"];
  1529. htData["TotalCount"] = Convert.ToInt32( dtSet.Tables["ds1"].Rows[0]["CountID"] );
  1530. htData["CurrentCount"] = htCount.Count;
  1531. return htData;
  1532. }
  1533. /// <summary>
  1534. /// 获取订单拍照
  1535. /// </summary>
  1536. /// <param name="dgvData"></param>
  1537. /// <param name="dictColumns"></param>
  1538. /// <param name="listColumns"></param>
  1539. /// <param name="StrQueryCondition"></param>
  1540. /// <param name="inTopCount"></param>
  1541. /// <param name="StrOrderBy"></param>
  1542. /// <returns></returns>
  1543. public static Hashtable GetData_OrderPhotographed( DataGridViewEc dgvData, Dictionary<string, string> dictColumns, List<string> listColumns,
  1544. string StrQueryCondition, int inTopCount, string StrOrderBy, int pageIndex ,string ordType="")
  1545. {
  1546. DataSet dtSet = new DataSet();
  1547. Hashtable htData = new Hashtable();
  1548. BLL.BLL_ErpOrderRemarkRecord bLL_ErpOrderRemark = new BLL.BLL_ErpOrderRemarkRecord();
  1549. BLL.MarketProcess.BLL_MarketProcess_Photograph bll_Photograph = new BLL.MarketProcess.BLL_MarketProcess_Photograph();
  1550. DataTable remarkDt = new DataTable();
  1551. //System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
  1552. //sw.Start();
  1553. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  1554. {
  1555. dtSet = LYFZ.BLL.BLL_ErpOrderView.GetData_OrderPhotographed( dictColumns, listColumns, StrQueryCondition, inTopCount, StrOrderBy, pageIndex, ordType);
  1556. //dtSet = bll_Photograph.GetDataTable_PhotographList(dictColumns,new List<Model.MarketProcess.Common_SearchParamModel>(), StrQueryCondition, inTopCount, StrOrderBy, pageIndex, ordType);
  1557. } );
  1558. //sw.Stop();
  1559. //TimeSpan ts2 = sw.Elapsed;
  1560. //MessageBoxCustom.Show(string.Format("Stopwatch总共花费{0}ms.", ts2.TotalMilliseconds),"提示消息");
  1561. #region 重组DataTable
  1562. DataTable newtable = new DataTable();
  1563. foreach ( var item in dictColumns )
  1564. {
  1565. if ( dtSet.Tables["ds"].Columns.Contains( item.Key.Trim() ) )
  1566. newtable.Columns.Add( item.Key.Trim(), typeof( string ) );
  1567. }
  1568. if ( dtSet.Tables["ds1"] != null )
  1569. {
  1570. DataTable dt = dtSet.Tables["ds"];
  1571. for ( int i = 0; i < dt.Rows.Count; i++ )
  1572. {
  1573. DataRow newRow = newtable.NewRow();
  1574. for ( int j = 0; j < newtable.Columns.Count; j++ )
  1575. {
  1576. string StrRowValue = "";
  1577. switch ( newtable.Columns[j].ColumnName.Trim() )
  1578. {
  1579. case "拍摄日期":
  1580. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  1581. StrRowValue = LYFZ.BLL.OtherCommonModel.DateTimeToString( StrRowValue );
  1582. break;
  1583. case "是否重拍":
  1584. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim() == "" ? "" : "重拍";
  1585. break;
  1586. case "拍摄状态":
  1587. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  1588. if ( !string.IsNullOrEmpty( StrRowValue ) )
  1589. {
  1590. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.PhotographyStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  1591. if ( !string.IsNullOrEmpty( dt.Rows[i]["Ordrr_SightsIDNumber"].ToString().Trim() ) )
  1592. {
  1593. StrRowValue += "(重拍)";
  1594. }
  1595. }
  1596. else
  1597. {
  1598. StrRowValue = "";
  1599. }
  1600. break;
  1601. case "选衣状态":
  1602. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  1603. if ( !string.IsNullOrEmpty( StrRowValue ) )
  1604. {
  1605. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.ClothingStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  1606. }
  1607. else
  1608. {
  1609. StrRowValue = "";
  1610. }
  1611. break;
  1612. case "选片状态":
  1613. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  1614. if ( !string.IsNullOrEmpty( StrRowValue ) )
  1615. {
  1616. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.FilmSelectionStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  1617. }
  1618. else
  1619. {
  1620. StrRowValue = "";
  1621. }
  1622. break;
  1623. case "取件状态":
  1624. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  1625. if ( !string.IsNullOrEmpty( StrRowValue ) )
  1626. {
  1627. //StrRowValue = Enum.ToObject(typeof(LYFZ.EnumPublic.ProductTakePiecesStatusEnum), Convert.ToInt32(StrRowValue)).ToString();
  1628. switch ( Convert.ToInt32( StrRowValue ) )
  1629. {
  1630. case 0:
  1631. StrRowValue = "未取";
  1632. break;
  1633. case 1:
  1634. StrRowValue = "取件中";
  1635. break;
  1636. case 2:
  1637. StrRowValue = "OK";
  1638. break;
  1639. }
  1640. }
  1641. else
  1642. {
  1643. StrRowValue = "";
  1644. }
  1645. break;
  1646. case "摄影师":
  1647. case "摄影助理":
  1648. case "化妆师":
  1649. case "化妆助理":
  1650. case "引导师":
  1651. case "引导助理":
  1652. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  1653. if ( !string.IsNullOrEmpty( StrRowValue ) )
  1654. {
  1655. DataRow dtRows = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrRowValue );
  1656. if ( dtRows != null )
  1657. {
  1658. StrRowValue = dtRows["User_Name"].ToString().Trim();
  1659. }
  1660. else
  1661. {
  1662. StrRowValue = "";
  1663. }
  1664. }
  1665. break;
  1666. case "订单类型":
  1667. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  1668. if ( !string.IsNullOrEmpty( StrRowValue ) )
  1669. {
  1670. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.OrderType ), Convert.ToInt32( StrRowValue ) ).ToString();
  1671. }
  1672. else
  1673. {
  1674. StrRowValue = "";
  1675. }
  1676. break;
  1677. default:
  1678. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  1679. break;
  1680. }
  1681. newRow[newtable.Columns[j].ColumnName.Trim()] = StrRowValue;
  1682. }
  1683. newtable.Rows.Add( newRow );
  1684. }
  1685. Hashtable htCount = new Hashtable();
  1686. string strWhere = "";
  1687. for ( int i = 0; i < dt.Rows.Count; i++ )
  1688. {
  1689. htCount[dt.Rows[i]["Ord_Number"].ToString().Trim()] = dt.Rows[i]["Ord_Number"].ToString().Trim();
  1690. if(strWhere !="")
  1691. {
  1692. strWhere += ",";
  1693. }
  1694. strWhere += "'" + dt.Rows[i]["Ordv_ViceNumber"].ToString().Trim() + "'";
  1695. }
  1696. if (strWhere != "")
  1697. {
  1698. remarkDt = bLL_ErpOrderRemark.GetList(" Ordrr_ViceNumber in (" + strWhere + ") and Ordrr_ModuleName = '订单拍照' and (Ordrr_Remark is not null and Ordrr_Remark!='' ) ").Tables[0];
  1699. }
  1700. htData["DataTable"] = newtable;
  1701. htData["TotalCount"] = Convert.ToInt32( dtSet.Tables["ds1"].Rows[0]["CountID"] );
  1702. htData["CurrentCount"] = htCount.Count;
  1703. }
  1704. else
  1705. {
  1706. htData["DataTable"] = new DataTable();
  1707. htData["TotalCount"] = Convert.ToInt32( dtSet.Tables["ds"].Rows[0]["CountID"] );
  1708. htData["CurrentCount"] = 0;
  1709. }
  1710. #endregion
  1711. if ( newtable.Rows.Count > 0 )
  1712. {
  1713. dgvData.DataSource( newtable , remarkDt);
  1714. #if old
  1715. if (dgvData.Columns.Contains("欠款"))
  1716. {
  1717. for (int i = 0; i < dgvData.Rows.Count; i++)
  1718. {
  1719. if (!string.IsNullOrEmpty(dgvData.Rows[i].Cells["欠款"].Value.ToString().Trim()))
  1720. {
  1721. if (Convert.ToDecimal(dgvData.Rows[i].Cells["欠款"].Value) > 0)
  1722. { dgvData.Rows[i].DefaultCellStyle.ForeColor = Color.Red; }
  1723. }
  1724. }
  1725. }
  1726. #endif
  1727. }
  1728. else
  1729. {
  1730. dgvData.DataColumns( string.Join( ",", dictColumns.Keys.ToArray() ), strHideField: dgvData.dgvFixedHideColumn );
  1731. }
  1732. dgvData.Columns["客户姓名"].Frozen = true;
  1733. return htData;
  1734. }
  1735. /// <summary>
  1736. /// 获取订单拍照
  1737. /// </summary>
  1738. /// <param name="dgvData"></param>
  1739. /// <param name="dictColumns"></param>
  1740. /// <param name="listColumns"></param>
  1741. /// <param name="StrQueryCondition"></param>
  1742. /// <param name="inTopCount"></param>
  1743. /// <param name="StrOrderBy"></param>
  1744. /// <returns></returns>
  1745. public static Hashtable GetData_OrderPhotographed2( Dictionary<string, string> dictColumns, List<string> listColumns, string StrQueryCondition, int inTopCount, string StrOrderBy )
  1746. {
  1747. DataSet dtSet = new DataSet();
  1748. Hashtable htData = new Hashtable();
  1749. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  1750. {
  1751. dtSet = LYFZ.BLL.BLL_ErpOrderView.GetData_OrderPhotographed( dictColumns, listColumns, StrQueryCondition, inTopCount, StrOrderBy, 1 );
  1752. } );
  1753. #region 重组DataTable
  1754. DataTable newtable = new DataTable();
  1755. foreach ( var item in dictColumns )
  1756. {
  1757. if ( dtSet.Tables["ds"].Columns.Contains( item.Key.Trim() ) )
  1758. newtable.Columns.Add( item.Key.Trim(), typeof( string ) );
  1759. }
  1760. if ( dtSet.Tables["ds1"] != null )
  1761. {
  1762. DataTable dt = dtSet.Tables["ds"];
  1763. for ( int i = 0; i < dt.Rows.Count; i++ )
  1764. {
  1765. DataRow newRow = newtable.NewRow();
  1766. for ( int j = 0; j < newtable.Columns.Count; j++ )
  1767. {
  1768. string StrRowValue = "";
  1769. switch ( newtable.Columns[j].ColumnName.Trim() )
  1770. {
  1771. case "拍摄日期":
  1772. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  1773. StrRowValue = LYFZ.BLL.OtherCommonModel.DateTimeToString( StrRowValue );
  1774. break;
  1775. case "是否重拍":
  1776. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim() == "" ? "" : "重拍";
  1777. break;
  1778. case "拍摄状态":
  1779. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  1780. if ( !string.IsNullOrEmpty( StrRowValue ) )
  1781. {
  1782. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.PhotographyStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  1783. if ( !string.IsNullOrEmpty( dt.Rows[i]["Ordrr_SightsIDNumber"].ToString().Trim() ) )
  1784. {
  1785. StrRowValue += "(重拍)";
  1786. }
  1787. }
  1788. else
  1789. {
  1790. StrRowValue = "";
  1791. }
  1792. break;
  1793. case "选衣状态":
  1794. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  1795. if ( !string.IsNullOrEmpty( StrRowValue ) )
  1796. {
  1797. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.ClothingStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  1798. }
  1799. else
  1800. {
  1801. StrRowValue = "";
  1802. }
  1803. break;
  1804. case "选片状态":
  1805. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  1806. if ( !string.IsNullOrEmpty( StrRowValue ) )
  1807. {
  1808. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.FilmSelectionStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  1809. }
  1810. else
  1811. {
  1812. StrRowValue = "";
  1813. }
  1814. break;
  1815. case "摄影师":
  1816. case "摄影助理":
  1817. case "化妆师":
  1818. case "化妆助理":
  1819. case "引导师":
  1820. case "引导助理":
  1821. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  1822. if ( !string.IsNullOrEmpty( StrRowValue ) )
  1823. {
  1824. DataRow dtRows = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrRowValue );
  1825. if ( dtRows != null )
  1826. {
  1827. StrRowValue = dtRows["User_Name"].ToString().Trim();
  1828. }
  1829. else
  1830. {
  1831. StrRowValue = "";
  1832. }
  1833. }
  1834. break;
  1835. case "取件状态":
  1836. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  1837. if ( !string.IsNullOrEmpty( StrRowValue ) )
  1838. {
  1839. //StrRowValue = Enum.ToObject(typeof(LYFZ.EnumPublic.ProductTakePiecesStatusEnum), Convert.ToInt32(StrRowValue)).ToString();
  1840. switch ( Convert.ToInt32( StrRowValue ) )
  1841. {
  1842. case 0:
  1843. StrRowValue = "未取";
  1844. break;
  1845. case 1:
  1846. StrRowValue = "取件中";
  1847. break;
  1848. case 2:
  1849. StrRowValue = "OK";
  1850. break;
  1851. }
  1852. }
  1853. else
  1854. {
  1855. StrRowValue = "";
  1856. }
  1857. break;
  1858. case "订单类型":
  1859. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  1860. if ( !string.IsNullOrEmpty( StrRowValue ) )
  1861. {
  1862. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.OrderType ), Convert.ToInt32( StrRowValue ) ).ToString();
  1863. }
  1864. else
  1865. {
  1866. StrRowValue = "";
  1867. }
  1868. break;
  1869. default:
  1870. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  1871. break;
  1872. }
  1873. newRow[newtable.Columns[j].ColumnName.Trim()] = StrRowValue;
  1874. }
  1875. newtable.Rows.Add( newRow );
  1876. }
  1877. Hashtable htCount = new Hashtable();
  1878. for ( int i = 0; i < dt.Rows.Count; i++ )
  1879. {
  1880. htCount[dt.Rows[i]["Ord_Number"].ToString().Trim()] = dt.Rows[i]["Ord_Number"].ToString().Trim();
  1881. }
  1882. htData["DataTable"] = newtable;
  1883. htData["TotalCount"] = Convert.ToInt32( dtSet.Tables["ds1"].Rows[0]["CountID"] );
  1884. htData["CurrentCount"] = htCount.Count;
  1885. }
  1886. else
  1887. {
  1888. htData["DataTable"] = new DataTable();
  1889. htData["TotalCount"] = Convert.ToInt32( dtSet.Tables["ds"].Rows[0]["CountID"] );
  1890. htData["CurrentCount"] = 0;
  1891. }
  1892. #endregion
  1893. return htData;
  1894. }
  1895. /// <summary>
  1896. /// 获取订单初修
  1897. /// </summary>
  1898. /// <param name="dgvData"></param>
  1899. /// <param name="dictColumns"></param>
  1900. /// <param name="StrQueryCondition"></param>
  1901. /// <param name="inTopCount"></param>
  1902. /// <param name="StrOrderBy"></param>
  1903. /// <returns></returns>
  1904. public static Hashtable GetData_OrderRepairPiece( DataGridViewEc dgvData, Dictionary<string, string> dictColumns, string StrQueryCondition,
  1905. int inTopCount, string StrOrderBy, int pageInde )
  1906. {
  1907. DataSet dtSet = new DataSet();
  1908. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  1909. {
  1910. dtSet = LYFZ.BLL.BLL_ErpOrderView.GetData_OrderRepairPiece( dictColumns, StrQueryCondition, inTopCount, StrOrderBy, pageInde );
  1911. } );
  1912. #region 重组DataTable
  1913. DataTable dt = dtSet.Tables["ds"];
  1914. DataTable newtable = new DataTable();
  1915. foreach ( var item in dictColumns )
  1916. {
  1917. if ( dt.Columns.Contains( item.Key.Trim() ) )
  1918. newtable.Columns.Add( item.Key.Trim(), typeof( string ) );
  1919. }
  1920. DataRow newRow = null;
  1921. bool bNewRow = false;
  1922. for ( int i = 0; i < dt.Rows.Count; i++ )
  1923. {
  1924. if ( newRow == null || !newRow["Ordv_ViceNumber"].ToString().Equals( dt.Rows[i]["Ordv_ViceNumber"].ToString() ) )
  1925. {
  1926. newRow = newtable.NewRow();
  1927. bNewRow = true;
  1928. }
  1929. else
  1930. {
  1931. bNewRow = false;
  1932. if ( newtable.Columns.Contains( "拍摄名称" ) )
  1933. {
  1934. if ( newRow["拍摄名称"].ToString() != "" )
  1935. {
  1936. newRow["拍摄名称"] = newRow["拍摄名称"] + ",";
  1937. }
  1938. newRow["拍摄名称"] += dt.Rows[i]["拍摄名称"].ToString().Trim();
  1939. }
  1940. if ( newtable.Columns.Contains( "摄影师" ) )
  1941. {
  1942. string photographer = dt.Rows[i]["摄影师"].ToString().Trim();
  1943. if ( !string.IsNullOrEmpty( photographer ) )
  1944. {
  1945. DataRow dtRows = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( photographer );
  1946. if ( dtRows != null )
  1947. {
  1948. photographer = dtRows["User_Name"].ToString().Trim();
  1949. }
  1950. else
  1951. {
  1952. photographer = "";
  1953. }
  1954. }
  1955. if ( !string.IsNullOrEmpty( photographer ) &&
  1956. newRow["摄影师"].ToString().IndexOf( photographer ) == -1 )
  1957. {
  1958. if ( newRow["摄影师"].ToString() != "" )
  1959. {
  1960. newRow["摄影师"] = newRow["摄影师"] + ",";
  1961. }
  1962. newRow["摄影师"] += photographer;
  1963. }
  1964. }
  1965. if ( newtable.Columns.Contains( "拍摄时间" ) )
  1966. {
  1967. if ( !string.IsNullOrEmpty( dt.Rows[i]["拍摄时间"].ToString().Trim() ) )
  1968. {
  1969. if ( newRow["拍摄时间"].ToString_s().Trim() != "" )
  1970. {
  1971. newRow["拍摄时间"] = LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["拍摄时间"].ToString().Trim() );
  1972. }
  1973. else if ( string.IsNullOrEmpty( newRow["拍摄时间"].ToString_s() )
  1974. || Convert.ToDateTime( newRow["拍摄时间"] ) < Convert.ToDateTime( dt.Rows[i]["拍摄时间"].ToString().Trim() ) )
  1975. {
  1976. string StrValue = dt.Rows[i]["拍摄时间"].ToString().Trim();
  1977. StrValue = LYFZ.BLL.OtherCommonModel.DateTimeToString( StrValue );
  1978. newRow["拍摄时间"] = StrValue;
  1979. }
  1980. }
  1981. }
  1982. if ( newtable.Columns.Contains( "拍照状态" ) )
  1983. {
  1984. if ( !string.IsNullOrEmpty( dt.Rows[i]["拍照状态"].ToString().Trim() ) )
  1985. {
  1986. string StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.PhotographyStatusEnum ),
  1987. Convert.ToInt32( dt.Rows[i]["拍照状态"].ToString().Trim() ) ).ToString();
  1988. if ( newRow["拍照状态"].ToString_s() != "拍照中" && newRow["拍照状态"].ToString_s().IndexOf( StrRowValue ) == -1 )
  1989. {
  1990. newRow["拍照状态"] = "拍照中";
  1991. }
  1992. }
  1993. }
  1994. continue;
  1995. }
  1996. for ( int j = 0; j < newtable.Columns.Count; j++ )
  1997. {
  1998. string StrRowValue = "";
  1999. switch ( newtable.Columns[j].ColumnName.Trim() )
  2000. {
  2001. case "拍摄时间":
  2002. case "加急日期":
  2003. case "初修日期":
  2004. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  2005. StrRowValue = LYFZ.BLL.OtherCommonModel.DateTimeToString( StrRowValue );
  2006. break;
  2007. case "选片时间":
  2008. if ( dt.Rows[i]["Ordv_FilmSelectionStatus"].ToString().Trim() == "0" )
  2009. {
  2010. StrRowValue = dt.Rows[i]["Ordv_ReservationFilmSelectionTime"].ToString().Trim();
  2011. }
  2012. else
  2013. {
  2014. StrRowValue = dt.Rows[i]["Ordv_FilmSelectionTime"].ToString().Trim();
  2015. }
  2016. StrRowValue = LYFZ.BLL.OtherCommonModel.DateTimeToString( StrRowValue );
  2017. break;
  2018. case "摄影师":
  2019. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  2020. if ( !string.IsNullOrEmpty( StrRowValue ) )
  2021. {
  2022. DataRow dtRows = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrRowValue );
  2023. if ( dtRows != null )
  2024. {
  2025. StrRowValue = dtRows["User_Name"].ToString().Trim();
  2026. }
  2027. else
  2028. {
  2029. StrRowValue = "";
  2030. }
  2031. }
  2032. break;
  2033. case "初修师":
  2034. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  2035. if ( !string.IsNullOrEmpty( StrRowValue ) )
  2036. {
  2037. DataRow dtRows = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrRowValue );
  2038. if ( dtRows != null )
  2039. {
  2040. StrRowValue = dtRows["User_Name"].ToString().Trim();
  2041. }
  2042. else
  2043. {
  2044. StrRowValue = "";
  2045. }
  2046. }
  2047. break;
  2048. case "初修是否外发":
  2049. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  2050. if ( StrRowValue == "已发" )
  2051. {
  2052. StrRowValue = "已外发";
  2053. }
  2054. else if ( StrRowValue == "已回" )
  2055. {
  2056. StrRowValue = "外发已回";
  2057. }
  2058. else
  2059. {
  2060. StrRowValue = "";
  2061. }
  2062. break;
  2063. case "拍照状态":
  2064. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  2065. if ( !string.IsNullOrEmpty( StrRowValue ) )
  2066. {
  2067. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.PhotographyStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  2068. }
  2069. else
  2070. {
  2071. StrRowValue = "";
  2072. }
  2073. break;
  2074. case "初修状态":
  2075. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  2076. if ( !string.IsNullOrEmpty( StrRowValue ) )
  2077. {
  2078. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.EarlyRepairStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  2079. }
  2080. else
  2081. {
  2082. StrRowValue = "";
  2083. }
  2084. break;
  2085. case "取件状态":
  2086. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  2087. if ( !string.IsNullOrEmpty( StrRowValue ) )
  2088. {
  2089. //StrRowValue = Enum.ToObject(typeof(LYFZ.EnumPublic.ProductTakePiecesStatusEnum), Convert.ToInt32(StrRowValue)).ToString();
  2090. switch ( Convert.ToInt32( StrRowValue ) )
  2091. {
  2092. case 0:
  2093. StrRowValue = "未取";
  2094. break;
  2095. case 1:
  2096. StrRowValue = "取件中";
  2097. break;
  2098. case 2:
  2099. StrRowValue = "OK";
  2100. break;
  2101. }
  2102. }
  2103. else
  2104. {
  2105. StrRowValue = "";
  2106. }
  2107. break;
  2108. case "选片状态":
  2109. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  2110. if ( !string.IsNullOrEmpty( StrRowValue ) )
  2111. {
  2112. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.FilmSelectionStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  2113. }
  2114. else
  2115. {
  2116. StrRowValue = "";
  2117. }
  2118. break;
  2119. case "设计状态":
  2120. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  2121. if ( !string.IsNullOrEmpty( StrRowValue ) )
  2122. {
  2123. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.DesignerStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  2124. }
  2125. else
  2126. {
  2127. StrRowValue = "";
  2128. }
  2129. break;
  2130. case "精修状态":
  2131. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  2132. if ( !string.IsNullOrEmpty( StrRowValue ) )
  2133. {
  2134. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.RefinementStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  2135. }
  2136. else
  2137. {
  2138. StrRowValue = "";
  2139. }
  2140. break;
  2141. case "看版状态":
  2142. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  2143. if ( !string.IsNullOrEmpty( StrRowValue ) )
  2144. {
  2145. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.LookDesignStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  2146. }
  2147. else
  2148. {
  2149. StrRowValue = "";
  2150. }
  2151. break;
  2152. case "订单类型":
  2153. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  2154. if ( !string.IsNullOrEmpty( StrRowValue ) )
  2155. {
  2156. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.OrderType ), Convert.ToInt32( StrRowValue ) ).ToString();
  2157. }
  2158. else
  2159. {
  2160. StrRowValue = "";
  2161. }
  2162. break;
  2163. case "加急":
  2164. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  2165. if ( StrRowValue == "1" )
  2166. {
  2167. StrRowValue = "加急";
  2168. }
  2169. else
  2170. {
  2171. StrRowValue = "";
  2172. }
  2173. break;
  2174. default:
  2175. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  2176. break;
  2177. }
  2178. newRow[newtable.Columns[j].ColumnName.Trim()] = StrRowValue;
  2179. }
  2180. if ( bNewRow )
  2181. {
  2182. newtable.Rows.Add( newRow );
  2183. }
  2184. }
  2185. BLL.BLL_ErpOrderRemarkRecord bLL_ErpOrderRemark = new BLL.BLL_ErpOrderRemarkRecord();
  2186. DataTable remarkDt = new DataTable();
  2187. string strWhere = "";
  2188. for (int i = 0; i < dt.Rows.Count; i++)
  2189. {
  2190. if (strWhere != "")
  2191. {
  2192. strWhere += ",";
  2193. }
  2194. strWhere += "'" + dt.Rows[i]["Ordv_ViceNumber"].ToString().Trim() + "'";
  2195. }
  2196. if (strWhere != "")
  2197. {
  2198. remarkDt = bLL_ErpOrderRemark.GetList(" Ordrr_ViceNumber in (" + strWhere + ") and Ordrr_ModuleName = '订单初修' and (Ordrr_Remark is not null and Ordrr_Remark!='' ) ").Tables[0];
  2199. }
  2200. var dataList = newtable.AsEnumerable().Where( p => p.Field<string>( "拍照状态" ).IndexOf( ',' ) != -1 );
  2201. foreach ( DataRow dr in dataList )
  2202. {
  2203. dr["拍照状态"] = "拍照中";
  2204. }
  2205. #endregion
  2206. if ( newtable.Rows.Count > 0 )
  2207. {
  2208. dgvData.DataSource( newtable, remarkDt);
  2209. }
  2210. else
  2211. {
  2212. dgvData.DataColumns( string.Join( ",", dictColumns.Keys.ToArray() ), strHideField: dgvData.dgvFixedHideColumn );
  2213. }
  2214. dgvData.Columns["客户姓名"].Frozen = true;
  2215. Hashtable htCount = new Hashtable();
  2216. for ( int i = 0; i < dtSet.Tables["ds"].Rows.Count; i++ )
  2217. {
  2218. htCount[dtSet.Tables["ds"].Rows[i]["Ord_Number"].ToString().Trim()] = dtSet.Tables["ds"].Rows[i]["Ord_Number"].ToString().Trim();
  2219. }
  2220. Hashtable htData = new Hashtable();
  2221. htData["DataTable"] = newtable;
  2222. htData["TotalCount"] = Convert.ToInt32( dtSet.Tables["ds1"].Rows[0]["CountID"] );
  2223. htData["CurrentCount"] = htCount.Count;
  2224. return htData;
  2225. }
  2226. /// <summary>
  2227. /// 获取订单选片
  2228. /// </summary>
  2229. /// <param name="dgvData"></param>
  2230. /// <param name="dictColumns"></param>
  2231. /// <param name="StrQueryCondition"></param>
  2232. /// <param name="inTopCount"></param>
  2233. /// <param name="StrOrderBy"></param>
  2234. /// <returns></returns>
  2235. public static Hashtable GetData_OrderFilmSelection( DataGridViewEc dgvData, Dictionary<string, string> dictColumns, string StrQueryCondition,
  2236. int inTopCount, string StrOrderBy, int pageInde )
  2237. {
  2238. DataSet dtSet = new DataSet();
  2239. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  2240. {
  2241. dtSet = LYFZ.BLL.BLL_ErpOrderView.GetData_OrderFilmSelection( dictColumns, StrQueryCondition, inTopCount, StrOrderBy, false, pageInde );
  2242. } );
  2243. #region 重组DataTable
  2244. DataTable dt = dtSet.Tables["ds"];
  2245. DataTable newtable = new DataTable();
  2246. foreach ( var item in dictColumns )
  2247. {
  2248. if ( dt.Columns.Contains( item.Key.Trim() ) )
  2249. {
  2250. newtable.Columns.Add( item.Key.Trim(), typeof( string ) );
  2251. }
  2252. }
  2253. DataRow newRow = null;
  2254. for ( int i = 0; i < dt.Rows.Count; i++ )
  2255. {
  2256. if ( newRow == null || !newRow["Ordv_ViceNumber"].ToString().Equals( dt.Rows[i]["Ordv_ViceNumber"].ToString() ) )
  2257. {
  2258. newRow = newtable.NewRow();
  2259. //bNewRow = true;
  2260. }
  2261. else
  2262. {
  2263. //bNewRow = false;
  2264. if ( newtable.Columns.Contains( "拍摄名称" ) )
  2265. {
  2266. if ( newRow["拍摄名称"].ToString() != "" )
  2267. {
  2268. newRow["拍摄名称"] = newRow["拍摄名称"] + ",";
  2269. }
  2270. newRow["拍摄名称"] += dt.Rows[i]["拍摄名称"].ToString().Trim();
  2271. }
  2272. if ( newtable.Columns.Contains( "摄影师" ) )
  2273. {
  2274. string photographer = dt.Rows[i]["摄影师"].ToString().Trim();
  2275. if ( !string.IsNullOrEmpty( photographer ) )
  2276. {
  2277. DataRow dtRows = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( photographer );
  2278. if ( dtRows != null )
  2279. {
  2280. photographer = dtRows["User_Name"].ToString().Trim();
  2281. }
  2282. else
  2283. {
  2284. photographer = "";
  2285. }
  2286. }
  2287. if ( !string.IsNullOrEmpty( photographer ) &&
  2288. newRow["摄影师"].ToString().IndexOf( photographer ) == -1 )
  2289. {
  2290. if ( newRow["摄影师"].ToString() != "" )
  2291. {
  2292. newRow["摄影师"] = newRow["摄影师"] + ",";
  2293. }
  2294. newRow["摄影师"] += photographer;
  2295. }
  2296. }
  2297. if ( newtable.Columns.Contains( "化妆师" ) )
  2298. {
  2299. string photographer = dt.Rows[i]["化妆师"].ToString().Trim();
  2300. if ( !string.IsNullOrEmpty( photographer ) )
  2301. {
  2302. DataRow dtRows = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( photographer );
  2303. if ( dtRows != null )
  2304. {
  2305. photographer = dtRows["User_Name"].ToString().Trim();
  2306. }
  2307. else
  2308. {
  2309. photographer = "";
  2310. }
  2311. }
  2312. if ( !string.IsNullOrEmpty( photographer ) &&
  2313. newRow["化妆师"].ToString().IndexOf( photographer ) == -1 )
  2314. {
  2315. if ( newRow["化妆师"].ToString() != "" )
  2316. {
  2317. newRow["化妆师"] = newRow["化妆师"] + ",";
  2318. }
  2319. newRow["化妆师"] += photographer;
  2320. }
  2321. }
  2322. if ( newtable.Columns.Contains( "引导师" ) )
  2323. {
  2324. string photographer = dt.Rows[i]["引导师"].ToString().Trim();
  2325. if ( !string.IsNullOrEmpty( photographer ) )
  2326. {
  2327. DataRow dtRows = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( photographer );
  2328. if ( dtRows != null )
  2329. {
  2330. photographer = dtRows["User_Name"].ToString().Trim();
  2331. }
  2332. else
  2333. {
  2334. photographer = "";
  2335. }
  2336. }
  2337. if ( !string.IsNullOrEmpty( photographer ) &&
  2338. newRow["引导师"].ToString().IndexOf( photographer ) == -1 )
  2339. {
  2340. if ( newRow["引导师"].ToString() != "" )
  2341. {
  2342. newRow["引导师"] = newRow["引导师"] + ",";
  2343. }
  2344. newRow["引导师"] += photographer;
  2345. }
  2346. }
  2347. //if (!string.IsNullOrEmpty(dt.Rows[i]["拍摄时间"].ToString().Trim()))
  2348. //{
  2349. // if (newRow["拍摄时间"].ToString_s().Trim() != "")
  2350. // {
  2351. // newRow["拍摄时间"] = LYFZ.BLL.OtherCommonModel.DateTimeToString(dt.Rows[i]["拍摄时间"].ToString().Trim());
  2352. // }
  2353. // else if (Convert.ToDateTime(newRow["拍摄时间"]) < Convert.ToDateTime(dt.Rows[i]["拍摄时间"].ToString().Trim()))
  2354. // {
  2355. // string StrValue = dt.Rows[i]["拍摄时间"].ToString().Trim();
  2356. // StrValue = LYFZ.BLL.OtherCommonModel.DateTimeToString(StrValue);
  2357. // newRow["拍摄时间"] = StrValue;
  2358. // }
  2359. //}
  2360. if ( newtable.Columns.Contains( "拍照状态" ) )
  2361. {
  2362. if ( !string.IsNullOrEmpty( dt.Rows[i]["拍照状态"].ToString().Trim() ) )
  2363. {
  2364. string StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.PhotographyStatusEnum ),
  2365. Convert.ToInt32( dt.Rows[i]["拍照状态"].ToString().Trim() ) ).ToString();
  2366. if ( newRow["拍照状态"].ToString_s() != "拍照中" && newRow["拍照状态"].ToString_s().IndexOf( StrRowValue ) == -1 )
  2367. {
  2368. newRow["拍照状态"] = "拍照中";
  2369. }
  2370. }
  2371. }
  2372. continue;
  2373. }
  2374. for ( int j = 0; j < newtable.Columns.Count; j++ )
  2375. {
  2376. string StrRowValue = "";
  2377. switch ( newtable.Columns[j].ColumnName.Trim() )
  2378. {
  2379. case "初修日期":
  2380. case "选片日期":
  2381. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  2382. StrRowValue = LYFZ.BLL.OtherCommonModel.DateTimeToString( StrRowValue );
  2383. break;
  2384. case "选片师":
  2385. case "化妆师":
  2386. case "引导师":
  2387. case "摄影师":
  2388. case "初修师":
  2389. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  2390. if ( !string.IsNullOrEmpty( StrRowValue ) )
  2391. {
  2392. DataRow dtRows = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrRowValue );
  2393. if ( dtRows != null )
  2394. {
  2395. StrRowValue = dtRows["User_Name"].ToString().Trim();
  2396. }
  2397. else
  2398. {
  2399. StrRowValue = "";
  2400. }
  2401. }
  2402. break;
  2403. case "拍照状态":
  2404. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  2405. if ( !string.IsNullOrEmpty( StrRowValue ) )
  2406. {
  2407. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.PhotographyStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  2408. }
  2409. else
  2410. {
  2411. StrRowValue = "";
  2412. }
  2413. break;
  2414. case "取件状态":
  2415. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  2416. if ( !string.IsNullOrEmpty( StrRowValue ) )
  2417. {
  2418. //StrRowValue = Enum.ToObject(typeof(LYFZ.EnumPublic.ProductTakePiecesStatusEnum), Convert.ToInt32(StrRowValue)).ToString();
  2419. switch ( Convert.ToInt32( StrRowValue ) )
  2420. {
  2421. case 0:
  2422. StrRowValue = "未取";
  2423. break;
  2424. case 1:
  2425. StrRowValue = "取件中";
  2426. break;
  2427. case 2:
  2428. StrRowValue = "OK";
  2429. break;
  2430. }
  2431. }
  2432. else
  2433. {
  2434. StrRowValue = "";
  2435. }
  2436. break;
  2437. case "初修状态":
  2438. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  2439. if ( !string.IsNullOrEmpty( StrRowValue ) )
  2440. {
  2441. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.EarlyRepairStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  2442. }
  2443. else
  2444. {
  2445. StrRowValue = "";
  2446. }
  2447. break;
  2448. case "选片状态":
  2449. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  2450. if ( !string.IsNullOrEmpty( StrRowValue ) )
  2451. {
  2452. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.FilmSelectionStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  2453. }
  2454. else
  2455. {
  2456. StrRowValue = "";
  2457. }
  2458. break;
  2459. case "设计状态":
  2460. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  2461. if ( !string.IsNullOrEmpty( StrRowValue ) )
  2462. {
  2463. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.DesignerStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  2464. }
  2465. else
  2466. {
  2467. StrRowValue = "";
  2468. }
  2469. break;
  2470. case "精修状态":
  2471. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  2472. if ( !string.IsNullOrEmpty( StrRowValue ) )
  2473. {
  2474. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.RefinementStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  2475. }
  2476. else
  2477. {
  2478. StrRowValue = "";
  2479. }
  2480. break;
  2481. case "看版状态":
  2482. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  2483. if ( !string.IsNullOrEmpty( StrRowValue ) )
  2484. {
  2485. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.LookDesignStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  2486. }
  2487. else
  2488. {
  2489. StrRowValue = "";
  2490. }
  2491. break;
  2492. case "订单类型":
  2493. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  2494. if ( !string.IsNullOrEmpty( StrRowValue ) )
  2495. {
  2496. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.OrderType ), Convert.ToInt32( StrRowValue ) ).ToString();
  2497. }
  2498. else
  2499. {
  2500. StrRowValue = "";
  2501. }
  2502. break;
  2503. default:
  2504. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  2505. break;
  2506. }
  2507. newRow[newtable.Columns[j].ColumnName.Trim()] = StrRowValue;
  2508. }
  2509. newtable.Rows.Add( newRow );
  2510. }
  2511. #endregion
  2512. BLL.BLL_ErpOrderRemarkRecord bLL_ErpOrderRemark = new BLL.BLL_ErpOrderRemarkRecord();
  2513. DataTable remarkDt = new DataTable();
  2514. string strWhere = "";
  2515. for (int i = 0; i < dt.Rows.Count; i++)
  2516. {
  2517. if (strWhere != "")
  2518. {
  2519. strWhere += ",";
  2520. }
  2521. strWhere += "'" + dt.Rows[i]["Ordv_ViceNumber"].ToString().Trim() + "'";
  2522. }
  2523. if (strWhere != "")
  2524. {
  2525. remarkDt = bLL_ErpOrderRemark.GetList(" Ordrr_ViceNumber in (" + strWhere + ") and Ordrr_ModuleName = '订单选片' and (Ordrr_Remark is not null and Ordrr_Remark!='' ) ").Tables[0];
  2526. }
  2527. if ( newtable.Rows.Count > 0 )
  2528. {
  2529. dgvData.DataSource( newtable, remarkDt);
  2530. #if old
  2531. if (dgvData.Columns.Contains("欠款"))
  2532. {
  2533. for (int i = 0; i < dgvData.Rows.Count; i++)
  2534. {
  2535. if (!string.IsNullOrEmpty(dgvData.Rows[i].Cells["欠款"].Value.ToString().Trim()))
  2536. {
  2537. if (Convert.ToDecimal(dgvData.Rows[i].Cells["欠款"].Value) > 0)
  2538. { dgvData.Rows[i].DefaultCellStyle.ForeColor = Color.Red; }
  2539. }
  2540. }
  2541. }
  2542. #endif
  2543. }
  2544. else
  2545. {
  2546. dgvData.DataColumns( string.Join( ",", dictColumns.Keys.ToArray() ), strHideField: dgvData.dgvFixedHideColumn );
  2547. }
  2548. dgvData.Columns["客户姓名"].Frozen = true;
  2549. Hashtable htCount = new Hashtable();
  2550. for ( int i = 0; i < dtSet.Tables["ds"].Rows.Count; i++ )
  2551. {
  2552. htCount[dtSet.Tables["ds"].Rows[i]["Ord_Number"].ToString().Trim()] = dtSet.Tables["ds"].Rows[i]["Ord_Number"].ToString().Trim();
  2553. }
  2554. Hashtable htData = new Hashtable();
  2555. htData["DataTable"] = newtable;
  2556. htData["TotalCount"] = Convert.ToInt32( dtSet.Tables["ds1"].Rows[0]["CountID"] );
  2557. htData["CurrentCount"] = htCount.Count;
  2558. return htData;
  2559. }
  2560. /// <summary>
  2561. /// 获取订单精修
  2562. /// </summary>
  2563. /// <param name="dgvData"></param>
  2564. /// <param name="dictColumns"></param>
  2565. /// <param name="StrQueryCondition"></param>
  2566. /// <param name="inTopCount"></param>
  2567. /// <param name="StrOrderBy"></param>
  2568. /// <returns></returns>
  2569. public static Hashtable GetData_OrderRefinedRepair( DataGridViewEc dgvData, Dictionary<string, string> dictColumns, string StrQueryCondition, int inTopCount,
  2570. string StrOrderBy, int pageIndex )
  2571. {
  2572. DataSet dtSet = new DataSet();
  2573. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  2574. {
  2575. dtSet = LYFZ.BLL.BLL_ErpOrderView.GetData_OrderRefinedRepair( dictColumns, StrQueryCondition, inTopCount, StrOrderBy, pageIndex );
  2576. } );
  2577. #region 重组DataTable
  2578. DataTable dt = dtSet.Tables["ds"];
  2579. DataTable newtable = new DataTable();
  2580. foreach ( var item in dictColumns )
  2581. {
  2582. if ( dt.Columns.Contains( item.Key.Trim() ) )
  2583. newtable.Columns.Add( item.Key.Trim(), typeof( string ) );
  2584. }
  2585. DataRow newRow = null;
  2586. bool bNewRow = false;
  2587. for ( int i = 0; i < dt.Rows.Count; i++ )
  2588. {
  2589. if ( newRow == null || !newRow["Ordv_ViceNumber"].ToString().Equals( dt.Rows[i]["Ordv_ViceNumber"].ToString() ) )
  2590. {
  2591. newRow = newtable.NewRow();
  2592. bNewRow = true;
  2593. }
  2594. else
  2595. {
  2596. bNewRow = false;
  2597. if ( newtable.Columns.Contains( "拍摄名称" ) )
  2598. {
  2599. if ( newRow["拍摄名称"].ToString() != "" )
  2600. {
  2601. newRow["拍摄名称"] = newRow["拍摄名称"] + ",";
  2602. }
  2603. newRow["拍摄名称"] += dt.Rows[i]["拍摄名称"].ToString().Trim();
  2604. }
  2605. if ( newtable.Columns.Contains( "摄影师" ) )
  2606. {
  2607. string photographer = dt.Rows[i]["摄影师"].ToString().Trim();
  2608. if ( !string.IsNullOrEmpty( photographer ) )
  2609. {
  2610. DataRow dtRows = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( photographer );
  2611. if ( dtRows != null )
  2612. {
  2613. photographer = dtRows["User_Name"].ToString().Trim();
  2614. }
  2615. else
  2616. {
  2617. photographer = "";
  2618. }
  2619. }
  2620. if ( !string.IsNullOrEmpty( photographer ) &&
  2621. newRow["摄影师"].ToString().IndexOf( photographer ) == -1 )
  2622. {
  2623. if ( newRow["摄影师"].ToString() != "" )
  2624. {
  2625. newRow["摄影师"] = newRow["摄影师"] + ",";
  2626. }
  2627. newRow["摄影师"] += photographer;
  2628. }
  2629. }
  2630. //if (!string.IsNullOrEmpty(dt.Rows[i]["拍摄时间"].ToString().Trim()))
  2631. //{
  2632. // if (newRow["拍摄时间"].ToString_s().Trim() != "")
  2633. // {
  2634. // newRow["拍摄时间"] = LYFZ.BLL.OtherCommonModel.DateTimeToString(dt.Rows[i]["拍摄时间"].ToString().Trim());
  2635. // }
  2636. // else if (Convert.ToDateTime(newRow["拍摄时间"]) < Convert.ToDateTime(dt.Rows[i]["拍摄时间"].ToString().Trim()))
  2637. // {
  2638. // string StrValue = dt.Rows[i]["拍摄时间"].ToString().Trim();
  2639. // StrValue = LYFZ.BLL.OtherCommonModel.DateTimeToString(StrValue);
  2640. // newRow["拍摄时间"] = StrValue;
  2641. // }
  2642. //}
  2643. if ( newtable.Columns.Contains( "拍照状态" ) )
  2644. {
  2645. if ( !string.IsNullOrEmpty( dt.Rows[i]["拍照状态"].ToString().Trim() ) )
  2646. {
  2647. string StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.PhotographyStatusEnum ),
  2648. Convert.ToInt32( dt.Rows[i]["拍照状态"].ToString().Trim() ) ).ToString();
  2649. if ( newRow["拍照状态"].ToString_s() != "拍照中" && newRow["拍照状态"].ToString_s().IndexOf( StrRowValue ) == -1 )
  2650. {
  2651. newRow["拍照状态"] = "拍照中";
  2652. }
  2653. }
  2654. }
  2655. continue;
  2656. }
  2657. //newRow = newtable.NewRow();
  2658. for ( int j = 0; j < newtable.Columns.Count; j++ )
  2659. {
  2660. string StrRowValue = "";
  2661. switch ( newtable.Columns[j].ColumnName.Trim() )
  2662. {
  2663. case "加急":
  2664. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  2665. if ( !string.IsNullOrEmpty( StrRowValue ) && Convert.ToInt32( StrRowValue ) > 0 )
  2666. {
  2667. StrRowValue = "是";
  2668. }
  2669. else
  2670. {
  2671. StrRowValue = "否";
  2672. }
  2673. break;
  2674. case "加急日期":
  2675. case "初修日期":
  2676. case "选片日期":
  2677. case "精修日期":
  2678. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  2679. StrRowValue = LYFZ.BLL.OtherCommonModel.DateTimeToString( StrRowValue );
  2680. break;
  2681. case "看版时间":
  2682. if ( dt.Rows[i]["Ordv_LookDesignStatus"].ToString().Trim() == "0" )
  2683. {
  2684. StrRowValue = dt.Rows[i]["Ordv_ReservationLookDesignTime"].ToString().Trim();
  2685. }
  2686. else
  2687. {
  2688. StrRowValue = dt.Rows[i]["Ordv_LookDesignTime"].ToString().Trim();
  2689. }
  2690. StrRowValue = LYFZ.BLL.OtherCommonModel.DateTimeToString( StrRowValue );
  2691. break;
  2692. case "摄影师":
  2693. case "初修师":
  2694. case "精修师":
  2695. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  2696. if ( !string.IsNullOrEmpty( StrRowValue ) )
  2697. {
  2698. DataRow dtRows = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrRowValue );
  2699. if ( dtRows != null )
  2700. {
  2701. StrRowValue = dtRows["User_Name"].ToString().Trim();
  2702. }
  2703. else
  2704. {
  2705. StrRowValue = "";
  2706. }
  2707. }
  2708. break;
  2709. case "拍照状态":
  2710. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  2711. if ( !string.IsNullOrEmpty( StrRowValue ) )
  2712. {
  2713. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.PhotographyStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  2714. }
  2715. else
  2716. {
  2717. StrRowValue = "";
  2718. }
  2719. break;
  2720. case "初修状态":
  2721. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  2722. if ( !string.IsNullOrEmpty( StrRowValue ) )
  2723. {
  2724. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.EarlyRepairStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  2725. }
  2726. else
  2727. {
  2728. StrRowValue = "";
  2729. }
  2730. break;
  2731. case "取件状态":
  2732. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  2733. if ( !string.IsNullOrEmpty( StrRowValue ) )
  2734. {
  2735. //StrRowValue = Enum.ToObject(typeof(LYFZ.EnumPublic.ProductTakePiecesStatusEnum), Convert.ToInt32(StrRowValue)).ToString();
  2736. switch ( Convert.ToInt32( StrRowValue ) )
  2737. {
  2738. case 0:
  2739. StrRowValue = "未取";
  2740. break;
  2741. case 1:
  2742. StrRowValue = "取件中";
  2743. break;
  2744. case 2:
  2745. StrRowValue = "OK";
  2746. break;
  2747. }
  2748. }
  2749. else
  2750. {
  2751. StrRowValue = "";
  2752. }
  2753. break;
  2754. case "选片状态":
  2755. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  2756. if ( !string.IsNullOrEmpty( StrRowValue ) )
  2757. {
  2758. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.FilmSelectionStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  2759. }
  2760. else
  2761. {
  2762. StrRowValue = "";
  2763. }
  2764. break;
  2765. case "设计状态":
  2766. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  2767. if ( !string.IsNullOrEmpty( StrRowValue ) )
  2768. {
  2769. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.DesignerStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  2770. }
  2771. else
  2772. {
  2773. StrRowValue = "";
  2774. }
  2775. break;
  2776. case "精修是否外发":
  2777. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  2778. if ( StrRowValue == "已发" )
  2779. {
  2780. StrRowValue = "已外发";
  2781. }
  2782. else if ( StrRowValue == "已回" )
  2783. {
  2784. StrRowValue = "外发已回";
  2785. }
  2786. else
  2787. {
  2788. StrRowValue = "";
  2789. }
  2790. break;
  2791. case "精修状态":
  2792. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  2793. if ( !string.IsNullOrEmpty( StrRowValue ) )
  2794. {
  2795. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.RefinementStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  2796. }
  2797. else
  2798. {
  2799. StrRowValue = "";
  2800. }
  2801. break;
  2802. case "看版状态":
  2803. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  2804. if ( !string.IsNullOrEmpty( StrRowValue ) )
  2805. {
  2806. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.LookDesignStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  2807. }
  2808. else
  2809. {
  2810. StrRowValue = "";
  2811. }
  2812. break;
  2813. case "订单类型":
  2814. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  2815. if ( !string.IsNullOrEmpty( StrRowValue ) )
  2816. {
  2817. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.OrderType ), Convert.ToInt32( StrRowValue ) ).ToString();
  2818. }
  2819. else
  2820. {
  2821. StrRowValue = "";
  2822. }
  2823. break;
  2824. default:
  2825. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  2826. break;
  2827. }
  2828. newRow[newtable.Columns[j].ColumnName.Trim()] = StrRowValue;
  2829. }
  2830. newtable.Rows.Add( newRow );
  2831. }
  2832. #endregion
  2833. BLL.BLL_ErpOrderRemarkRecord bLL_ErpOrderRemark = new BLL.BLL_ErpOrderRemarkRecord();
  2834. DataTable remarkDt = new DataTable();
  2835. string strWhere = "";
  2836. for (int i = 0; i < dt.Rows.Count; i++)
  2837. {
  2838. if (strWhere != "")
  2839. {
  2840. strWhere += ",";
  2841. }
  2842. strWhere += "'" + dt.Rows[i]["Ordv_ViceNumber"].ToString().Trim() + "'";
  2843. }
  2844. if (strWhere != "")
  2845. {
  2846. remarkDt = bLL_ErpOrderRemark.GetList(" Ordrr_ViceNumber in (" + strWhere + ") and Ordrr_ModuleName = '订单精修' and (Ordrr_Remark is not null and Ordrr_Remark!='' ) ").Tables[0];
  2847. }
  2848. if ( newtable.Rows.Count > 0 )
  2849. {
  2850. dgvData.DataSource( newtable , remarkDt);
  2851. }
  2852. else
  2853. {
  2854. dgvData.DataColumns( string.Join( ",", dictColumns.Keys.ToArray() ), strHideField: dgvData.dgvFixedHideColumn );
  2855. }
  2856. dgvData.Columns["客户姓名"].Frozen = true;
  2857. Hashtable htCount = new Hashtable();
  2858. for ( int i = 0; i < dtSet.Tables["ds"].Rows.Count; i++ )
  2859. {
  2860. htCount[dtSet.Tables["ds"].Rows[i]["Ord_Number"].ToString().Trim()] = dtSet.Tables["ds"].Rows[i]["Ord_Number"].ToString().Trim();
  2861. }
  2862. Hashtable htData = new Hashtable();
  2863. htData["DataTable"] = newtable;
  2864. htData["TotalCount"] = Convert.ToInt32( dtSet.Tables["ds1"].Rows[0]["CountID"] );
  2865. htData["CurrentCount"] = htCount.Count;
  2866. return htData;
  2867. }
  2868. /// <summary>
  2869. /// 获取订单设计
  2870. /// </summary>
  2871. /// <param name="dgvData"></param>
  2872. /// <param name="dictColumns"></param>
  2873. /// <param name="StrQueryCondition"></param>
  2874. /// <param name="inTopCount"></param>
  2875. /// <param name="StrOrderBy"></param>
  2876. /// <returns></returns>
  2877. public static Hashtable GetData_OrderDesign( DataGridViewEc dgvData, Dictionary<string, string> dictColumns, string StrQueryCondition, int inTopCount, string StrOrderBy, int pageIndex )
  2878. {
  2879. DataSet dtSet = new DataSet();
  2880. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  2881. {
  2882. dtSet = LYFZ.BLL.BLL_ErpOrderView.GetData_OrderDesign( dictColumns, StrQueryCondition, inTopCount, StrOrderBy, pageIndex );
  2883. } );
  2884. #region 重组DataTable
  2885. DataTable dt = dtSet.Tables["ds"];
  2886. DataTable newtable = new DataTable();
  2887. foreach ( var item in dictColumns )
  2888. {
  2889. if ( dt.Columns.Contains( item.Key.Trim() ) )
  2890. newtable.Columns.Add( item.Key.Trim(), typeof( string ) );
  2891. }
  2892. DataRow newRow = null;
  2893. bool bNewRow = false;
  2894. for ( int i = 0; i < dt.Rows.Count; i++ )
  2895. {
  2896. if ( newRow == null || !newRow["Ordv_ViceNumber"].ToString().Equals( dt.Rows[i]["Ordv_ViceNumber"].ToString() ) )
  2897. {
  2898. newRow = newtable.NewRow();
  2899. bNewRow = true;
  2900. }
  2901. else
  2902. {
  2903. bNewRow = false;
  2904. if ( newRow["拍摄名称"].ToString() != "" )
  2905. {
  2906. newRow["拍摄名称"] = newRow["拍摄名称"] + ",";
  2907. }
  2908. newRow["拍摄名称"] += dt.Rows[i]["拍摄名称"].ToString().Trim();
  2909. //string photographer = dt.Rows[i]["摄影师"].ToString().Trim();
  2910. //if (!string.IsNullOrEmpty(photographer))
  2911. //{
  2912. // DataRow dtRows = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find(photographer);
  2913. // if (dtRows != null)
  2914. // { photographer = dtRows["User_Name"].ToString().Trim(); }
  2915. // else
  2916. // { photographer = ""; }
  2917. //}
  2918. //if (!string.IsNullOrEmpty(photographer) &&
  2919. // newRow["摄影师"].ToString().IndexOf(photographer) == -1)
  2920. //{
  2921. // if (newRow["摄影师"].ToString() != "")
  2922. // {
  2923. // newRow["摄影师"] = newRow["摄影师"] + ",";
  2924. // }
  2925. // newRow["摄影师"] += photographer;
  2926. //}
  2927. //if (!string.IsNullOrEmpty(dt.Rows[i]["拍摄时间"].ToString().Trim()))
  2928. //{
  2929. // if (newRow["拍摄时间"].ToString_s().Trim() != "")
  2930. // {
  2931. // newRow["拍摄时间"] = LYFZ.BLL.OtherCommonModel.DateTimeToString(dt.Rows[i]["拍摄时间"].ToString().Trim());
  2932. // }
  2933. // else if (Convert.ToDateTime(newRow["拍摄时间"]) < Convert.ToDateTime(dt.Rows[i]["拍摄时间"].ToString().Trim()))
  2934. // {
  2935. // string StrValue = dt.Rows[i]["拍摄时间"].ToString().Trim();
  2936. // StrValue = LYFZ.BLL.OtherCommonModel.DateTimeToString(StrValue);
  2937. // newRow["拍摄时间"] = StrValue;
  2938. // }
  2939. //}
  2940. //if (!string.IsNullOrEmpty(dt.Rows[i]["拍照状态"].ToString().Trim()))
  2941. //{
  2942. // string StrRowValue = Enum.ToObject(typeof(LYFZ.EnumPublic.PhotographyStatusEnum),
  2943. // Convert.ToInt32(dt.Rows[i]["拍照状态"].ToString().Trim())).ToString();
  2944. // if (newRow["拍照状态"].ToString_s() != "拍照中" && newRow["拍照状态"].ToString_s().IndexOf(StrRowValue) == -1)
  2945. // {
  2946. // newRow["拍照状态"] = "拍照中";
  2947. // }
  2948. //}
  2949. continue;
  2950. }
  2951. //newRow = newtable.NewRow();
  2952. for ( int j = 0; j < newtable.Columns.Count; j++ )
  2953. {
  2954. string StrRowValue = "";
  2955. switch ( newtable.Columns[j].ColumnName.Trim() )
  2956. {
  2957. case "加急":
  2958. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  2959. if ( !string.IsNullOrEmpty( StrRowValue ) && Convert.ToInt32( StrRowValue ) > 0 )
  2960. {
  2961. StrRowValue = "是";
  2962. }
  2963. else
  2964. {
  2965. StrRowValue = "否";
  2966. }
  2967. break;
  2968. case "加急日期":
  2969. case "设计日期":
  2970. case "精修日期":
  2971. case "看版日期":
  2972. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  2973. StrRowValue = LYFZ.BLL.OtherCommonModel.DateTimeToString( StrRowValue );
  2974. break;
  2975. case "设计师":
  2976. case "看版师":
  2977. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  2978. if ( !string.IsNullOrEmpty( StrRowValue ) )
  2979. {
  2980. DataRow dtRows = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrRowValue );
  2981. if ( dtRows != null )
  2982. {
  2983. StrRowValue = dtRows["User_Name"].ToString().Trim();
  2984. }
  2985. else
  2986. {
  2987. StrRowValue = "";
  2988. }
  2989. }
  2990. break;
  2991. case "初修状态":
  2992. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  2993. if ( !string.IsNullOrEmpty( StrRowValue ) )
  2994. {
  2995. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.EarlyRepairStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  2996. }
  2997. else
  2998. {
  2999. StrRowValue = "";
  3000. }
  3001. break;
  3002. case "选片状态":
  3003. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  3004. if ( !string.IsNullOrEmpty( StrRowValue ) )
  3005. {
  3006. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.FilmSelectionStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  3007. }
  3008. else
  3009. {
  3010. StrRowValue = "";
  3011. }
  3012. break;
  3013. case "设计是否外发":
  3014. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  3015. if ( StrRowValue.Trim() == "1" )
  3016. {
  3017. StrRowValue = "已外发";
  3018. }
  3019. else
  3020. {
  3021. StrRowValue = "";
  3022. }
  3023. break;
  3024. case "设计状态":
  3025. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  3026. if ( !string.IsNullOrEmpty( StrRowValue ) )
  3027. {
  3028. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.DesignerStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  3029. }
  3030. else
  3031. {
  3032. StrRowValue = "";
  3033. }
  3034. break;
  3035. case "精修状态":
  3036. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  3037. if ( !string.IsNullOrEmpty( StrRowValue ) )
  3038. {
  3039. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.RefinementStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  3040. }
  3041. else
  3042. {
  3043. StrRowValue = "";
  3044. }
  3045. break;
  3046. case "看版状态":
  3047. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  3048. if ( !string.IsNullOrEmpty( StrRowValue ) )
  3049. {
  3050. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.LookDesignStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  3051. }
  3052. else
  3053. {
  3054. StrRowValue = "";
  3055. }
  3056. break;
  3057. case "取件状态":
  3058. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  3059. if ( !string.IsNullOrEmpty( StrRowValue ) )
  3060. {
  3061. //StrRowValue = Enum.ToObject(typeof(LYFZ.EnumPublic.ProductTakePiecesStatusEnum), Convert.ToInt32(StrRowValue)).ToString();
  3062. switch ( Convert.ToInt32( StrRowValue ) )
  3063. {
  3064. case 0:
  3065. StrRowValue = "未取";
  3066. break;
  3067. case 1:
  3068. StrRowValue = "取件中";
  3069. break;
  3070. case 2:
  3071. StrRowValue = "OK";
  3072. break;
  3073. }
  3074. }
  3075. else
  3076. {
  3077. StrRowValue = "";
  3078. }
  3079. break;
  3080. case "订单类型":
  3081. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  3082. if ( !string.IsNullOrEmpty( StrRowValue ) )
  3083. {
  3084. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.OrderType ), Convert.ToInt32( StrRowValue ) ).ToString();
  3085. }
  3086. else
  3087. {
  3088. StrRowValue = "";
  3089. }
  3090. break;
  3091. default:
  3092. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  3093. break;
  3094. }
  3095. newRow[newtable.Columns[j].ColumnName.Trim()] = StrRowValue;
  3096. }
  3097. newtable.Rows.Add( newRow );
  3098. }
  3099. #endregion
  3100. BLL.BLL_ErpOrderRemarkRecord bLL_ErpOrderRemark = new BLL.BLL_ErpOrderRemarkRecord();
  3101. DataTable remarkDt = new DataTable();
  3102. string strWhere = "";
  3103. for (int i = 0; i < dt.Rows.Count; i++)
  3104. {
  3105. if (strWhere != "")
  3106. {
  3107. strWhere += ",";
  3108. }
  3109. strWhere += "'" + dt.Rows[i]["Ordv_ViceNumber"].ToString().Trim() + "'";
  3110. }
  3111. if (strWhere != "")
  3112. {
  3113. remarkDt = bLL_ErpOrderRemark.GetList(" Ordrr_ViceNumber in (" + strWhere + ") and Ordrr_ModuleName = '订单设计' and (Ordrr_Remark is not null and Ordrr_Remark!='' ) ").Tables[0];
  3114. }
  3115. if ( newtable.Rows.Count > 0 )
  3116. {
  3117. dgvData.DataSource( newtable , remarkDt);
  3118. #if old
  3119. if (dgvData.Columns.Contains("欠款"))
  3120. {
  3121. for (int i = 0; i < dgvData.Rows.Count; i++)
  3122. {
  3123. if (!string.IsNullOrEmpty(dgvData.Rows[i].Cells["欠款"].Value.ToString().Trim()))
  3124. {
  3125. if (Convert.ToDecimal(dgvData.Rows[i].Cells["欠款"].Value) > 0)
  3126. { dgvData.Rows[i].DefaultCellStyle.ForeColor = Color.Red; }
  3127. }
  3128. }
  3129. }
  3130. #endif
  3131. }
  3132. else
  3133. {
  3134. dgvData.DataColumns( string.Join( ",", dictColumns.Keys.ToArray() ), strHideField: dgvData.dgvFixedHideColumn );
  3135. }
  3136. dgvData.Columns["客户姓名"].Frozen = true;
  3137. Hashtable htCount = new Hashtable();
  3138. for ( int i = 0; i < dtSet.Tables["ds"].Rows.Count; i++ )
  3139. {
  3140. htCount[dtSet.Tables["ds"].Rows[i]["Ord_Number"].ToString().Trim()] = dtSet.Tables["ds"].Rows[i]["Ord_Number"].ToString().Trim();
  3141. }
  3142. Hashtable htData = new Hashtable();
  3143. htData["DataTable"] = newtable;
  3144. htData["TotalCount"] = Convert.ToInt32( dtSet.Tables["ds1"].Rows[0]["CountID"] );
  3145. htData["CurrentCount"] = htCount.Count;
  3146. return htData;
  3147. }
  3148. /// <summary>
  3149. /// 获取订单设计
  3150. /// </summary>
  3151. /// <param name="dgvData"></param>
  3152. /// <param name="dictColumns"></param>
  3153. /// <param name="StrQueryCondition"></param>
  3154. /// <param name="inTopCount"></param>
  3155. /// <param name="StrOrderBy"></param>
  3156. /// <returns></returns>
  3157. public static void GetData_OrderDesignOutSendStatistic( DataGridViewEc dgvData, string StrQueryCondition, string StrOrderBy )
  3158. {
  3159. DataTable newtable = new DataTable();
  3160. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  3161. {
  3162. newtable = LYFZ.BLL.BLL_ErpOrderView.GetData_OrderDesignOutSendStatistic( StrQueryCondition, StrOrderBy );
  3163. } );
  3164. if ( newtable.Rows.Count > 0 )
  3165. {
  3166. dgvData.DataSource( newtable );
  3167. #if old
  3168. if (dgvData.Columns.Contains("欠款"))
  3169. {
  3170. for (int i = 0; i < dgvData.Rows.Count; i++)
  3171. {
  3172. if (!string.IsNullOrEmpty(dgvData.Rows[i].Cells["欠款"].Value.ToString().Trim()))
  3173. {
  3174. if (Convert.ToDecimal(dgvData.Rows[i].Cells["欠款"].Value) > 0)
  3175. { dgvData.Rows[i].DefaultCellStyle.ForeColor = Color.Red; }
  3176. }
  3177. }
  3178. }
  3179. #endif
  3180. }
  3181. dgvData.Columns["客户姓名"].Frozen = true;
  3182. }
  3183. /// <summary>
  3184. /// 获取订单刻盘
  3185. /// </summary>
  3186. /// <param name="dgvData"></param>
  3187. /// <param name="dictColumns"></param>
  3188. /// <param name="StrQueryCondition"></param>
  3189. /// <param name="inTopCount"></param>
  3190. /// <param name="StrOrderBy"></param>
  3191. /// <returns></returns>
  3192. public static Hashtable GetData_OrderKepan( DataGridViewEc dgvData, Dictionary<string, string> dictColumns, string StrQueryCondition, int inTopCount, string StrOrderBy, int pageIndex )
  3193. {
  3194. DataSet dtSet = new DataSet();
  3195. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  3196. {
  3197. dtSet = LYFZ.BLL.BLL_ErpOrderView.GetData_OrderKepan( dictColumns, StrQueryCondition, inTopCount, StrOrderBy, pageIndex );
  3198. } );
  3199. #region 重组DataTable
  3200. DataTable dt = dtSet.Tables["ds"];
  3201. DataTable newtable = new DataTable();
  3202. foreach ( var item in dictColumns )
  3203. {
  3204. if ( dt.Columns.Contains( item.Key.Trim() ) )
  3205. newtable.Columns.Add( item.Key.Trim(), typeof( string ) );
  3206. }
  3207. DataRow newRow = null;
  3208. bool bNewRow = false;
  3209. for ( int i = 0; i < dt.Rows.Count; i++ )
  3210. {
  3211. if ( newRow == null || !newRow["Ordv_ViceNumber"].ToString().Equals( dt.Rows[i]["Ordv_ViceNumber"].ToString() ) )
  3212. {
  3213. newRow = newtable.NewRow();
  3214. bNewRow = true;
  3215. }
  3216. else
  3217. {
  3218. bNewRow = false;
  3219. if ( newtable.Columns.Contains( "拍摄名称" ) )
  3220. {
  3221. if ( newRow["拍摄名称"].ToString() != "" )
  3222. {
  3223. newRow["拍摄名称"] = newRow["拍摄名称"] + ",";
  3224. }
  3225. newRow["拍摄名称"] += dt.Rows[i]["拍摄名称"].ToString().Trim();
  3226. }
  3227. //string photographer = dt.Rows[i]["摄影师"].ToString().Trim();
  3228. //if (!string.IsNullOrEmpty(photographer))
  3229. //{
  3230. // DataRow dtRows = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find(photographer);
  3231. // if (dtRows != null)
  3232. // { photographer = dtRows["User_Name"].ToString().Trim(); }
  3233. // else
  3234. // { photographer = ""; }
  3235. //}
  3236. //if (!string.IsNullOrEmpty(photographer) &&
  3237. // newRow["摄影师"].ToString().IndexOf(photographer) == -1)
  3238. //{
  3239. // if (newRow["摄影师"].ToString() != "")
  3240. // {
  3241. // newRow["摄影师"] = newRow["摄影师"] + ",";
  3242. // }
  3243. // newRow["摄影师"] += photographer;
  3244. //}
  3245. //if (!string.IsNullOrEmpty(dt.Rows[i]["拍摄时间"].ToString().Trim()))
  3246. //{
  3247. // if (newRow["拍摄时间"].ToString_s().Trim() != "")
  3248. // {
  3249. // newRow["拍摄时间"] = LYFZ.BLL.OtherCommonModel.DateTimeToString(dt.Rows[i]["拍摄时间"].ToString().Trim());
  3250. // }
  3251. // else if (Convert.ToDateTime(newRow["拍摄时间"]) < Convert.ToDateTime(dt.Rows[i]["拍摄时间"].ToString().Trim()))
  3252. // {
  3253. // string StrValue = dt.Rows[i]["拍摄时间"].ToString().Trim();
  3254. // StrValue = LYFZ.BLL.OtherCommonModel.DateTimeToString(StrValue);
  3255. // newRow["拍摄时间"] = StrValue;
  3256. // }
  3257. //}
  3258. if ( newtable.Columns.Contains( "拍照状态" ) )
  3259. {
  3260. if ( !string.IsNullOrEmpty( dt.Rows[i]["拍照状态"].ToString().Trim() ) )
  3261. {
  3262. string StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.PhotographyStatusEnum ),
  3263. Convert.ToInt32( dt.Rows[i]["拍照状态"].ToString().Trim() ) ).ToString();
  3264. if ( newRow["拍照状态"].ToString_s() != "拍照中" && newRow["拍照状态"].ToString_s().IndexOf( StrRowValue ) == -1 )
  3265. {
  3266. newRow["拍照状态"] = "拍照中";
  3267. }
  3268. }
  3269. }
  3270. continue;
  3271. }
  3272. //DataRow newRow = newtable.NewRow();
  3273. for ( int j = 0; j < newtable.Columns.Count; j++ )
  3274. {
  3275. string StrRowValue = "";
  3276. switch ( newtable.Columns[j].ColumnName.Trim() )
  3277. {
  3278. case "加急":
  3279. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  3280. if ( !string.IsNullOrEmpty( StrRowValue ) && Convert.ToInt32( StrRowValue ) > 0 )
  3281. {
  3282. StrRowValue = "是";
  3283. }
  3284. else
  3285. {
  3286. StrRowValue = "否";
  3287. }
  3288. break;
  3289. case "取件状态":
  3290. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  3291. if ( !string.IsNullOrEmpty( StrRowValue ) )
  3292. {
  3293. //StrRowValue = Enum.ToObject(typeof(LYFZ.EnumPublic.ProductTakePiecesStatusEnum), Convert.ToInt32(StrRowValue)).ToString();
  3294. switch ( Convert.ToInt32( StrRowValue ) )
  3295. {
  3296. case 0:
  3297. StrRowValue = "未取";
  3298. break;
  3299. case 1:
  3300. StrRowValue = "取件中";
  3301. break;
  3302. case 2:
  3303. StrRowValue = "OK";
  3304. break;
  3305. }
  3306. }
  3307. else
  3308. {
  3309. StrRowValue = "";
  3310. }
  3311. break;
  3312. case "加急日期":
  3313. case "设计日期":
  3314. case "看版日期":
  3315. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  3316. StrRowValue = LYFZ.BLL.OtherCommonModel.DateTimeToString( StrRowValue );
  3317. break;
  3318. case "初修状态":
  3319. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  3320. if ( !string.IsNullOrEmpty( StrRowValue ) )
  3321. {
  3322. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.EarlyRepairStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  3323. }
  3324. else
  3325. {
  3326. StrRowValue = "";
  3327. }
  3328. break;
  3329. case "选片状态":
  3330. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  3331. if ( !string.IsNullOrEmpty( StrRowValue ) )
  3332. {
  3333. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.FilmSelectionStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  3334. }
  3335. else
  3336. {
  3337. StrRowValue = "";
  3338. }
  3339. break;
  3340. case "拍照状态":
  3341. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  3342. if ( !string.IsNullOrEmpty( StrRowValue ) )
  3343. {
  3344. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.PhotographyStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  3345. }
  3346. else
  3347. {
  3348. StrRowValue = "";
  3349. }
  3350. break;
  3351. case "设计状态":
  3352. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  3353. if ( !string.IsNullOrEmpty( StrRowValue ) )
  3354. {
  3355. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.DesignerStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  3356. }
  3357. else
  3358. {
  3359. StrRowValue = "";
  3360. }
  3361. break;
  3362. case "精修状态":
  3363. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  3364. if ( !string.IsNullOrEmpty( StrRowValue ) )
  3365. {
  3366. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.RefinementStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  3367. }
  3368. else
  3369. {
  3370. StrRowValue = "";
  3371. }
  3372. break;
  3373. case "看版状态":
  3374. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  3375. if ( !string.IsNullOrEmpty( StrRowValue ) )
  3376. {
  3377. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.LookDesignStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  3378. }
  3379. else
  3380. {
  3381. StrRowValue = "";
  3382. }
  3383. break;
  3384. case "订单类型":
  3385. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  3386. if ( !string.IsNullOrEmpty( StrRowValue ) )
  3387. {
  3388. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.OrderType ), Convert.ToInt32( StrRowValue ) ).ToString();
  3389. }
  3390. else
  3391. {
  3392. StrRowValue = "";
  3393. }
  3394. break;
  3395. default:
  3396. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  3397. break;
  3398. }
  3399. newRow[newtable.Columns[j].ColumnName.Trim()] = StrRowValue;
  3400. }
  3401. newtable.Rows.Add( newRow );
  3402. }
  3403. #endregion
  3404. BLL.BLL_ErpOrderRemarkRecord bLL_ErpOrderRemark = new BLL.BLL_ErpOrderRemarkRecord();
  3405. DataTable remarkDt = new DataTable();
  3406. string strWhere = "";
  3407. for (int i = 0; i < dt.Rows.Count; i++)
  3408. {
  3409. if (strWhere != "")
  3410. {
  3411. strWhere += ",";
  3412. }
  3413. strWhere += "'" + dt.Rows[i]["Ordv_ViceNumber"].ToString().Trim() + "'";
  3414. }
  3415. if (strWhere != "")
  3416. {
  3417. remarkDt = bLL_ErpOrderRemark.GetList(" Ordrr_ViceNumber in (" + strWhere + ") and Ordrr_ModuleName = '相片刻录' and (Ordrr_Remark is not null and Ordrr_Remark!='' ) ").Tables[0];
  3418. }
  3419. if ( newtable.Rows.Count > 0 )
  3420. {
  3421. dgvData.DataSource( newtable, remarkDt);
  3422. #if old
  3423. if (dgvData.Columns.Contains("欠款"))
  3424. {
  3425. for (int i = 0; i < dgvData.Rows.Count; i++)
  3426. {
  3427. if (!string.IsNullOrEmpty(dgvData.Rows[i].Cells["欠款"].Value.ToString().Trim()))
  3428. {
  3429. if (Convert.ToDecimal(dgvData.Rows[i].Cells["欠款"].Value) > 0)
  3430. { dgvData.Rows[i].DefaultCellStyle.ForeColor = Color.Red; }
  3431. }
  3432. }
  3433. }
  3434. #endif
  3435. }
  3436. else
  3437. {
  3438. dgvData.DataColumns( string.Join( ",", dictColumns.Keys.ToArray() ), strHideField: dgvData.dgvFixedHideColumn );
  3439. }
  3440. dgvData.Columns["客户姓名"].Frozen = true;
  3441. Hashtable htCount = new Hashtable();
  3442. for ( int i = 0; i < dtSet.Tables["ds"].Rows.Count; i++ )
  3443. {
  3444. htCount[dtSet.Tables["ds"].Rows[i]["Ord_Number"].ToString().Trim()] = dtSet.Tables["ds"].Rows[i]["Ord_Number"].ToString().Trim();
  3445. }
  3446. Hashtable htData = new Hashtable();
  3447. htData["DataTable"] = newtable;
  3448. htData["TotalCount"] = Convert.ToInt32( dtSet.Tables["ds1"].Rows[0]["CountID"] );
  3449. htData["CurrentCount"] = htCount.Count;
  3450. return htData;
  3451. }
  3452. /// <summary>
  3453. /// 获取订单相片冲印(分组后的TopCount)
  3454. /// </summary>
  3455. /// <param name="dgvData"></param>
  3456. /// <param name="dictColumns"></param>
  3457. /// <param name="listColumns"></param>
  3458. /// <param name="StrQueryCondition"></param>
  3459. /// <param name="inTopCount"></param>
  3460. /// <param name="StrOrderBy"></param>
  3461. /// <returns></returns>
  3462. public static Hashtable GetData_OrderPhotosPrints( DataGridViewEc dgvData, Dictionary<string, string> dictColumns, List<string> listColumns, string StrQueryCondition, int inTopCount, string StrOrderBy
  3463. , int pageIndex )
  3464. {
  3465. DataSet dtSet = new DataSet();
  3466. Hashtable htData = new Hashtable();
  3467. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  3468. {
  3469. dtSet = LYFZ.BLL.BLL_ErpOrderView.GetData_OrderPhotosPrints( dictColumns, listColumns, StrQueryCondition, inTopCount, StrOrderBy, pageIndex );
  3470. } );
  3471. #region 重组DataTable
  3472. DataTable newtable = new DataTable();
  3473. foreach ( var item in dictColumns )
  3474. {
  3475. if ( dtSet.Tables["ds"].Columns.Contains( item.Key.Trim() ) )
  3476. newtable.Columns.Add( item.Key.Trim(), typeof( string ) );
  3477. }
  3478. if ( dtSet.Tables["ds1"] != null )
  3479. {
  3480. DataTable dt = dtSet.Tables["ds"];
  3481. DataRow newRow = null;
  3482. bool bNewRow = false;
  3483. for ( int i = 0; i < dt.Rows.Count; i++ )
  3484. {
  3485. if ( newRow == null || !newRow["Ordv_ViceNumber"].ToString().Equals( dt.Rows[i]["Ordv_ViceNumber"].ToString() ) )
  3486. {
  3487. newRow = newtable.NewRow();
  3488. bNewRow = true;
  3489. }
  3490. else
  3491. {
  3492. bNewRow = false;
  3493. if ( newtable.Columns.Contains( "拍摄名称" ) )
  3494. {
  3495. if ( newRow["拍摄名称"].ToString() != "" )
  3496. {
  3497. newRow["拍摄名称"] = newRow["拍摄名称"] + ",";
  3498. }
  3499. newRow["拍摄名称"] += dt.Rows[i]["拍摄名称"].ToString().Trim();
  3500. }
  3501. //string photographer = dt.Rows[i]["摄影师"].ToString().Trim();
  3502. //if (!string.IsNullOrEmpty(photographer))
  3503. //{
  3504. // DataRow dtRows = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find(photographer);
  3505. // if (dtRows != null)
  3506. // { photographer = dtRows["User_Name"].ToString().Trim(); }
  3507. // else
  3508. // { photographer = ""; }
  3509. //}
  3510. //if (!string.IsNullOrEmpty(photographer) &&
  3511. // newRow["摄影师"].ToString().IndexOf(photographer) == -1)
  3512. //{
  3513. // if (newRow["摄影师"].ToString() != "")
  3514. // {
  3515. // newRow["摄影师"] = newRow["摄影师"] + ",";
  3516. // }
  3517. // newRow["摄影师"] += photographer;
  3518. //}
  3519. //if (!string.IsNullOrEmpty(dt.Rows[i]["拍摄时间"].ToString().Trim()))
  3520. //{
  3521. // if (newRow["拍摄时间"].ToString_s().Trim() != "")
  3522. // {
  3523. // newRow["拍摄时间"] = LYFZ.BLL.OtherCommonModel.DateTimeToString(dt.Rows[i]["拍摄时间"].ToString().Trim());
  3524. // }
  3525. // else if (Convert.ToDateTime(newRow["拍摄时间"]) < Convert.ToDateTime(dt.Rows[i]["拍摄时间"].ToString().Trim()))
  3526. // {
  3527. // string StrValue = dt.Rows[i]["拍摄时间"].ToString().Trim();
  3528. // StrValue = LYFZ.BLL.OtherCommonModel.DateTimeToString(StrValue);
  3529. // newRow["拍摄时间"] = StrValue;
  3530. // }
  3531. //}
  3532. if ( newtable.Columns.Contains( "拍照状态" ) )
  3533. {
  3534. if ( !string.IsNullOrEmpty( dt.Rows[i]["拍照状态"].ToString().Trim() ) )
  3535. {
  3536. string StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.PhotographyStatusEnum ),
  3537. Convert.ToInt32( dt.Rows[i]["拍照状态"].ToString().Trim() ) ).ToString();
  3538. if ( newRow["拍照状态"].ToString_s() != "拍照中" && newRow["拍照状态"].ToString_s().IndexOf( StrRowValue ) == -1 )
  3539. {
  3540. newRow["拍照状态"] = "拍照中";
  3541. }
  3542. }
  3543. }
  3544. continue;
  3545. }
  3546. for ( int j = 0; j < newtable.Columns.Count; j++ )
  3547. {
  3548. string StrRowValue = "";
  3549. switch ( newtable.Columns[j].ColumnName.Trim() )
  3550. {
  3551. case "加急":
  3552. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  3553. if ( !string.IsNullOrEmpty( StrRowValue ) && Convert.ToInt32( StrRowValue ) > 0 )
  3554. {
  3555. StrRowValue = "是";
  3556. }
  3557. else
  3558. {
  3559. StrRowValue = "否";
  3560. }
  3561. break;
  3562. case "加急日期":
  3563. case "设计日期":
  3564. case "看版日期":
  3565. case "发出日期":
  3566. case "返工日期":
  3567. case "完成日期":
  3568. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  3569. StrRowValue = LYFZ.BLL.OtherCommonModel.DateTimeToString( StrRowValue );
  3570. break;
  3571. case "拍照状态":
  3572. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  3573. if ( !string.IsNullOrEmpty( StrRowValue ) )
  3574. {
  3575. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.PhotographyStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  3576. }
  3577. else
  3578. {
  3579. StrRowValue = "";
  3580. }
  3581. break;
  3582. case "设计状态":
  3583. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  3584. if ( !string.IsNullOrEmpty( StrRowValue ) )
  3585. {
  3586. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.DesignerStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  3587. }
  3588. else
  3589. {
  3590. StrRowValue = "";
  3591. }
  3592. break;
  3593. case "看版状态":
  3594. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  3595. if ( !string.IsNullOrEmpty( StrRowValue ) )
  3596. {
  3597. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.LookDesignStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  3598. }
  3599. else
  3600. {
  3601. StrRowValue = "";
  3602. }
  3603. break;
  3604. case "设计师":
  3605. case "看版师":
  3606. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  3607. if ( !string.IsNullOrEmpty( StrRowValue ) )
  3608. {
  3609. DataRow dtRows = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrRowValue );
  3610. if ( dtRows != null )
  3611. {
  3612. StrRowValue = dtRows["User_Name"].ToString().Trim();
  3613. }
  3614. else
  3615. {
  3616. StrRowValue = "";
  3617. }
  3618. }
  3619. break;
  3620. case "订单类型":
  3621. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  3622. if ( !string.IsNullOrEmpty( StrRowValue ) )
  3623. {
  3624. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.OrderType ), Convert.ToInt32( StrRowValue ) ).ToString();
  3625. }
  3626. else
  3627. {
  3628. StrRowValue = "";
  3629. }
  3630. break;
  3631. case "取件状态":
  3632. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  3633. if ( !string.IsNullOrEmpty( StrRowValue ) )
  3634. {
  3635. //StrRowValue = Enum.ToObject(typeof(LYFZ.EnumPublic.ProductTakePiecesStatusEnum), Convert.ToInt32(StrRowValue)).ToString();
  3636. switch ( Convert.ToInt32( StrRowValue ) )
  3637. {
  3638. case 0:
  3639. StrRowValue = "未取";
  3640. break;
  3641. case 1:
  3642. StrRowValue = "取件中";
  3643. break;
  3644. case 2:
  3645. StrRowValue = "OK";
  3646. break;
  3647. }
  3648. }
  3649. else
  3650. {
  3651. StrRowValue = "";
  3652. }
  3653. break;
  3654. case "返工状态":
  3655. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  3656. if ( !string.IsNullOrEmpty( StrRowValue ) )
  3657. {
  3658. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.PhotoPrintsReworkStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  3659. }
  3660. else
  3661. {
  3662. StrRowValue = "";
  3663. }
  3664. break;
  3665. case "完成状态":
  3666. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  3667. if ( !string.IsNullOrEmpty( StrRowValue ) )
  3668. {
  3669. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.PhotoPrintsCompletedStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  3670. }
  3671. else
  3672. {
  3673. StrRowValue = "";
  3674. }
  3675. break;
  3676. default:
  3677. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  3678. break;
  3679. }
  3680. newRow[newtable.Columns[j].ColumnName.Trim()] = StrRowValue;
  3681. }
  3682. newtable.Rows.Add( newRow );
  3683. }
  3684. Hashtable htCount = new Hashtable();
  3685. for ( int i = 0; i < dt.Rows.Count; i++ )
  3686. {
  3687. htCount[dt.Rows[i]["Ord_Number"].ToString().Trim()] = dt.Rows[i]["Ord_Number"].ToString().Trim();
  3688. }
  3689. htData["DataTable"] = newtable;
  3690. htData["TotalCount"] = Convert.ToInt32( dtSet.Tables["ds1"].Rows[0]["CountID"] );
  3691. htData["CurrentCount"] = htCount.Count;
  3692. }
  3693. else
  3694. {
  3695. htData["DataTable"] = new DataTable();
  3696. htData["TotalCount"] = Convert.ToInt32( dtSet.Tables["ds"].Rows[0]["CountID"] );
  3697. htData["CurrentCount"] = 0;
  3698. }
  3699. #endregion
  3700. BLL.BLL_ErpOrderRemarkRecord bLL_ErpOrderRemark = new BLL.BLL_ErpOrderRemarkRecord();
  3701. DataTable remarkDt = new DataTable();
  3702. string strWhere = "";
  3703. for (int i = 0; i < newtable.Rows.Count; i++)
  3704. {
  3705. if (strWhere != "")
  3706. {
  3707. strWhere += ",";
  3708. }
  3709. strWhere += "'" + newtable.Rows[i]["Ordv_ViceNumber"].ToString().Trim() + "'";
  3710. }
  3711. if (strWhere != "")
  3712. {
  3713. remarkDt = bLL_ErpOrderRemark.GetList(" Ordrr_ViceNumber in (" + strWhere + ") and Ordrr_ModuleName = '相片冲印' and (Ordrr_Remark is not null and Ordrr_Remark!='' ) ").Tables[0];
  3714. }
  3715. if ( newtable.Rows.Count > 0 )
  3716. {
  3717. dgvData.DataSource( newtable, remarkDt, StrSecondStageNull: dgvData.StrSecondStageNull );
  3718. if ( dgvData.Columns.Contains( "欠款" ) )
  3719. {
  3720. for ( int i = 0; i < dgvData.Rows.Count; i++ )
  3721. {
  3722. if ( !string.IsNullOrEmpty( dgvData.Rows[i].Cells["欠款"].Value.ToString().Trim() ) )
  3723. {
  3724. if ( Convert.ToDecimal( dgvData.Rows[i].Cells["欠款"].Value ) > 0 )
  3725. {
  3726. dgvData.Rows[i].DefaultCellStyle.ForeColor = Color.Red;
  3727. }
  3728. }
  3729. }
  3730. }
  3731. }
  3732. else
  3733. {
  3734. dgvData.DataColumns( string.Join( ",", dictColumns.Keys.ToArray() ), strHideField: dgvData.dgvFixedHideColumn );
  3735. }
  3736. dgvData.Columns["客户姓名"].Frozen = true;
  3737. return htData;
  3738. }
  3739. /// <summary>
  3740. /// 获取订单发片取件(分组后的TopCount)
  3741. /// </summary>
  3742. /// <param name="dgvData"></param>
  3743. /// <param name="dictColumns"></param>
  3744. /// <param name="listColumns"></param>
  3745. /// <param name="StrQueryCondition"></param>
  3746. /// <param name="inTopCount"></param>
  3747. /// <param name="StrOrderBy"></param>
  3748. /// <returns></returns>
  3749. public static Hashtable GetData_OrderTotakePiece( DataGridViewEc dgvData, Dictionary<string, string> dictColumns, List<string> listColumns, string StrQueryCondition, int inTopCount,
  3750. string StrOrderBy, int pageIndex )
  3751. {
  3752. DataSet dtSet = new DataSet();
  3753. Hashtable htData = new Hashtable();
  3754. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  3755. {
  3756. dtSet = LYFZ.BLL.BLL_ErpOrderView.GetData_OrderTotakePiece( dictColumns, listColumns, StrQueryCondition, inTopCount, StrOrderBy, pageIndex );
  3757. } );
  3758. #region 重组DataTable
  3759. DataTable newtable = new DataTable();
  3760. foreach ( var item in dictColumns )
  3761. {
  3762. if ( dtSet.Tables["ds"].Columns.Contains( item.Key.Trim() ) )
  3763. newtable.Columns.Add( item.Key.Trim(), typeof( string ) );
  3764. }
  3765. if ( dtSet.Tables["ds1"] != null )
  3766. {
  3767. DataTable dt = dtSet.Tables["ds"];
  3768. DataRow newRow = null;
  3769. bool bNewRow = false;
  3770. List<string> strProductList = null;
  3771. for ( int i = 0; i < dt.Rows.Count; i++ )
  3772. {
  3773. //newRow = newtable.NewRow();
  3774. if ( newRow == null || !newRow["Ordv_ViceNumber"].ToString().Equals( dt.Rows[i]["Ordv_ViceNumber"].ToString() ) )
  3775. {
  3776. newRow = newtable.NewRow();
  3777. strProductList = new List<string>();
  3778. bNewRow = true;
  3779. }
  3780. else
  3781. {
  3782. bNewRow = false;
  3783. if ( newtable.Columns.Contains( "拍摄名称" ) )
  3784. {
  3785. if ( newRow["拍摄名称"].ToString_s().IndexOf( dt.Rows[i]["拍摄名称"].ToString().Trim() ) == -1 )
  3786. {
  3787. if ( newRow["拍摄名称"].ToString() != "" )
  3788. {
  3789. newRow["拍摄名称"] = newRow["拍摄名称"] + ",";
  3790. }
  3791. newRow["拍摄名称"] += dt.Rows[i]["拍摄名称"].ToString().Trim();
  3792. }
  3793. }
  3794. string strProductListID = dt.Rows[i]["ProductListID"].ToString().Trim();
  3795. if ( strProductList.Find( p => p.ToString_s() == strProductListID ) == null )
  3796. {
  3797. strProductList.Add( strProductListID );
  3798. DataRow tempNewRow = newtable.NewRow();
  3799. tempNewRow["Ord_Number"] = dt.Rows[i]["Ord_Number"].ToString().Trim();
  3800. //tempNewRow["ProductListID"] = dt.Rows[i]["ProductListID"].ToString().Trim();
  3801. tempNewRow["Ordv_ViceNumber"] = dt.Rows[i]["Ordv_ViceNumber"].ToString().Trim();
  3802. tempNewRow["Ord_Type"] = dt.Rows[i]["Ord_Type"].ToString().Trim();
  3803. if ( newtable.Columns.Contains( "欠款" ) )
  3804. {
  3805. tempNewRow["欠款"] = "0";
  3806. }
  3807. if ( newtable.Columns.Contains( "商品名称" ) )
  3808. {
  3809. tempNewRow["商品名称"] = dt.Rows[i]["商品名称"].ToString().Trim();
  3810. }
  3811. if ( newtable.Columns.Contains( "加急" ) )
  3812. {
  3813. tempNewRow["加急"] = dt.Rows[i]["加急"].ToString().Trim();
  3814. }
  3815. if ( newtable.Columns.Contains( "预约取件日期" ) )
  3816. {
  3817. tempNewRow["预约取件日期"] = dt.Rows[i]["预约取件日期"].ToString().Trim();
  3818. }
  3819. if ( newtable.Columns.Contains( "商品取走日期" ) )
  3820. {
  3821. tempNewRow["商品取走日期"] = dt.Rows[i]["商品取走日期"].ToString().Trim();
  3822. }
  3823. if ( newtable.Columns.Contains( "是否发出" ) )
  3824. {
  3825. tempNewRow["是否发出"] = dt.Rows[i]["是否发出"].ToString().Trim();
  3826. }
  3827. if ( newtable.Columns.Contains( "是否返工" ) )
  3828. {
  3829. tempNewRow["是否返工"] = dt.Rows[i]["是否返工"].ToString().Trim();
  3830. if ( !string.IsNullOrEmpty( tempNewRow["是否返工"].ToString_s() ) )
  3831. {
  3832. tempNewRow["是否返工"] = Enum.ToObject( typeof( LYFZ.EnumPublic.ProductReworkStatusEnum ), Convert.ToInt32( tempNewRow["是否返工"] ) ).ToString();
  3833. }
  3834. else
  3835. {
  3836. tempNewRow["是否返工"] = "";
  3837. }
  3838. }
  3839. if ( newtable.Columns.Contains( "商品完成状态" ) )
  3840. {
  3841. tempNewRow["商品完成状态"] = dt.Rows[i]["商品完成状态"].ToString().Trim();
  3842. if ( !string.IsNullOrEmpty( tempNewRow["商品完成状态"].ToString_s() ) )
  3843. {
  3844. tempNewRow["商品完成状态"] = Enum.ToObject( typeof( LYFZ.EnumPublic.ProductCompletedStatusEnum ), Convert.ToInt32( tempNewRow["商品完成状态"].ToString_s() ) ).ToString();
  3845. }
  3846. else
  3847. {
  3848. tempNewRow["商品完成状态"] = "";
  3849. }
  3850. }
  3851. if ( newtable.Columns.Contains( "是否取走" ) )
  3852. {
  3853. tempNewRow["是否取走"] = dt.Rows[i]["是否取走"].ToString().Trim();
  3854. if ( !string.IsNullOrEmpty( tempNewRow["是否取走"].ToString_s() ) )
  3855. {
  3856. tempNewRow["是否取走"] = Enum.ToObject( typeof( LYFZ.EnumPublic.ProductTakePiecesStatusEnum ), Convert.ToInt32( tempNewRow["是否取走"].ToString_s() ) ).ToString();
  3857. }
  3858. else
  3859. {
  3860. tempNewRow["是否取走"] = "";
  3861. }
  3862. }
  3863. newtable.Rows.Add( tempNewRow );
  3864. }
  3865. //string photographer = dt.Rows[i]["摄影师"].ToString().Trim();
  3866. //if (!string.IsNullOrEmpty(photographer))
  3867. //{
  3868. // DataRow dtRows = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find(photographer);
  3869. // if (dtRows != null)
  3870. // { photographer = dtRows["User_Name"].ToString().Trim(); }
  3871. // else
  3872. // { photographer = ""; }
  3873. //}
  3874. //if (!string.IsNullOrEmpty(photographer) &&
  3875. // newRow["摄影师"].ToString().IndexOf(photographer) == -1)
  3876. //{
  3877. // if (newRow["摄影师"].ToString() != "")
  3878. // {
  3879. // newRow["摄影师"] = newRow["摄影师"] + ",";
  3880. // }
  3881. // newRow["摄影师"] += photographer;
  3882. //}
  3883. //if (!string.IsNullOrEmpty(dt.Rows[i]["拍摄时间"].ToString().Trim()))
  3884. //{
  3885. // if (newRow["拍摄时间"].ToString_s().Trim() != "")
  3886. // {
  3887. // newRow["拍摄时间"] = LYFZ.BLL.OtherCommonModel.DateTimeToString(dt.Rows[i]["拍摄时间"].ToString().Trim());
  3888. // }
  3889. // else if (Convert.ToDateTime(newRow["拍摄时间"]) < Convert.ToDateTime(dt.Rows[i]["拍摄时间"].ToString().Trim()))
  3890. // {
  3891. // string StrValue = dt.Rows[i]["拍摄时间"].ToString().Trim();
  3892. // StrValue = LYFZ.BLL.OtherCommonModel.DateTimeToString(StrValue);
  3893. // newRow["拍摄时间"] = StrValue;
  3894. // }
  3895. //}
  3896. if ( newtable.Columns.Contains( "拍照状态" ) )
  3897. {
  3898. if ( !string.IsNullOrEmpty( dt.Rows[i]["拍照状态"].ToString().Trim() ) )
  3899. {
  3900. string StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.PhotographyStatusEnum ),
  3901. Convert.ToInt32( dt.Rows[i]["拍照状态"].ToString().Trim() ) ).ToString();
  3902. if ( newRow["拍照状态"].ToString_s() != "拍照中" && newRow["拍照状态"].ToString_s().IndexOf( StrRowValue ) == -1 )
  3903. {
  3904. newRow["拍照状态"] = "拍照中";
  3905. }
  3906. }
  3907. }
  3908. continue;
  3909. }
  3910. strProductList.Add( dt.Rows[i]["ProductListID"].ToString().Trim() );
  3911. for ( int j = 0; j < newtable.Columns.Count; j++ )
  3912. {
  3913. string StrRowValue = "";
  3914. switch ( newtable.Columns[j].ColumnName.Trim() )
  3915. {
  3916. case "拍照状态":
  3917. if ( dt.Rows[i]["拍照状态"].ToString() != "" )
  3918. {
  3919. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.PhotographyStatusEnum ),
  3920. Convert.ToInt32( dt.Rows[i]["拍照状态"].ToString().Trim() ) ).ToString();
  3921. }
  3922. break;
  3923. case "取件状态":
  3924. string tempValue1 = dt.Rows[i]["取件状态"].ToString();
  3925. if ( tempValue1 == "0" )
  3926. {
  3927. StrRowValue = "未取件";
  3928. }
  3929. else if ( tempValue1 == "1" )
  3930. {
  3931. StrRowValue = "部分取件";
  3932. }
  3933. else if ( tempValue1 == "2" )
  3934. {
  3935. StrRowValue = "OK";
  3936. }
  3937. break;
  3938. case "是否完成":
  3939. string tempValue = dt.Rows[i]["是否完成"].ToString();
  3940. if ( tempValue == "0" )
  3941. {
  3942. StrRowValue = "未完成";
  3943. }
  3944. else if ( tempValue == "1" )
  3945. {
  3946. StrRowValue = "部分完成";
  3947. }
  3948. else if ( tempValue == "2" )
  3949. {
  3950. StrRowValue = "OK";
  3951. }
  3952. break;
  3953. case "设计日期":
  3954. case "看版日期":
  3955. case "预约取件日期":
  3956. case "商品取走日期":
  3957. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  3958. StrRowValue = LYFZ.BLL.OtherCommonModel.DateTimeToString( StrRowValue );
  3959. break;
  3960. case "设计状态":
  3961. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  3962. if ( !string.IsNullOrEmpty( StrRowValue ) )
  3963. {
  3964. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.DesignerStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  3965. }
  3966. else
  3967. {
  3968. StrRowValue = "";
  3969. }
  3970. break;
  3971. case "看版状态":
  3972. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  3973. if ( !string.IsNullOrEmpty( StrRowValue ) )
  3974. {
  3975. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.LookDesignStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  3976. }
  3977. else
  3978. {
  3979. StrRowValue = "";
  3980. }
  3981. break;
  3982. case "商品完成状态":
  3983. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  3984. if ( !string.IsNullOrEmpty( StrRowValue ) )
  3985. {
  3986. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.ProductCompletedStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  3987. }
  3988. else
  3989. {
  3990. StrRowValue = "";
  3991. }
  3992. break;
  3993. case "是否取走":
  3994. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  3995. if ( !string.IsNullOrEmpty( StrRowValue ) )
  3996. {
  3997. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.ProductTakePiecesStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  3998. }
  3999. else
  4000. {
  4001. StrRowValue = "";
  4002. }
  4003. break;
  4004. case "是否返工":
  4005. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  4006. if ( !string.IsNullOrEmpty( StrRowValue ) )
  4007. {
  4008. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.ProductReworkStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  4009. }
  4010. else
  4011. {
  4012. StrRowValue = "";
  4013. }
  4014. break;
  4015. case "设计师":
  4016. case "看版师":
  4017. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  4018. if ( !string.IsNullOrEmpty( StrRowValue ) )
  4019. {
  4020. DataRow dtRows = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrRowValue );
  4021. if ( dtRows != null )
  4022. {
  4023. StrRowValue = dtRows["User_Name"].ToString().Trim();
  4024. }
  4025. else
  4026. {
  4027. StrRowValue = "";
  4028. }
  4029. }
  4030. break;
  4031. case "订单类型":
  4032. case "Ord_Type":
  4033. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  4034. if ( !string.IsNullOrEmpty( StrRowValue ) )
  4035. {
  4036. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.OrderType ), Convert.ToInt32( StrRowValue ) ).ToString();
  4037. }
  4038. else
  4039. {
  4040. StrRowValue = "";
  4041. }
  4042. break;
  4043. default:
  4044. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  4045. break;
  4046. }
  4047. newRow[newtable.Columns[j].ColumnName.Trim()] = StrRowValue;
  4048. }
  4049. newtable.Rows.Add( newRow );
  4050. }
  4051. Hashtable htCount = new Hashtable();
  4052. for ( int i = 0; i < dt.Rows.Count; i++ )
  4053. {
  4054. htCount[dt.Rows[i]["Ord_Number"].ToString().Trim()] = dt.Rows[i]["Ord_Number"].ToString().Trim();
  4055. }
  4056. htData["DataTable"] = newtable;
  4057. htData["TotalCount"] = Convert.ToInt32( dtSet.Tables["ds1"].Rows[0]["CountID"] );
  4058. htData["CurrentCount"] = htCount.Count;
  4059. }
  4060. else
  4061. {
  4062. htData["DataTable"] = new DataTable();
  4063. htData["TotalCount"] = Convert.ToInt32( dtSet.Tables["ds"].Rows[0]["CountID"] );
  4064. htData["CurrentCount"] = 0;
  4065. }
  4066. #endregion
  4067. BLL.BLL_ErpOrderRemarkRecord bLL_ErpOrderRemark = new BLL.BLL_ErpOrderRemarkRecord();
  4068. DataTable remarkDt = new DataTable();
  4069. string strWhere = "";
  4070. for (int i = 0; i < newtable.Rows.Count; i++)
  4071. {
  4072. if (strWhere != "")
  4073. {
  4074. strWhere += ",";
  4075. }
  4076. strWhere += "'" + newtable.Rows[i]["Ordv_ViceNumber"].ToString().Trim() + "'";
  4077. }
  4078. if (strWhere != "")
  4079. {
  4080. remarkDt = bLL_ErpOrderRemark.GetList(" Ordrr_ViceNumber in (" + strWhere + ") and Ordrr_ModuleName = '发片取件' and (Ordrr_Remark is not null and Ordrr_Remark!='' ) ").Tables[0];
  4081. }
  4082. if ( newtable.Rows.Count > 0 )
  4083. {
  4084. dgvData.UseVirtualMode( newtable, remarkDt, strSecondStageNull: dgvData.StrSecondStageNull );
  4085. #if old
  4086. dgvData.DataSource(newtable, StrSecondStageNull: dgvData.StrSecondStageNull);
  4087. if (dgvData.Columns.Contains("欠款"))
  4088. {
  4089. for (int i = 0; i < dgvData.Rows.Count; i++)
  4090. {
  4091. if (!string.IsNullOrEmpty(dgvData.Rows[i].Cells["欠款"].Value.ToString().Trim()))
  4092. {
  4093. if (Convert.ToDecimal(dgvData.Rows[i].Cells["欠款"].Value) > 0)
  4094. { dgvData.Rows[i].DefaultCellStyle.ForeColor = Color.Red; }
  4095. }
  4096. }
  4097. }
  4098. #endif
  4099. }
  4100. else
  4101. {
  4102. dgvData.DataColumns( string.Join( ",", dictColumns.Keys.ToArray() ), strHideField: dgvData.dgvFixedHideColumn );
  4103. }
  4104. dgvData.Columns["客户姓名"].Frozen = true;
  4105. return htData;
  4106. }
  4107. /// <summary>
  4108. /// 部分取件订单;
  4109. /// </summary>
  4110. /// <param name="dgvData"></param>
  4111. /// <param name="dictColumns"></param>
  4112. /// <param name="listColumns"></param>
  4113. /// <param name="StrQueryCondition"></param>
  4114. /// <param name="inTopCount"></param>
  4115. /// <param name="StrOrderBy"></param>
  4116. /// <returns></returns>
  4117. public static Hashtable GetData_OrderPartTakenPiece( DataGridViewEc dgvData, Dictionary<string, string> dictColumns, List<string> listColumns, string StrQueryCondition, string strPublicQueryString, int inTopCount,
  4118. string StrOrderBy, int pageIndex )
  4119. {
  4120. DataSet dtSet = new DataSet();
  4121. Hashtable htData = new Hashtable();
  4122. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  4123. {
  4124. dtSet = LYFZ.BLL.BLL_ErpOrderView.GetData_OrderPartTakenPiece( dictColumns, listColumns, StrQueryCondition, strPublicQueryString, inTopCount, StrOrderBy, pageIndex );
  4125. } );
  4126. #region 重组DataTable
  4127. DataTable newtable = new DataTable();
  4128. foreach ( var item in dictColumns )
  4129. {
  4130. if ( dtSet.Tables["ds"].Columns.Contains( item.Key.Trim() ) )
  4131. newtable.Columns.Add( item.Key.Trim(), typeof( string ) );
  4132. }
  4133. if ( dtSet.Tables["ds1"] != null )
  4134. {
  4135. DataTable dt = dtSet.Tables["ds"];
  4136. for ( int i = 0; i < dt.Rows.Count; i++ )
  4137. {
  4138. DataRow newRow = newtable.NewRow();
  4139. for ( int j = 0; j < newtable.Columns.Count; j++ )
  4140. {
  4141. string StrRowValue = "";
  4142. switch ( newtable.Columns[j].ColumnName.Trim() )
  4143. {
  4144. case "设计日期":
  4145. case "看版日期":
  4146. case "预约取件日期":
  4147. case "商品取走日期":
  4148. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  4149. StrRowValue = LYFZ.BLL.OtherCommonModel.DateTimeToString( StrRowValue );
  4150. break;
  4151. case "设计状态":
  4152. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  4153. if ( !string.IsNullOrEmpty( StrRowValue ) )
  4154. {
  4155. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.DesignerStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  4156. }
  4157. else
  4158. {
  4159. StrRowValue = "";
  4160. }
  4161. break;
  4162. case "看版状态":
  4163. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  4164. if ( !string.IsNullOrEmpty( StrRowValue ) )
  4165. {
  4166. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.LookDesignStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  4167. }
  4168. else
  4169. {
  4170. StrRowValue = "";
  4171. }
  4172. break;
  4173. case "商品完成状态":
  4174. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  4175. if ( !string.IsNullOrEmpty( StrRowValue ) )
  4176. {
  4177. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.ProductCompletedStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  4178. }
  4179. else
  4180. {
  4181. StrRowValue = "";
  4182. }
  4183. break;
  4184. case "是否取走":
  4185. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  4186. if ( !string.IsNullOrEmpty( StrRowValue ) )
  4187. {
  4188. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.ProductTakePiecesStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  4189. }
  4190. else
  4191. {
  4192. StrRowValue = "";
  4193. }
  4194. break;
  4195. case "是否返工":
  4196. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  4197. if ( !string.IsNullOrEmpty( StrRowValue ) )
  4198. {
  4199. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.ProductReworkStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  4200. }
  4201. else
  4202. {
  4203. StrRowValue = "";
  4204. }
  4205. break;
  4206. case "设计师":
  4207. case "看版师":
  4208. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  4209. if ( !string.IsNullOrEmpty( StrRowValue ) )
  4210. {
  4211. DataRow dtRows = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrRowValue );
  4212. if ( dtRows != null )
  4213. {
  4214. StrRowValue = dtRows["User_Name"].ToString().Trim();
  4215. }
  4216. else
  4217. {
  4218. StrRowValue = "";
  4219. }
  4220. }
  4221. break;
  4222. case "订单类型":
  4223. case "Ord_Type":
  4224. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  4225. if ( !string.IsNullOrEmpty( StrRowValue ) )
  4226. {
  4227. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.OrderType ), Convert.ToInt32( StrRowValue ) ).ToString();
  4228. }
  4229. else
  4230. {
  4231. StrRowValue = "";
  4232. }
  4233. break;
  4234. default:
  4235. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  4236. break;
  4237. }
  4238. newRow[newtable.Columns[j].ColumnName.Trim()] = StrRowValue;
  4239. }
  4240. newtable.Rows.Add( newRow );
  4241. }
  4242. Hashtable htCount = new Hashtable();
  4243. for ( int i = 0; i < dt.Rows.Count; i++ )
  4244. {
  4245. htCount[dt.Rows[i]["Ord_Number"].ToString().Trim()] = dt.Rows[i]["Ord_Number"].ToString().Trim();
  4246. }
  4247. htData["DataTable"] = newtable;
  4248. htData["TotalCount"] = Convert.ToInt32( dtSet.Tables["ds1"].Rows[0]["CountID"] );
  4249. htData["CurrentCount"] = htCount.Count;
  4250. }
  4251. else
  4252. {
  4253. htData["DataTable"] = new DataTable();
  4254. htData["TotalCount"] = Convert.ToInt32( dtSet.Tables["ds"].Rows[0]["CountID"] );
  4255. htData["CurrentCount"] = 0;
  4256. }
  4257. #endregion
  4258. if ( newtable.Rows.Count > 0 )
  4259. {
  4260. dgvData.UseVirtualMode( newtable, strSecondStageNull: dgvData.StrSecondStageNull );
  4261. #if old
  4262. dgvData.DataSource(newtable, StrSecondStageNull: dgvData.StrSecondStageNull);
  4263. if (dgvData.Columns.Contains("欠款"))
  4264. {
  4265. for (int i = 0; i < dgvData.Rows.Count; i++)
  4266. {
  4267. if (!string.IsNullOrEmpty(dgvData.Rows[i].Cells["欠款"].Value.ToString().Trim()))
  4268. {
  4269. if (Convert.ToDecimal(dgvData.Rows[i].Cells["欠款"].Value) > 0)
  4270. { dgvData.Rows[i].DefaultCellStyle.ForeColor = Color.Red; }
  4271. }
  4272. }
  4273. }
  4274. #endif
  4275. }
  4276. else
  4277. {
  4278. dgvData.DataColumns( string.Join( ",", dictColumns.Keys.ToArray() ), strHideField: dgvData.dgvFixedHideColumn );
  4279. }
  4280. dgvData.Columns["客户姓名"].Frozen = true;
  4281. return htData;
  4282. }
  4283. /// <summary>
  4284. /// 获取订单发片取件(分组后的TopCount)
  4285. /// </summary>
  4286. /// <param name="dgvData"></param>
  4287. /// <param name="dictColumns"></param>
  4288. /// <param name="listColumns"></param>
  4289. /// <param name="StrQueryCondition"></param>
  4290. /// <param name="inTopCount"></param>
  4291. /// <param name="StrOrderBy"></param>
  4292. /// <returns></returns>
  4293. public static Hashtable GetData_OrderTotakePiece( Dictionary<string, string> dictColumns, List<string> listColumns, string StrQueryCondition, int inTopCount, string StrOrderBy )
  4294. {
  4295. DataSet dtSet = new DataSet();
  4296. Hashtable htData = new Hashtable();
  4297. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  4298. {
  4299. dtSet = LYFZ.BLL.BLL_ErpOrderView.GetData_OrderTotakePiece( dictColumns, listColumns, StrQueryCondition, inTopCount, StrOrderBy, 1 );
  4300. } );
  4301. #region 重组DataTable
  4302. DataTable newtable = new DataTable();
  4303. foreach ( var item in dictColumns )
  4304. {
  4305. if ( dtSet.Tables["ds"].Columns.Contains( item.Key.Trim() ) )
  4306. newtable.Columns.Add( item.Key.Trim(), typeof( string ) );
  4307. }
  4308. if ( dtSet.Tables["ds1"] != null )
  4309. {
  4310. DataTable dt = dtSet.Tables["ds"];
  4311. for ( int i = 0; i < dt.Rows.Count; i++ )
  4312. {
  4313. DataRow newRow = newtable.NewRow();
  4314. for ( int j = 0; j < newtable.Columns.Count; j++ )
  4315. {
  4316. string StrRowValue = "";
  4317. switch ( newtable.Columns[j].ColumnName.Trim() )
  4318. {
  4319. case "设计日期":
  4320. case "看版日期":
  4321. case "预约取件日期":
  4322. case "商品取走日期":
  4323. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  4324. StrRowValue = LYFZ.BLL.OtherCommonModel.DateTimeToString( StrRowValue );
  4325. break;
  4326. case "设计状态":
  4327. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  4328. if ( !string.IsNullOrEmpty( StrRowValue ) )
  4329. {
  4330. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.DesignerStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  4331. }
  4332. else
  4333. {
  4334. StrRowValue = "";
  4335. }
  4336. break;
  4337. case "看版状态":
  4338. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  4339. if ( !string.IsNullOrEmpty( StrRowValue ) )
  4340. {
  4341. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.LookDesignStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  4342. }
  4343. else
  4344. {
  4345. StrRowValue = "";
  4346. }
  4347. break;
  4348. case "商品完成状态":
  4349. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  4350. if ( !string.IsNullOrEmpty( StrRowValue ) )
  4351. {
  4352. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.ProductCompletedStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  4353. }
  4354. else
  4355. {
  4356. StrRowValue = "";
  4357. }
  4358. break;
  4359. case "是否取走":
  4360. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  4361. if ( !string.IsNullOrEmpty( StrRowValue ) )
  4362. {
  4363. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.ProductTakePiecesStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  4364. }
  4365. else
  4366. {
  4367. StrRowValue = "";
  4368. }
  4369. break;
  4370. case "是否返工":
  4371. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  4372. if ( !string.IsNullOrEmpty( StrRowValue ) )
  4373. {
  4374. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.ProductReworkStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  4375. }
  4376. else
  4377. {
  4378. StrRowValue = "";
  4379. }
  4380. break;
  4381. case "设计师":
  4382. case "看版师":
  4383. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  4384. if ( !string.IsNullOrEmpty( StrRowValue ) )
  4385. {
  4386. DataRow dtRows = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrRowValue );
  4387. if ( dtRows != null )
  4388. {
  4389. StrRowValue = dtRows["User_Name"].ToString().Trim();
  4390. }
  4391. else
  4392. {
  4393. StrRowValue = "";
  4394. }
  4395. }
  4396. break;
  4397. case "订单类型":
  4398. case "Ord_Type":
  4399. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  4400. if ( !string.IsNullOrEmpty( StrRowValue ) )
  4401. {
  4402. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.OrderType ), Convert.ToInt32( StrRowValue ) ).ToString();
  4403. }
  4404. else
  4405. {
  4406. StrRowValue = "";
  4407. }
  4408. break;
  4409. default:
  4410. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  4411. break;
  4412. }
  4413. newRow[newtable.Columns[j].ColumnName.Trim()] = StrRowValue;
  4414. }
  4415. newtable.Rows.Add( newRow );
  4416. }
  4417. Hashtable htCount = new Hashtable();
  4418. for ( int i = 0; i < dt.Rows.Count; i++ )
  4419. {
  4420. htCount[dt.Rows[i]["Ord_Number"].ToString().Trim()] = dt.Rows[i]["Ord_Number"].ToString().Trim();
  4421. }
  4422. string ordNumber = "";
  4423. foreach ( DataRow dr in newtable.Rows )
  4424. {
  4425. if ( ordNumber != dr["Ordv_ViceNumber"].ToString() )
  4426. {
  4427. ordNumber = dr["Ordv_ViceNumber"].ToString();
  4428. continue;
  4429. }
  4430. else
  4431. {
  4432. dr["Ord_Number"] = "";
  4433. dr["Ordv_ViceNumber"] = "";
  4434. dr["订单号"] = "";
  4435. dr["客户姓名"] = "";
  4436. dr["客户性别"] = "";
  4437. dr["客户电话"] = "";
  4438. dr["订单类型"] = "";
  4439. dr["接单人"] = "";
  4440. dr["套系名称"] = "";
  4441. dr["套系价格"] = "";
  4442. dr["欠款"] = "";
  4443. dr["拍摄名称"] = "";
  4444. dr["取件状态"] = "";
  4445. dr["拍照状态"] = "";
  4446. dr["设计状态"] = "";
  4447. dr["设计师"] = "";
  4448. dr["设计日期"] = "";
  4449. dr["看版状态"] = "";
  4450. dr["看版师"] = "";
  4451. dr["看版日期"] = "";
  4452. dr["是否完成"] = "";
  4453. }
  4454. }
  4455. htData["DataTable"] = newtable;
  4456. htData["TotalCount"] = Convert.ToInt32( dtSet.Tables["ds1"].Rows[0]["CountID"] );
  4457. htData["CurrentCount"] = htCount.Count;
  4458. }
  4459. else
  4460. {
  4461. htData["DataTable"] = new DataTable();
  4462. htData["TotalCount"] = Convert.ToInt32( dtSet.Tables["ds"].Rows[0]["CountID"] );
  4463. htData["CurrentCount"] = 0;
  4464. }
  4465. #endregion
  4466. return htData;
  4467. }
  4468. /// <summary>
  4469. /// 获取订单数码安排
  4470. /// </summary>
  4471. /// <param name="dgvData"></param>
  4472. /// <param name="dictColumns"></param>
  4473. /// <param name="StrQueryCondition"></param>
  4474. /// <param name="StrQueryCondition2"></param>
  4475. /// <param name="inTopCount"></param>
  4476. /// <param name="StrOrderBy"></param>
  4477. /// <returns></returns>
  4478. public static Hashtable GetData_OrderDigitalArrange( DataGridViewEc dgvData, Dictionary<string, string> dictColumns, string StrQueryCondition, int inTopCount, string StrOrderBy, int pageIndex )
  4479. {
  4480. DataSet dtSet = new DataSet();
  4481. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  4482. {
  4483. dtSet = LYFZ.BLL.BLL_ErpOrderView.GetData_OrderDigitalArrange( dictColumns, StrQueryCondition, inTopCount, StrOrderBy, pageIndex );
  4484. } );
  4485. return GetData_ReplaceDigitalArrange( dgvData, dictColumns, dtSet.Tables["ds"], Convert.ToInt32( dtSet.Tables["ds1"].Rows[0]["CountID"] ) );
  4486. //#region 重组DataTable
  4487. //DataTable dt = dtSet.Tables["ds"];
  4488. //DataTable newtable = new DataTable();
  4489. //foreach (var item in dictColumns)
  4490. //{
  4491. // if (dt.Columns.Contains(item.Key.Trim()))
  4492. // newtable.Columns.Add(item.Key.Trim(), typeof(string));
  4493. //}
  4494. //for (int i = 0; i < dt.Rows.Count; i++)
  4495. //{
  4496. // DataRow newRow = newtable.NewRow();
  4497. // for (int j = 0; j < newtable.Columns.Count; j++)
  4498. // {
  4499. // string StrRowValue = "";
  4500. // switch (newtable.Columns[j].ColumnName.Trim())
  4501. // {
  4502. // case "婚期":
  4503. // StrRowValue = LYFZ.BLL.OtherCommonModel.DateTimeToString(dt.Rows[i]["Cus_DayForMarriage"], LYFZ.DateTimeType.StryyyyMMdd);
  4504. // if (!string.IsNullOrEmpty(StrRowValue))
  4505. // {
  4506. // if (dt.Rows[i]["Cus_DayForMarriageLunar"].ToString().Trim() == "1")
  4507. // { StrRowValue += "_农历"; }
  4508. // }
  4509. // break;
  4510. // case "加急日期":
  4511. // case "初修日期":
  4512. // case "选片日期":
  4513. // case "精修日期":
  4514. // case "设计日期":
  4515. // case "看版日期":
  4516. // StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  4517. // StrRowValue = LYFZ.BLL.OtherCommonModel.DateTimeToString(StrRowValue);
  4518. // break;
  4519. // case "初修状态":
  4520. // StrRowValue = Enum.ToObject(typeof(LYFZ.EnumPublic.EarlyRepairStatusEnum), Convert.ToInt32(dt.Rows[i]["Ordv_EarlyRepairStatus"])).ToString() + "/";
  4521. // if (!string.IsNullOrEmpty(dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim()))
  4522. // {
  4523. // DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find(dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim());
  4524. // if (dtRow != null)
  4525. // { StrRowValue += dtRow["User_Name"].ToString().Trim(); }
  4526. // }
  4527. // break;
  4528. // case "选片状态":
  4529. // StrRowValue = Enum.ToObject(typeof(LYFZ.EnumPublic.FilmSelectionStatusEnum), Convert.ToInt32(dt.Rows[i]["Ordv_FilmSelectionStatus"])).ToString() + "/";
  4530. // if (!string.IsNullOrEmpty(dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim()))
  4531. // {
  4532. // DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find(dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim());
  4533. // if (dtRow != null)
  4534. // { StrRowValue += dtRow["User_Name"].ToString().Trim(); }
  4535. // }
  4536. // break;
  4537. // case "设计状态":
  4538. // StrRowValue = Enum.ToObject(typeof(LYFZ.EnumPublic.DesignerStatusEnum), Convert.ToInt32(dt.Rows[i]["Ordv_DesignerStatus"])).ToString() + "/";
  4539. // if (!string.IsNullOrEmpty(dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim()))
  4540. // {
  4541. // DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find(dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim());
  4542. // if (dtRow != null)
  4543. // { StrRowValue += dtRow["User_Name"].ToString().Trim(); }
  4544. // }
  4545. // break;
  4546. // case "精修状态":
  4547. // StrRowValue = Enum.ToObject(typeof(LYFZ.EnumPublic.RefinementStatusEnum), Convert.ToInt32(dt.Rows[i]["Ordv_RefinementStatus"])).ToString() + "/";
  4548. // if (!string.IsNullOrEmpty(dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim()))
  4549. // {
  4550. // DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find(dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim());
  4551. // if (dtRow != null)
  4552. // { StrRowValue += dtRow["User_Name"].ToString().Trim(); }
  4553. // }
  4554. // break;
  4555. // case "看版状态":
  4556. // StrRowValue = Enum.ToObject(typeof(LYFZ.EnumPublic.LookDesignStatusEnum), Convert.ToInt32(dt.Rows[i]["Ordv_LookDesignStatus"])).ToString() + "/";
  4557. // if (!string.IsNullOrEmpty(dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim()))
  4558. // {
  4559. // DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find(dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim());
  4560. // if (dtRow != null)
  4561. // { StrRowValue += dtRow["User_Name"].ToString().Trim(); }
  4562. // }
  4563. // break;
  4564. // case "订单类型":
  4565. // StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  4566. // if (!string.IsNullOrEmpty(StrRowValue))
  4567. // { StrRowValue = Enum.ToObject(typeof(LYFZ.EnumPublic.OrderType), Convert.ToInt32(StrRowValue)).ToString(); }
  4568. // else
  4569. // { StrRowValue = ""; }
  4570. // break;
  4571. // default: StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  4572. // break;
  4573. // }
  4574. // newRow[newtable.Columns[j].ColumnName.Trim()] = StrRowValue;
  4575. // }
  4576. // newtable.Rows.Add(newRow);
  4577. //}
  4578. //#endregion
  4579. //if (newtable.Rows.Count > 0)
  4580. //{ dgvData.DataSource(newtable); }
  4581. //else
  4582. //{ dgvData.DataColumns(string.Join(",", dictColumns.Keys.ToArray()), strHideField: dgvData.dgvFixedHideColumn); }
  4583. //dgvData.Columns["客户姓名"].Frozen = true;
  4584. //Hashtable htCount = new Hashtable();
  4585. //for (int i = 0; i < newtable.Rows.Count; i++)
  4586. //{ htCount[newtable.Rows[i]["Ord_Number"].ToString().Trim()] = newtable.Rows[i]["Ord_Number"].ToString().Trim(); }
  4587. //Hashtable htData = new Hashtable();
  4588. //htData["DataTable"] = newtable;
  4589. //htData["TotalCount"] = Convert.ToInt32(dtSet.Tables["ds1"].Rows[0]["CountID"]);
  4590. //htData["CurrentCount"] = htCount.Count;
  4591. //return htData;
  4592. }
  4593. public static Hashtable GetData_ReplaceDigitalArrange( DataGridViewEc dgvData, Dictionary<string, string> dictColumns, DataTable dt, int TotalCount )
  4594. {
  4595. #region 重组DataTable
  4596. DataTable newtable = new DataTable();
  4597. foreach ( var item in dictColumns )
  4598. {
  4599. if ( dt.Columns.Contains( item.Key.Trim() ) )
  4600. newtable.Columns.Add( item.Key.Trim(), typeof( string ) );
  4601. }
  4602. DataRow newRow = null;
  4603. bool bNewRow = false;
  4604. for ( int i = 0; i < dt.Rows.Count; i++ )
  4605. {
  4606. if ( newRow == null || !newRow["Ordv_ViceNumber"].ToString().Equals( dt.Rows[i]["Ordv_ViceNumber"].ToString() ) )
  4607. {
  4608. newRow = newtable.NewRow();
  4609. bNewRow = true;
  4610. }
  4611. else
  4612. {
  4613. bNewRow = false;
  4614. if ( newtable.Columns.Contains( "拍摄名称" ) )
  4615. {
  4616. if ( newRow["拍摄名称"].ToString_s().IndexOf( dt.Rows[i]["拍摄名称"].ToString().Trim() ) == -1 )
  4617. {
  4618. if ( newRow["拍摄名称"].ToString() != "" )
  4619. {
  4620. newRow["拍摄名称"] = newRow["拍摄名称"] + ",";
  4621. }
  4622. newRow["拍摄名称"] += dt.Rows[i]["拍摄名称"].ToString().Trim();
  4623. }
  4624. }
  4625. if ( newtable.Columns.Contains( "拍照状态" ) )
  4626. {
  4627. if ( !string.IsNullOrEmpty( dt.Rows[i]["拍照状态"].ToString().Trim() ) )
  4628. {
  4629. string StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.PhotographyStatusEnum ),
  4630. Convert.ToInt32( dt.Rows[i]["拍照状态"].ToString().Trim() ) ).ToString();
  4631. if ( newRow["拍照状态"].ToString_s() != "拍照中" && newRow["拍照状态"].ToString_s().IndexOf( StrRowValue ) == -1 )
  4632. {
  4633. newRow["拍照状态"] = "拍照中";
  4634. }
  4635. }
  4636. }
  4637. continue;
  4638. }
  4639. for ( int j = 0; j < newtable.Columns.Count; j++ )
  4640. {
  4641. string StrRowValue = "";
  4642. switch ( newtable.Columns[j].ColumnName.Trim() )
  4643. {
  4644. case "取件状态":
  4645. string tempValue1 = dt.Rows[i]["取件状态"].ToString();
  4646. if ( tempValue1 == "0" )
  4647. {
  4648. StrRowValue = "未取件";
  4649. }
  4650. else if ( tempValue1 == "1" )
  4651. {
  4652. StrRowValue = "部分取件";
  4653. }
  4654. else if ( tempValue1 == "2" )
  4655. {
  4656. StrRowValue = "OK";
  4657. }
  4658. break;
  4659. case "拍照状态":
  4660. if ( dt.Rows[i]["拍照状态"].ToString() != "" )
  4661. {
  4662. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.PhotographyStatusEnum ),
  4663. Convert.ToInt32( dt.Rows[i]["拍照状态"].ToString().Trim() ) ).ToString();
  4664. }
  4665. break;
  4666. case "婚期":
  4667. StrRowValue = LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["Cus_DayForMarriage"], LYFZ.DateTimeType.StryyyyMMdd );
  4668. if ( !string.IsNullOrEmpty( StrRowValue ) )
  4669. {
  4670. if ( dt.Rows[i]["Cus_DayForMarriageLunar"].ToString().Trim() == "1" )
  4671. {
  4672. StrRowValue += "_农历";
  4673. }
  4674. }
  4675. break;
  4676. case "加急":
  4677. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  4678. if ( !string.IsNullOrEmpty( StrRowValue ) && Convert.ToInt32( StrRowValue ) > 0 )
  4679. {
  4680. StrRowValue = "是";
  4681. }
  4682. else
  4683. {
  4684. StrRowValue = "否";
  4685. }
  4686. break;
  4687. case "加急日期":
  4688. case "初修日期":
  4689. case "选片日期":
  4690. case "精修日期":
  4691. case "设计日期":
  4692. case "看版日期":
  4693. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  4694. StrRowValue = LYFZ.BLL.OtherCommonModel.DateTimeToString( StrRowValue );
  4695. break;
  4696. case "初修状态":
  4697. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.EarlyRepairStatusEnum ), Convert.ToInt32( dt.Rows[i]["Ordv_EarlyRepairStatus"] ) ).ToString() + "/";
  4698. if ( !string.IsNullOrEmpty( dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim() ) )
  4699. {
  4700. DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim() );
  4701. if ( dtRow != null )
  4702. {
  4703. StrRowValue += dtRow["User_Name"].ToString().Trim();
  4704. }
  4705. }
  4706. break;
  4707. case "选片状态":
  4708. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.FilmSelectionStatusEnum ), Convert.ToInt32( dt.Rows[i]["Ordv_FilmSelectionStatus"] ) ).ToString() + "/";
  4709. if ( !string.IsNullOrEmpty( dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim() ) )
  4710. {
  4711. DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim() );
  4712. if ( dtRow != null )
  4713. {
  4714. StrRowValue += dtRow["User_Name"].ToString().Trim();
  4715. }
  4716. }
  4717. break;
  4718. case "设计状态":
  4719. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.DesignerStatusEnum ), Convert.ToInt32( dt.Rows[i]["Ordv_DesignerStatus"] ) ).ToString() + "/";
  4720. if ( !string.IsNullOrEmpty( dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim() ) )
  4721. {
  4722. DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim() );
  4723. if ( dtRow != null )
  4724. {
  4725. StrRowValue += dtRow["User_Name"].ToString().Trim();
  4726. }
  4727. }
  4728. break;
  4729. case "精修状态":
  4730. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.RefinementStatusEnum ), Convert.ToInt32( dt.Rows[i]["Ordv_RefinementStatus"] ) ).ToString() + "/";
  4731. if ( !string.IsNullOrEmpty( dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim() ) )
  4732. {
  4733. DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim() );
  4734. if ( dtRow != null )
  4735. {
  4736. StrRowValue += dtRow["User_Name"].ToString().Trim();
  4737. }
  4738. }
  4739. break;
  4740. case "看版状态":
  4741. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.LookDesignStatusEnum ), Convert.ToInt32( dt.Rows[i]["Ordv_LookDesignStatus"] ) ).ToString() + "/";
  4742. if ( !string.IsNullOrEmpty( dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim() ) )
  4743. {
  4744. DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim() );
  4745. if ( dtRow != null )
  4746. {
  4747. StrRowValue += dtRow["User_Name"].ToString().Trim();
  4748. }
  4749. }
  4750. break;
  4751. case "订单类型":
  4752. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  4753. if ( !string.IsNullOrEmpty( StrRowValue ) )
  4754. {
  4755. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.OrderType ), Convert.ToInt32( StrRowValue ) ).ToString();
  4756. }
  4757. else
  4758. {
  4759. StrRowValue = "";
  4760. }
  4761. break;
  4762. default:
  4763. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  4764. break;
  4765. }
  4766. newRow[newtable.Columns[j].ColumnName.Trim()] = StrRowValue;
  4767. }
  4768. newtable.Rows.Add( newRow );
  4769. }
  4770. #endregion
  4771. BLL.BLL_ErpOrderRemarkRecord bLL_ErpOrderRemark = new BLL.BLL_ErpOrderRemarkRecord();
  4772. DataTable remarkDt = new DataTable();
  4773. string strWhere = "";
  4774. for (int i = 0; i < newtable.Rows.Count; i++)
  4775. {
  4776. if (strWhere != "")
  4777. {
  4778. strWhere += ",";
  4779. }
  4780. strWhere += "'" + newtable.Rows[i]["Ordv_ViceNumber"].ToString().Trim() + "'";
  4781. }
  4782. if (strWhere != "")
  4783. {
  4784. remarkDt = bLL_ErpOrderRemark.GetList(" Ordrr_ViceNumber in (" + strWhere + ") and Ordrr_ModuleName = '数码安排' and (Ordrr_Remark is not null and Ordrr_Remark!='' ) ").Tables[0];
  4785. }
  4786. if ( newtable.Rows.Count > 0 )
  4787. {
  4788. dgvData.DataSource( newtable, remarkDt);
  4789. }
  4790. else
  4791. {
  4792. dgvData.DataColumns( string.Join( ",", dictColumns.Keys.ToArray() ), strHideField: dgvData.dgvFixedHideColumn );
  4793. }
  4794. dgvData.Columns["客户姓名"].Frozen = true;
  4795. Hashtable htCount = new Hashtable();
  4796. for ( int i = 0; i < newtable.Rows.Count; i++ )
  4797. {
  4798. htCount[newtable.Rows[i]["Ord_Number"].ToString().Trim()] = newtable.Rows[i]["Ord_Number"].ToString().Trim();
  4799. }
  4800. Hashtable htData = new Hashtable();
  4801. htData["DTable"] = dt;
  4802. htData["DataTable"] = newtable;
  4803. htData["TotalCount"] = Convert.ToInt32( TotalCount );
  4804. htData["CurrentCount"] = htCount.Count;
  4805. return htData;
  4806. }
  4807. /// <summary>
  4808. /// 获取订单收款
  4809. /// </summary>
  4810. /// <param name="dgvData"></param>
  4811. /// <param name="dictColumns"></param>
  4812. /// <param name="StrQueryCondition"></param>
  4813. /// <param name="StrQueryCondition2"></param>
  4814. /// <param name="inTopCount"></param>
  4815. /// <param name="StrOrderBy"></param>
  4816. /// <returns></returns>
  4817. public static Hashtable GetData_OrderPayment( DataGridViewEc dgvData, Dictionary<string, string> dictColumns, string StrQueryCondition, int inTopCount, string StrOrderBy, int pageIndex )
  4818. {
  4819. DataSet dtSet = new DataSet();
  4820. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  4821. {
  4822. dtSet = LYFZ.BLL.BLL_ErpOrderView.GetData_OrderPayment( dictColumns, StrQueryCondition, inTopCount, StrOrderBy, pageIndex );
  4823. } );
  4824. #region 重组DataTable
  4825. DataTable dt = dtSet.Tables["ds"];
  4826. DataTable newtable = new DataTable();
  4827. foreach ( var item in dictColumns )
  4828. {
  4829. if ( dt.Columns.Contains( item.Key.Trim() ) )
  4830. newtable.Columns.Add( item.Key.Trim(), typeof( string ) );
  4831. }
  4832. for ( int i = 0; i < dt.Rows.Count; i++ )
  4833. {
  4834. DataRow newRow = newtable.NewRow();
  4835. for ( int j = 0; j < newtable.Columns.Count; j++ )
  4836. {
  4837. string StrRowValue = "";
  4838. switch ( newtable.Columns[j].ColumnName.Trim() )
  4839. {
  4840. case "订单时间":
  4841. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  4842. StrRowValue = LYFZ.BLL.OtherCommonModel.DateTimeToString( StrRowValue );
  4843. break;
  4844. case "订单类型":
  4845. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  4846. if ( !string.IsNullOrEmpty( StrRowValue ) )
  4847. {
  4848. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.OrderType ), Convert.ToInt32( StrRowValue ) ).ToString();
  4849. }
  4850. else
  4851. {
  4852. StrRowValue = "";
  4853. }
  4854. break;
  4855. default:
  4856. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  4857. break;
  4858. }
  4859. newRow[newtable.Columns[j].ColumnName.Trim()] = StrRowValue;
  4860. }
  4861. newtable.Rows.Add( newRow );
  4862. }
  4863. #endregion
  4864. if ( newtable.Rows.Count > 0 )
  4865. dgvData.DataSource( newtable );
  4866. else
  4867. dgvData.DataColumns( string.Join( ",", dictColumns.Keys.ToArray() ), strHideField: dgvData.dgvFixedHideColumn );
  4868. dgvData.Columns["客户姓名"].Frozen = true;
  4869. #if old
  4870. if (dgvData.Columns.Contains("欠款"))
  4871. {
  4872. for (int i = 0; i < dgvData.Rows.Count; i++)
  4873. {
  4874. if (Convert.ToDecimal(dgvData.Rows[i].Cells["欠款"].Value) != 0)
  4875. { dgvData.Rows[i].DefaultCellStyle.ForeColor = Color.Red; }
  4876. }
  4877. }
  4878. #endif
  4879. Hashtable htData = new Hashtable();
  4880. htData["TotalCount"] = Convert.ToInt32( dtSet.Tables["ds1"].Rows[0]["CountID"] );
  4881. htData["CurrentCount"] = newtable.Rows.Count;
  4882. return htData;
  4883. }
  4884. /// <summary>
  4885. /// 流程把控_已定未拍
  4886. /// </summary>
  4887. /// <param name="dictColumns"></param>
  4888. /// <param name="StrQueryCondition"></param>
  4889. /// <param name="StrQueryCondition2"></param>
  4890. /// <param name="StrOrderBy"></param>
  4891. /// <returns></returns>
  4892. public static DataTable GetData_ProcessMonitorNotShot( Dictionary<string, string> dictColumns, string StrQueryCondition, string StrQueryCondition2, string StrOrderBy )
  4893. {
  4894. DataTable dt = new DataTable();
  4895. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  4896. {
  4897. dt = LYFZ.BLL.BLL_ErpOrderView.GetData_ProcessMonitorNotShot( dictColumns, StrQueryCondition, StrQueryCondition2, StrOrderBy );
  4898. } );
  4899. #region 重组DataTable
  4900. DataTable newtable = new DataTable();
  4901. foreach ( var item in dictColumns )
  4902. {
  4903. if ( dt.Columns.Contains( item.Key.Trim() ) )
  4904. newtable.Columns.Add( item.Key.Trim(), typeof( string ) );
  4905. }
  4906. for ( int i = 0; i < dt.Rows.Count; i++ )
  4907. {
  4908. string StrTime = "";
  4909. if ( !string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["Ordpg_ReservationPhotographyTime"] ) ) && !string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["下次提醒时间"] ) ) )
  4910. {
  4911. StrTime = dt.Rows[i]["下次提醒时间"].ToString().Trim();
  4912. if ( Convert.ToDateTime( dt.Rows[i]["Ordpg_ReservationPhotographyTime"] ) > Convert.ToDateTime( dt.Rows[i]["下次提醒时间"] ) )
  4913. {
  4914. StrTime = dt.Rows[i]["Ordpg_ReservationPhotographyTime"].ToString().Trim();
  4915. }
  4916. }
  4917. else if ( !string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["Ordpg_ReservationPhotographyTime"] ) ) && string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["下次提醒时间"] ) ) )
  4918. {
  4919. StrTime = dt.Rows[i]["Ordpg_ReservationPhotographyTime"].ToString().Trim();
  4920. }
  4921. else if ( string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["Ordpg_ReservationPhotographyTime"] ) ) && !string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["下次提醒时间"] ) ) )
  4922. {
  4923. StrTime = dt.Rows[i]["下次提醒时间"].ToString().Trim();
  4924. }
  4925. if ( !string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( StrTime ) ) )
  4926. {
  4927. if ( (SDateTime.Now - Convert.ToDateTime( StrTime )).Days < 0 )
  4928. {
  4929. continue;
  4930. }
  4931. }
  4932. DataRow newRow = newtable.NewRow();
  4933. for ( int j = 0; j < newtable.Columns.Count; j++ )
  4934. {
  4935. string StrRowValue = "";
  4936. switch ( newtable.Columns[j].ColumnName.Trim() )
  4937. {
  4938. case "结婚日期":
  4939. case "下单日期":
  4940. case "预定时间":
  4941. case "沟通时间":
  4942. StrRowValue = LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim() );
  4943. break;
  4944. case "拍照状态":
  4945. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.PhotographyStatusEnum ), Convert.ToInt32( dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim() ) ).ToString();
  4946. break;
  4947. case "摄影师":
  4948. case "化妆师":
  4949. case "引导师":
  4950. case "客服人员":
  4951. if ( !string.IsNullOrEmpty( dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim() ) )
  4952. {
  4953. DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim() );
  4954. if ( dtRow != null )
  4955. {
  4956. StrRowValue += dtRow["User_Name"].ToString().Trim();
  4957. }
  4958. }
  4959. break;
  4960. case "订单类型":
  4961. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  4962. if ( !string.IsNullOrEmpty( StrRowValue ) )
  4963. {
  4964. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.OrderType ), Convert.ToInt32( StrRowValue ) ).ToString();
  4965. }
  4966. else
  4967. {
  4968. StrRowValue = "";
  4969. }
  4970. break;
  4971. default:
  4972. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  4973. break;
  4974. }
  4975. newRow[newtable.Columns[j].ColumnName.Trim()] = StrRowValue;
  4976. }
  4977. newtable.Rows.Add( newRow );
  4978. }
  4979. #endregion
  4980. return newtable;
  4981. }
  4982. /// <summary>
  4983. /// 流程把控_已拍未拍完
  4984. /// </summary>
  4985. /// <param name="dictColumns"></param>
  4986. /// <param name="StrQueryCondition"></param>
  4987. /// <param name="StrQueryCondition2"></param>
  4988. /// <param name="StrOrderBy"></param>
  4989. /// <returns></returns>
  4990. public static DataTable GetData_ProcessMonitorNotShotIn( Dictionary<string, string> dictColumns, string StrQueryCondition, string StrQueryCondition2, string StrOrderBy )
  4991. {
  4992. DataTable dt = new DataTable();
  4993. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  4994. {
  4995. dt = LYFZ.BLL.BLL_ErpOrderView.GetData_ProcessMonitorNotShotIn( dictColumns, StrQueryCondition, StrQueryCondition2, StrOrderBy );
  4996. } );
  4997. #region 重组DataTable
  4998. DataTable newtable = new DataTable();
  4999. foreach ( var item in dictColumns )
  5000. {
  5001. newtable.Columns.Add( item.Key.Trim(), typeof( string ) );
  5002. }
  5003. for (int i = 0; i < dt.Rows.Count; i++)
  5004. {
  5005. string StrTime = "";
  5006. if (!string.IsNullOrEmpty(LYFZ.BLL.OtherCommonModel.DateTimeToString(dt.Rows[i]["Ords_PhotographMinTime"])) && !string.IsNullOrEmpty(LYFZ.BLL.OtherCommonModel.DateTimeToString(dt.Rows[i]["下次提醒时间"])))
  5007. {
  5008. StrTime = dt.Rows[i]["下次提醒时间"].ToString().Trim();
  5009. if (Convert.ToDateTime(dt.Rows[i]["Ords_PhotographMinTime"]) > Convert.ToDateTime(dt.Rows[i]["下次提醒时间"]))
  5010. {
  5011. StrTime = dt.Rows[i]["Ords_PhotographMinTime"].ToString().Trim();
  5012. }
  5013. }
  5014. else if (!string.IsNullOrEmpty(LYFZ.BLL.OtherCommonModel.DateTimeToString(dt.Rows[i]["Ords_PhotographMinTime"])) && string.IsNullOrEmpty(LYFZ.BLL.OtherCommonModel.DateTimeToString(dt.Rows[i]["下次提醒时间"])))
  5015. {
  5016. StrTime = dt.Rows[i]["Ords_PhotographMinTime"].ToString().Trim();
  5017. }
  5018. else if (string.IsNullOrEmpty(LYFZ.BLL.OtherCommonModel.DateTimeToString(dt.Rows[i]["Ords_PhotographMinTime"])) && !string.IsNullOrEmpty(LYFZ.BLL.OtherCommonModel.DateTimeToString(dt.Rows[i]["下次提醒时间"])))
  5019. {
  5020. StrTime = dt.Rows[i]["下次提醒时间"].ToString().Trim();
  5021. }
  5022. if (!string.IsNullOrEmpty(LYFZ.BLL.OtherCommonModel.DateTimeToString(StrTime)) && dt.Rows[i]["Ords_PhotographIntStatus"].ToString().Trim() == "2")
  5023. {
  5024. if ((SDateTime.Now - Convert.ToDateTime(StrTime)).Days < 0)
  5025. {
  5026. continue;
  5027. }
  5028. }
  5029. try
  5030. {
  5031. DataRow newRow = newtable.NewRow();
  5032. for (int j = 0; j < newtable.Columns.Count; j++)
  5033. {
  5034. string StrRowValue = "";
  5035. switch (newtable.Columns[j].ColumnName.Trim())
  5036. {
  5037. case "预约时间":
  5038. if (dt.Rows[i]["Ordpg_PhotographyStatus"].ToString().Trim() == "0")
  5039. {
  5040. StrRowValue = LYFZ.BLL.OtherCommonModel.DateTimeToString(dt.Rows[i]["Ordpg_ReservationPhotographyTime"]);
  5041. }
  5042. else
  5043. {
  5044. StrRowValue = LYFZ.BLL.OtherCommonModel.DateTimeToString(dt.Rows[i]["Ordpg_PhotographyTime"]);
  5045. }
  5046. break;
  5047. case "结婚日期":
  5048. case "开拍日期":
  5049. case "沟通时间":
  5050. StrRowValue = LYFZ.BLL.OtherCommonModel.DateTimeToString(dt.Rows[i][newtable.Columns[j].ColumnName.Trim()]);
  5051. break;
  5052. case "拍照状态":
  5053. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString_s().Trim();
  5054. //if(StrRowValue=="1")
  5055. //{
  5056. // StrRowValue = "2";
  5057. //}
  5058. //else if (StrRowValue == "2")
  5059. //{
  5060. // StrRowValue = "1";
  5061. //}
  5062. StrRowValue = Enum.ToObject(typeof(LYFZ.EnumPublic.PhotographyStatusEnum), Convert.ToInt32(StrRowValue)).ToString();
  5063. break;
  5064. case "摄影师":
  5065. case "客服人员":
  5066. string StrNameA = dt.Rows[i]["Ordpg_Photographer"].ToString().Trim();
  5067. if (dt.Rows[i]["Ordpg_PhotographyStatus"].ToString().Trim() == "0")
  5068. {
  5069. StrNameA = dt.Rows[i]["Ordpg_ReservationPhotographyName"].ToString().Trim();
  5070. }
  5071. if (!string.IsNullOrEmpty(StrNameA.Trim()))
  5072. {
  5073. DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find(StrNameA);
  5074. if (dtRow != null)
  5075. {
  5076. StrRowValue += dtRow["User_Name"].ToString().Trim();
  5077. }
  5078. }
  5079. break;
  5080. case "化妆师":
  5081. string StrNameB = dt.Rows[i]["Ordpg_MakeupArtist"].ToString().Trim();
  5082. if (dt.Rows[i]["Ordpg_PhotographyStatus"].ToString().Trim() == "0")
  5083. {
  5084. StrNameB = dt.Rows[i]["Ordpg_ReservationMakeupArtist"].ToString().Trim();
  5085. }
  5086. if (!string.IsNullOrEmpty(StrNameB.Trim()))
  5087. {
  5088. DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find(StrNameB);
  5089. if (dtRow != null)
  5090. {
  5091. StrRowValue += dtRow["User_Name"].ToString().Trim();
  5092. }
  5093. }
  5094. break;
  5095. case "引导师":
  5096. string StrNameC = dt.Rows[i]["Ordpg_BootDivision"].ToString().Trim();
  5097. if (dt.Rows[i]["Ordpg_PhotographyStatus"].ToString().Trim() == "0")
  5098. {
  5099. StrNameC = dt.Rows[i]["Ordpg_ReservationPhotographyTime"].ToString().Trim();
  5100. }
  5101. if (!string.IsNullOrEmpty(StrNameC.Trim()))
  5102. {
  5103. DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find(StrNameC);
  5104. if (dtRow != null)
  5105. {
  5106. StrRowValue += dtRow["User_Name"].ToString().Trim();
  5107. }
  5108. }
  5109. break;
  5110. case "订单类型":
  5111. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  5112. if (!string.IsNullOrEmpty(StrRowValue))
  5113. {
  5114. StrRowValue = Enum.ToObject(typeof(LYFZ.EnumPublic.OrderType), Convert.ToInt32(StrRowValue)).ToString();
  5115. }
  5116. else
  5117. {
  5118. StrRowValue = "";
  5119. }
  5120. break;
  5121. default:
  5122. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  5123. break;
  5124. }
  5125. newRow[newtable.Columns[j].ColumnName.Trim()] = StrRowValue;
  5126. }
  5127. newtable.Rows.Add(newRow);
  5128. }
  5129. catch (Exception e)
  5130. {
  5131. }
  5132. }
  5133. #endregion
  5134. return newtable;
  5135. }
  5136. /// <summary>
  5137. /// 流程把控_已拍未初修
  5138. /// </summary>
  5139. /// <param name="dictColumns"></param>
  5140. /// <param name="StrQueryCondition"></param>
  5141. /// <param name="StrQueryCondition2"></param>
  5142. /// <param name="StrOrderBy"></param>
  5143. /// <returns></returns>
  5144. public static DataTable GetData_ProcessMonitorNotRepair( Dictionary<string, string> dictColumns, string StrQueryCondition, string StrQueryCondition2, string StrOrderBy )
  5145. {
  5146. DataTable dt = new DataTable();
  5147. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  5148. {
  5149. dt = LYFZ.BLL.BLL_ErpOrderView.GetData_ProcessMonitorNotRepair( dictColumns, StrQueryCondition, StrQueryCondition2, StrOrderBy );
  5150. } );
  5151. #region 重组DataTable
  5152. DataTable newtable = new DataTable();
  5153. foreach ( var item in dictColumns )
  5154. {
  5155. newtable.Columns.Add( item.Key.Trim(), typeof( string ) );
  5156. }
  5157. for ( int i = 0; i < dt.Rows.Count; i++ )
  5158. {
  5159. string StrTime = "";
  5160. if ( !string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["Ordv_ReservationEarlyRepairTime"] ) ) && !string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["下次提醒时间"] ) ) )
  5161. {
  5162. StrTime = dt.Rows[i]["下次提醒时间"].ToString().Trim();
  5163. if ( Convert.ToDateTime( dt.Rows[i]["Ordv_ReservationEarlyRepairTime"] ) > Convert.ToDateTime( dt.Rows[i]["下次提醒时间"] ) )
  5164. {
  5165. StrTime = dt.Rows[i]["Ordv_ReservationEarlyRepairTime"].ToString().Trim();
  5166. }
  5167. }
  5168. else if ( !string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["Ordv_ReservationEarlyRepairTime"] ) ) && string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["下次提醒时间"] ) ) )
  5169. {
  5170. StrTime = dt.Rows[i]["Ordv_ReservationEarlyRepairTime"].ToString().Trim();
  5171. }
  5172. else if ( string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["Ordv_ReservationEarlyRepairTime"] ) ) && !string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["下次提醒时间"] ) ) )
  5173. {
  5174. StrTime = dt.Rows[i]["下次提醒时间"].ToString().Trim();
  5175. }
  5176. if ( !string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( StrTime ) ) )
  5177. {
  5178. if ( (SDateTime.Now - Convert.ToDateTime( StrTime )).Days < 0 )
  5179. {
  5180. continue;
  5181. }
  5182. }
  5183. DataRow newRow = newtable.NewRow();
  5184. for ( int j = 0; j < newtable.Columns.Count; j++ )
  5185. {
  5186. string StrRowValue = "";
  5187. switch ( newtable.Columns[j].ColumnName.Trim() )
  5188. {
  5189. case "结婚日期":
  5190. case "拍摄时间":
  5191. case "预定时间":
  5192. case "沟通时间":
  5193. StrRowValue = LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i][newtable.Columns[j].ColumnName.Trim()] );
  5194. break;
  5195. case "摄影师":
  5196. string[] StrNameList = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim().Split(',');
  5197. List<string> txtInfoList = new List<string>();
  5198. foreach (string keyValue in StrNameList)
  5199. {
  5200. if(txtInfoList.Contains(keyValue))
  5201. {
  5202. continue;
  5203. }
  5204. if (!string.IsNullOrEmpty(keyValue.Trim()))
  5205. {
  5206. DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find(keyValue);
  5207. if (dtRow != null)
  5208. {
  5209. if(StrRowValue!="")
  5210. {
  5211. StrRowValue += ",";
  5212. }
  5213. StrRowValue += dtRow["User_Name"].ToString().Trim();
  5214. }
  5215. }
  5216. txtInfoList.Add(keyValue);
  5217. }
  5218. break;
  5219. case "初修师":
  5220. case "客服人员":
  5221. string StrNameA = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  5222. if ( !string.IsNullOrEmpty( StrNameA.Trim() ) )
  5223. {
  5224. DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrNameA );
  5225. if ( dtRow != null )
  5226. {
  5227. StrRowValue += dtRow["User_Name"].ToString().Trim();
  5228. }
  5229. }
  5230. break;
  5231. case "拍照状态":
  5232. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  5233. if ( !string.IsNullOrEmpty( StrRowValue ) )
  5234. {
  5235. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.PhotographyStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  5236. }
  5237. else
  5238. {
  5239. StrRowValue = "";
  5240. }
  5241. break;
  5242. case "初修状态":
  5243. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  5244. if ( !string.IsNullOrEmpty( StrRowValue ) )
  5245. {
  5246. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.EarlyRepairStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  5247. }
  5248. else
  5249. {
  5250. StrRowValue = "";
  5251. }
  5252. break;
  5253. case "订单类型":
  5254. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  5255. if ( !string.IsNullOrEmpty( StrRowValue ) )
  5256. {
  5257. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.OrderType ), Convert.ToInt32( StrRowValue ) ).ToString();
  5258. }
  5259. else
  5260. {
  5261. StrRowValue = "";
  5262. }
  5263. break;
  5264. default:
  5265. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  5266. break;
  5267. }
  5268. newRow[newtable.Columns[j].ColumnName.Trim()] = StrRowValue;
  5269. }
  5270. newtable.Rows.Add( newRow );
  5271. }
  5272. #endregion
  5273. return newtable;
  5274. }
  5275. /// <summary>
  5276. /// 流程把控_已拍未选
  5277. /// </summary>
  5278. /// <param name="dictColumns"></param>
  5279. /// <param name="StrQueryCondition"></param>
  5280. /// <param name="StrQueryCondition2"></param>
  5281. /// <param name="StrOrderBy"></param>
  5282. /// <returns></returns>
  5283. public static DataTable GetData_ProcessMonitorNotSelected( Dictionary<string, string> dictColumns, string StrQueryCondition, string StrQueryCondition2, string StrOrderBy )
  5284. {
  5285. DataTable dt = new DataTable();
  5286. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  5287. {
  5288. dt = LYFZ.BLL.BLL_ErpOrderView.GetData_ProcessMonitorNotSelected( dictColumns, StrQueryCondition, StrQueryCondition2, StrOrderBy );
  5289. } );
  5290. #region 重组DataTable
  5291. DataTable newtable = new DataTable();
  5292. foreach ( var item in dictColumns )
  5293. {
  5294. newtable.Columns.Add( item.Key.Trim(), typeof( string ) );
  5295. }
  5296. for ( int i = 0; i < dt.Rows.Count; i++ )
  5297. {
  5298. string StrTime = "";
  5299. if ( !string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["Ordv_ReservationFilmSelectionTime"] ) ) && !string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["下次提醒时间"] ) ) )
  5300. {
  5301. StrTime = dt.Rows[i]["下次提醒时间"].ToString().Trim();
  5302. if ( Convert.ToDateTime( dt.Rows[i]["Ordv_ReservationFilmSelectionTime"] ) > Convert.ToDateTime( dt.Rows[i]["下次提醒时间"] ) )
  5303. {
  5304. StrTime = dt.Rows[i]["Ordv_ReservationFilmSelectionTime"].ToString().Trim();
  5305. }
  5306. }
  5307. else if ( !string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["Ordv_ReservationFilmSelectionTime"] ) ) && string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["下次提醒时间"] ) ) )
  5308. {
  5309. StrTime = dt.Rows[i]["Ordv_ReservationFilmSelectionTime"].ToString().Trim();
  5310. }
  5311. else if ( string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["Ordv_ReservationFilmSelectionTime"] ) ) && !string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["下次提醒时间"] ) ) )
  5312. {
  5313. StrTime = dt.Rows[i]["下次提醒时间"].ToString().Trim();
  5314. }
  5315. if ( !string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( StrTime ) ) )
  5316. {
  5317. if ( (SDateTime.Now - Convert.ToDateTime( StrTime )).Days < 0 )
  5318. {
  5319. continue;
  5320. }
  5321. }
  5322. DataRow newRow = newtable.NewRow();
  5323. for ( int j = 0; j < newtable.Columns.Count; j++ )
  5324. {
  5325. string StrRowValue = "";
  5326. switch ( newtable.Columns[j].ColumnName.Trim() )
  5327. {
  5328. case "结婚日期":
  5329. case "拍摄时间":
  5330. case "预定时间":
  5331. case "沟通时间":
  5332. StrRowValue = LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i][newtable.Columns[j].ColumnName.Trim()] );
  5333. break;
  5334. case "摄影师":
  5335. string[] StrNameList = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim().Split(',');
  5336. List<string> txtInfoList = new List<string>();
  5337. foreach (string keyValue in StrNameList)
  5338. {
  5339. if (txtInfoList.Contains(keyValue))
  5340. {
  5341. continue;
  5342. }
  5343. if (!string.IsNullOrEmpty(keyValue.Trim()))
  5344. {
  5345. DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find(keyValue);
  5346. if (dtRow != null)
  5347. {
  5348. if (StrRowValue != "")
  5349. {
  5350. StrRowValue += ",";
  5351. }
  5352. StrRowValue += dtRow["User_Name"].ToString().Trim();
  5353. }
  5354. }
  5355. txtInfoList.Add(keyValue);
  5356. }
  5357. break;
  5358. case "选片师":
  5359. case "客服人员":
  5360. string StrNameA = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  5361. if ( !string.IsNullOrEmpty( StrNameA.Trim() ) )
  5362. {
  5363. DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrNameA );
  5364. if ( dtRow != null )
  5365. {
  5366. StrRowValue += dtRow["User_Name"].ToString().Trim();
  5367. }
  5368. }
  5369. break;
  5370. case "拍照状态":
  5371. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  5372. if ( StrRowValue == "1" )
  5373. {
  5374. StrRowValue = "2";
  5375. }
  5376. else if ( StrRowValue == "2" )
  5377. {
  5378. StrRowValue = "1";
  5379. }
  5380. if ( !string.IsNullOrEmpty( StrRowValue ) )
  5381. {
  5382. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.OrderPhotographyStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  5383. }
  5384. else
  5385. {
  5386. StrRowValue = "";
  5387. }
  5388. break;
  5389. case "选片状态":
  5390. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  5391. if ( !string.IsNullOrEmpty( StrRowValue ) )
  5392. {
  5393. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.FilmSelectionStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  5394. }
  5395. else
  5396. {
  5397. StrRowValue = "";
  5398. }
  5399. break;
  5400. case "订单类型":
  5401. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  5402. if ( !string.IsNullOrEmpty( StrRowValue ) )
  5403. {
  5404. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.OrderType ), Convert.ToInt32( StrRowValue ) ).ToString();
  5405. }
  5406. else
  5407. {
  5408. StrRowValue = "";
  5409. }
  5410. break;
  5411. default:
  5412. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  5413. break;
  5414. }
  5415. newRow[newtable.Columns[j].ColumnName.Trim()] = StrRowValue;
  5416. }
  5417. newtable.Rows.Add( newRow );
  5418. }
  5419. #endregion
  5420. return newtable;
  5421. }
  5422. /// <summary>
  5423. /// 流程把控_已修未选
  5424. /// </summary>
  5425. /// <param name="dictColumns"></param>
  5426. /// <param name="StrQueryCondition"></param>
  5427. /// <param name="StrQueryCondition2"></param>
  5428. /// <param name="StrOrderBy"></param>
  5429. /// <returns></returns>
  5430. public static DataTable GetData_ProcessMonitorNotSelected2( Dictionary<string, string> dictColumns, string StrQueryCondition, string StrQueryCondition2, string StrOrderBy )
  5431. {
  5432. DataTable dt = new DataTable();
  5433. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  5434. {
  5435. dt = LYFZ.BLL.BLL_ErpOrderView.GetData_ProcessMonitorNotSelected2( dictColumns, StrQueryCondition, StrQueryCondition2, StrOrderBy );
  5436. } );
  5437. #region 重组DataTable
  5438. DataTable newtable = new DataTable();
  5439. foreach ( var item in dictColumns )
  5440. {
  5441. newtable.Columns.Add( item.Key.Trim(), typeof( string ) );
  5442. }
  5443. for ( int i = 0; i < dt.Rows.Count; i++ )
  5444. {
  5445. string StrTime = "";
  5446. if ( !string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["Ordv_ReservationFilmSelectionTime"] ) ) && !string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["下次提醒时间"] ) ) )
  5447. {
  5448. StrTime = dt.Rows[i]["下次提醒时间"].ToString().Trim();
  5449. if ( Convert.ToDateTime( dt.Rows[i]["Ordv_ReservationFilmSelectionTime"] ) > Convert.ToDateTime( dt.Rows[i]["下次提醒时间"] ) )
  5450. {
  5451. StrTime = dt.Rows[i]["Ordv_ReservationFilmSelectionTime"].ToString().Trim();
  5452. }
  5453. }
  5454. else if ( !string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["Ordv_ReservationFilmSelectionTime"] ) ) && string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["下次提醒时间"] ) ) )
  5455. {
  5456. StrTime = dt.Rows[i]["Ordv_ReservationFilmSelectionTime"].ToString().Trim();
  5457. }
  5458. else if ( string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["Ordv_ReservationFilmSelectionTime"] ) ) && !string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["下次提醒时间"] ) ) )
  5459. {
  5460. StrTime = dt.Rows[i]["下次提醒时间"].ToString().Trim();
  5461. }
  5462. if ( !string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( StrTime ) ) )
  5463. {
  5464. if ( (SDateTime.Now - Convert.ToDateTime( StrTime )).Days < 0 )
  5465. {
  5466. continue;
  5467. }
  5468. }
  5469. DataRow newRow = newtable.NewRow();
  5470. for ( int j = 0; j < newtable.Columns.Count; j++ )
  5471. {
  5472. string StrRowValue = "";
  5473. switch ( newtable.Columns[j].ColumnName.Trim() )
  5474. {
  5475. case "结婚日期":
  5476. case "初修日期":
  5477. case "预定时间":
  5478. case "沟通时间":
  5479. StrRowValue = LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i][newtable.Columns[j].ColumnName.Trim()] );
  5480. break;
  5481. case "初修师":
  5482. case "选片师":
  5483. case "客服人员":
  5484. string StrNameA = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  5485. if ( !string.IsNullOrEmpty( StrNameA.Trim() ) )
  5486. {
  5487. DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrNameA );
  5488. if ( dtRow != null )
  5489. {
  5490. StrRowValue += dtRow["User_Name"].ToString().Trim();
  5491. }
  5492. }
  5493. break;
  5494. case "初修状态":
  5495. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  5496. if ( !string.IsNullOrEmpty( StrRowValue ) )
  5497. {
  5498. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.EarlyRepairStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  5499. }
  5500. else
  5501. {
  5502. StrRowValue = "";
  5503. }
  5504. break;
  5505. case "选片状态":
  5506. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  5507. if ( !string.IsNullOrEmpty( StrRowValue ) )
  5508. {
  5509. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.FilmSelectionStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  5510. }
  5511. else
  5512. {
  5513. StrRowValue = "";
  5514. }
  5515. break;
  5516. case "订单类型":
  5517. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  5518. if ( !string.IsNullOrEmpty( StrRowValue ) )
  5519. {
  5520. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.OrderType ), Convert.ToInt32( StrRowValue ) ).ToString();
  5521. }
  5522. else
  5523. {
  5524. StrRowValue = "";
  5525. }
  5526. break;
  5527. default:
  5528. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  5529. break;
  5530. }
  5531. newRow[newtable.Columns[j].ColumnName.Trim()] = StrRowValue;
  5532. }
  5533. newtable.Rows.Add( newRow );
  5534. }
  5535. #endregion
  5536. return newtable;
  5537. }
  5538. /// <summary>
  5539. /// 流程把控_已选未设计
  5540. /// </summary>
  5541. /// <param name="dictColumns"></param>
  5542. /// <param name="StrQueryCondition"></param>
  5543. /// <param name="StrQueryCondition2"></param>
  5544. /// <param name="StrOrderBy"></param>
  5545. /// <returns></returns>
  5546. public static DataTable GetData_ProcessMonitorNotDesign( Dictionary<string, string> dictColumns, string StrQueryCondition, string StrQueryCondition2, string StrOrderBy )
  5547. {
  5548. DataTable dt = new DataTable();
  5549. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  5550. {
  5551. dt = LYFZ.BLL.BLL_ErpOrderView.GetData_ProcessMonitorNotDesign( dictColumns, StrQueryCondition, StrQueryCondition2, StrOrderBy );
  5552. } );
  5553. #region 重组DataTable
  5554. DataTable newtable = new DataTable();
  5555. foreach ( var item in dictColumns )
  5556. {
  5557. newtable.Columns.Add( item.Key.Trim(), typeof( string ) );
  5558. }
  5559. for ( int i = 0; i < dt.Rows.Count; i++ )
  5560. {
  5561. string StrTime = "";
  5562. if ( !string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["Ordv_ReservationDesignerTime"] ) ) && !string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["下次提醒时间"] ) ) )
  5563. {
  5564. StrTime = dt.Rows[i]["下次提醒时间"].ToString().Trim();
  5565. if ( Convert.ToDateTime( dt.Rows[i]["Ordv_ReservationDesignerTime"] ) > Convert.ToDateTime( dt.Rows[i]["下次提醒时间"] ) )
  5566. {
  5567. StrTime = dt.Rows[i]["Ordv_ReservationDesignerTime"].ToString().Trim();
  5568. }
  5569. }
  5570. else if ( !string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["Ordv_ReservationDesignerTime"] ) ) && string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["下次提醒时间"] ) ) )
  5571. {
  5572. StrTime = dt.Rows[i]["Ordv_ReservationDesignerTime"].ToString().Trim();
  5573. }
  5574. else if ( string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["Ordv_ReservationDesignerTime"] ) ) && !string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["下次提醒时间"] ) ) )
  5575. {
  5576. StrTime = dt.Rows[i]["下次提醒时间"].ToString().Trim();
  5577. }
  5578. if ( !string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( StrTime ) ) )
  5579. {
  5580. if ( (SDateTime.Now - Convert.ToDateTime( StrTime )).Days < 0 )
  5581. {
  5582. continue;
  5583. }
  5584. }
  5585. DataRow newRow = newtable.NewRow();
  5586. for ( int j = 0; j < newtable.Columns.Count; j++ )
  5587. {
  5588. string StrRowValue = "";
  5589. switch ( newtable.Columns[j].ColumnName.Trim() )
  5590. {
  5591. case "结婚日期":
  5592. case "选片日期":
  5593. case "预定时间":
  5594. case "沟通时间":
  5595. StrRowValue = LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i][newtable.Columns[j].ColumnName.Trim()] );
  5596. break;
  5597. case "设计师":
  5598. case "选片师":
  5599. case "客服人员":
  5600. string StrNameA = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  5601. if ( !string.IsNullOrEmpty( StrNameA.Trim() ) )
  5602. {
  5603. DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrNameA );
  5604. if ( dtRow != null )
  5605. {
  5606. StrRowValue += dtRow["User_Name"].ToString().Trim();
  5607. }
  5608. }
  5609. break;
  5610. case "设计状态":
  5611. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  5612. if ( !string.IsNullOrEmpty( StrRowValue ) )
  5613. {
  5614. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.DesignerStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  5615. }
  5616. else
  5617. {
  5618. StrRowValue = "";
  5619. }
  5620. break;
  5621. case "选片状态":
  5622. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  5623. if ( !string.IsNullOrEmpty( StrRowValue ) )
  5624. {
  5625. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.FilmSelectionStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  5626. }
  5627. else
  5628. {
  5629. StrRowValue = "";
  5630. }
  5631. break;
  5632. case "订单类型":
  5633. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  5634. if ( !string.IsNullOrEmpty( StrRowValue ) )
  5635. {
  5636. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.OrderType ), Convert.ToInt32( StrRowValue ) ).ToString();
  5637. }
  5638. else
  5639. {
  5640. StrRowValue = "";
  5641. }
  5642. break;
  5643. default:
  5644. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  5645. break;
  5646. }
  5647. newRow[newtable.Columns[j].ColumnName.Trim()] = StrRowValue;
  5648. }
  5649. newtable.Rows.Add( newRow );
  5650. }
  5651. #endregion
  5652. return newtable;
  5653. }
  5654. /// <summary>
  5655. /// 流程把控_已选未发片
  5656. /// </summary>
  5657. /// <param name="dictColumns"></param>
  5658. /// <param name="StrQueryCondition"></param>
  5659. /// <param name="StrQueryCondition2"></param>
  5660. /// <param name="StrOrderBy"></param>
  5661. /// <returns></returns>
  5662. public static DataTable GetData_ProcessMonitorNotSend2( Dictionary<string, string> dictColumns, string StrQueryCondition, string StrQueryCondition2, string StrOrderBy )
  5663. {
  5664. DataTable dt = new DataTable();
  5665. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  5666. {
  5667. dt = LYFZ.BLL.BLL_ErpOrderView.GetData_ProcessMonitorNotSend2( dictColumns, StrQueryCondition, StrQueryCondition2, StrOrderBy );
  5668. } );
  5669. #region 重组DataTable
  5670. DataTable newtable = new DataTable();
  5671. foreach ( var item in dictColumns )
  5672. {
  5673. newtable.Columns.Add( item.Key.Trim(), typeof( string ) );
  5674. }
  5675. for ( int i = 0; i < dt.Rows.Count; i++ )
  5676. {
  5677. if ( dt.Rows[i]["OPlist_IsSendOuntRemind"].ToString().Trim() == "2" )
  5678. {
  5679. if ( Convert.ToDateTime( dt.Rows[i]["OPlist_FilmSelectionTime"] ) == Convert.ToDateTime( dt.Rows[i]["Ordv_FilmSelectionTime"] ) )
  5680. {
  5681. continue;
  5682. }
  5683. }
  5684. DataRow newRow = newtable.NewRow();
  5685. for ( int j = 0; j < newtable.Columns.Count; j++ )
  5686. {
  5687. string StrRowValue = "";
  5688. switch ( newtable.Columns[j].ColumnName.Trim() )
  5689. {
  5690. case "结婚日期":
  5691. case "选片日期":
  5692. case "预定时间":
  5693. case "沟通时间":
  5694. StrRowValue = LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i][newtable.Columns[j].ColumnName.Trim()] );
  5695. break;
  5696. case "选片师":
  5697. case "客服人员":
  5698. string StrNameA = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  5699. if ( !string.IsNullOrEmpty( StrNameA.Trim() ) )
  5700. {
  5701. DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrNameA );
  5702. if ( dtRow != null )
  5703. {
  5704. StrRowValue += dtRow["User_Name"].ToString().Trim();
  5705. }
  5706. }
  5707. break;
  5708. case "发片状态":
  5709. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  5710. if ( !string.IsNullOrEmpty( StrRowValue ) )
  5711. {
  5712. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.ProductSendStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  5713. }
  5714. else
  5715. {
  5716. StrRowValue = "";
  5717. }
  5718. break;
  5719. case "选片状态":
  5720. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  5721. if ( !string.IsNullOrEmpty( StrRowValue ) )
  5722. {
  5723. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.FilmSelectionStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  5724. }
  5725. else
  5726. {
  5727. StrRowValue = "";
  5728. }
  5729. break;
  5730. case "订单类型":
  5731. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  5732. if ( !string.IsNullOrEmpty( StrRowValue ) )
  5733. {
  5734. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.OrderType ), Convert.ToInt32( StrRowValue ) ).ToString();
  5735. }
  5736. else
  5737. {
  5738. StrRowValue = "";
  5739. }
  5740. break;
  5741. default:
  5742. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  5743. break;
  5744. }
  5745. newRow[newtable.Columns[j].ColumnName.Trim()] = StrRowValue;
  5746. }
  5747. newtable.Rows.Add( newRow );
  5748. }
  5749. #endregion
  5750. return newtable;
  5751. }
  5752. /// <summary>
  5753. /// 流程把控_已设计未看版
  5754. /// </summary>
  5755. /// <param name="dictColumns"></param>
  5756. /// <param name="StrQueryCondition"></param>
  5757. /// <param name="StrQueryCondition2"></param>
  5758. /// <param name="StrOrderBy"></param>
  5759. /// <returns></returns>
  5760. public static DataTable GetData_ProcessMonitorNotLook( Dictionary<string, string> dictColumns, string StrQueryCondition, string StrQueryCondition2, string StrOrderBy )
  5761. {
  5762. DataTable dt = new DataTable();
  5763. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  5764. {
  5765. dt = LYFZ.BLL.BLL_ErpOrderView.GetData_ProcessMonitorNotLook( dictColumns, StrQueryCondition, StrQueryCondition2, StrOrderBy );
  5766. } );
  5767. #region 重组DataTable
  5768. DataTable newtable = new DataTable();
  5769. foreach ( var item in dictColumns )
  5770. {
  5771. newtable.Columns.Add( item.Key.Trim(), typeof( string ) );
  5772. }
  5773. for ( int i = 0; i < dt.Rows.Count; i++ )
  5774. {
  5775. string StrTime = "";
  5776. if ( !string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["Ordv_ReservationLookDesignTime"] ) ) && !string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["下次提醒时间"] ) ) )
  5777. {
  5778. StrTime = dt.Rows[i]["下次提醒时间"].ToString().Trim();
  5779. if ( Convert.ToDateTime( dt.Rows[i]["Ordv_ReservationLookDesignTime"] ) > Convert.ToDateTime( dt.Rows[i]["下次提醒时间"] ) )
  5780. {
  5781. StrTime = dt.Rows[i]["Ordv_ReservationLookDesignTime"].ToString().Trim();
  5782. }
  5783. }
  5784. else if ( !string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["Ordv_ReservationLookDesignTime"] ) ) && string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["下次提醒时间"] ) ) )
  5785. {
  5786. StrTime = dt.Rows[i]["Ordv_ReservationLookDesignTime"].ToString().Trim();
  5787. }
  5788. else if ( string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["Ordv_ReservationLookDesignTime"] ) ) && !string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["下次提醒时间"] ) ) )
  5789. {
  5790. StrTime = dt.Rows[i]["下次提醒时间"].ToString().Trim();
  5791. }
  5792. if ( !string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( StrTime ) ) )
  5793. {
  5794. if ( (SDateTime.Now - Convert.ToDateTime( StrTime )).Days < 0 )
  5795. {
  5796. continue;
  5797. }
  5798. }
  5799. DataRow newRow = newtable.NewRow();
  5800. for ( int j = 0; j < newtable.Columns.Count; j++ )
  5801. {
  5802. string StrRowValue = "";
  5803. switch ( newtable.Columns[j].ColumnName.Trim() )
  5804. {
  5805. case "结婚日期":
  5806. case "设计日期":
  5807. case "预定时间":
  5808. case "沟通时间":
  5809. StrRowValue = LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i][newtable.Columns[j].ColumnName.Trim()] );
  5810. break;
  5811. case "设计师":
  5812. case "看样师":
  5813. case "客服人员":
  5814. string StrNameA = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  5815. if ( !string.IsNullOrEmpty( StrNameA.Trim() ) )
  5816. {
  5817. DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrNameA );
  5818. if ( dtRow != null )
  5819. {
  5820. StrRowValue += dtRow["User_Name"].ToString().Trim();
  5821. }
  5822. }
  5823. break;
  5824. case "设计状态":
  5825. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  5826. if ( !string.IsNullOrEmpty( StrRowValue ) )
  5827. {
  5828. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.DesignerStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  5829. }
  5830. else
  5831. {
  5832. StrRowValue = "";
  5833. }
  5834. break;
  5835. case "看样状态":
  5836. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  5837. if ( !string.IsNullOrEmpty( StrRowValue ) )
  5838. {
  5839. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.LookDesignStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  5840. }
  5841. else
  5842. {
  5843. StrRowValue = "";
  5844. }
  5845. break;
  5846. case "订单类型":
  5847. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  5848. if ( !string.IsNullOrEmpty( StrRowValue ) )
  5849. {
  5850. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.OrderType ), Convert.ToInt32( StrRowValue ) ).ToString();
  5851. }
  5852. else
  5853. {
  5854. StrRowValue = "";
  5855. }
  5856. break;
  5857. default:
  5858. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  5859. break;
  5860. }
  5861. newRow[newtable.Columns[j].ColumnName.Trim()] = StrRowValue;
  5862. }
  5863. newtable.Rows.Add( newRow );
  5864. }
  5865. #endregion
  5866. return newtable;
  5867. }
  5868. /// <summary>
  5869. /// 流程把控_已看未发片
  5870. /// </summary>
  5871. /// <param name="dictColumns"></param>
  5872. /// <param name="StrQueryCondition"></param>
  5873. /// <param name="StrQueryCondition2"></param>
  5874. /// <param name="StrOrderBy"></param>
  5875. /// <returns></returns>
  5876. public static DataTable GetData_ProcessMonitorNotSend( Dictionary<string, string> dictColumns, string StrQueryCondition, string StrQueryCondition2, string StrOrderBy )
  5877. {
  5878. DataTable dt = new DataTable();
  5879. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  5880. {
  5881. dt = LYFZ.BLL.BLL_ErpOrderView.GetData_ProcessMonitorNotSend( dictColumns, StrQueryCondition, StrQueryCondition2, StrOrderBy );
  5882. } );
  5883. #region 重组DataTable
  5884. DataTable newtable = new DataTable();
  5885. foreach ( var item in dictColumns )
  5886. {
  5887. newtable.Columns.Add( item.Key.Trim(), typeof( string ) );
  5888. }
  5889. for ( int i = 0; i < dt.Rows.Count; i++ )
  5890. {
  5891. string StrTime = "";
  5892. if ( !string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["Ordv_ReservationSendPhotoTime"] ) ) && !string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["下次提醒时间"] ) ) )
  5893. {
  5894. StrTime = dt.Rows[i]["下次提醒时间"].ToString().Trim();
  5895. if ( Convert.ToDateTime( dt.Rows[i]["Ordv_ReservationSendPhotoTime"] ) > Convert.ToDateTime( dt.Rows[i]["下次提醒时间"] ) )
  5896. {
  5897. StrTime = dt.Rows[i]["Ordv_ReservationSendPhotoTime"].ToString().Trim();
  5898. }
  5899. }
  5900. else if ( !string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["Ordv_ReservationSendPhotoTime"] ) ) && string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["下次提醒时间"] ) ) )
  5901. {
  5902. StrTime = dt.Rows[i]["Ordv_ReservationSendPhotoTime"].ToString().Trim();
  5903. }
  5904. else if ( string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["Ordv_ReservationSendPhotoTime"] ) ) && !string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["下次提醒时间"] ) ) )
  5905. {
  5906. StrTime = dt.Rows[i]["下次提醒时间"].ToString().Trim();
  5907. }
  5908. if ( !string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( StrTime ) ) )
  5909. {
  5910. if ( (SDateTime.Now - Convert.ToDateTime( StrTime )).Days < 0 )
  5911. {
  5912. continue;
  5913. }
  5914. }
  5915. DataRow newRow = newtable.NewRow();
  5916. for ( int j = 0; j < newtable.Columns.Count; j++ )
  5917. {
  5918. string StrRowValue = "";
  5919. switch ( newtable.Columns[j].ColumnName.Trim() )
  5920. {
  5921. case "结婚日期":
  5922. case "看版日期":
  5923. case "预定时间":
  5924. case "沟通时间":
  5925. StrRowValue = LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i][newtable.Columns[j].ColumnName.Trim()] );
  5926. break;
  5927. case "看版师":
  5928. case "客服人员":
  5929. string StrNameA = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  5930. if ( !string.IsNullOrEmpty( StrNameA.Trim() ) )
  5931. {
  5932. DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrNameA );
  5933. if ( dtRow != null )
  5934. {
  5935. StrRowValue += dtRow["User_Name"].ToString().Trim();
  5936. }
  5937. }
  5938. break;
  5939. case "发片状态":
  5940. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  5941. if ( !string.IsNullOrEmpty( StrRowValue ) )
  5942. {
  5943. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.ProductSendStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  5944. }
  5945. else
  5946. {
  5947. StrRowValue = "";
  5948. }
  5949. break;
  5950. case "看版状态":
  5951. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  5952. if ( !string.IsNullOrEmpty( StrRowValue ) )
  5953. {
  5954. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.LookDesignStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  5955. }
  5956. else
  5957. {
  5958. StrRowValue = "";
  5959. }
  5960. break;
  5961. case "订单类型":
  5962. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  5963. if ( !string.IsNullOrEmpty( StrRowValue ) )
  5964. {
  5965. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.OrderType ), Convert.ToInt32( StrRowValue ) ).ToString();
  5966. }
  5967. else
  5968. {
  5969. StrRowValue = "";
  5970. }
  5971. break;
  5972. default:
  5973. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  5974. break;
  5975. }
  5976. newRow[newtable.Columns[j].ColumnName.Trim()] = StrRowValue;
  5977. }
  5978. newtable.Rows.Add( newRow );
  5979. }
  5980. #endregion
  5981. return newtable;
  5982. }
  5983. /// <summary>
  5984. /// 流程把控_已发未回件
  5985. /// </summary>
  5986. /// <param name="dictColumns"></param>
  5987. /// <param name="StrQueryCondition"></param>
  5988. /// <param name="StrQueryCondition2"></param>
  5989. /// <param name="StrOrderBy"></param>
  5990. /// <returns></returns>
  5991. public static DataTable GetData_ProcessMonitorNotBack( Dictionary<string, string> dictColumns, string StrQueryCondition, string StrQueryCondition2, string StrOrderBy )
  5992. {
  5993. DataTable dt = new DataTable();
  5994. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  5995. {
  5996. dt = LYFZ.BLL.BLL_ErpOrderView.GetData_ProcessMonitorNotBack( dictColumns, StrQueryCondition, StrQueryCondition2, StrOrderBy );
  5997. } );
  5998. #region 重组DataTable
  5999. DataTable newtable = new DataTable();
  6000. foreach ( var item in dictColumns )
  6001. {
  6002. newtable.Columns.Add( item.Key.Trim(), typeof( string ) );
  6003. }
  6004. for ( int i = 0; i < dt.Rows.Count; i++ )
  6005. {
  6006. DataRow newRow = newtable.NewRow();
  6007. for ( int j = 0; j < newtable.Columns.Count; j++ )
  6008. {
  6009. string StrRowValue = "";
  6010. switch ( newtable.Columns[j].ColumnName.Trim() )
  6011. {
  6012. case "结婚日期":
  6013. case "发片日期":
  6014. case "取件日期":
  6015. case "沟通时间":
  6016. StrRowValue = LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i][newtable.Columns[j].ColumnName.Trim()] );
  6017. break;
  6018. case "发片师":
  6019. case "客服人员":
  6020. string StrNameA = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  6021. if ( !string.IsNullOrEmpty( StrNameA.Trim() ) )
  6022. {
  6023. DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrNameA );
  6024. if ( dtRow != null )
  6025. {
  6026. StrRowValue += dtRow["User_Name"].ToString().Trim();
  6027. }
  6028. }
  6029. break;
  6030. case "发片状态":
  6031. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  6032. if ( !string.IsNullOrEmpty( StrRowValue ) )
  6033. {
  6034. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.ProductSendStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  6035. }
  6036. else
  6037. {
  6038. StrRowValue = "";
  6039. }
  6040. break;
  6041. case "完成状态":
  6042. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  6043. if ( !string.IsNullOrEmpty( StrRowValue ) )
  6044. {
  6045. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.ProductCompletedStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  6046. }
  6047. else
  6048. {
  6049. StrRowValue = "";
  6050. }
  6051. break;
  6052. case "取件状态":
  6053. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  6054. if ( !string.IsNullOrEmpty( StrRowValue ) )
  6055. {
  6056. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.ProductTakePiecesStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  6057. }
  6058. else
  6059. {
  6060. StrRowValue = "";
  6061. }
  6062. break;
  6063. case "订单类型":
  6064. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  6065. if ( !string.IsNullOrEmpty( StrRowValue ) )
  6066. {
  6067. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.OrderType ), Convert.ToInt32( StrRowValue ) ).ToString();
  6068. }
  6069. else
  6070. {
  6071. StrRowValue = "";
  6072. }
  6073. break;
  6074. default:
  6075. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  6076. break;
  6077. }
  6078. newRow[newtable.Columns[j].ColumnName.Trim()] = StrRowValue;
  6079. }
  6080. newtable.Rows.Add( newRow );
  6081. }
  6082. #endregion
  6083. return newtable;
  6084. }
  6085. /// <summary>
  6086. /// 流程把控_部分回未取件
  6087. /// </summary>
  6088. /// <param name="dictColumns"></param>
  6089. /// <param name="StrQueryCondition"></param>
  6090. /// <param name="StrQueryCondition2"></param>
  6091. /// <param name="StrOrderBy"></param>
  6092. /// <returns></returns>
  6093. public static DataTable GetData_ProcessMonitorNotPickup( Dictionary<string, string> dictColumns, string StrQueryCondition, string StrQueryCondition2, string StrOrderBy )
  6094. {
  6095. DataTable dt = new DataTable();
  6096. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  6097. {
  6098. dt = LYFZ.BLL.BLL_ErpOrderView.GetData_ProcessMonitorNotPickup( dictColumns, StrQueryCondition, StrQueryCondition2, StrOrderBy );
  6099. } );
  6100. #region 重组DataTable
  6101. DataTable newtable = new DataTable();
  6102. foreach ( var item in dictColumns )
  6103. {
  6104. newtable.Columns.Add( item.Key.Trim(), typeof( string ) );
  6105. }
  6106. for ( int i = 0; i < dt.Rows.Count; i++ )
  6107. {
  6108. string StrTime = "";
  6109. if ( !string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["OPlist_ReservationTakeTime"] ) ) && !string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["下次提醒时间"] ) ) )
  6110. {
  6111. StrTime = dt.Rows[i]["下次提醒时间"].ToString().Trim();
  6112. if ( Convert.ToDateTime( dt.Rows[i]["OPlist_ReservationTakeTime"] ) > Convert.ToDateTime( dt.Rows[i]["下次提醒时间"] ) )
  6113. {
  6114. StrTime = dt.Rows[i]["OPlist_ReservationTakeTime"].ToString().Trim();
  6115. }
  6116. }
  6117. else if ( !string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["OPlist_ReservationTakeTime"] ) ) && string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["下次提醒时间"] ) ) )
  6118. {
  6119. StrTime = dt.Rows[i]["OPlist_ReservationTakeTime"].ToString().Trim();
  6120. }
  6121. else if ( string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["OPlist_ReservationTakeTime"] ) ) && !string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["下次提醒时间"] ) ) )
  6122. {
  6123. StrTime = dt.Rows[i]["下次提醒时间"].ToString().Trim();
  6124. }
  6125. if ( !string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( StrTime ) ) )
  6126. {
  6127. if ( (SDateTime.Now - Convert.ToDateTime( StrTime )).Days < 0 )
  6128. {
  6129. continue;
  6130. }
  6131. }
  6132. DataRow newRow = newtable.NewRow();
  6133. for ( int j = 0; j < newtable.Columns.Count; j++ )
  6134. {
  6135. string StrRowValue = "";
  6136. switch ( newtable.Columns[j].ColumnName.Trim() )
  6137. {
  6138. case "结婚日期":
  6139. case "完成日期":
  6140. case "预定时间":
  6141. case "取件日期":
  6142. case "沟通时间":
  6143. StrRowValue = LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i][newtable.Columns[j].ColumnName.Trim()] );
  6144. break;
  6145. case "完成师":
  6146. case "客服人员":
  6147. string StrNameA = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  6148. if ( !string.IsNullOrEmpty( StrNameA.Trim() ) )
  6149. {
  6150. DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrNameA );
  6151. if ( dtRow != null )
  6152. {
  6153. StrRowValue += dtRow["User_Name"].ToString().Trim();
  6154. }
  6155. }
  6156. break;
  6157. case "完成状态":
  6158. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  6159. if ( !string.IsNullOrEmpty( StrRowValue ) )
  6160. {
  6161. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.ProductCompletedStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  6162. }
  6163. else
  6164. {
  6165. StrRowValue = "";
  6166. }
  6167. break;
  6168. case "超出天数":
  6169. StrRowValue = dt.Rows[i]["完成状态"].ToString().Trim();
  6170. if ( StrRowValue != "1" )
  6171. {
  6172. StrRowValue = "";
  6173. }
  6174. else
  6175. {
  6176. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  6177. }
  6178. break;
  6179. case "订单类型":
  6180. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  6181. if ( !string.IsNullOrEmpty( StrRowValue ) )
  6182. {
  6183. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.OrderType ), Convert.ToInt32( StrRowValue ) ).ToString();
  6184. }
  6185. else
  6186. {
  6187. StrRowValue = "";
  6188. }
  6189. break;
  6190. default:
  6191. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  6192. break;
  6193. }
  6194. newRow[newtable.Columns[j].ColumnName.Trim()] = StrRowValue;
  6195. }
  6196. newtable.Rows.Add( newRow );
  6197. }
  6198. #endregion
  6199. return newtable;
  6200. }
  6201. /// <summary>
  6202. /// 流程把控_全部回未取件
  6203. /// </summary>
  6204. /// <param name="dictColumns"></param>
  6205. /// <param name="StrQueryCondition"></param>
  6206. /// <param name="StrQueryCondition2"></param>
  6207. /// <param name="StrOrderBy"></param>
  6208. /// <returns></returns>
  6209. public static DataTable GetData_ProcessMonitorNotPickup2( Dictionary<string, string> dictColumns, string StrQueryCondition, string StrQueryCondition2, string StrOrderBy )
  6210. {
  6211. DataTable dt = new DataTable();
  6212. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  6213. {
  6214. dt = LYFZ.BLL.BLL_ErpOrderView.GetData_ProcessMonitorNotPickup2( dictColumns, StrQueryCondition, StrQueryCondition2, StrOrderBy );
  6215. } );
  6216. #region 重组DataTable
  6217. DataTable newtable = new DataTable();
  6218. foreach ( var item in dictColumns )
  6219. {
  6220. newtable.Columns.Add( item.Key.Trim(), typeof( string ) );
  6221. }
  6222. for ( int i = 0; i < dt.Rows.Count; i++ )
  6223. {
  6224. //string StrTime = "";
  6225. //if (!string.IsNullOrEmpty(LYFZ.BLL.OtherCommonModel.DateTimeToString(dt.Rows[i]["OPlist_ReservationTakeTime"])) && !string.IsNullOrEmpty(LYFZ.BLL.OtherCommonModel.DateTimeToString(dt.Rows[i]["下次提醒时间"])))
  6226. //{
  6227. // StrTime = dt.Rows[i]["下次提醒时间"].ToString().Trim();
  6228. // if (Convert.ToDateTime(dt.Rows[i]["OPlist_ReservationTakeTime"]) > Convert.ToDateTime(dt.Rows[i]["下次提醒时间"]))
  6229. // { StrTime = dt.Rows[i]["OPlist_ReservationTakeTime"].ToString().Trim(); }
  6230. //}
  6231. //else if (!string.IsNullOrEmpty(LYFZ.BLL.OtherCommonModel.DateTimeToString(dt.Rows[i]["OPlist_ReservationTakeTime"])) && string.IsNullOrEmpty(LYFZ.BLL.OtherCommonModel.DateTimeToString(dt.Rows[i]["下次提醒时间"])))
  6232. //{ StrTime = dt.Rows[i]["OPlist_ReservationTakeTime"].ToString().Trim(); }
  6233. //else if (string.IsNullOrEmpty(LYFZ.BLL.OtherCommonModel.DateTimeToString(dt.Rows[i]["OPlist_ReservationTakeTime"])) && !string.IsNullOrEmpty(LYFZ.BLL.OtherCommonModel.DateTimeToString(dt.Rows[i]["下次提醒时间"])))
  6234. //{ StrTime = dt.Rows[i]["下次提醒时间"].ToString().Trim(); }
  6235. //if (!string.IsNullOrEmpty(LYFZ.BLL.OtherCommonModel.DateTimeToString(StrTime)))
  6236. //{
  6237. // if ((SDateTime.Now - Convert.ToDateTime(StrTime)).Days <= 0)
  6238. // { continue; }
  6239. //}
  6240. //Ord_Number,Ordv_ViceNumber,订单号,客户姓名,客户电话,订单类型,拍摄名称,完成日期,完成状态,预定时间,客服人员,沟通时间,沟通状态,沟通备注,超出天数
  6241. DataRow newRow = newtable.NewRow();
  6242. for ( int j = 0; j < newtable.Columns.Count; j++ )
  6243. {
  6244. string StrRowValue = "";
  6245. switch ( newtable.Columns[j].ColumnName.Trim() )
  6246. {
  6247. case "完成日期":
  6248. case "预定时间":
  6249. case "沟通时间":
  6250. StrRowValue = LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i][newtable.Columns[j].ColumnName.Trim()] );
  6251. break;
  6252. case "客服人员":
  6253. string StrNameA = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  6254. if ( !string.IsNullOrEmpty( StrNameA.Trim() ) )
  6255. {
  6256. DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrNameA );
  6257. if ( dtRow != null )
  6258. {
  6259. StrRowValue += dtRow["User_Name"].ToString().Trim();
  6260. }
  6261. }
  6262. break;
  6263. case "完成状态":
  6264. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  6265. if ( StrRowValue == "2" )
  6266. {
  6267. StrRowValue = "OK";
  6268. }
  6269. else if ( StrRowValue == "1" )
  6270. {
  6271. StrRowValue = "部分完成";
  6272. }
  6273. else
  6274. {
  6275. StrRowValue = "未完";
  6276. }
  6277. break;
  6278. case "订单类型":
  6279. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  6280. if ( !string.IsNullOrEmpty( StrRowValue ) )
  6281. {
  6282. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.OrderType ), Convert.ToInt32( StrRowValue ) ).ToString();
  6283. }
  6284. else
  6285. {
  6286. StrRowValue = "";
  6287. }
  6288. break;
  6289. default:
  6290. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  6291. break;
  6292. }
  6293. newRow[newtable.Columns[j].ColumnName.Trim()] = StrRowValue;
  6294. }
  6295. newtable.Rows.Add( newRow );
  6296. }
  6297. #endregion
  6298. return newtable;
  6299. }
  6300. /// <summary>
  6301. /// 流程把控_已选未精修
  6302. /// </summary>
  6303. /// <param name="dictColumns"></param>
  6304. /// <param name="StrQueryCondition"></param>
  6305. /// <param name="StrQueryCondition2"></param>
  6306. /// <param name="StrOrderBy"></param>
  6307. /// <returns></returns>
  6308. public static DataTable GetData_ProcessMonitorSelectNotRefinement( Dictionary<string, string> dictColumns, string StrQueryCondition, string StrQueryCondition2, string StrOrderBy )
  6309. {
  6310. DataTable dt = new DataTable();
  6311. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  6312. {
  6313. dt = LYFZ.BLL.BLL_ErpOrderView.GetData_ProcessMonitorSelectNotRefinement( dictColumns, StrQueryCondition, StrQueryCondition2, StrOrderBy );
  6314. } );
  6315. #region 重组DataTable
  6316. DataTable newtable = new DataTable();
  6317. foreach ( var item in dictColumns )
  6318. {
  6319. newtable.Columns.Add( item.Key.Trim(), typeof( string ) );
  6320. }
  6321. for ( int i = 0; i < dt.Rows.Count; i++ )
  6322. {
  6323. string StrTime = "";
  6324. if ( !string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["Ordv_ReservationRefinementTime"] ) ) && !string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["下次提醒时间"] ) ) )
  6325. {
  6326. StrTime = dt.Rows[i]["下次提醒时间"].ToString().Trim();
  6327. if ( Convert.ToDateTime( dt.Rows[i]["Ordv_ReservationRefinementTime"] ) > Convert.ToDateTime( dt.Rows[i]["下次提醒时间"] ) )
  6328. {
  6329. StrTime = dt.Rows[i]["Ordv_ReservationRefinementTime"].ToString().Trim();
  6330. }
  6331. }
  6332. else if ( !string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["Ordv_ReservationRefinementTime"] ) ) && string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["下次提醒时间"] ) ) )
  6333. {
  6334. StrTime = dt.Rows[i]["Ordv_ReservationRefinementTime"].ToString().Trim();
  6335. }
  6336. else if ( string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["Ordv_ReservationRefinementTime"] ) ) && !string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["下次提醒时间"] ) ) )
  6337. {
  6338. StrTime = dt.Rows[i]["下次提醒时间"].ToString().Trim();
  6339. }
  6340. if ( !string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( StrTime ) ) )
  6341. {
  6342. if ( (SDateTime.Now - Convert.ToDateTime( StrTime )).Days < 0 )
  6343. {
  6344. continue;
  6345. }
  6346. }
  6347. DataRow newRow = newtable.NewRow();
  6348. for ( int j = 0; j < newtable.Columns.Count; j++ )
  6349. {
  6350. string StrRowValue = "";
  6351. switch ( newtable.Columns[j].ColumnName.Trim() )
  6352. {
  6353. case "结婚日期":
  6354. case "选片日期":
  6355. case "预定时间":
  6356. case "沟通时间":
  6357. StrRowValue = LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i][newtable.Columns[j].ColumnName.Trim()] );
  6358. break;
  6359. case "精修师":
  6360. case "选片师":
  6361. case "客服人员":
  6362. string StrNameA = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  6363. if ( !string.IsNullOrEmpty( StrNameA.Trim() ) )
  6364. {
  6365. DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrNameA );
  6366. if ( dtRow != null )
  6367. {
  6368. StrRowValue += dtRow["User_Name"].ToString().Trim();
  6369. }
  6370. }
  6371. break;
  6372. case "精修状态":
  6373. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  6374. if ( !string.IsNullOrEmpty( StrRowValue ) )
  6375. {
  6376. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.RefinementStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  6377. }
  6378. else
  6379. {
  6380. StrRowValue = "";
  6381. }
  6382. break;
  6383. case "选片状态":
  6384. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  6385. if ( !string.IsNullOrEmpty( StrRowValue ) )
  6386. {
  6387. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.FilmSelectionStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  6388. }
  6389. else
  6390. {
  6391. StrRowValue = "";
  6392. }
  6393. break;
  6394. case "订单类型":
  6395. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  6396. if ( !string.IsNullOrEmpty( StrRowValue ) )
  6397. {
  6398. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.OrderType ), Convert.ToInt32( StrRowValue ) ).ToString();
  6399. }
  6400. else
  6401. {
  6402. StrRowValue = "";
  6403. }
  6404. break;
  6405. default:
  6406. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  6407. break;
  6408. }
  6409. newRow[newtable.Columns[j].ColumnName.Trim()] = StrRowValue;
  6410. }
  6411. newtable.Rows.Add( newRow );
  6412. }
  6413. #endregion
  6414. return newtable;
  6415. }
  6416. /// <summary>
  6417. /// 流程把控_已精修未设计
  6418. /// </summary>
  6419. /// <param name="dictColumns"></param>
  6420. /// <param name="StrQueryCondition"></param>
  6421. /// <param name="StrQueryCondition2"></param>
  6422. /// <param name="StrOrderBy"></param>
  6423. /// <returns></returns>
  6424. public static DataTable GetData_ProcessMonitorRefinementNotDesign( Dictionary<string, string> dictColumns, string StrQueryCondition, string StrQueryCondition2, string StrOrderBy )
  6425. {
  6426. DataTable dt = new DataTable();
  6427. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  6428. {
  6429. dt = LYFZ.BLL.BLL_ErpOrderView.GetData_ProcessMonitorRefinementNotDesign( dictColumns, StrQueryCondition, StrQueryCondition2, StrOrderBy );
  6430. } );
  6431. #region 重组DataTable
  6432. DataTable newtable = new DataTable();
  6433. foreach ( var item in dictColumns )
  6434. {
  6435. newtable.Columns.Add( item.Key.Trim(), typeof( string ) );
  6436. }
  6437. for ( int i = 0; i < dt.Rows.Count; i++ )
  6438. {
  6439. string StrTime = "";
  6440. if ( !string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["Ordv_ReservationDesignerTime"] ) ) && !string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["下次提醒时间"] ) ) )
  6441. {
  6442. StrTime = dt.Rows[i]["下次提醒时间"].ToString().Trim();
  6443. if ( Convert.ToDateTime( dt.Rows[i]["Ordv_ReservationDesignerTime"] ) > Convert.ToDateTime( dt.Rows[i]["下次提醒时间"] ) )
  6444. {
  6445. StrTime = dt.Rows[i]["Ordv_ReservationDesignerTime"].ToString().Trim();
  6446. }
  6447. }
  6448. else if ( !string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["Ordv_ReservationDesignerTime"] ) ) && string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["下次提醒时间"] ) ) )
  6449. {
  6450. StrTime = dt.Rows[i]["Ordv_ReservationDesignerTime"].ToString().Trim();
  6451. }
  6452. else if ( string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["Ordv_ReservationDesignerTime"] ) ) && !string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i]["下次提醒时间"] ) ) )
  6453. {
  6454. StrTime = dt.Rows[i]["下次提醒时间"].ToString().Trim();
  6455. }
  6456. if ( !string.IsNullOrEmpty( LYFZ.BLL.OtherCommonModel.DateTimeToString( StrTime ) ) )
  6457. {
  6458. if ( (SDateTime.Now - Convert.ToDateTime( StrTime )).Days < 0 )
  6459. {
  6460. continue;
  6461. }
  6462. }
  6463. DataRow newRow = newtable.NewRow();
  6464. for ( int j = 0; j < newtable.Columns.Count; j++ )
  6465. {
  6466. string StrRowValue = "";
  6467. switch ( newtable.Columns[j].ColumnName.Trim() )
  6468. {
  6469. case "结婚日期":
  6470. case "选片日期":
  6471. case "预定时间":
  6472. case "沟通时间":
  6473. StrRowValue = LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i][newtable.Columns[j].ColumnName.Trim()] );
  6474. break;
  6475. case "精修师":
  6476. case "设计师":
  6477. case "客服人员":
  6478. string StrNameA = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  6479. if ( !string.IsNullOrEmpty( StrNameA.Trim() ) )
  6480. {
  6481. DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrNameA );
  6482. if ( dtRow != null )
  6483. {
  6484. StrRowValue += dtRow["User_Name"].ToString().Trim();
  6485. }
  6486. }
  6487. break;
  6488. case "精修状态":
  6489. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  6490. if ( !string.IsNullOrEmpty( StrRowValue ) )
  6491. {
  6492. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.RefinementStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  6493. }
  6494. else
  6495. {
  6496. StrRowValue = "";
  6497. }
  6498. break;
  6499. case "设计状态":
  6500. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  6501. if ( !string.IsNullOrEmpty( StrRowValue ) )
  6502. {
  6503. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.FilmSelectionStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  6504. }
  6505. else
  6506. {
  6507. StrRowValue = "";
  6508. }
  6509. break;
  6510. case "订单类型":
  6511. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  6512. if ( !string.IsNullOrEmpty( StrRowValue ) )
  6513. {
  6514. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.OrderType ), Convert.ToInt32( StrRowValue ) ).ToString();
  6515. }
  6516. else
  6517. {
  6518. StrRowValue = "";
  6519. }
  6520. break;
  6521. default:
  6522. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  6523. break;
  6524. }
  6525. newRow[newtable.Columns[j].ColumnName.Trim()] = StrRowValue;
  6526. }
  6527. newtable.Rows.Add( newRow );
  6528. }
  6529. #endregion
  6530. return newtable;
  6531. }
  6532. /// <summary>
  6533. /// 摄控本_拍照客人
  6534. /// </summary>
  6535. /// <param name="dgvData"></param>
  6536. /// <param name="dictColumns"></param>
  6537. /// <param name="StrQueryCondition"></param>
  6538. /// <param name="StrOrderBy"></param>
  6539. /// <returns></returns>
  6540. public static void GetData_CameraControlBookPhotographed( DataGridViewEc dgvData, Dictionary<string, string> dictColumns, string StrQueryCondition, string StrOrderBy )
  6541. {
  6542. DataTable newtable = new DataTable();
  6543. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  6544. {
  6545. newtable = LYFZ.BLL.BLL_ErpOrderView.GetData_CameraControlBookPhotographed( dictColumns, StrQueryCondition, StrOrderBy );
  6546. } );
  6547. if ( newtable.Rows.Count > 0 )
  6548. {
  6549. dgvData.DataSource( newtable );
  6550. }
  6551. else
  6552. {
  6553. dgvData.DataColumns( string.Join( ",", dictColumns.Keys.ToArray() ), strHideField: dgvData.dgvFixedHideColumn );
  6554. }
  6555. dgvData.Columns["客户姓名"].Frozen = true;
  6556. for ( int i = 0; i < dgvData.Rows.Count; i++ )
  6557. {
  6558. if ( dgvData.Columns.Contains( "Ord_Class" ) && dgvData.Rows[i].Cells["Ord_Class"].Value.ToString().Trim() == "0" )
  6559. {
  6560. dgvData.Rows[i].DefaultCellStyle.ForeColor = Color.Red;
  6561. }
  6562. if ( dgvData.Columns.Contains( "拍摄状态" ) && dgvData.Rows[i].Cells["拍摄状态"].Value.ToString().Trim().IndexOf( "重拍" ) != -1 )
  6563. {
  6564. dgvData.Rows[i].DefaultCellStyle.ForeColor = Color.Coral;
  6565. }
  6566. }
  6567. }
  6568. /// <summary>
  6569. /// 摄控本_选片客人
  6570. /// </summary>
  6571. /// <param name="dgvData"></param>
  6572. /// <param name="dictColumns"></param>
  6573. /// <param name="StrQueryCondition"></param>
  6574. /// <param name="StrOrderBy"></param>
  6575. /// <returns></returns>
  6576. public static void GetData_CameraControlBookFilmSelection( DataGridViewEc dgvData, Dictionary<string, string> dictColumns, string StrQueryCondition, string StrOrderBy )
  6577. {
  6578. DataTable newtable = new DataTable();
  6579. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  6580. {
  6581. newtable = LYFZ.BLL.BLL_ErpOrderView.GetData_CameraControlBookFilmSelection( dictColumns, StrQueryCondition, StrOrderBy );
  6582. } );
  6583. if ( newtable.Rows.Count > 0 )
  6584. {
  6585. dgvData.DataSource( newtable );
  6586. }
  6587. else
  6588. {
  6589. dgvData.DataColumns( string.Join( ",", dictColumns.Keys.ToArray() ), strHideField: dgvData.dgvFixedHideColumn );
  6590. }
  6591. dgvData.Columns["客户姓名"].Frozen = true;
  6592. }
  6593. /// <summary>
  6594. /// 摄控本_看样客人
  6595. /// </summary>
  6596. /// <param name="dictColumns"></param>
  6597. /// <param name="StrQueryCondition"></param>
  6598. /// <param name="StrOrderBy"></param>
  6599. /// <returns></returns>
  6600. public static void GetData_CameraControlBookLookDesign( DataGridViewEc dgvData, Dictionary<string, string> dictColumns, string StrQueryCondition, string StrOrderBy )
  6601. {
  6602. DataTable newtable = new DataTable();
  6603. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  6604. {
  6605. newtable = LYFZ.BLL.BLL_ErpOrderView.GetData_CameraControlBookLookDesign( dictColumns, StrQueryCondition, StrOrderBy );
  6606. } );
  6607. if ( newtable.Rows.Count > 0 )
  6608. {
  6609. dgvData.DataSource( newtable );
  6610. }
  6611. else
  6612. {
  6613. dgvData.DataColumns( string.Join( ",", dictColumns.Keys.ToArray() ), strHideField: dgvData.dgvFixedHideColumn );
  6614. }
  6615. dgvData.Columns["客户姓名"].Frozen = true;
  6616. }
  6617. /// <summary>
  6618. /// 摄控本_取件客人
  6619. /// </summary>
  6620. /// <param name="dictColumns"></param>
  6621. /// <param name="StrQueryCondition"></param>
  6622. /// <param name="StrOrderBy"></param>
  6623. /// <returns></returns>
  6624. public static void GetData_CameraControlBookTotakePiece( DataGridViewEc dgvData, Dictionary<string, string> dictColumns, string StrQueryCondition, string StrOrderBy )
  6625. {
  6626. DataTable newtable = new DataTable();
  6627. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  6628. {
  6629. newtable = LYFZ.BLL.BLL_ErpOrderView.GetData_CameraControlBookTotakePiece( dictColumns, StrQueryCondition, StrOrderBy );
  6630. } );
  6631. if ( newtable.Rows.Count > 0 )
  6632. {
  6633. dgvData.DataSource( newtable, dgvData.StrSecondStageNull );
  6634. }
  6635. else
  6636. {
  6637. dgvData.DataColumns( string.Join( ",", dictColumns.Keys.ToArray() ), strHideField: dgvData.dgvFixedHideColumn );
  6638. }
  6639. dgvData.Columns["客户姓名"].Frozen = true;
  6640. for ( int i = 0; i < dgvData.Rows.Count; i++ )
  6641. {
  6642. if ( dgvData.Columns.Contains( "欠款" ) && !string.IsNullOrEmpty( Convert.ToString( dgvData.Rows[i].Cells["欠款"].Value ) ) && Convert.ToDecimal( dgvData.Rows[i].Cells["欠款"].Value ) > 0 )
  6643. {
  6644. dgvData.Rows[i].DefaultCellStyle.ForeColor = Color.Red;
  6645. }
  6646. }
  6647. }
  6648. /// <summary>
  6649. /// 摄控本_服务客人
  6650. /// </summary>
  6651. /// <param name="dictColumns"></param>
  6652. /// <param name="StrQueryCondition"></param>
  6653. /// <param name="StrOrderBy"></param>
  6654. /// <returns></returns>
  6655. public static void GetData_CameraControlBookService( DataGridViewEc dgvData, Dictionary<string, string> dictColumns, string StrQueryCondition, string StrOrderBy )
  6656. {
  6657. DataTable newtable = new DataTable();
  6658. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  6659. {
  6660. newtable = LYFZ.BLL.BLL_ErpOrderView.GetData_CameraControlBookService( dictColumns, StrQueryCondition, StrOrderBy );
  6661. } );
  6662. if ( newtable.Rows.Count > 0 )
  6663. {
  6664. dgvData.DataSource( newtable, StrSecondStageNull: dgvData.StrSecondStageNull );
  6665. }
  6666. else
  6667. {
  6668. dgvData.DataColumns( string.Join( ",", dictColumns.Keys.ToArray() ), strHideField: dgvData.dgvFixedHideColumn );
  6669. }
  6670. dgvData.Columns["客户姓名"].Frozen = true;
  6671. }
  6672. /// <summary>
  6673. /// 摄控本_选衣客人
  6674. /// </summary>
  6675. /// <param name="dictColumns"></param>
  6676. /// <param name="StrQueryCondition"></param>
  6677. /// <param name="StrOrderBy"></param>
  6678. /// <returns></returns>
  6679. public static void GetData_CameraControlBookSelectDress( DataGridViewEc dgvData, Dictionary<string, string> dictColumns, string StrQueryCondition, string StrOrderBy )
  6680. {
  6681. DataTable newtable = new DataTable();
  6682. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  6683. {
  6684. newtable = LYFZ.BLL.BLL_ErpOrderView.GetData_CameraControlBookSelectDress( dictColumns, StrQueryCondition, StrOrderBy );
  6685. } );
  6686. if ( newtable.Rows.Count > 0 )
  6687. {
  6688. dgvData.DataSource( newtable, StrSecondStageNull: dgvData.StrSecondStageNull );
  6689. }
  6690. else
  6691. {
  6692. dgvData.DataColumns( string.Join( ",", dictColumns.Keys.ToArray() ), strHideField: dgvData.dgvFixedHideColumn );
  6693. }
  6694. dgvData.Columns["客户姓名"].Frozen = true;
  6695. }
  6696. /// <summary>
  6697. /// 摄控本_医院客人
  6698. /// </summary>
  6699. /// <param name="dictColumns"></param>
  6700. /// <param name="StrQueryCondition"></param>
  6701. /// <param name="StrOrderBy"></param>
  6702. /// <returns></returns>
  6703. public static void GetData_CameraControlBookUpDoorSendSingle( DataGridViewEc dgvData, Dictionary<string, string> dictColumns, string StrQueryCondition, string StrOrderBy )
  6704. {
  6705. DataTable newtable = new DataTable();
  6706. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  6707. {
  6708. newtable = LYFZ.BLL.BLL_ErpOrderView.GetData_CameraControlBookUpDoorSendSingle( dictColumns, StrQueryCondition, StrOrderBy );
  6709. } );
  6710. if ( newtable.Rows.Count > 0 )
  6711. {
  6712. dgvData.DataSource( newtable );
  6713. }
  6714. else
  6715. {
  6716. dgvData.DataColumns( string.Join( ",", dictColumns.Keys.ToArray() ), strHideField: dgvData.dgvFixedHideColumn );
  6717. }
  6718. dgvData.Columns["客户姓名"].Frozen = true;
  6719. }
  6720. /// <summary>
  6721. /// 摄控本_统计未拍客人
  6722. /// </summary>
  6723. /// <param name="dictColumns"></param>
  6724. /// <param name="StrQueryCondition"></param>
  6725. /// <param name="StrOrderBy"></param>
  6726. /// <returns></returns>
  6727. public static Hashtable GetData_CameraControlBookPhotographedNot( DataGridViewEc dgvData, Dictionary<string, string> dictColumns, string StrQueryCondition, int inTopCount, string StrOrderBy )
  6728. {
  6729. DataSet dtSet = new DataSet();
  6730. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  6731. {
  6732. dtSet = LYFZ.BLL.BLL_ErpOrderView.GetData_CameraControlBookPhotographedNot( dictColumns, StrQueryCondition, inTopCount, StrOrderBy );
  6733. } );
  6734. #region 重组DataTable
  6735. DataTable dt = dtSet.Tables["ds"];
  6736. DataTable newtable = new DataTable();
  6737. foreach ( var item in dictColumns )
  6738. {
  6739. newtable.Columns.Add( item.Key.Trim(), typeof( string ) );
  6740. }
  6741. for ( int i = 0; i < dt.Rows.Count; i++ )
  6742. {
  6743. DataRow newRow = newtable.NewRow();
  6744. for ( int j = 0; j < newtable.Columns.Count; j++ )
  6745. {
  6746. string StrRowValue = "";
  6747. switch ( newtable.Columns[j].ColumnName.Trim() )
  6748. {
  6749. case "婚期":
  6750. case "订单日期":
  6751. case "摄影时间":
  6752. StrRowValue = LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i][newtable.Columns[j].ColumnName.Trim()] );
  6753. break;
  6754. case "摄影师":
  6755. case "摄影助理":
  6756. case "化妆师":
  6757. case "化妆助理":
  6758. case "引导师":
  6759. case "引导助理":
  6760. string StrNameA = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  6761. if ( !string.IsNullOrEmpty( StrNameA.Trim() ) )
  6762. {
  6763. DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrNameA );
  6764. if ( dtRow != null )
  6765. {
  6766. StrRowValue += dtRow["User_Name"].ToString().Trim();
  6767. }
  6768. }
  6769. break;
  6770. case "拍摄状态":
  6771. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  6772. if ( !string.IsNullOrEmpty( StrRowValue ) )
  6773. {
  6774. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.PhotographyStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  6775. }
  6776. else
  6777. {
  6778. StrRowValue = "";
  6779. }
  6780. break;
  6781. case "订单类型":
  6782. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  6783. if ( !string.IsNullOrEmpty( StrRowValue ) )
  6784. {
  6785. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.OrderType ), Convert.ToInt32( StrRowValue ) ).ToString();
  6786. }
  6787. else
  6788. {
  6789. StrRowValue = "";
  6790. }
  6791. break;
  6792. default:
  6793. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  6794. break;
  6795. }
  6796. newRow[newtable.Columns[j].ColumnName.Trim()] = StrRowValue;
  6797. }
  6798. newtable.Rows.Add( newRow );
  6799. }
  6800. #endregion
  6801. if ( newtable.Rows.Count > 0 )
  6802. {
  6803. dgvData.DataSource( newtable );
  6804. }
  6805. else
  6806. {
  6807. dgvData.DataColumns( string.Join( ",", dictColumns.Keys.ToArray() ), strHideField: dgvData.dgvFixedHideColumn );
  6808. }
  6809. dgvData.Columns["客户姓名"].Frozen = true;
  6810. Hashtable htCount = new Hashtable();
  6811. for ( int i = 0; i < dt.Rows.Count; i++ )
  6812. {
  6813. htCount[dt.Rows[i]["Ord_Number"].ToString().Trim()] = dt.Rows[i]["Ord_Number"].ToString().Trim();
  6814. }
  6815. Hashtable htData = new Hashtable();
  6816. htData["TotalCount"] = Convert.ToInt32( dtSet.Tables["ds1"].Rows[0]["CountID"] );
  6817. htData["CurrentCount"] = htCount.Count;
  6818. return htData;
  6819. }
  6820. /// <summary>
  6821. /// 摄控本_统计未选片客人
  6822. /// </summary>
  6823. /// <param name="dictColumns"></param>
  6824. /// <param name="StrQueryCondition"></param>
  6825. /// <param name="StrOrderBy"></param>
  6826. /// <returns></returns>
  6827. public static Hashtable GetData_CameraControlBookFilmSelectionNot( DataGridViewEc dgvData, Dictionary<string, string> dictColumns, string StrQueryCondition, int inTopCount, string StrOrderBy )
  6828. {
  6829. DataSet dtSet = new DataSet();
  6830. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  6831. {
  6832. dtSet = LYFZ.BLL.BLL_ErpOrderView.GetData_CameraControlBookFilmSelectionNot( dictColumns, StrQueryCondition, inTopCount, StrOrderBy );
  6833. } );
  6834. #region 重组DataTable
  6835. DataTable dt = dtSet.Tables["ds"];
  6836. DataTable newtable = new DataTable();
  6837. foreach ( var item in dictColumns )
  6838. {
  6839. newtable.Columns.Add( item.Key.Trim(), typeof( string ) );
  6840. }
  6841. for ( int i = 0; i < dt.Rows.Count; i++ )
  6842. {
  6843. DataRow newRow = newtable.NewRow();
  6844. for ( int j = 0; j < newtable.Columns.Count; j++ )
  6845. {
  6846. string StrRowValue = "";
  6847. switch ( newtable.Columns[j].ColumnName.Trim() )
  6848. {
  6849. case "婚期":
  6850. case "选片时间":
  6851. case "安排时间":
  6852. StrRowValue = LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i][newtable.Columns[j].ColumnName.Trim()] );
  6853. break;
  6854. case "选片师":
  6855. case "安排人员":
  6856. string StrNameA = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  6857. if ( !string.IsNullOrEmpty( StrNameA.Trim() ) )
  6858. {
  6859. DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrNameA );
  6860. if ( dtRow != null )
  6861. {
  6862. StrRowValue += dtRow["User_Name"].ToString().Trim();
  6863. }
  6864. }
  6865. break;
  6866. case "拍照状态":
  6867. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  6868. if (!string.IsNullOrEmpty(StrRowValue))
  6869. {
  6870. StrRowValue = Enum.ToObject(typeof(LYFZ.EnumPublic.OrderPhotographyStatusEnum), Convert.ToInt32(StrRowValue)).ToString();
  6871. }
  6872. else
  6873. {
  6874. StrRowValue = "";
  6875. }
  6876. break;
  6877. case "初修状态":
  6878. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  6879. if ( !string.IsNullOrEmpty( StrRowValue ) )
  6880. {
  6881. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.EarlyRepairStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  6882. }
  6883. else
  6884. {
  6885. StrRowValue = "";
  6886. }
  6887. break;
  6888. case "选片状态":
  6889. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  6890. if ( !string.IsNullOrEmpty( StrRowValue ) )
  6891. {
  6892. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.FilmSelectionStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  6893. }
  6894. else
  6895. {
  6896. StrRowValue = "";
  6897. }
  6898. break;
  6899. case "订单类型":
  6900. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  6901. if ( !string.IsNullOrEmpty( StrRowValue ) )
  6902. {
  6903. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.OrderType ), Convert.ToInt32( StrRowValue ) ).ToString();
  6904. }
  6905. else
  6906. {
  6907. StrRowValue = "";
  6908. }
  6909. break;
  6910. default:
  6911. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  6912. break;
  6913. }
  6914. newRow[newtable.Columns[j].ColumnName.Trim()] = StrRowValue;
  6915. }
  6916. newtable.Rows.Add( newRow );
  6917. }
  6918. #endregion
  6919. if ( newtable.Rows.Count > 0 )
  6920. {
  6921. dgvData.DataSource( newtable );
  6922. }
  6923. else
  6924. {
  6925. dgvData.DataColumns( string.Join( ",", dictColumns.Keys.ToArray() ), strHideField: dgvData.dgvFixedHideColumn );
  6926. }
  6927. dgvData.Columns["客户姓名"].Frozen = true;
  6928. Hashtable htCount = new Hashtable();
  6929. for ( int i = 0; i < dt.Rows.Count; i++ )
  6930. {
  6931. htCount[dt.Rows[i]["Ord_Number"].ToString().Trim()] = dt.Rows[i]["Ord_Number"].ToString().Trim();
  6932. }
  6933. Hashtable htData = new Hashtable();
  6934. htData["TotalCount"] = Convert.ToInt32( dtSet.Tables["ds1"].Rows[0]["CountID"] );
  6935. htData["CurrentCount"] = htCount.Count;
  6936. return htData;
  6937. }
  6938. /// <summary>
  6939. /// 摄控本_统计未看版客人
  6940. /// </summary>
  6941. /// <param name="dictColumns"></param>
  6942. /// <param name="StrQueryCondition"></param>
  6943. /// <param name="StrOrderBy"></param>
  6944. /// <returns></returns>
  6945. public static Hashtable GetData_CameraControlBookLookDesignNot( DataGridViewEc dgvData, Dictionary<string, string> dictColumns, string StrQueryCondition, int inTopCount, string StrOrderBy )
  6946. {
  6947. DataSet dtSet = new DataSet();
  6948. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  6949. {
  6950. dtSet = LYFZ.BLL.BLL_ErpOrderView.GetData_CameraControlBookLookDesignNot( dictColumns, StrQueryCondition, inTopCount, StrOrderBy );
  6951. } );
  6952. #region 重组DataTable
  6953. DataTable dt = dtSet.Tables["ds"];
  6954. DataTable newtable = new DataTable();
  6955. foreach ( var item in dictColumns )
  6956. {
  6957. newtable.Columns.Add( item.Key.Trim(), typeof( string ) );
  6958. }
  6959. for ( int i = 0; i < dt.Rows.Count; i++ )
  6960. {
  6961. DataRow newRow = newtable.NewRow();
  6962. for ( int j = 0; j < newtable.Columns.Count; j++ )
  6963. {
  6964. string StrRowValue = "";
  6965. switch ( newtable.Columns[j].ColumnName.Trim() )
  6966. {
  6967. case "婚期":
  6968. case "选片时间":
  6969. case "看版时间":
  6970. case "安排时间":
  6971. StrRowValue = LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i][newtable.Columns[j].ColumnName.Trim()] );
  6972. break;
  6973. case "看版师":
  6974. case "安排人员":
  6975. string StrNameA = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  6976. if ( !string.IsNullOrEmpty( StrNameA.Trim() ) )
  6977. {
  6978. DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrNameA );
  6979. if ( dtRow != null )
  6980. {
  6981. StrRowValue += dtRow["User_Name"].ToString().Trim();
  6982. }
  6983. }
  6984. break;
  6985. case "设计状态":
  6986. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  6987. if ( !string.IsNullOrEmpty( StrRowValue ) )
  6988. {
  6989. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.DesignerStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  6990. }
  6991. else
  6992. {
  6993. StrRowValue = "";
  6994. }
  6995. break;
  6996. case "看版状态":
  6997. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  6998. if ( !string.IsNullOrEmpty( StrRowValue ) )
  6999. {
  7000. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.LookDesignStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  7001. }
  7002. else
  7003. {
  7004. StrRowValue = "";
  7005. }
  7006. break;
  7007. case "选片状态":
  7008. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  7009. if ( !string.IsNullOrEmpty( StrRowValue ) )
  7010. {
  7011. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.FilmSelectionStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  7012. }
  7013. else
  7014. {
  7015. StrRowValue = "";
  7016. }
  7017. break;
  7018. case "订单类型":
  7019. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  7020. if ( !string.IsNullOrEmpty( StrRowValue ) )
  7021. {
  7022. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.OrderType ), Convert.ToInt32( StrRowValue ) ).ToString();
  7023. }
  7024. else
  7025. {
  7026. StrRowValue = "";
  7027. }
  7028. break;
  7029. default:
  7030. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  7031. break;
  7032. }
  7033. newRow[newtable.Columns[j].ColumnName.Trim()] = StrRowValue;
  7034. }
  7035. newtable.Rows.Add( newRow );
  7036. }
  7037. #endregion
  7038. if ( newtable.Rows.Count > 0 )
  7039. {
  7040. dgvData.DataSource( newtable );
  7041. }
  7042. else
  7043. {
  7044. dgvData.DataColumns( string.Join( ",", dictColumns.Keys.ToArray() ), strHideField: dgvData.dgvFixedHideColumn );
  7045. }
  7046. dgvData.Columns["客户姓名"].Frozen = true;
  7047. Hashtable htCount = new Hashtable();
  7048. for ( int i = 0; i < dt.Rows.Count; i++ )
  7049. {
  7050. htCount[dt.Rows[i]["Ord_Number"].ToString().Trim()] = dt.Rows[i]["Ord_Number"].ToString().Trim();
  7051. }
  7052. Hashtable htData = new Hashtable();
  7053. htData["TotalCount"] = Convert.ToInt32( dtSet.Tables["ds1"].Rows[0]["CountID"] );
  7054. htData["CurrentCount"] = htCount.Count;
  7055. return htData;
  7056. }
  7057. /// <summary>
  7058. /// 摄控本_统计未取件客人
  7059. /// </summary>
  7060. /// <param name="dictColumns"></param>
  7061. /// <param name="StrQueryCondition"></param>
  7062. /// <param name="StrOrderBy"></param>
  7063. /// <returns></returns>
  7064. public static Hashtable GetData_CameraControlBookTotakePieceNot( DataGridViewEc dgvData, Dictionary<string, string> dictColumns, List<string> listColumns, string StrQueryCondition, int inTopCount, string StrOrderBy )
  7065. {
  7066. DataSet dtSet = new DataSet();
  7067. Hashtable htData = new Hashtable();
  7068. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  7069. {
  7070. dtSet = LYFZ.BLL.BLL_ErpOrderView.GetData_CameraControlBookTotakePieceNot( dictColumns, listColumns, StrQueryCondition, inTopCount, StrOrderBy );
  7071. } );
  7072. #region 重组DataTable
  7073. DataTable newtable = new DataTable();
  7074. foreach ( var item in dictColumns )
  7075. {
  7076. newtable.Columns.Add( item.Key.Trim(), typeof( string ) );
  7077. }
  7078. if ( dtSet.Tables["ds1"] != null )
  7079. {
  7080. DataTable dt = dtSet.Tables["ds"];
  7081. for ( int i = 0; i < dt.Rows.Count; i++ )
  7082. {
  7083. DataRow newRow = newtable.NewRow();
  7084. for ( int j = 0; j < newtable.Columns.Count; j++ )
  7085. {
  7086. string StrRowValue = "";
  7087. switch ( newtable.Columns[j].ColumnName.Trim() )
  7088. {
  7089. case "加急":
  7090. StrRowValue = Convert.ToBoolean( dt.Rows[i][newtable.Columns[j].ColumnName.Trim()] ) ? "加急" : "否";
  7091. break;
  7092. case "婚期":
  7093. case "取件日期":
  7094. case "加急日期":
  7095. StrRowValue = LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i][newtable.Columns[j].ColumnName.Trim()] );
  7096. break;
  7097. case "取件人":
  7098. string StrNameA = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  7099. if ( !string.IsNullOrEmpty( StrNameA.Trim() ) )
  7100. {
  7101. DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrNameA );
  7102. if ( dtRow != null )
  7103. {
  7104. StrRowValue += dtRow["User_Name"].ToString().Trim();
  7105. }
  7106. }
  7107. break;
  7108. case "取件状态":
  7109. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  7110. if ( !string.IsNullOrEmpty( StrRowValue ) )
  7111. {
  7112. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.ProductTakePiecesStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  7113. }
  7114. else
  7115. {
  7116. StrRowValue = "";
  7117. }
  7118. break;
  7119. case "完成状态":
  7120. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  7121. if ( !string.IsNullOrEmpty( StrRowValue ) )
  7122. {
  7123. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.ProductCompletedStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  7124. }
  7125. else
  7126. {
  7127. StrRowValue = "";
  7128. }
  7129. break;
  7130. case "订单类型":
  7131. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  7132. if ( !string.IsNullOrEmpty( StrRowValue ) )
  7133. {
  7134. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.OrderType ), Convert.ToInt32( StrRowValue ) ).ToString();
  7135. }
  7136. else
  7137. {
  7138. StrRowValue = "";
  7139. }
  7140. break;
  7141. default:
  7142. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  7143. break;
  7144. }
  7145. newRow[newtable.Columns[j].ColumnName.Trim()] = StrRowValue;
  7146. }
  7147. newtable.Rows.Add( newRow );
  7148. }
  7149. Hashtable htCount = new Hashtable();
  7150. for ( int i = 0; i < dt.Rows.Count; i++ )
  7151. {
  7152. htCount[dt.Rows[i]["Ord_Number"].ToString().Trim()] = dt.Rows[i]["Ord_Number"].ToString().Trim();
  7153. }
  7154. htData["TotalCount"] = Convert.ToInt32( dtSet.Tables["ds1"].Rows[0]["CountID"] );
  7155. htData["CurrentCount"] = htCount.Count;
  7156. }
  7157. else
  7158. {
  7159. htData["TotalCount"] = Convert.ToInt32( dtSet.Tables["ds"].Rows[0]["CountID"] );
  7160. htData["CurrentCount"] = 0;
  7161. }
  7162. #endregion
  7163. if ( newtable.Rows.Count > 0 )
  7164. {
  7165. dgvData.DataSource( newtable, StrSecondStageNull: dgvData.StrSecondStageNull );
  7166. }
  7167. else
  7168. {
  7169. dgvData.DataColumns( string.Join( ",", dictColumns.Keys.ToArray() ), strHideField: dgvData.dgvFixedHideColumn );
  7170. }
  7171. dgvData.Columns["客户姓名"].Frozen = true;
  7172. return htData;
  7173. }
  7174. /// <summary>
  7175. /// 摄控本_统计未服务客人
  7176. /// </summary>
  7177. /// <param name="dictColumns"></param>
  7178. /// <param name="StrQueryCondition"></param>
  7179. /// <param name="StrOrderBy"></param>
  7180. /// <returns></returns>
  7181. public static Hashtable GetData_CameraControlBookServiceNot( DataGridViewEc dgvData, Dictionary<string, string> dictColumns, List<string> listColumns, string StrQueryCondition, int inTopCount, string StrOrderBy )
  7182. {
  7183. DataSet dtSet = new DataSet();
  7184. Hashtable htData = new Hashtable();
  7185. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  7186. {
  7187. dtSet = LYFZ.BLL.BLL_ErpOrderView.GetData_CameraControlBookServiceNot( dictColumns, listColumns, StrQueryCondition, inTopCount, StrOrderBy );
  7188. } );
  7189. #region 重组DataTable
  7190. DataTable newtable = new DataTable();
  7191. foreach ( var item in dictColumns )
  7192. {
  7193. newtable.Columns.Add( item.Key.Trim(), typeof( string ) );
  7194. }
  7195. if ( dtSet.Tables["ds1"] != null )
  7196. {
  7197. DataTable dt = dtSet.Tables["ds"];
  7198. for ( int i = 0; i < dt.Rows.Count; i++ )
  7199. {
  7200. DataRow newRow = newtable.NewRow();
  7201. for ( int j = 0; j < newtable.Columns.Count; j++ )
  7202. {
  7203. string StrRowValue = "";
  7204. switch ( newtable.Columns[j].ColumnName.Trim() )
  7205. {
  7206. case "婚期":
  7207. case "婚庆日期":
  7208. StrRowValue = LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i][newtable.Columns[j].ColumnName.Trim()] );
  7209. break;
  7210. case "服务人员1":
  7211. case "服务人员2":
  7212. string StrNameA = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  7213. if ( !string.IsNullOrEmpty( StrNameA.Trim() ) )
  7214. {
  7215. DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrNameA );
  7216. if ( dtRow != null )
  7217. {
  7218. StrRowValue += dtRow["User_Name"].ToString().Trim();
  7219. }
  7220. }
  7221. break;
  7222. case "服务状态":
  7223. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  7224. if ( !string.IsNullOrEmpty( StrRowValue ) )
  7225. {
  7226. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.WeddingServiceStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  7227. }
  7228. else
  7229. {
  7230. StrRowValue = "";
  7231. }
  7232. break;
  7233. case "订单类型":
  7234. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  7235. if ( !string.IsNullOrEmpty( StrRowValue ) )
  7236. {
  7237. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.OrderType ), Convert.ToInt32( StrRowValue ) ).ToString();
  7238. }
  7239. else
  7240. {
  7241. StrRowValue = "";
  7242. }
  7243. break;
  7244. default:
  7245. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  7246. break;
  7247. }
  7248. newRow[newtable.Columns[j].ColumnName.Trim()] = StrRowValue;
  7249. }
  7250. newtable.Rows.Add( newRow );
  7251. }
  7252. Hashtable htCount = new Hashtable();
  7253. for ( int i = 0; i < dt.Rows.Count; i++ )
  7254. {
  7255. htCount[dt.Rows[i]["Ord_Number"].ToString().Trim()] = dt.Rows[i]["Ord_Number"].ToString().Trim();
  7256. }
  7257. htData["TotalCount"] = Convert.ToInt32( dtSet.Tables["ds1"].Rows[0]["CountID"] );
  7258. htData["CurrentCount"] = htCount.Count;
  7259. }
  7260. else
  7261. {
  7262. htData["TotalCount"] = Convert.ToInt32( dtSet.Tables["ds"].Rows[0]["CountID"] );
  7263. htData["CurrentCount"] = 0;
  7264. }
  7265. #endregion
  7266. if ( newtable.Rows.Count > 0 )
  7267. {
  7268. dgvData.DataSource( newtable, dgvData.StrSecondStageNull );
  7269. }
  7270. else
  7271. {
  7272. dgvData.DataColumns( string.Join( ",", dictColumns.Keys.ToArray() ), strHideField: dgvData.dgvFixedHideColumn );
  7273. }
  7274. dgvData.Columns["客户姓名"].Frozen = true;
  7275. return htData;
  7276. }
  7277. /// <summary>
  7278. /// 摄控本_统计未选衣服客人
  7279. /// </summary>
  7280. /// <param name="dictColumns"></param>
  7281. /// <param name="StrQueryCondition"></param>
  7282. /// <param name="inTopCount"></param>
  7283. /// <param name="StrOrderBy"></param>
  7284. /// <returns></returns>
  7285. public static Hashtable GetData_CameraControlBookSelectDressNot( DataGridViewEc dgvData, Dictionary<string, string> dictColumns, string StrQueryCondition, int inTopCount, string StrOrderBy )
  7286. {
  7287. DataSet dtSet = new DataSet();
  7288. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  7289. {
  7290. dtSet = LYFZ.BLL.BLL_ErpOrderView.GetData_CameraControlBookSelectDressNot( dictColumns, StrQueryCondition, inTopCount, StrOrderBy );
  7291. } );
  7292. #region 重组DataTable
  7293. DataTable dt = dtSet.Tables["ds"];
  7294. DataTable newtable = new DataTable();
  7295. foreach ( var item in dictColumns )
  7296. {
  7297. newtable.Columns.Add( item.Key.Trim(), typeof( string ) );
  7298. }
  7299. for ( int i = 0; i < dt.Rows.Count; i++ )
  7300. {
  7301. DataRow newRow = newtable.NewRow();
  7302. for ( int j = 0; j < newtable.Columns.Count; j++ )
  7303. {
  7304. string StrRowValue = "";
  7305. switch ( newtable.Columns[j].ColumnName.Trim() )
  7306. {
  7307. case "婚期":
  7308. case "选礼服时间":
  7309. case "安排时间":
  7310. StrRowValue = LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[i][newtable.Columns[j].ColumnName.Trim()] );
  7311. break;
  7312. case "选礼服师":
  7313. case "安排人员":
  7314. string StrNameA = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  7315. if ( !string.IsNullOrEmpty( StrNameA.Trim() ) )
  7316. {
  7317. DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrNameA );
  7318. if ( dtRow != null )
  7319. {
  7320. StrRowValue += dtRow["User_Name"].ToString().Trim();
  7321. }
  7322. }
  7323. break;
  7324. case "选礼服状态":
  7325. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  7326. if ( !string.IsNullOrEmpty( StrRowValue ) )
  7327. {
  7328. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.DesignerStatusEnum ), Convert.ToInt32( StrRowValue ) ).ToString();
  7329. }
  7330. else
  7331. {
  7332. StrRowValue = "";
  7333. }
  7334. break;
  7335. case "订单类型":
  7336. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  7337. if ( !string.IsNullOrEmpty( StrRowValue ) )
  7338. {
  7339. StrRowValue = Enum.ToObject( typeof( LYFZ.EnumPublic.OrderType ), Convert.ToInt32( StrRowValue ) ).ToString();
  7340. }
  7341. else
  7342. {
  7343. StrRowValue = "";
  7344. }
  7345. break;
  7346. default:
  7347. StrRowValue = dt.Rows[i][newtable.Columns[j].ColumnName.Trim()].ToString().Trim();
  7348. break;
  7349. }
  7350. newRow[newtable.Columns[j].ColumnName.Trim()] = StrRowValue;
  7351. }
  7352. newtable.Rows.Add( newRow );
  7353. }
  7354. #endregion
  7355. if ( newtable.Rows.Count > 0 )
  7356. {
  7357. dgvData.DataSource( newtable );
  7358. }
  7359. else
  7360. {
  7361. dgvData.DataColumns( string.Join( ",", dictColumns.Keys.ToArray() ), strHideField: dgvData.dgvFixedHideColumn );
  7362. }
  7363. dgvData.Columns["客户姓名"].Frozen = true;
  7364. Hashtable htCount = new Hashtable();
  7365. for ( int i = 0; i < newtable.Rows.Count; i++ )
  7366. {
  7367. htCount[newtable.Rows[i]["Ord_Number"].ToString().Trim()] = newtable.Rows[i]["Ord_Number"].ToString().Trim();
  7368. }
  7369. Hashtable htData = new Hashtable();
  7370. htData["DataTable"] = newtable;
  7371. htData["TotalCount"] = Convert.ToInt32( dtSet.Tables["ds1"].Rows[0]["CountID"] );
  7372. htData["CurrentCount"] = htCount.Count;
  7373. return htData;
  7374. }
  7375. /// <summary>
  7376. /// 获取满意度调查_接单人调查
  7377. /// </summary>
  7378. /// <param name="dgvData"></param>
  7379. /// <param name="StrQueryCondition"></param>
  7380. public static void GetData_SatisfactionSurveyOrderPerson( DataGridViewEc dgvData, string StrQueryCondition )
  7381. {
  7382. DataSet dtSet = new DataSet();
  7383. string StrTableColumnName = "Ord_Number,订单号,客户姓名,客户电话,订单类型,订单日期,接单人,满意度,回访人员,回访日期,回访备注";
  7384. DataTable newtable = new DataTable();
  7385. List<string> ListStrColumns = new List<string>( StrTableColumnName.Trim().Split( ',' ) );
  7386. for ( int i = 0; i < ListStrColumns.Count; i++ )
  7387. {
  7388. newtable.Columns.Add( ListStrColumns[i].Trim(), typeof( string ) );
  7389. }
  7390. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  7391. {
  7392. dtSet = LYFZ.BLL.BLL_ErpOrderView.GetData_SatisfactionSurveyOrderPerson( StrQueryCondition );
  7393. #region 重组DataTable
  7394. backgroundWorker.ReportProgress( 0, "正在获取接单人满意分值..." );
  7395. DataTable dt1 = dtSet.Tables["ds"];
  7396. if ( dt1.Rows.Count > 0 )
  7397. {
  7398. DataTable dt2 = dtSet.Tables["ds1"];
  7399. string StrWhere = "";
  7400. for ( int i = 0; i < dt1.Rows.Count; i++ )
  7401. {
  7402. StrWhere += "'" + dt1.Rows[i]["Ord_Number"].ToString().Trim() + "',";
  7403. }
  7404. StrWhere = " Where Sfs_Type = 0 And Sfs_OrderNumber in (" + StrWhere.TrimEnd( ',' ) + ")";
  7405. DataTable dt3 = LYFZ.BLL.BLL_ErpOrderView.GetData_SatisfactionSurvey( StrWhere );
  7406. for ( int i = 0; i < dt1.Rows.Count; i++ )
  7407. {
  7408. DataRow dtNewRow = newtable.NewRow();
  7409. #region 满意度
  7410. string StrPerson = "";
  7411. string StrPersonName = "";
  7412. string StrPersonTime = "";
  7413. string StrPersonRemark = "";
  7414. DataRow[] dtRows1 = dt3.Select( "Sfs_OrderNumber = '" + dt1.Rows[i]["Ord_Number"].ToString().Trim() + "'" );
  7415. if ( dtRows1.Length > 0 )
  7416. {
  7417. decimal intPerson = 0;
  7418. int PersonCount = 0;
  7419. Hashtable htDataDesignName = new Hashtable();
  7420. Hashtable htDataDesignTime = new Hashtable();
  7421. Hashtable htDataDesignRemark = new Hashtable();
  7422. for ( int j = 0; j < dtRows1.Length; j++ )
  7423. {
  7424. if ( dtRows1[j]["Sfrs_Scores"].ToString().Trim().Length > 0 )
  7425. {
  7426. intPerson += Convert.ToDecimal( dtRows1[j]["Sfrs_Scores"] );
  7427. PersonCount++;
  7428. }
  7429. string StrName = dtRows1[j]["Sfs_CreateName"].ToString().Trim();
  7430. if ( !string.IsNullOrEmpty( StrName.Trim() ) )
  7431. {
  7432. DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrName );
  7433. if ( dtRow != null && dtRow["User_Name"].ToString().Trim().Length > 0 )
  7434. {
  7435. htDataDesignName[dtRow["User_Name"].ToString().Trim()] = "";
  7436. }
  7437. }
  7438. if ( LYFZ.BLL.OtherCommonModel.DateTimeToString( dtRows1[j]["Sfs_CreateTime"] ).Length > 0 )
  7439. {
  7440. htDataDesignTime[LYFZ.BLL.OtherCommonModel.DateTimeToString( dtRows1[j]["Sfs_CreateTime"] )] = "";
  7441. }
  7442. if ( dtRows1[j]["Sfs_Remark"].ToString().Trim().Length > 0 )
  7443. {
  7444. htDataDesignRemark[dtRows1[j]["Sfs_Remark"].ToString().Trim()] = "";
  7445. }
  7446. }
  7447. if ( intPerson > 0 )
  7448. {
  7449. string Strs = (intPerson / Convert.ToDecimal( PersonCount )).ToString( "0.00" );
  7450. DataRow[] dt3Value = dt2.Select( "Sfrs_Scores <= " + Strs + "", sort: "Sfrs_Scores DESC" );
  7451. if ( dt3Value.Length > 0 )
  7452. StrPerson = dt3Value[0]["Sfrs_Name"].ToString().Trim();
  7453. }
  7454. // 没有分数时也要显示备注, 回访人员, 回访日期;
  7455. foreach ( string item in htDataDesignName.Keys )
  7456. StrPersonName += item.Trim() + ",";
  7457. foreach ( string item in htDataDesignTime.Keys )
  7458. StrPersonTime += item.Trim() + ",";
  7459. foreach ( string item in htDataDesignRemark.Keys )
  7460. StrPersonRemark += item.Trim() + ";";
  7461. }
  7462. #endregion
  7463. dtNewRow["Ord_Number"] = dt1.Rows[i]["Ord_Number"].ToString().Trim();
  7464. dtNewRow["订单号"] = dt1.Rows[i]["订单号"].ToString().Trim();
  7465. dtNewRow["客户姓名"] = dt1.Rows[i]["客户姓名"].ToString().Trim();
  7466. dtNewRow["客户电话"] = dt1.Rows[i]["客户电话"].ToString().Trim();
  7467. dtNewRow["订单类型"] = Enum.ToObject( typeof( LYFZ.EnumPublic.OrderType ), Convert.ToInt32( dt1.Rows[i]["订单类型"] ) ).ToString();
  7468. dtNewRow["订单日期"] = LYFZ.BLL.OtherCommonModel.DateTimeToString( dt1.Rows[i]["订单日期"] );
  7469. dtNewRow["接单人"] = dt1.Rows[i]["接单人"].ToString().Trim();
  7470. dtNewRow["满意度"] = StrPerson;
  7471. dtNewRow["回访人员"] = StrPersonName.TrimEnd( ',' );
  7472. dtNewRow["回访日期"] = StrPersonTime.TrimEnd( ',' );
  7473. dtNewRow["回访备注"] = StrPersonRemark.TrimEnd( ';' );
  7474. newtable.Rows.Add( dtNewRow );
  7475. }
  7476. }
  7477. #endregion
  7478. } );
  7479. if ( newtable.Rows.Count > 0 )
  7480. {
  7481. dgvData.DataSource( newtable, strHideField: "Ord_Number" );
  7482. }
  7483. else
  7484. {
  7485. dgvData.DataColumns( StrTableColumnName, strHideField: "Ord_Number" );
  7486. }
  7487. dgvData.Columns["客户姓名"].Frozen = true;
  7488. dgvData.Columns["订单日期"].Width = 110;
  7489. dgvData.Columns["回访日期"].Width = 120;
  7490. dgvData.Columns["回访备注"].Width = 300;
  7491. }
  7492. /// <summary>
  7493. /// 获取满意度调查_选衣人调查
  7494. /// </summary>
  7495. /// <param name="dgvData"></param>
  7496. /// <param name="StrQueryCondition"></param>
  7497. public static void GetData_SatisfactionSurveySelectDress( DataGridViewEc dgvData, string StrQueryCondition )
  7498. {
  7499. DataSet dtSet = new DataSet();
  7500. string StrTableColumnName = "Ord_Number,Ordv_ViceNumber,订单号,客户姓名,客户电话,订单类型,拍摄名称,选衣日期,选衣状态,礼服师,满意度,回访人员,回访日期,回访备注";
  7501. DataTable newtable = new DataTable();
  7502. List<string> ListStrColumns = new List<string>( StrTableColumnName.Trim().Split( ',' ) );
  7503. for ( int i = 0; i < ListStrColumns.Count; i++ )
  7504. {
  7505. newtable.Columns.Add( ListStrColumns[i].Trim(), typeof( string ) );
  7506. }
  7507. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  7508. {
  7509. dtSet = LYFZ.BLL.BLL_ErpOrderView.GetData_SatisfactionSurveySelectDress( StrQueryCondition );
  7510. #region 重组DataTable
  7511. backgroundWorker.ReportProgress( 0, "正在获取接单人满意分值..." );
  7512. DataTable dt1 = dtSet.Tables["ds"];
  7513. if ( dt1.Rows.Count > 0 )
  7514. {
  7515. DataTable dt2 = dtSet.Tables["ds1"];
  7516. string StrWhere = "";
  7517. for ( int i = 0; i < dt1.Rows.Count; i++ )
  7518. {
  7519. StrWhere += "'" + dt1.Rows[i]["Ordv_ViceNumber"].ToString().Trim() + "',";
  7520. }
  7521. StrWhere = " Where Sfs_Type = 1 And Sfs_SurveySetID = 2 And Sfs_OrderNumberDeputy in (" + StrWhere.TrimEnd( ',' ) + ")";
  7522. DataTable dt3 = LYFZ.BLL.BLL_ErpOrderView.GetData_SatisfactionSurvey( StrWhere );
  7523. for ( int i = 0; i < dt1.Rows.Count; i++ )
  7524. {
  7525. DataRow dtNewRow = newtable.NewRow();
  7526. #region 满意度
  7527. string StrPerson = "";
  7528. string StrPersonName = "";
  7529. string StrPersonTime = "";
  7530. string StrPersonRemark = "";
  7531. DataRow[] dtRows1 = dt3.Select( "Sfs_OrderNumberDeputy = '" + dt1.Rows[i]["Ordv_ViceNumber"].ToString().Trim() + "' And Sfs_SurveySetID = 2" );
  7532. if ( dtRows1.Length > 0 )
  7533. {
  7534. decimal intPerson = 0;
  7535. int PersonCount = 0;
  7536. Hashtable htDataDesignName = new Hashtable();
  7537. Hashtable htDataDesignTime = new Hashtable();
  7538. Hashtable htDataDesignRemark = new Hashtable();
  7539. for ( int j = 0; j < dtRows1.Length; j++ )
  7540. {
  7541. if ( dtRows1[j]["Sfrs_Scores"].ToString().Trim().Length > 0 )
  7542. {
  7543. intPerson += Convert.ToDecimal( dtRows1[j]["Sfrs_Scores"] );
  7544. PersonCount++;
  7545. }
  7546. string StrName = dtRows1[j]["Sfs_CreateName"].ToString().Trim();
  7547. if ( !string.IsNullOrEmpty( StrName.Trim() ) )
  7548. {
  7549. DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrName );
  7550. if ( dtRow != null && dtRow["User_Name"].ToString().Trim().Length > 0 )
  7551. {
  7552. htDataDesignName[dtRow["User_Name"].ToString().Trim()] = "";
  7553. }
  7554. }
  7555. if ( LYFZ.BLL.OtherCommonModel.DateTimeToString( dtRows1[j]["Sfs_CreateTime"] ).Length > 0 )
  7556. {
  7557. htDataDesignTime[LYFZ.BLL.OtherCommonModel.DateTimeToString( dtRows1[j]["Sfs_CreateTime"] )] = "";
  7558. }
  7559. if ( dtRows1[j]["Sfs_Remark"].ToString().Trim().Length > 0 )
  7560. {
  7561. htDataDesignRemark[dtRows1[j]["Sfs_Remark"].ToString().Trim()] = "";
  7562. }
  7563. }
  7564. if ( intPerson > 0 )
  7565. {
  7566. string Strs = (intPerson / Convert.ToDecimal( PersonCount )).ToString( "0.00" );
  7567. DataRow[] dt3Value = dt2.Select( "Sfrs_Scores <= " + Strs + "", sort: "Sfrs_Scores DESC" );
  7568. if ( dt3Value.Length > 0 )
  7569. {
  7570. StrPerson = dt3Value[0]["Sfrs_Name"].ToString().Trim();
  7571. }
  7572. }
  7573. // 没有分数时,也要显示回访人员, 回访备注, 回访日期;
  7574. foreach ( string item in htDataDesignName.Keys )
  7575. StrPersonName += item.Trim() + ",";
  7576. foreach ( string item in htDataDesignTime.Keys )
  7577. StrPersonTime += item.Trim() + ",";
  7578. foreach ( string item in htDataDesignRemark.Keys )
  7579. StrPersonRemark += item.Trim() + ";";
  7580. }
  7581. #endregion
  7582. dtNewRow["Ord_Number"] = dt1.Rows[i]["Ord_Number"].ToString().Trim();
  7583. dtNewRow["Ordv_ViceNumber"] = dt1.Rows[i]["Ordv_ViceNumber"].ToString().Trim();
  7584. dtNewRow["订单号"] = dt1.Rows[i]["订单号"].ToString().Trim();
  7585. dtNewRow["客户姓名"] = dt1.Rows[i]["客户姓名"].ToString().Trim();
  7586. dtNewRow["客户电话"] = dt1.Rows[i]["客户电话"].ToString().Trim();
  7587. dtNewRow["订单类型"] = Enum.ToObject( typeof( LYFZ.EnumPublic.OrderType ), Convert.ToInt32( dt1.Rows[i]["订单类型"] ) ).ToString();
  7588. dtNewRow["拍摄名称"] = dt1.Rows[i]["拍摄名称"].ToString().Trim();
  7589. dtNewRow["选衣日期"] = LYFZ.BLL.OtherCommonModel.DateTimeToString( dt1.Rows[i]["选衣日期"] );
  7590. dtNewRow["选衣状态"] = Enum.ToObject( typeof( LYFZ.EnumPublic.ClothingStatusEnum ), Convert.ToInt32( dt1.Rows[i]["选衣状态"] ) ).ToString();
  7591. dtNewRow["礼服师"] = "";
  7592. string StrNameA = dt1.Rows[i]["礼服师"].ToString().Trim();
  7593. if ( !string.IsNullOrEmpty( StrNameA.Trim() ) )
  7594. {
  7595. DataRow dtRowA = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrNameA );
  7596. if ( dtRowA != null )
  7597. {
  7598. dtNewRow["礼服师"] = dtRowA["User_Name"].ToString().Trim();
  7599. }
  7600. }
  7601. dtNewRow["满意度"] = StrPerson;
  7602. dtNewRow["回访人员"] = StrPersonName.TrimEnd( ',' );
  7603. dtNewRow["回访日期"] = StrPersonTime.TrimEnd( ',' );
  7604. dtNewRow["回访备注"] = StrPersonRemark.TrimEnd( ';' );
  7605. newtable.Rows.Add( dtNewRow );
  7606. }
  7607. }
  7608. #endregion
  7609. } );
  7610. if ( newtable.Rows.Count > 0 )
  7611. {
  7612. dgvData.DataSource( newtable, strHideField: "Ord_Number,Ordv_ViceNumber" );
  7613. }
  7614. else
  7615. {
  7616. dgvData.DataColumns( StrTableColumnName, strHideField: "Ord_Number,Ordv_ViceNumber" );
  7617. }
  7618. dgvData.Columns["客户姓名"].Frozen = true;
  7619. dgvData.Columns["选衣日期"].Width = 110;
  7620. dgvData.Columns["回访日期"].Width = 120;
  7621. dgvData.Columns["回访备注"].Width = 300;
  7622. }
  7623. /// <summary>
  7624. /// 获取满意度调查_拍照相关调查
  7625. /// </summary>
  7626. /// <param name="dgvData"></param>
  7627. /// <param name="StrQueryCondition"></param>
  7628. public static void GetData_SatisfactionSurveyPhotograph( DataGridViewEc dgvData, string StrQueryCondition )
  7629. {
  7630. DataSet dtSet = new DataSet();
  7631. string StrTableColumnName = "Ord_Number,Ordv_ViceNumber,订单号,客户姓名,客户电话,订单类型,拍摄名称,拍摄时间,拍照状态,摄影师,摄影满意度,摄影回访人员,摄影回访日期,摄影回访备注,摄影助理,摄影助理满意度," +
  7632. "摄影助理回访人员,摄影助理回访日期,摄影助理回访备注,化妆师,化妆满意度,化妆回访人员,化妆回访日期,化妆回访备注,化妆助理,化妆助理满意度,化妆助理回访人员,化妆助理回访日期,化妆助理回访备注,引导师," +
  7633. "引导满意度,引导回访人员,引导回访日期,引导回访备注,引导助理,引导助理满意度,引导助理回访人员,引导助理回访日期,引导助理回访备注";
  7634. DataTable newtable = new DataTable();
  7635. List<string> ListStrColumns = new List<string>( StrTableColumnName.Trim().Split( ',' ) );
  7636. for ( int i = 0; i < ListStrColumns.Count; i++ )
  7637. {
  7638. newtable.Columns.Add( ListStrColumns[i].Trim(), typeof( string ) );
  7639. }
  7640. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  7641. {
  7642. dtSet = LYFZ.BLL.BLL_ErpOrderView.GetData_SatisfactionSurveyPhotograph( StrQueryCondition );
  7643. #region 重组DataTable
  7644. backgroundWorker.ReportProgress( 0, "正在获取满意分值..." );
  7645. DataTable dt0 = dtSet.Tables["ds"];
  7646. if ( dt0.Rows.Count > 0 )
  7647. {
  7648. DataTable dt1 = dtSet.Tables["ds1"];
  7649. DataTable dt2 = dtSet.Tables["ds2"];
  7650. int intBootAssistantID = 0;
  7651. if ( dt2.Rows.Count > 0 )
  7652. {
  7653. intBootAssistantID = Convert.ToInt32( dt2.Rows[0]["ID"] );
  7654. }
  7655. string StrWhere = "";
  7656. for ( int i = 0; i < dt0.Rows.Count; i++ )
  7657. {
  7658. StrWhere += "'" + dt0.Rows[i]["Ord_Number"].ToString().Trim() + "',";
  7659. }
  7660. StrWhere = " Where Sfs_Type = 2 And Sfs_SurveySetID in (3,4,5,6,7,(select top 1 ID from tb_ErpSatisfactionSurveySet where Sfss_Name = '引导助理')) And Sfs_OrderNumber in (" + StrWhere.TrimEnd( ',' ) + ")";
  7661. DataTable dt3 = LYFZ.BLL.BLL_ErpOrderView.GetData_SatisfactionSurvey( StrWhere );
  7662. for ( int i = 0; i < dt0.Rows.Count; i++ )
  7663. {
  7664. DataRow dtNewRow = newtable.NewRow();
  7665. #region 满意度
  7666. #region 摄影师
  7667. string StrPerson = "";
  7668. string StrPersonName = "";
  7669. string StrPersonTime = "";
  7670. string StrPersonRemark = "";
  7671. DataRow[] dtRows1 = dt3.Select( "Sfs_OrderNumberDeputy = '" + dt0.Rows[i]["Ordv_ViceNumber"].ToString().Trim() + "' And Sfs_SurveySetID = 3" );
  7672. if ( dtRows1.Length > 0 )
  7673. {
  7674. decimal intPerson = 0;
  7675. int PersonCount = 0;
  7676. Hashtable htDataDesignName = new Hashtable();
  7677. Hashtable htDataDesignTime = new Hashtable();
  7678. Hashtable htDataDesignRemark = new Hashtable();
  7679. for ( int j = 0; j < dtRows1.Length; j++ )
  7680. {
  7681. if ( dtRows1[j]["Sfrs_Scores"].ToString().Trim().Length > 0 )
  7682. {
  7683. intPerson += Convert.ToDecimal( dtRows1[j]["Sfrs_Scores"] );
  7684. PersonCount++;
  7685. }
  7686. string StrName = dtRows1[j]["Sfs_CreateName"].ToString().Trim();
  7687. if ( !string.IsNullOrEmpty( StrName.Trim() ) )
  7688. {
  7689. DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrName );
  7690. if ( dtRow != null && dtRow["User_Name"].ToString().Trim().Length > 0 )
  7691. {
  7692. htDataDesignName[dtRow["User_Name"].ToString().Trim()] = "";
  7693. }
  7694. }
  7695. if ( LYFZ.BLL.OtherCommonModel.DateTimeToString( dtRows1[j]["Sfs_CreateTime"] ).Length > 0 )
  7696. {
  7697. htDataDesignTime[LYFZ.BLL.OtherCommonModel.DateTimeToString( dtRows1[j]["Sfs_CreateTime"] )] = "";
  7698. }
  7699. if ( dtRows1[j]["Sfs_Remark"].ToString().Trim().Length > 0 )
  7700. {
  7701. htDataDesignRemark[dtRows1[j]["Sfs_Remark"].ToString().Trim()] = "";
  7702. }
  7703. }
  7704. if ( intPerson > 0 )
  7705. {
  7706. string Strs = (intPerson / Convert.ToDecimal( PersonCount )).ToString( "0.00" );
  7707. DataRow[] dt3Value = dt1.Select( "Sfrs_Scores <= " + Strs + "", sort: "Sfrs_Scores DESC" );
  7708. if ( dt3Value.Length > 0 )
  7709. {
  7710. StrPerson = dt3Value[0]["Sfrs_Name"].ToString().Trim();
  7711. }
  7712. }
  7713. // 没有分数时,也要显示回访人员, 回访备注, 回访日期;
  7714. foreach ( string item in htDataDesignName.Keys )
  7715. StrPersonName += item.Trim() + ",";
  7716. foreach ( string item in htDataDesignTime.Keys )
  7717. StrPersonTime += item.Trim() + ",";
  7718. foreach ( string item in htDataDesignRemark.Keys )
  7719. StrPersonRemark += item.Trim() + ";";
  7720. }
  7721. #endregion
  7722. #region 摄影助理
  7723. string StrPerson2 = "";
  7724. string StrPersonName2 = "";
  7725. string StrPersonTime2 = "";
  7726. string StrPersonRemark2 = "";
  7727. DataRow[] dtRows2 = dt3.Select( "Sfs_OrderNumberDeputy = '" + dt0.Rows[i]["Ordv_ViceNumber"].ToString().Trim() + "' And Sfs_SurveySetID = 4" );
  7728. if ( dtRows2.Length > 0 )
  7729. {
  7730. decimal intPerson = 0;
  7731. int PersonCount = 0;
  7732. Hashtable htDataDesignName = new Hashtable();
  7733. Hashtable htDataDesignTime = new Hashtable();
  7734. Hashtable htDataDesignRemark = new Hashtable();
  7735. for ( int j = 0; j < dtRows2.Length; j++ )
  7736. {
  7737. if ( dtRows2[j]["Sfrs_Scores"].ToString().Trim().Length > 0 )
  7738. {
  7739. intPerson += Convert.ToDecimal( dtRows2[j]["Sfrs_Scores"] );
  7740. PersonCount++;
  7741. }
  7742. string StrName = dtRows2[j]["Sfs_CreateName"].ToString().Trim();
  7743. if ( !string.IsNullOrEmpty( StrName.Trim() ) )
  7744. {
  7745. DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrName );
  7746. if ( dtRow != null && dtRow["User_Name"].ToString().Trim().Length > 0 )
  7747. {
  7748. htDataDesignName[dtRow["User_Name"].ToString().Trim()] = "";
  7749. }
  7750. }
  7751. if ( LYFZ.BLL.OtherCommonModel.DateTimeToString( dtRows2[j]["Sfs_CreateTime"] ).Length > 0 )
  7752. {
  7753. htDataDesignTime[LYFZ.BLL.OtherCommonModel.DateTimeToString( dtRows2[j]["Sfs_CreateTime"] )] = "";
  7754. }
  7755. if ( dtRows2[j]["Sfs_Remark"].ToString().Trim().Length > 0 )
  7756. {
  7757. htDataDesignRemark[dtRows2[j]["Sfs_Remark"].ToString().Trim()] = "";
  7758. }
  7759. }
  7760. if ( intPerson > 0 )
  7761. {
  7762. string Strs = (intPerson / Convert.ToDecimal( PersonCount )).ToString( "0.00" );
  7763. DataRow[] dt3Value = dt1.Select( "Sfrs_Scores <= " + Strs + "", sort: "Sfrs_Scores DESC" );
  7764. if ( dt3Value.Length > 0 )
  7765. {
  7766. StrPerson2 = dt3Value[0]["Sfrs_Name"].ToString().Trim();
  7767. }
  7768. }
  7769. // 没有分数时,也要显示回访人员, 回访备注, 回访日期;
  7770. foreach ( string item in htDataDesignName.Keys )
  7771. StrPersonName2 += item.Trim() + ",";
  7772. foreach ( string item in htDataDesignTime.Keys )
  7773. StrPersonTime2 += item.Trim() + ",";
  7774. foreach ( string item in htDataDesignRemark.Keys )
  7775. StrPersonRemark2 += item.Trim() + ";";
  7776. }
  7777. #endregion
  7778. #region 化妆师
  7779. string StrPerson3 = "";
  7780. string StrPersonName3 = "";
  7781. string StrPersonTime3 = "";
  7782. string StrPersonRemark3 = "";
  7783. DataRow[] dtRows3 = dt3.Select( "Sfs_OrderNumberDeputy = '" + dt0.Rows[i]["Ordv_ViceNumber"].ToString().Trim() + "' And Sfs_SurveySetID = 5" );
  7784. if ( dtRows3.Length > 0 )
  7785. {
  7786. decimal intPerson = 0;
  7787. int PersonCount = 0;
  7788. Hashtable htDataDesignName = new Hashtable();
  7789. Hashtable htDataDesignTime = new Hashtable();
  7790. Hashtable htDataDesignRemark = new Hashtable();
  7791. for ( int j = 0; j < dtRows3.Length; j++ )
  7792. {
  7793. if ( dtRows3[j]["Sfrs_Scores"].ToString().Trim().Length > 0 )
  7794. {
  7795. intPerson += Convert.ToDecimal( dtRows3[j]["Sfrs_Scores"] );
  7796. PersonCount++;
  7797. }
  7798. string StrName = dtRows3[j]["Sfs_CreateName"].ToString().Trim();
  7799. if ( !string.IsNullOrEmpty( StrName.Trim() ) )
  7800. {
  7801. DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrName );
  7802. if ( dtRow != null && dtRow["User_Name"].ToString().Trim().Length > 0 )
  7803. {
  7804. htDataDesignName[dtRow["User_Name"].ToString().Trim()] = "";
  7805. }
  7806. }
  7807. if ( LYFZ.BLL.OtherCommonModel.DateTimeToString( dtRows3[j]["Sfs_CreateTime"] ).Length > 0 )
  7808. {
  7809. htDataDesignTime[LYFZ.BLL.OtherCommonModel.DateTimeToString( dtRows3[j]["Sfs_CreateTime"] )] = "";
  7810. }
  7811. if ( dtRows3[j]["Sfs_Remark"].ToString().Trim().Length > 0 )
  7812. {
  7813. htDataDesignRemark[dtRows3[j]["Sfs_Remark"].ToString().Trim()] = "";
  7814. }
  7815. }
  7816. if ( intPerson > 0 )
  7817. {
  7818. string Strs = (intPerson / Convert.ToDecimal( PersonCount )).ToString( "0.00" );
  7819. DataRow[] dt3Value = dt1.Select( "Sfrs_Scores <= " + Strs + "", sort: "Sfrs_Scores DESC" );
  7820. if ( dt3Value.Length > 0 )
  7821. {
  7822. StrPerson3 = dt3Value[0]["Sfrs_Name"].ToString().Trim();
  7823. }
  7824. }
  7825. // 没有分数时,也要显示回访人员, 回访备注, 回访日期;
  7826. foreach ( string item in htDataDesignName.Keys )
  7827. StrPersonName3 += item.Trim() + ",";
  7828. foreach ( string item in htDataDesignTime.Keys )
  7829. StrPersonTime3 += item.Trim() + ",";
  7830. foreach ( string item in htDataDesignRemark.Keys )
  7831. StrPersonRemark3 += item.Trim() + ";";
  7832. }
  7833. #endregion
  7834. #region 化妆助理
  7835. string StrPerson4 = "";
  7836. string StrPersonName4 = "";
  7837. string StrPersonTime4 = "";
  7838. string StrPersonRemark4 = "";
  7839. DataRow[] dtRows4 = dt3.Select( "Sfs_OrderNumberDeputy = '" + dt0.Rows[i]["Ordv_ViceNumber"].ToString().Trim() + "' And Sfs_SurveySetID = 6" );
  7840. if ( dtRows4.Length > 0 )
  7841. {
  7842. decimal intPerson = 0;
  7843. int PersonCount = 0;
  7844. Hashtable htDataDesignName = new Hashtable();
  7845. Hashtable htDataDesignTime = new Hashtable();
  7846. Hashtable htDataDesignRemark = new Hashtable();
  7847. for ( int j = 0; j < dtRows4.Length; j++ )
  7848. {
  7849. if ( dtRows4[j]["Sfrs_Scores"].ToString().Trim().Length > 0 )
  7850. {
  7851. intPerson += Convert.ToDecimal( dtRows4[j]["Sfrs_Scores"] );
  7852. PersonCount++;
  7853. }
  7854. string StrName = dtRows4[j]["Sfs_CreateName"].ToString().Trim();
  7855. if ( !string.IsNullOrEmpty( StrName.Trim() ) )
  7856. {
  7857. DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrName );
  7858. if ( dtRow != null && dtRow["User_Name"].ToString().Trim().Length > 0 )
  7859. {
  7860. htDataDesignName[dtRow["User_Name"].ToString().Trim()] = "";
  7861. }
  7862. }
  7863. if ( LYFZ.BLL.OtherCommonModel.DateTimeToString( dtRows4[j]["Sfs_CreateTime"] ).Length > 0 )
  7864. {
  7865. htDataDesignTime[LYFZ.BLL.OtherCommonModel.DateTimeToString( dtRows4[j]["Sfs_CreateTime"] )] = "";
  7866. }
  7867. if ( dtRows4[j]["Sfs_Remark"].ToString().Trim().Length > 0 )
  7868. {
  7869. htDataDesignRemark[dtRows4[j]["Sfs_Remark"].ToString().Trim()] = "";
  7870. }
  7871. }
  7872. if ( intPerson > 0 )
  7873. {
  7874. string Strs = (intPerson / Convert.ToDecimal( PersonCount )).ToString( "0.00" );
  7875. DataRow[] dt3Value = dt1.Select( "Sfrs_Scores <= " + Strs + "", sort: "Sfrs_Scores DESC" );
  7876. if ( dt3Value.Length > 0 )
  7877. {
  7878. StrPerson4 = dt3Value[0]["Sfrs_Name"].ToString().Trim();
  7879. }
  7880. }
  7881. // 没有分数时,也要显示回访人员, 回访备注, 回访日期;
  7882. foreach ( string item in htDataDesignName.Keys )
  7883. StrPersonName4 += item.Trim() + ",";
  7884. foreach ( string item in htDataDesignTime.Keys )
  7885. StrPersonTime4 += item.Trim() + ",";
  7886. foreach ( string item in htDataDesignRemark.Keys )
  7887. StrPersonRemark4 += item.Trim() + ";";
  7888. }
  7889. #endregion
  7890. #region 引导师
  7891. string StrPerson5 = "";
  7892. string StrPersonName5 = "";
  7893. string StrPersonTime5 = "";
  7894. string StrPersonRemark5 = "";
  7895. DataRow[] dtRows5 = dt3.Select( "Sfs_OrderNumberDeputy = '" + dt0.Rows[i]["Ordv_ViceNumber"].ToString().Trim() + "' And Sfs_SurveySetID = 7" );
  7896. if ( dtRows5.Length > 0 )
  7897. {
  7898. decimal intPerson = 0;
  7899. int PersonCount = 0;
  7900. Hashtable htDataDesignName = new Hashtable();
  7901. Hashtable htDataDesignTime = new Hashtable();
  7902. Hashtable htDataDesignRemark = new Hashtable();
  7903. for ( int j = 0; j < dtRows5.Length; j++ )
  7904. {
  7905. if ( dtRows5[j]["Sfrs_Scores"].ToString().Trim().Length > 0 )
  7906. {
  7907. intPerson += Convert.ToDecimal( dtRows5[j]["Sfrs_Scores"] );
  7908. PersonCount++;
  7909. }
  7910. string StrName = dtRows5[j]["Sfs_CreateName"].ToString().Trim();
  7911. if ( !string.IsNullOrEmpty( StrName.Trim() ) )
  7912. {
  7913. DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrName );
  7914. if ( dtRow != null && dtRow["User_Name"].ToString().Trim().Length > 0 )
  7915. {
  7916. htDataDesignName[dtRow["User_Name"].ToString().Trim()] = "";
  7917. }
  7918. }
  7919. if ( LYFZ.BLL.OtherCommonModel.DateTimeToString( dtRows5[j]["Sfs_CreateTime"] ).Length > 0 )
  7920. {
  7921. htDataDesignTime[LYFZ.BLL.OtherCommonModel.DateTimeToString( dtRows5[j]["Sfs_CreateTime"] )] = "";
  7922. }
  7923. if ( dtRows5[j]["Sfs_Remark"].ToString().Trim().Length > 0 )
  7924. {
  7925. htDataDesignRemark[dtRows5[j]["Sfs_Remark"].ToString().Trim()] = "";
  7926. }
  7927. }
  7928. if ( intPerson > 0 )
  7929. {
  7930. string Strs = (intPerson / Convert.ToDecimal( PersonCount )).ToString( "0.00" );
  7931. DataRow[] dt3Value = dt1.Select( "Sfrs_Scores <= " + Strs + "", sort: "Sfrs_Scores DESC" );
  7932. if ( dt3Value.Length > 0 )
  7933. {
  7934. StrPerson5 = dt3Value[0]["Sfrs_Name"].ToString().Trim();
  7935. }
  7936. }
  7937. // 没有分数时,也要显示回访人员, 回访备注, 回访日期;
  7938. foreach ( string item in htDataDesignName.Keys )
  7939. StrPersonName5 += item.Trim() + ",";
  7940. foreach ( string item in htDataDesignTime.Keys )
  7941. StrPersonTime5 += item.Trim() + ",";
  7942. foreach ( string item in htDataDesignRemark.Keys )
  7943. StrPersonRemark5 += item.Trim() + ";";
  7944. }
  7945. #endregion
  7946. #region 引导助理
  7947. string StrPerson6 = "";
  7948. string StrPersonName6 = "";
  7949. string StrPersonTime6 = "";
  7950. string StrPersonRemark6 = "";
  7951. if ( intBootAssistantID > 0 )
  7952. {
  7953. DataRow[] dtRows6 = dt3.Select( "Sfs_OrderNumberDeputy = '" + dt0.Rows[i]["Ordv_ViceNumber"].ToString().Trim() + "' And Sfs_SurveySetID = " + intBootAssistantID + "" );
  7954. if ( dtRows6.Length > 0 )
  7955. {
  7956. decimal intPerson = 0;
  7957. int PersonCount = 0;
  7958. Hashtable htDataDesignName = new Hashtable();
  7959. Hashtable htDataDesignTime = new Hashtable();
  7960. Hashtable htDataDesignRemark = new Hashtable();
  7961. for ( int j = 0; j < dtRows6.Length; j++ )
  7962. {
  7963. if ( dtRows6[j]["Sfrs_Scores"].ToString().Trim().Length > 0 )
  7964. {
  7965. intPerson += Convert.ToDecimal( dtRows6[j]["Sfrs_Scores"] );
  7966. PersonCount++;
  7967. }
  7968. string StrName = dtRows6[j]["Sfs_CreateName"].ToString().Trim();
  7969. if ( !string.IsNullOrEmpty( StrName.Trim() ) )
  7970. {
  7971. DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrName );
  7972. if ( dtRow != null && dtRow["User_Name"].ToString().Trim().Length > 0 )
  7973. {
  7974. htDataDesignName[dtRow["User_Name"].ToString().Trim()] = "";
  7975. }
  7976. }
  7977. if ( LYFZ.BLL.OtherCommonModel.DateTimeToString( dtRows6[j]["Sfs_CreateTime"] ).Length > 0 )
  7978. {
  7979. htDataDesignTime[LYFZ.BLL.OtherCommonModel.DateTimeToString( dtRows6[j]["Sfs_CreateTime"] )] = "";
  7980. }
  7981. if ( dtRows6[j]["Sfs_Remark"].ToString().Trim().Length > 0 )
  7982. {
  7983. htDataDesignRemark[dtRows6[j]["Sfs_Remark"].ToString().Trim()] = "";
  7984. }
  7985. }
  7986. if ( intPerson > 0 )
  7987. {
  7988. string Strs = (intPerson / Convert.ToDecimal( PersonCount )).ToString( "0.00" );
  7989. DataRow[] dt3Value = dt1.Select( "Sfrs_Scores <= " + Strs + "", sort: "Sfrs_Scores DESC" );
  7990. if ( dt3Value.Length > 0 )
  7991. {
  7992. StrPerson6 = dt3Value[0]["Sfrs_Name"].ToString().Trim();
  7993. }
  7994. }
  7995. // 没有分数时,也要显示回访人员, 回访备注, 回访日期;
  7996. foreach ( string item in htDataDesignName.Keys )
  7997. StrPersonName6 += item.Trim() + ",";
  7998. foreach ( string item in htDataDesignTime.Keys )
  7999. StrPersonTime6 += item.Trim() + ",";
  8000. foreach ( string item in htDataDesignRemark.Keys )
  8001. StrPersonRemark6 += item.Trim() + ";";
  8002. }
  8003. }
  8004. #endregion
  8005. #endregion
  8006. dtNewRow["Ord_Number"] = dt0.Rows[i]["Ord_Number"].ToString().Trim();
  8007. dtNewRow["Ordv_ViceNumber"] = dt0.Rows[i]["Ordv_ViceNumber"].ToString().Trim();
  8008. dtNewRow["订单号"] = dt0.Rows[i]["订单号"].ToString().Trim();
  8009. dtNewRow["客户姓名"] = dt0.Rows[i]["客户姓名"].ToString().Trim();
  8010. dtNewRow["客户电话"] = dt0.Rows[i]["客户电话"].ToString().Trim();
  8011. dtNewRow["订单类型"] = Enum.ToObject( typeof( LYFZ.EnumPublic.OrderType ), Convert.ToInt32( dt0.Rows[i]["订单类型"] ) ).ToString();
  8012. dtNewRow["拍摄名称"] = dt0.Rows[i]["拍摄名称"].ToString().Trim().Substring( 0, dt0.Rows[i]["拍摄名称"].ToString().Trim().Length - 1 );
  8013. dtNewRow["拍摄时间"] = LYFZ.BLL.OtherCommonModel.DateTimeToString( dt0.Rows[i]["拍摄时间"] );
  8014. dtNewRow["拍照状态"] = dt0.Rows[i]["拍照状态"].ToString().Trim();
  8015. dtNewRow["摄影师"] = "";
  8016. string StrNameA = dt0.Rows[i]["摄影师"].ToString().Trim().Trim(',');
  8017. if ( !string.IsNullOrEmpty( StrNameA.Trim() ) )
  8018. {
  8019. dtNewRow["摄影师"] = LYFZ.DAL.DAL_ErpUser.GetUserIDToUserName(StrNameA, ',');
  8020. /* DataRow dtRowA = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrNameA );
  8021. if ( dtRowA != null )
  8022. {
  8023. dtNewRow["摄影师"] = dtRowA["User_Name"].ToString().Trim();
  8024. }
  8025. else
  8026. {
  8027. dtNewRow["摄影师"] = StrNameA;
  8028. }*/
  8029. }
  8030. dtNewRow["摄影满意度"] = StrPerson;
  8031. dtNewRow["摄影回访人员"] = StrPersonName.TrimEnd( ',' );
  8032. dtNewRow["摄影回访日期"] = StrPersonTime.TrimEnd( ',' );
  8033. dtNewRow["摄影回访备注"] = StrPersonRemark.TrimEnd( ';' );
  8034. dtNewRow["摄影助理"] = "";
  8035. string StrNameB = dt0.Rows[i]["摄影助理"].ToString().Trim().Trim(',');
  8036. if ( !string.IsNullOrEmpty( StrNameB.Trim() ) )
  8037. {
  8038. dtNewRow["摄影助理"] = LYFZ.DAL.DAL_ErpUser.GetUserIDToUserName(StrNameB, ',');
  8039. /* DataRow dtRowA = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrNameB );
  8040. if ( dtRowA != null )
  8041. {
  8042. dtNewRow["摄影助理"] = dtRowA["User_Name"].ToString().Trim();
  8043. }
  8044. else
  8045. {
  8046. dtNewRow["摄影助理"] = StrNameB;
  8047. }*/
  8048. }
  8049. dtNewRow["摄影助理满意度"] = StrPerson2;
  8050. dtNewRow["摄影助理回访人员"] = StrPersonName2.TrimEnd( ',' );
  8051. dtNewRow["摄影助理回访日期"] = StrPersonTime2.TrimEnd( ',' );
  8052. dtNewRow["摄影助理回访备注"] = StrPersonRemark2.TrimEnd( ';' );
  8053. dtNewRow["化妆师"] = "";
  8054. string StrNameC = "";
  8055. if (dt0.Rows[i]["化妆师"].ToString().Trim().Length != 0)
  8056. StrNameC = dt0.Rows[i]["化妆师"].ToString().Trim().Substring( 0, dt0.Rows[i]["化妆师"].ToString().Trim().Length - 1 ); ;
  8057. if ( !string.IsNullOrEmpty( StrNameC.Trim() ) )
  8058. {
  8059. dtNewRow["化妆师"] = LYFZ.DAL.DAL_ErpUser.GetUserIDToUserName(StrNameC, ',');
  8060. /*DataRow dtRowA = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrNameC );
  8061. if ( dtRowA != null )
  8062. {
  8063. dtNewRow["化妆师"] = dtRowA["User_Name"].ToString().Trim();
  8064. }
  8065. else
  8066. {
  8067. dtNewRow["化妆师"] = StrNameC;
  8068. }*/
  8069. }
  8070. dtNewRow["化妆满意度"] = StrPerson3;
  8071. dtNewRow["化妆回访人员"] = StrPersonName3.TrimEnd( ',' );
  8072. dtNewRow["化妆回访日期"] = StrPersonTime3.TrimEnd( ',' );
  8073. dtNewRow["化妆回访备注"] = StrPersonRemark3.TrimEnd( ';' );
  8074. dtNewRow["化妆助理"] = "";
  8075. string StrNameD = "";
  8076. if (dt0.Rows[i]["化妆助理"].ToString().Trim().Length != 0)
  8077. StrNameD = dt0.Rows[i]["化妆助理"].ToString().Trim().Substring( 0, dt0.Rows[i]["化妆助理"].ToString().Trim().Length - 1 );
  8078. if ( !string.IsNullOrEmpty( StrNameD.Trim() ) )
  8079. {
  8080. dtNewRow["化妆助理"] = LYFZ.DAL.DAL_ErpUser.GetUserIDToUserName(StrNameD, ',');
  8081. /* DataRow dtRowA = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrNameD );
  8082. if ( dtRowA != null )
  8083. {
  8084. dtNewRow["化妆助理"] = dtRowA["User_Name"].ToString().Trim();
  8085. }
  8086. else
  8087. {
  8088. dtNewRow["化妆助理"] = StrNameD;
  8089. }*/
  8090. }
  8091. dtNewRow["化妆助理满意度"] = StrPerson4;
  8092. dtNewRow["化妆助理回访人员"] = StrPersonName4.TrimEnd( ',' );
  8093. dtNewRow["化妆助理回访日期"] = StrPersonTime4.TrimEnd( ',' );
  8094. dtNewRow["化妆助理回访备注"] = StrPersonRemark4.TrimEnd( ';' );
  8095. dtNewRow["引导师"] = "";
  8096. string StrNameE = "";
  8097. if (dt0.Rows[i]["引导师"].ToString().Trim().Length != 0 )
  8098. StrNameE = dt0.Rows[i]["引导师"].ToString().Trim().Substring( 0, dt0.Rows[i]["引导师"].ToString().Trim().Length - 1 );
  8099. if ( !string.IsNullOrEmpty( StrNameE.Trim() ) )
  8100. {
  8101. dtNewRow["引导师"] = LYFZ.DAL.DAL_ErpUser.GetUserIDToUserName(StrNameE, ',');
  8102. /*DataRow dtRowA = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrNameE );
  8103. if ( dtRowA != null )
  8104. {
  8105. dtNewRow["引导师"] = dtRowA["User_Name"].ToString().Trim();
  8106. }
  8107. else
  8108. {
  8109. dtNewRow["引导师"] = StrNameE;
  8110. }*/
  8111. }
  8112. dtNewRow["引导满意度"] = StrPerson5;
  8113. dtNewRow["引导回访人员"] = StrPersonName5.TrimEnd( ',' );
  8114. dtNewRow["引导回访日期"] = StrPersonTime5.TrimEnd( ',' );
  8115. dtNewRow["引导回访备注"] = StrPersonRemark5.TrimEnd( ';' );
  8116. dtNewRow["引导助理"] = "";
  8117. string StrNameF = "";
  8118. if (dt0.Rows[i]["引导助理"].ToString().Trim().Length != 0)
  8119. StrNameF = dt0.Rows[i]["引导助理"].ToString().Trim().Substring( 0, dt0.Rows[i]["引导助理"].ToString().Trim().Length - 1 );
  8120. if ( !string.IsNullOrEmpty( StrNameF.Trim() ) )
  8121. {
  8122. dtNewRow["引导助理"] = LYFZ.DAL.DAL_ErpUser.GetUserIDToUserName(StrNameF, ',');
  8123. /* DataRow dtRowA = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrNameF );
  8124. if ( dtRowA != null )
  8125. {
  8126. dtNewRow["引导助理"] = dtRowA["User_Name"].ToString().Trim();
  8127. }
  8128. else
  8129. {
  8130. dtNewRow["引导助理"] = StrNameF;
  8131. }*/
  8132. }
  8133. dtNewRow["引导助理满意度"] = StrPerson6;
  8134. dtNewRow["引导助理回访人员"] = StrPersonName6.TrimEnd( ',' );
  8135. dtNewRow["引导助理回访日期"] = StrPersonTime6.TrimEnd( ',' );
  8136. dtNewRow["引导助理回访备注"] = StrPersonRemark6.TrimEnd( ';' );
  8137. newtable.Rows.Add( dtNewRow );
  8138. }
  8139. }
  8140. #endregion
  8141. } );
  8142. if ( newtable.Rows.Count > 0 )
  8143. {
  8144. dgvData.DataSource( newtable, strHideField: "Ord_Number,Ordv_ViceNumber" );
  8145. }
  8146. else
  8147. {
  8148. dgvData.DataColumns( StrTableColumnName, strHideField: "Ord_Number,Ordv_ViceNumber" );
  8149. }
  8150. dgvData.Columns["客户姓名"].Frozen = true;
  8151. dgvData.Columns["拍摄时间"].Width = 110;
  8152. dgvData.Columns["摄影回访日期"].Width = 120;
  8153. dgvData.Columns["摄影助理回访日期"].Width = 120;
  8154. dgvData.Columns["化妆回访日期"].Width = 120;
  8155. dgvData.Columns["化妆助理回访日期"].Width = 120;
  8156. dgvData.Columns["引导回访日期"].Width = 120;
  8157. dgvData.Columns["引导助理回访日期"].Width = 120;
  8158. dgvData.Columns["摄影回访备注"].Width = 300;
  8159. dgvData.Columns["摄影助理回访备注"].Width = 300;
  8160. dgvData.Columns["化妆回访备注"].Width = 300;
  8161. dgvData.Columns["化妆助理回访备注"].Width = 300;
  8162. dgvData.Columns["引导回访备注"].Width = 300;
  8163. dgvData.Columns["引导助理回访人员"].Width = 110;
  8164. dgvData.Columns["引导助理回访备注"].Width = 300;
  8165. }
  8166. /// <summary>
  8167. /// 获取满意度调查_选片人调查
  8168. /// </summary>
  8169. /// <param name="dgvData"></param>
  8170. /// <param name="StrQueryCondition"></param>
  8171. public static void GetData_SatisfactionSurveyFilmSelection( DataGridViewEc dgvData, string StrQueryCondition )
  8172. {
  8173. DataSet dtSet = new DataSet();
  8174. string StrTableColumnName = "Ord_Number,Ordv_ViceNumber,订单号,客户姓名,客户电话,订单类型,拍摄名称,选片日期,选片状态,选片师,选片满意度,选片回访人员,选片回访日期,选片回访备注,初修日期查询,初修日期,初修状态,初修师,初修满意度,初修回访人员,初修回访日期,初修回访备注,精修日期查询,精修日期,精修状态,精修师,精修满意度,精修回访人员,精修回访日期,精修回访备注";
  8175. DataTable newtable = new DataTable();
  8176. List<string> ListStrColumns = new List<string>( StrTableColumnName.Trim().Split( ',' ) );
  8177. for ( int i = 0; i < ListStrColumns.Count; i++ )
  8178. {
  8179. newtable.Columns.Add( ListStrColumns[i].Trim(), typeof( string ) );
  8180. }
  8181. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  8182. {
  8183. dtSet = LYFZ.BLL.BLL_ErpOrderView.GetData_SatisfactionSurveyFilmSelection( StrQueryCondition );
  8184. #region 重组DataTable
  8185. backgroundWorker.ReportProgress( 0, "正在获取接单人满意分值..." );
  8186. DataTable dt1 = dtSet.Tables["ds"];
  8187. if ( dt1.Rows.Count > 0 )
  8188. {
  8189. DataTable dt2 = dtSet.Tables["ds1"];
  8190. string StrWhere = "";
  8191. for ( int i = 0; i < dt1.Rows.Count; i++ )
  8192. {
  8193. StrWhere += "'" + dt1.Rows[i]["Ord_Number"].ToString().Trim() + "',";
  8194. }
  8195. StrWhere = " Where Sfs_Type = 3 And Sfs_SurveySetID in (8,9,10) And Sfs_OrderNumber in (" + StrWhere.TrimEnd( ',' ) + ")";
  8196. DataTable dt3 = LYFZ.BLL.BLL_ErpOrderView.GetData_SatisfactionSurvey( StrWhere );
  8197. for ( int i = 0; i < dt1.Rows.Count; i++ )
  8198. {
  8199. DataRow dtNewRow = newtable.NewRow();
  8200. #region 满意度
  8201. string StrPerson = "";
  8202. string StrPersonName = "";
  8203. string StrPersonTime = "";
  8204. string StrPersonRemark = "";
  8205. DataRow[] dtRows1 = dt3.Select( "Sfs_OrderNumber = '" + dt1.Rows[i]["Ord_Number"].ToString().Trim() + "' And Sfs_SurveySetID = 8" );
  8206. if ( dtRows1.Length > 0 )
  8207. {
  8208. decimal intPerson = 0;
  8209. int PersonCount = 0;
  8210. Hashtable htDataDesignName = new Hashtable();
  8211. Hashtable htDataDesignTime = new Hashtable();
  8212. Hashtable htDataDesignRemark = new Hashtable();
  8213. for ( int j = 0; j < dtRows1.Length; j++ )
  8214. {
  8215. if ( dtRows1[j]["Sfrs_Scores"].ToString().Trim().Length > 0 )
  8216. {
  8217. intPerson += Convert.ToDecimal( dtRows1[j]["Sfrs_Scores"] );
  8218. PersonCount++;
  8219. }
  8220. string StrName = dtRows1[j]["Sfs_CreateName"].ToString().Trim();
  8221. if ( !string.IsNullOrEmpty( StrName.Trim() ) )
  8222. {
  8223. DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrName );
  8224. if ( dtRow != null && dtRow["User_Name"].ToString().Trim().Length > 0 )
  8225. {
  8226. htDataDesignName[dtRow["User_Name"].ToString().Trim()] = "";
  8227. }
  8228. }
  8229. if ( LYFZ.BLL.OtherCommonModel.DateTimeToString( dtRows1[j]["Sfs_CreateTime"] ).Length > 0 )
  8230. {
  8231. htDataDesignTime[LYFZ.BLL.OtherCommonModel.DateTimeToString( dtRows1[j]["Sfs_CreateTime"] )] = "";
  8232. }
  8233. if ( dtRows1[j]["Sfs_Remark"].ToString().Trim().Length > 0 )
  8234. {
  8235. htDataDesignRemark[dtRows1[j]["Sfs_Remark"].ToString().Trim()] = "";
  8236. }
  8237. }
  8238. if ( intPerson > 0 )
  8239. {
  8240. string Strs = (intPerson / Convert.ToDecimal( PersonCount )).ToString( "0.00" );
  8241. DataRow[] dt3Value = dt2.Select( "Sfrs_Scores <= " + Strs + "", sort: "Sfrs_Scores DESC" );
  8242. if ( dt3Value.Length > 0 )
  8243. {
  8244. StrPerson = dt3Value[0]["Sfrs_Name"].ToString().Trim();
  8245. }
  8246. }
  8247. // 没有分数时,也要显示回访人员, 回访备注, 回访日期;
  8248. foreach ( string item in htDataDesignName.Keys )
  8249. StrPersonName += item.Trim() + ",";
  8250. foreach ( string item in htDataDesignTime.Keys )
  8251. StrPersonTime += item.Trim() + ",";
  8252. foreach ( string item in htDataDesignRemark.Keys )
  8253. StrPersonRemark += item.Trim() + ";";
  8254. }
  8255. string StrPerson2 = "";
  8256. string StrPersonName2 = "";
  8257. string StrPersonTime2 = "";
  8258. string StrPersonRemark2 = "";
  8259. DataRow[] dtRows2 = dt3.Select( "Sfs_OrderNumber = '" + dt1.Rows[i]["Ord_Number"].ToString().Trim() + "' And Sfs_SurveySetID = 9" );
  8260. if ( dtRows2.Length > 0 )
  8261. {
  8262. decimal intPerson = 0;
  8263. Hashtable htDataDesignName = new Hashtable();
  8264. Hashtable htDataDesignTime = new Hashtable();
  8265. Hashtable htDataDesignRemark = new Hashtable();
  8266. for ( int j = 0; j < dtRows2.Length; j++ )
  8267. {
  8268. if ( dtRows2[j]["Sfrs_Scores"].ToString().Trim().Length > 0 )
  8269. {
  8270. intPerson += Convert.ToDecimal( dtRows2[j]["Sfrs_Scores"] );
  8271. }
  8272. string StrName = dtRows2[j]["Sfs_CreateName"].ToString().Trim();
  8273. if ( !string.IsNullOrEmpty( StrName.Trim() ) )
  8274. {
  8275. DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrName );
  8276. if ( dtRow != null && dtRow["User_Name"].ToString().Trim().Length > 0 )
  8277. {
  8278. htDataDesignName[dtRow["User_Name"].ToString().Trim()] = "";
  8279. }
  8280. }
  8281. if ( LYFZ.BLL.OtherCommonModel.DateTimeToString( dtRows2[j]["Sfs_CreateTime"] ).Length > 0 )
  8282. {
  8283. htDataDesignTime[LYFZ.BLL.OtherCommonModel.DateTimeToString( dtRows2[j]["Sfs_CreateTime"] )] = "";
  8284. }
  8285. if ( dtRows2[j]["Sfs_Remark"].ToString().Trim().Length > 0 )
  8286. {
  8287. htDataDesignRemark[dtRows2[j]["Sfs_Remark"].ToString().Trim()] = "";
  8288. }
  8289. }
  8290. if ( intPerson > 0 )
  8291. {
  8292. string Strs = (intPerson / Convert.ToDecimal( dtRows2.Length )).ToString( "0.00" );
  8293. DataRow[] dt3Value = dt2.Select( "Sfrs_Scores <= " + Strs + "", sort: "Sfrs_Scores DESC" );
  8294. if ( dt3Value.Length > 0 )
  8295. {
  8296. StrPerson2 = dt3Value[0]["Sfrs_Name"].ToString().Trim();
  8297. foreach ( string item in htDataDesignName.Keys )
  8298. {
  8299. StrPersonName2 += item.Trim() + ",";
  8300. }
  8301. foreach ( string item in htDataDesignTime.Keys )
  8302. {
  8303. StrPersonTime2 += item.Trim() + ",";
  8304. }
  8305. foreach ( string item in htDataDesignRemark.Keys )
  8306. {
  8307. StrPersonRemark2 += item.Trim() + ";";
  8308. }
  8309. }
  8310. }
  8311. }
  8312. string StrPerson3 = "";
  8313. string StrPersonName3 = "";
  8314. string StrPersonTime3 = "";
  8315. string StrPersonRemark3 = "";
  8316. DataRow[] dtRows3 = dt3.Select( "Sfs_OrderNumber = '" + dt1.Rows[i]["Ord_Number"].ToString().Trim() + "' And Sfs_SurveySetID =10" );
  8317. if ( dtRows3.Length > 0 )
  8318. {
  8319. decimal intPerson = 0;
  8320. Hashtable htDataDesignName = new Hashtable();
  8321. Hashtable htDataDesignTime = new Hashtable();
  8322. Hashtable htDataDesignRemark = new Hashtable();
  8323. for ( int j = 0; j < dtRows3.Length; j++ )
  8324. {
  8325. if ( dtRows3[j]["Sfrs_Scores"].ToString().Trim().Length > 0 )
  8326. {
  8327. intPerson += Convert.ToDecimal( dtRows3[j]["Sfrs_Scores"] );
  8328. }
  8329. string StrName = dtRows3[j]["Sfs_CreateName"].ToString().Trim();
  8330. if ( !string.IsNullOrEmpty( StrName.Trim() ) )
  8331. {
  8332. DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrName );
  8333. if ( dtRow != null && dtRow["User_Name"].ToString().Trim().Length > 0 )
  8334. {
  8335. htDataDesignName[dtRow["User_Name"].ToString().Trim()] = "";
  8336. }
  8337. }
  8338. if ( LYFZ.BLL.OtherCommonModel.DateTimeToString( dtRows3[j]["Sfs_CreateTime"] ).Length > 0 )
  8339. {
  8340. htDataDesignTime[LYFZ.BLL.OtherCommonModel.DateTimeToString( dtRows3[j]["Sfs_CreateTime"] )] = "";
  8341. }
  8342. if ( dtRows3[j]["Sfs_Remark"].ToString().Trim().Length > 0 )
  8343. {
  8344. htDataDesignRemark[dtRows3[j]["Sfs_Remark"].ToString().Trim()] = "";
  8345. }
  8346. }
  8347. if ( intPerson > 0 )
  8348. {
  8349. string Strs = (intPerson / Convert.ToDecimal( dtRows3.Length )).ToString( "0.00" );
  8350. DataRow[] dt3Value = dt2.Select( "Sfrs_Scores <= " + Strs + "", sort: "Sfrs_Scores DESC" );
  8351. if ( dt3Value.Length > 0 )
  8352. {
  8353. StrPerson3 = dt3Value[0]["Sfrs_Name"].ToString().Trim();
  8354. foreach ( string item in htDataDesignName.Keys )
  8355. {
  8356. StrPersonName3 += item.Trim() + ",";
  8357. }
  8358. foreach ( string item in htDataDesignTime.Keys )
  8359. {
  8360. StrPersonTime3 += item.Trim() + ",";
  8361. }
  8362. foreach ( string item in htDataDesignRemark.Keys )
  8363. {
  8364. StrPersonRemark3 += item.Trim() + ";";
  8365. }
  8366. }
  8367. }
  8368. }
  8369. #endregion
  8370. dtNewRow["Ord_Number"] = dt1.Rows[i]["Ord_Number"].ToString().Trim();
  8371. dtNewRow["Ordv_ViceNumber"] = dt1.Rows[i]["Ordv_ViceNumber"].ToString().Trim();
  8372. dtNewRow["订单号"] = dt1.Rows[i]["订单号"].ToString().Trim();
  8373. dtNewRow["客户姓名"] = dt1.Rows[i]["客户姓名"].ToString().Trim();
  8374. dtNewRow["客户电话"] = dt1.Rows[i]["客户电话"].ToString().Trim();
  8375. dtNewRow["订单类型"] = Enum.ToObject( typeof( LYFZ.EnumPublic.OrderType ), Convert.ToInt32( dt1.Rows[i]["订单类型"] ) ).ToString();
  8376. dtNewRow["拍摄名称"] = dt1.Rows[i]["拍摄名称"].ToString().Trim();
  8377. dtNewRow["选片日期"] = LYFZ.BLL.OtherCommonModel.DateTimeToString( dt1.Rows[i]["选片日期"] );
  8378. dtNewRow["选片状态"] = Enum.ToObject( typeof( LYFZ.EnumPublic.FilmSelectionStatusEnum ), Convert.ToInt32( dt1.Rows[i]["选片状态"] ) ).ToString();
  8379. dtNewRow["选片师"] = "";
  8380. string StrNameA = dt1.Rows[i]["选片师"].ToString().Trim();
  8381. if ( !string.IsNullOrEmpty( StrNameA.Trim() ) )
  8382. {
  8383. DataRow dtRowA = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrNameA );
  8384. if ( dtRowA != null )
  8385. {
  8386. dtNewRow["选片师"] = dtRowA["User_Name"].ToString().Trim();
  8387. }
  8388. }
  8389. dtNewRow["选片满意度"] = StrPerson;
  8390. dtNewRow["选片回访人员"] = StrPersonName.TrimEnd( ',' );
  8391. dtNewRow["选片回访日期"] = StrPersonTime.TrimEnd( ',' );
  8392. dtNewRow["选片回访备注"] = StrPersonRemark.TrimEnd( ';' );
  8393. dtNewRow["初修日期"] = LYFZ.BLL.OtherCommonModel.DateTimeToString( dt1.Rows[i]["初修日期"] );
  8394. dtNewRow["初修状态"] = Enum.ToObject( typeof( LYFZ.EnumPublic.EarlyRepairStatusEnum ), Convert.ToInt32( dt1.Rows[i]["初修状态"] ) ).ToString();
  8395. dtNewRow["初修师"] = "";
  8396. string StrNameB = dt1.Rows[i]["初修师"].ToString().Trim();
  8397. if ( !string.IsNullOrEmpty( StrNameB.Trim() ) )
  8398. {
  8399. DataRow dtRowA = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrNameB );
  8400. if ( dtRowA != null )
  8401. {
  8402. dtNewRow["初修师"] = dtRowA["User_Name"].ToString().Trim();
  8403. }
  8404. }
  8405. dtNewRow["初修满意度"] = StrPerson2;
  8406. dtNewRow["初修回访人员"] = StrPersonName3.TrimEnd( ',' );
  8407. dtNewRow["初修回访日期"] = StrPersonTime3.TrimEnd( ',' );
  8408. dtNewRow["初修回访备注"] = StrPersonRemark3.TrimEnd( ';' );
  8409. dtNewRow["精修日期"] = LYFZ.BLL.OtherCommonModel.DateTimeToString( dt1.Rows[i]["精修日期"] );
  8410. dtNewRow["精修状态"] = Enum.ToObject( typeof( LYFZ.EnumPublic.RefinementStatusEnum ), Convert.ToInt32( dt1.Rows[i]["精修状态"] ) ).ToString();
  8411. dtNewRow["精修师"] = "";
  8412. string StrNameC = dt1.Rows[i]["精修师"].ToString().Trim();
  8413. if ( !string.IsNullOrEmpty( StrNameC.Trim() ) )
  8414. {
  8415. DataRow dtRowA = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrNameC );
  8416. if ( dtRowA != null )
  8417. {
  8418. dtNewRow["精修师"] = dtRowA["User_Name"].ToString().Trim();
  8419. }
  8420. }
  8421. dtNewRow["精修满意度"] = StrPerson3;
  8422. dtNewRow["精修回访人员"] = StrPersonName3.TrimEnd( ',' );
  8423. dtNewRow["精修回访日期"] = StrPersonTime3.TrimEnd( ',' );
  8424. dtNewRow["精修回访备注"] = StrPersonRemark3.TrimEnd( ';' );
  8425. newtable.Rows.Add( dtNewRow );
  8426. }
  8427. }
  8428. #endregion
  8429. } );
  8430. if ( newtable.Rows.Count > 0 )
  8431. {
  8432. dgvData.DataSource( newtable, strHideField: "Ord_Number,Ordv_ViceNumber" );
  8433. }
  8434. else
  8435. {
  8436. dgvData.DataColumns( StrTableColumnName, strHideField: "Ord_Number,Ordv_ViceNumber" );
  8437. }
  8438. dgvData.Columns["客户姓名"].Frozen = true;
  8439. dgvData.Columns["选片日期"].Width = 110;
  8440. dgvData.Columns["初修日期"].Width = 110;
  8441. dgvData.Columns["精修日期"].Width = 110;
  8442. dgvData.Columns["选片回访日期"].Width = 120;
  8443. dgvData.Columns["初修回访日期"].Width = 120;
  8444. dgvData.Columns["精修回访日期"].Width = 120;
  8445. dgvData.Columns["选片回访备注"].Width = 300;
  8446. dgvData.Columns["初修回访备注"].Width = 300;
  8447. dgvData.Columns["精修回访备注"].Width = 300;
  8448. }
  8449. /// <summary>
  8450. /// 获取满意度调查_设计、看版师调查
  8451. /// </summary>
  8452. /// <param name="dgvData"></param>
  8453. /// <param name="StrQueryCondition"></param>
  8454. public static void GetData_SatisfactionSurveyLookDesign( DataGridViewEc dgvData, string StrQueryCondition )
  8455. {
  8456. DataSet dtSet = new DataSet();
  8457. string StrTableColumnName = "Ord_Number,Ordv_ViceNumber,订单号,客户姓名,客户电话,订单类型,拍摄名称,设计时间,设计状态,设计师,设计满意度,设计回访人员,设计回访日期,设计回访备注,看版时间,看版状态,看版师,看版满意度,看版回访人员,看版回访日期,看版回访备注";
  8458. DataTable newtable = new DataTable();
  8459. List<string> ListStrColumns = new List<string>( StrTableColumnName.Trim().Split( ',' ) );
  8460. for ( int i = 0; i < ListStrColumns.Count; i++ )
  8461. {
  8462. newtable.Columns.Add( ListStrColumns[i].Trim(), typeof( string ) );
  8463. }
  8464. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  8465. {
  8466. dtSet = LYFZ.BLL.BLL_ErpOrderView.GetData_SatisfactionSurveyLookDesign( StrQueryCondition );
  8467. #region 重组DataTable
  8468. backgroundWorker.ReportProgress( 0, "正在获取看样满意分值..." );
  8469. DataTable dt1 = dtSet.Tables["ds"];
  8470. if ( dt1.Rows.Count > 0 )
  8471. {
  8472. DataTable dt2 = dtSet.Tables["ds1"];
  8473. string StrWhere = "";
  8474. for ( int i = 0; i < dt1.Rows.Count; i++ )
  8475. {
  8476. StrWhere += "'" + dt1.Rows[i]["Ordv_ViceNumber"].ToString().Trim() + "',";
  8477. }
  8478. StrWhere = " Where Sfs_Type = 4 And Sfs_SurveySetID in (11,12) And Sfs_OrderNumberDeputy in (" + StrWhere.TrimEnd( ',' ) + ")";
  8479. DataTable dt3 = LYFZ.BLL.BLL_ErpOrderView.GetData_SatisfactionSurvey( StrWhere );
  8480. for ( int i = 0; i < dt1.Rows.Count; i++ )
  8481. {
  8482. DataRow dtNewRow = newtable.NewRow();
  8483. #region 满意度
  8484. string StrDesign = "";
  8485. string StrDesignName = "";
  8486. string StrDesignTime = "";
  8487. string StrDesignRemark = "";
  8488. DataRow[] dtRows1 = dt3.Select( "Sfs_OrderNumberDeputy = '" + dt1.Rows[i]["Ordv_ViceNumber"].ToString().Trim() + "' And Sfs_SurveySetID = '12'" );
  8489. if ( dtRows1.Length > 0 )
  8490. {
  8491. decimal intDesign = 0;
  8492. int PersonCount = 0;
  8493. Hashtable htDataDesignName = new Hashtable();
  8494. Hashtable htDataDesignTime = new Hashtable();
  8495. Hashtable htDataDesignRemark = new Hashtable();
  8496. for ( int j = 0; j < dtRows1.Length; j++ )
  8497. {
  8498. if ( dtRows1[j]["Sfrs_Scores"].ToString().Trim().Length > 0 )
  8499. {
  8500. intDesign += Convert.ToDecimal( dtRows1[j]["Sfrs_Scores"] );
  8501. PersonCount++;
  8502. }
  8503. string StrName = dtRows1[j]["Sfs_CreateName"].ToString().Trim();
  8504. if ( !string.IsNullOrEmpty( StrName.Trim() ) )
  8505. {
  8506. DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrName );
  8507. if ( dtRow != null && dtRow["User_Name"].ToString().Trim().Length > 0 )
  8508. {
  8509. htDataDesignName[dtRow["User_Name"].ToString().Trim()] = "";
  8510. }
  8511. }
  8512. if ( LYFZ.BLL.OtherCommonModel.DateTimeToString( dtRows1[j]["Sfs_CreateTime"] ).Length > 0 )
  8513. {
  8514. htDataDesignTime[LYFZ.BLL.OtherCommonModel.DateTimeToString( dtRows1[j]["Sfs_CreateTime"] )] = "";
  8515. }
  8516. if ( dtRows1[j]["Sfs_Remark"].ToString().Trim().Length > 0 )
  8517. {
  8518. htDataDesignRemark[dtRows1[j]["Sfs_Remark"].ToString().Trim()] = "";
  8519. }
  8520. }
  8521. if ( intDesign > 0 )
  8522. {
  8523. string Strs = (intDesign / Convert.ToDecimal( PersonCount )).ToString( "0.00" );
  8524. DataRow[] dt3Value = dt2.Select( "Sfrs_Scores <= " + Strs + "", sort: "Sfrs_Scores DESC" );
  8525. if ( dt3Value.Length > 0 )
  8526. {
  8527. StrDesign = dt3Value[0]["Sfrs_Name"].ToString().Trim();
  8528. }
  8529. }
  8530. // 没有分数时,也要显示回访人员, 回访备注, 回访日期;
  8531. foreach ( string item in htDataDesignName.Keys )
  8532. StrDesignName += item.Trim() + ",";
  8533. foreach ( string item in htDataDesignTime.Keys )
  8534. StrDesignTime += item.Trim() + ",";
  8535. foreach ( string item in htDataDesignRemark.Keys )
  8536. StrDesignRemark += item.Trim() + ";";
  8537. }
  8538. string StrLookDesign = "";
  8539. string StrLookDesignName = "";
  8540. string StrLookDesignTime = "";
  8541. string StrLookDesignRemark = "";
  8542. DataRow[] dtRows2 = dt3.Select( "Sfs_OrderNumberDeputy = '" + dt1.Rows[i]["Ordv_ViceNumber"].ToString().Trim() + "' And Sfs_SurveySetID = '11'" );
  8543. if ( dtRows2.Length > 0 )
  8544. {
  8545. decimal intPerson = 0;
  8546. int PersonCount = 0;
  8547. Hashtable htDataLookDesignName = new Hashtable();
  8548. Hashtable htDataLookDesignTime = new Hashtable();
  8549. Hashtable htDataLookDesignRemark = new Hashtable();
  8550. for ( int j = 0; j < dtRows2.Length; j++ )
  8551. {
  8552. if ( dtRows2[j]["Sfrs_Scores"].ToString().Trim().Length > 0 )
  8553. {
  8554. intPerson += Convert.ToDecimal( dtRows2[j]["Sfrs_Scores"] );
  8555. PersonCount++;
  8556. }
  8557. string StrName = dtRows2[j]["Sfs_CreateName"].ToString().Trim();
  8558. if ( !string.IsNullOrEmpty( StrName.Trim() ) )
  8559. {
  8560. DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrName );
  8561. if ( dtRow != null && dtRow["User_Name"].ToString().Trim().Length > 0 )
  8562. {
  8563. htDataLookDesignName[dtRow["User_Name"].ToString().Trim()] = "";
  8564. }
  8565. }
  8566. if ( intPerson > 0 )
  8567. {
  8568. if ( LYFZ.BLL.OtherCommonModel.DateTimeToString( dtRows2[j]["Sfs_CreateTime"] ).Length > 0 )
  8569. {
  8570. htDataLookDesignTime[LYFZ.BLL.OtherCommonModel.DateTimeToString( dtRows2[j]["Sfs_CreateTime"] )] = "";
  8571. }
  8572. if ( dtRows2[j]["Sfs_Remark"].ToString().Trim().Length > 0 )
  8573. {
  8574. htDataLookDesignRemark[dtRows2[j]["Sfs_Remark"].ToString().Trim()] = "";
  8575. }
  8576. }
  8577. }
  8578. string Strs = (intPerson / Convert.ToDecimal( PersonCount )).ToString( "0.00" );
  8579. DataRow[] dt3Value = dt2.Select( "Sfrs_Scores <= " + Strs + "", sort: "Sfrs_Scores DESC" );
  8580. if ( dt3Value.Length > 0 )
  8581. {
  8582. StrLookDesign = dt3Value[0]["Sfrs_Name"].ToString().Trim();
  8583. foreach ( string item in htDataLookDesignName.Keys )
  8584. {
  8585. StrLookDesignName += item.Trim() + ",";
  8586. }
  8587. foreach ( string item in htDataLookDesignTime.Keys )
  8588. {
  8589. StrLookDesignTime += item.Trim() + ",";
  8590. }
  8591. foreach ( string item in htDataLookDesignRemark.Keys )
  8592. {
  8593. StrLookDesignRemark += item.Trim() + ";";
  8594. }
  8595. }
  8596. }
  8597. #endregion
  8598. dtNewRow["Ord_Number"] = dt1.Rows[i]["Ord_Number"].ToString().Trim();
  8599. dtNewRow["Ordv_ViceNumber"] = dt1.Rows[i]["Ordv_ViceNumber"].ToString().Trim();
  8600. dtNewRow["订单号"] = dt1.Rows[i]["订单号"].ToString().Trim();
  8601. dtNewRow["客户姓名"] = dt1.Rows[i]["客户姓名"].ToString().Trim();
  8602. dtNewRow["客户电话"] = dt1.Rows[i]["客户电话"].ToString().Trim();
  8603. dtNewRow["订单类型"] = Enum.ToObject( typeof( LYFZ.EnumPublic.OrderType ), Convert.ToInt32( dt1.Rows[i]["订单类型"] ) ).ToString();
  8604. dtNewRow["拍摄名称"] = dt1.Rows[i]["拍摄名称"].ToString().Trim();
  8605. dtNewRow["设计时间"] = LYFZ.BLL.OtherCommonModel.DateTimeToString( dt1.Rows[i]["设计时间"] );
  8606. dtNewRow["设计状态"] = Enum.ToObject( typeof( LYFZ.EnumPublic.DesignerStatusEnum ), Convert.ToInt32( dt1.Rows[i]["设计状态"] ) ).ToString();
  8607. dtNewRow["设计师"] = "";
  8608. string StrNameA = dt1.Rows[i]["设计师"].ToString().Trim();
  8609. if ( !string.IsNullOrEmpty( StrNameA.Trim() ) )
  8610. {
  8611. DataRow dtRowA = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrNameA );
  8612. if ( dtRowA != null )
  8613. {
  8614. dtNewRow["设计师"] = dtRowA["User_Name"].ToString().Trim();
  8615. }
  8616. }
  8617. dtNewRow["设计满意度"] = StrDesign;
  8618. dtNewRow["设计回访人员"] = StrDesignName.TrimEnd( ',' );
  8619. dtNewRow["设计回访日期"] = StrDesignTime.TrimEnd( ',' );
  8620. dtNewRow["设计回访备注"] = StrDesignRemark.TrimEnd( ';' );
  8621. dtNewRow["看版时间"] = LYFZ.BLL.OtherCommonModel.DateTimeToString( dt1.Rows[i]["看版时间"] );
  8622. dtNewRow["看版状态"] = Enum.ToObject( typeof( LYFZ.EnumPublic.LookDesignStatusEnum ), Convert.ToInt32( dt1.Rows[i]["看版状态"] ) ).ToString();
  8623. dtNewRow["看版师"] = "";
  8624. string StrNameB = dt1.Rows[i]["看版师"].ToString().Trim();
  8625. if ( !string.IsNullOrEmpty( StrNameB.Trim() ) )
  8626. {
  8627. DataRow dtRowA = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrNameB );
  8628. if ( dtRowA != null )
  8629. {
  8630. dtNewRow["看版师"] = dtRowA["User_Name"].ToString().Trim();
  8631. }
  8632. }
  8633. dtNewRow["看版满意度"] = StrLookDesign;
  8634. dtNewRow["看版回访人员"] = StrLookDesignName.TrimEnd( ',' );
  8635. dtNewRow["看版回访日期"] = StrLookDesignTime.TrimEnd( ',' );
  8636. dtNewRow["看版回访备注"] = StrLookDesignRemark.TrimEnd( ';' );
  8637. newtable.Rows.Add( dtNewRow );
  8638. }
  8639. }
  8640. #endregion
  8641. } );
  8642. if ( newtable.Rows.Count > 0 )
  8643. {
  8644. dgvData.DataSource( newtable, strHideField: "Ord_Number,Ordv_ViceNumber" );
  8645. }
  8646. else
  8647. {
  8648. dgvData.DataColumns( StrTableColumnName, strHideField: "Ord_Number,Ordv_ViceNumber" );
  8649. }
  8650. dgvData.Columns["客户姓名"].Frozen = true;
  8651. dgvData.Columns["设计时间"].Width = 110;
  8652. dgvData.Columns["看版时间"].Width = 110;
  8653. dgvData.Columns["设计回访备注"].Width = 300;
  8654. dgvData.Columns["看版回访备注"].Width = 300;
  8655. }
  8656. /// <summary>
  8657. /// 获取满意度调查_取件调查
  8658. /// </summary>
  8659. /// <param name="dgvData"></param>
  8660. /// <param name="StrQueryCondition"></param>
  8661. public static void GetData_SatisfactionSurveyTotakePiece( DataGridViewEc dgvData, string StrQueryCondition )
  8662. {
  8663. DataSet dtSet = new DataSet();
  8664. string StrTableColumnName = "Ord_Number,Ordv_ViceNumber,订单号,客户姓名,客户电话,订单类型,套系名称,取件日期,取件状态,产品满意度,产品回访人员,产品回访日期,产品回访备注,进度满意度,进度回访人员,进度回访日期,进度回访备注";
  8665. DataTable newtable = new DataTable();
  8666. List<string> ListStrColumns = new List<string>( StrTableColumnName.Trim().Split( ',' ) );
  8667. for ( int i = 0; i < ListStrColumns.Count; i++ )
  8668. {
  8669. newtable.Columns.Add( ListStrColumns[i].Trim(), typeof( string ) );
  8670. }
  8671. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  8672. {
  8673. dtSet = LYFZ.BLL.BLL_ErpOrderView.GetData_SatisfactionSurveyTotakePiece( StrQueryCondition );
  8674. #region 重组DataTable
  8675. backgroundWorker.ReportProgress( 0, "正在获取满意分值..." );
  8676. DataTable dt1 = dtSet.Tables["ds"];
  8677. if ( dt1.Rows.Count > 0 )
  8678. {
  8679. DataTable dt2 = dtSet.Tables["ds1"];
  8680. string StrWhere = "";
  8681. for ( int i = 0; i < dt1.Rows.Count; i++ )
  8682. {
  8683. StrWhere += "'" + dt1.Rows[i]["Ordv_ViceNumber"].ToString().Trim() + "',";
  8684. dt1.Rows[i]["取件状态"] = (dt1.Rows[i]["取件状态"].ToString().Trim() == "0" ? "未取" :
  8685. dt1.Rows[i]["取件状态"].ToString().Trim() == "1" ? "取件中" :
  8686. dt1.Rows[i]["取件状态"].ToString().Trim() == "2" ? "OK" : "");
  8687. }
  8688. StrWhere = " Where Sfs_Type = 5 And Sfs_SurveySetID in (13,14) And Sfs_OrderNumberDeputy in (" + StrWhere.TrimEnd( ',' ) + ")";
  8689. DataTable dt3 = LYFZ.BLL.BLL_ErpOrderView.GetData_SatisfactionSurvey( StrWhere );
  8690. for ( int i = 0; i < dt1.Rows.Count; i++ )
  8691. {
  8692. DataRow dtNewRow = newtable.NewRow();
  8693. #region 满意度
  8694. string StrPerson = "";
  8695. string StrPersonName = "";
  8696. string StrPersonTime = "";
  8697. string StrPersonRemark = "";
  8698. DataRow[] dtRows1 = dt3.Select( "Sfs_OrderNumberDeputy = '" + dt1.Rows[i]["Ordv_ViceNumber"].ToString().Trim() + "' And Sfs_SurveySetID = 13" );
  8699. if ( dtRows1.Length > 0 )
  8700. {
  8701. decimal intPerson = 0;
  8702. int PersonCount = 0;
  8703. Hashtable htDataDesignName = new Hashtable();
  8704. Hashtable htDataDesignTime = new Hashtable();
  8705. Hashtable htDataDesignRemark = new Hashtable();
  8706. for ( int j = 0; j < dtRows1.Length; j++ )
  8707. {
  8708. if ( dtRows1[j]["Sfrs_Scores"].ToString().Trim().Length > 0 )
  8709. {
  8710. intPerson += Convert.ToDecimal( dtRows1[j]["Sfrs_Scores"] );
  8711. PersonCount++;
  8712. }
  8713. string StrName = dtRows1[j]["Sfs_CreateName"].ToString().Trim();
  8714. if ( !string.IsNullOrEmpty( StrName.Trim() ) )
  8715. {
  8716. DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrName );
  8717. if ( dtRow != null && dtRow["User_Name"].ToString().Trim().Length > 0 )
  8718. {
  8719. htDataDesignName[dtRow["User_Name"].ToString().Trim()] = "";
  8720. }
  8721. }
  8722. if ( LYFZ.BLL.OtherCommonModel.DateTimeToString( dtRows1[j]["Sfs_CreateTime"] ).Length > 0 )
  8723. {
  8724. htDataDesignTime[LYFZ.BLL.OtherCommonModel.DateTimeToString( dtRows1[j]["Sfs_CreateTime"] )] = "";
  8725. }
  8726. if ( dtRows1[j]["Sfs_Remark"].ToString().Trim().Length > 0 )
  8727. {
  8728. htDataDesignRemark[dtRows1[j]["Sfs_Remark"].ToString().Trim()] = "";
  8729. }
  8730. }
  8731. if ( intPerson > 0 )
  8732. {
  8733. string Strs = (intPerson / Convert.ToDecimal( PersonCount )).ToString( "0.00" );
  8734. DataRow[] dt3Value = dt2.Select( "Sfrs_Scores <= " + Strs + "", sort: "Sfrs_Scores DESC" );
  8735. if ( dt3Value.Length > 0 )
  8736. {
  8737. StrPerson = dt3Value[0]["Sfrs_Name"].ToString().Trim();
  8738. }
  8739. }
  8740. // 没有分数时,也要显示回访人员, 回访备注, 回访日期;
  8741. foreach ( string item in htDataDesignName.Keys )
  8742. StrPersonName += item.Trim() + ",";
  8743. foreach ( string item in htDataDesignTime.Keys )
  8744. StrPersonTime += item.Trim() + ",";
  8745. foreach ( string item in htDataDesignRemark.Keys )
  8746. StrPersonRemark += item.Trim() + ";";
  8747. }
  8748. string StrPerson2 = "";
  8749. string StrPersonName2 = "";
  8750. string StrPersonTime2 = "";
  8751. string StrPersonRemark2 = "";
  8752. DataRow[] dtRows2 = dt3.Select( "Sfs_OrderNumberDeputy = '" + dt1.Rows[i]["Ordv_ViceNumber"].ToString().Trim() + "' And Sfs_SurveySetID = 14" );
  8753. if ( dtRows2.Length > 0 )
  8754. {
  8755. decimal intPerson = 0;
  8756. int PersonCount = 0;
  8757. Hashtable htDataDesignName = new Hashtable();
  8758. Hashtable htDataDesignTime = new Hashtable();
  8759. Hashtable htDataDesignRemark = new Hashtable();
  8760. for ( int j = 0; j < dtRows2.Length; j++ )
  8761. {
  8762. if ( dtRows2[j]["Sfrs_Scores"].ToString().Trim().Length > 0 )
  8763. {
  8764. intPerson += Convert.ToDecimal( dtRows2[j]["Sfrs_Scores"] );
  8765. PersonCount++;
  8766. }
  8767. string StrName = dtRows2[j]["Sfs_CreateName"].ToString().Trim();
  8768. if ( !string.IsNullOrEmpty( StrName.Trim() ) )
  8769. {
  8770. DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrName );
  8771. if ( dtRow != null && dtRow["User_Name"].ToString().Trim().Length > 0 )
  8772. {
  8773. htDataDesignName[dtRow["User_Name"].ToString().Trim()] = "";
  8774. }
  8775. }
  8776. if ( LYFZ.BLL.OtherCommonModel.DateTimeToString( dtRows2[j]["Sfs_CreateTime"] ).Length > 0 )
  8777. {
  8778. htDataDesignTime[LYFZ.BLL.OtherCommonModel.DateTimeToString( dtRows2[j]["Sfs_CreateTime"] )] = "";
  8779. }
  8780. if ( dtRows2[j]["Sfs_Remark"].ToString().Trim().Length > 0 )
  8781. {
  8782. htDataDesignRemark[dtRows2[j]["Sfs_Remark"].ToString().Trim()] = "";
  8783. }
  8784. }
  8785. string Strs = "";
  8786. if ( PersonCount > 0 )
  8787. {
  8788. Strs = (intPerson / Convert.ToDecimal( PersonCount )).ToString( "0.00" );
  8789. }
  8790. else
  8791. {
  8792. Strs = "0.00";
  8793. }
  8794. DataRow[] dt3Value = dt2.Select( "Sfrs_Scores <= " + Strs + "", sort: "Sfrs_Scores DESC" );
  8795. if ( dt3Value.Length > 0 )
  8796. {
  8797. StrPerson2 = dt3Value[0]["Sfrs_Name"].ToString().Trim();
  8798. foreach ( string item in htDataDesignName.Keys )
  8799. {
  8800. StrPersonName2 += item.Trim() + ",";
  8801. }
  8802. foreach ( string item in htDataDesignTime.Keys )
  8803. {
  8804. StrPersonTime2 += item.Trim() + ",";
  8805. }
  8806. foreach ( string item in htDataDesignRemark.Keys )
  8807. {
  8808. StrPersonRemark2 += item.Trim() + ";";
  8809. }
  8810. }
  8811. }
  8812. #endregion
  8813. dtNewRow["Ord_Number"] = dt1.Rows[i]["Ord_Number"].ToString().Trim();
  8814. dtNewRow["Ordv_ViceNumber"] = dt1.Rows[i]["Ordv_ViceNumber"].ToString().Trim();
  8815. dtNewRow["订单号"] = dt1.Rows[i]["订单号"].ToString().Trim();
  8816. dtNewRow["客户姓名"] = dt1.Rows[i]["客户姓名"].ToString().Trim();
  8817. dtNewRow["客户电话"] = dt1.Rows[i]["客户电话"].ToString().Trim();
  8818. dtNewRow["订单类型"] = Enum.ToObject( typeof( LYFZ.EnumPublic.OrderType ), Convert.ToInt32( dt1.Rows[i]["订单类型"] ) ).ToString();
  8819. dtNewRow["套系名称"] = dt1.Rows[i]["套系名称"].ToString().Trim();
  8820. dtNewRow["取件日期"] = LYFZ.BLL.OtherCommonModel.DateTimeToString( dt1.Rows[i]["取件日期"] );
  8821. dtNewRow["取件状态"] = dt1.Rows[i]["取件状态"].ToString().Trim();
  8822. dtNewRow["产品满意度"] = StrPerson;
  8823. dtNewRow["产品回访人员"] = StrPersonName.TrimEnd( ',' );
  8824. dtNewRow["产品回访日期"] = StrPersonTime.TrimEnd( ',' );
  8825. dtNewRow["产品回访备注"] = StrPersonRemark.TrimEnd( ';' );
  8826. dtNewRow["进度满意度"] = StrPerson2;
  8827. dtNewRow["进度回访人员"] = StrPersonName2.TrimEnd( ',' );
  8828. dtNewRow["进度回访日期"] = StrPersonTime2.TrimEnd( ',' );
  8829. dtNewRow["进度回访备注"] = StrPersonRemark2.TrimEnd( ';' );
  8830. newtable.Rows.Add( dtNewRow );
  8831. }
  8832. }
  8833. #endregion
  8834. } );
  8835. if ( newtable.Rows.Count > 0 )
  8836. {
  8837. dgvData.DataSource( newtable, strHideField: "Ord_Number,Ordv_ViceNumber" );
  8838. }
  8839. else
  8840. {
  8841. dgvData.DataColumns( StrTableColumnName, strHideField: "Ord_Number,Ordv_ViceNumber" );
  8842. }
  8843. dgvData.Columns["客户姓名"].Frozen = true;
  8844. dgvData.Columns["取件日期"].Width = 110;
  8845. dgvData.Columns["产品回访日期"].Width = 110;
  8846. dgvData.Columns["进度回访日期"].Width = 120;
  8847. dgvData.Columns["产品回访备注"].Width = 300;
  8848. dgvData.Columns["进度回访备注"].Width = 300;
  8849. }
  8850. /// <summary>
  8851. /// 获取满意度调查_服务调查
  8852. /// </summary>
  8853. /// <param name="dgvData"></param>
  8854. /// <param name="StrQueryCondition"></param>
  8855. public static void GetData_SatisfactionSurveyService( DataGridViewEc dgvData, string StrQueryCondition )
  8856. {
  8857. DataSet dtSet = new DataSet();
  8858. string StrTableColumnName = "Ord_Number,Ordv_ViceNumber,订单号,客户姓名,客户电话,订单类型,套系名称,服务内容,服务日期,服务状态,服务人员1,满意度,回访人员,回访日期,回访备注,服务人员2,人员2满意度,人员2回访人员,人员2回访日期,人员2回访备注";
  8859. DataTable newtable = new DataTable();
  8860. List<string> ListStrColumns = new List<string>( StrTableColumnName.Trim().Split( ',' ) );
  8861. for ( int i = 0; i < ListStrColumns.Count; i++ )
  8862. {
  8863. newtable.Columns.Add( ListStrColumns[i].Trim(), typeof( string ) );
  8864. }
  8865. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  8866. {
  8867. dtSet = LYFZ.BLL.BLL_ErpOrderView.GetData_SatisfactionSurveyService( StrQueryCondition );
  8868. #region 重组DataTable
  8869. backgroundWorker.ReportProgress( 0, "正在获取满意分值..." );
  8870. DataTable dt1 = dtSet.Tables["ds"];
  8871. if ( dt1.Rows.Count > 0 )
  8872. {
  8873. DataTable dt2 = dtSet.Tables["ds1"];
  8874. string StrWhere = "";
  8875. for ( int i = 0; i < dt1.Rows.Count; i++ )
  8876. {
  8877. StrWhere += "'" + dt1.Rows[i]["Ordv_ViceNumber"].ToString().Trim() + "',";
  8878. }
  8879. StrWhere = " Where Sfs_Type = 6 And Sfs_SurveySetID in (15,16) And Sfs_OrderNumberDeputy in (" + StrWhere.TrimEnd( ',' ) + ")";
  8880. DataTable dt3 = LYFZ.BLL.BLL_ErpOrderView.GetData_SatisfactionSurvey( StrWhere );
  8881. for ( int i = 0; i < dt1.Rows.Count; i++ )
  8882. {
  8883. DataRow dtNewRow = newtable.NewRow();
  8884. #region 满意度
  8885. string StrPerson = "";
  8886. string StrPersonName = "";
  8887. string StrPersonTime = "";
  8888. string StrPersonRemark = "";
  8889. DataRow[] dtRows1 = dt3.Select( "Sfs_OrderNumberDeputy = '" + dt1.Rows[i]["Ordv_ViceNumber"].ToString().Trim() + "' And Sfs_SurveySetID = 15" );
  8890. if ( dtRows1.Length > 0 )
  8891. {
  8892. decimal intPerson = 0;
  8893. int PersonCount = 0;
  8894. Hashtable htDataDesignName = new Hashtable();
  8895. Hashtable htDataDesignTime = new Hashtable();
  8896. Hashtable htDataDesignRemark = new Hashtable();
  8897. for ( int j = 0; j < dtRows1.Length; j++ )
  8898. {
  8899. if ( dtRows1[j]["Sfrs_Scores"].ToString().Trim().Length > 0 )
  8900. {
  8901. intPerson += Convert.ToDecimal( dtRows1[j]["Sfrs_Scores"] );
  8902. PersonCount++;
  8903. }
  8904. string StrName = dtRows1[j]["Sfs_CreateName"].ToString().Trim();
  8905. if ( !string.IsNullOrEmpty( StrName.Trim() ) )
  8906. {
  8907. DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrName );
  8908. if ( dtRow != null && dtRow["User_Name"].ToString().Trim().Length > 0 )
  8909. {
  8910. htDataDesignName[dtRow["User_Name"].ToString().Trim()] = "";
  8911. }
  8912. }
  8913. if ( LYFZ.BLL.OtherCommonModel.DateTimeToString( dtRows1[j]["Sfs_CreateTime"] ).Length > 0 )
  8914. {
  8915. htDataDesignTime[LYFZ.BLL.OtherCommonModel.DateTimeToString( dtRows1[j]["Sfs_CreateTime"] )] = "";
  8916. }
  8917. if ( dtRows1[j]["Sfs_Remark"].ToString().Trim().Length > 0 )
  8918. {
  8919. htDataDesignRemark[dtRows1[j]["Sfs_Remark"].ToString().Trim()] = "";
  8920. }
  8921. }
  8922. if ( intPerson > 0 )
  8923. {
  8924. string Strs = (intPerson / Convert.ToDecimal( PersonCount )).ToString( "0.00" );
  8925. DataRow[] dt3Value = dt2.Select( "Sfrs_Scores <= " + Strs + "", sort: "Sfrs_Scores DESC" );
  8926. if ( dt3Value.Length > 0 )
  8927. {
  8928. StrPerson = dt3Value[0]["Sfrs_Name"].ToString().Trim();
  8929. }
  8930. }
  8931. // 没有分数时,也要显示回访人员, 回访备注, 回访日期;
  8932. foreach ( string item in htDataDesignName.Keys )
  8933. StrPersonName += item.Trim() + ",";
  8934. foreach ( string item in htDataDesignTime.Keys )
  8935. StrPersonTime += item.Trim() + ",";
  8936. foreach ( string item in htDataDesignRemark.Keys )
  8937. StrPersonRemark += item.Trim() + ";";
  8938. }
  8939. string StrPerson2 = "";
  8940. string StrPersonName2 = "";
  8941. string StrPersonTime2 = "";
  8942. string StrPersonRemark2 = "";
  8943. DataRow[] dtRows2 = dt3.Select( "Sfs_OrderNumberDeputy = '" + dt1.Rows[i]["Ordv_ViceNumber"].ToString().Trim() + "' And Sfs_SurveySetID = 16" );
  8944. if ( dtRows2.Length > 0 )
  8945. {
  8946. decimal intPerson = 0;
  8947. int PersonCount = 0;
  8948. Hashtable htDataDesignName = new Hashtable();
  8949. Hashtable htDataDesignTime = new Hashtable();
  8950. Hashtable htDataDesignRemark = new Hashtable();
  8951. for ( int j = 0; j < dtRows2.Length; j++ )
  8952. {
  8953. if ( dtRows2[j]["Sfrs_Scores"].ToString().Trim().Length > 0 )
  8954. {
  8955. intPerson += Convert.ToDecimal( dtRows2[j]["Sfrs_Scores"] );
  8956. PersonCount++;
  8957. }
  8958. string StrName = dtRows2[j]["Sfs_CreateName"].ToString().Trim();
  8959. if ( !string.IsNullOrEmpty( StrName.Trim() ) )
  8960. {
  8961. DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrName );
  8962. if ( dtRow != null && dtRow["User_Name"].ToString().Trim().Length > 0 )
  8963. {
  8964. htDataDesignName[dtRow["User_Name"].ToString().Trim()] = "";
  8965. }
  8966. }
  8967. if ( LYFZ.BLL.OtherCommonModel.DateTimeToString( dtRows2[j]["Sfs_CreateTime"] ).Length > 0 )
  8968. {
  8969. htDataDesignTime[LYFZ.BLL.OtherCommonModel.DateTimeToString( dtRows2[j]["Sfs_CreateTime"] )] = "";
  8970. }
  8971. if ( dtRows2[j]["Sfs_Remark"].ToString().Trim().Length > 0 )
  8972. {
  8973. htDataDesignRemark[dtRows2[j]["Sfs_Remark"].ToString().Trim()] = "";
  8974. }
  8975. }
  8976. if ( intPerson > 0 )
  8977. {
  8978. string Strs = (intPerson / Convert.ToDecimal( PersonCount )).ToString( "0.00" );
  8979. DataRow[] dt3Value = dt2.Select( "Sfrs_Scores <= " + Strs + "", sort: "Sfrs_Scores DESC" );
  8980. if ( dt3Value.Length > 0 )
  8981. {
  8982. StrPerson2 = dt3Value[0]["Sfrs_Name"].ToString().Trim();
  8983. foreach ( string item in htDataDesignName.Keys )
  8984. {
  8985. StrPersonName2 += item.Trim() + ",";
  8986. }
  8987. foreach ( string item in htDataDesignTime.Keys )
  8988. {
  8989. StrPersonTime2 += item.Trim() + ",";
  8990. }
  8991. foreach ( string item in htDataDesignRemark.Keys )
  8992. {
  8993. StrPersonRemark2 += item.Trim() + ";";
  8994. }
  8995. }
  8996. }
  8997. }
  8998. #endregion
  8999. dtNewRow["Ord_Number"] = dt1.Rows[i]["Ord_Number"].ToString().Trim();
  9000. dtNewRow["Ordv_ViceNumber"] = dt1.Rows[i]["Ordv_ViceNumber"].ToString().Trim();
  9001. dtNewRow["订单号"] = dt1.Rows[i]["订单号"].ToString().Trim();
  9002. dtNewRow["客户姓名"] = dt1.Rows[i]["客户姓名"].ToString().Trim();
  9003. dtNewRow["客户电话"] = dt1.Rows[i]["客户电话"].ToString().Trim();
  9004. dtNewRow["订单类型"] = Enum.ToObject( typeof( LYFZ.EnumPublic.OrderType ), Convert.ToInt32( dt1.Rows[i]["订单类型"] ) ).ToString();
  9005. dtNewRow["套系名称"] = dt1.Rows[i]["套系名称"].ToString().Trim();
  9006. dtNewRow["服务内容"] = dt1.Rows[i]["服务内容"].ToString().Trim();
  9007. dtNewRow["服务日期"] = LYFZ.BLL.OtherCommonModel.DateTimeToString( dt1.Rows[i]["服务日期"] );
  9008. dtNewRow["服务状态"] = (dt1.Rows[i]["服务状态"].ToString().Trim()=="0"?"未开始": dt1.Rows[i]["服务状态"].ToString().Trim() == "1"?"服务中":"OK");
  9009. dtNewRow["服务人员1"] = dt1.Rows[i]["服务人员1"].ToString().Trim();
  9010. dtNewRow["满意度"] = StrPerson;
  9011. dtNewRow["回访人员"] = StrPersonName.TrimEnd( ',' );
  9012. dtNewRow["回访日期"] = StrPersonTime.TrimEnd( ',' );
  9013. dtNewRow["回访备注"] = StrPersonRemark.TrimEnd( ';' );
  9014. dtNewRow["服务人员2"] = dt1.Rows[i]["服务人员2"].ToString().Trim();
  9015. dtNewRow["人员2满意度"] = StrPerson2;
  9016. dtNewRow["人员2回访人员"] = StrPersonName2.TrimEnd( ',' );
  9017. dtNewRow["人员2回访日期"] = StrPersonTime2.TrimEnd( ',' );
  9018. dtNewRow["人员2回访备注"] = StrPersonRemark2.TrimEnd( ';' );
  9019. newtable.Rows.Add( dtNewRow );
  9020. }
  9021. }
  9022. #endregion
  9023. } );
  9024. if ( newtable.Rows.Count > 0 )
  9025. {
  9026. dgvData.DataSource( newtable, strHideField: "Ord_Number,Ordv_ViceNumber" );
  9027. }
  9028. else
  9029. {
  9030. dgvData.DataColumns( StrTableColumnName, strHideField: "Ord_Number,Ordv_ViceNumber" );
  9031. }
  9032. dgvData.Columns["客户姓名"].Frozen = true;
  9033. dgvData.Columns["服务日期"].Width = 110;
  9034. dgvData.Columns["回访日期"].Width = 110;
  9035. dgvData.Columns["人员2回访日期"].Width = 120;
  9036. dgvData.Columns["回访备注"].Width = 300;
  9037. dgvData.Columns["人员2回访备注"].Width = 300;
  9038. }
  9039. /// <summary>
  9040. /// 获取满意度调查_其他调查
  9041. /// </summary>
  9042. /// <param name="dgvData"></param>
  9043. /// <param name="StrQueryCondition"></param>
  9044. public static void GetData_SatisfactionSurveyOther( DataGridViewEc dgvData, string StrQueryCondition )
  9045. {
  9046. DataSet dtSet = new DataSet();
  9047. string StrTableColumnName = "Ord_Number,订单号,客户姓名,客户电话,订单类型,订单日期,沟通满意度,产品回访人员,产品回访日期,产品回访备注,质量满意度,进度回访人员,进度回访日期,进度回访备注";
  9048. DataTable newtable = new DataTable();
  9049. List<string> ListStrColumns = new List<string>( StrTableColumnName.Trim().Split( ',' ) );
  9050. for ( int i = 0; i < ListStrColumns.Count; i++ )
  9051. {
  9052. newtable.Columns.Add( ListStrColumns[i].Trim(), typeof( string ) );
  9053. }
  9054. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  9055. {
  9056. dtSet = LYFZ.BLL.BLL_ErpOrderView.GetData_SatisfactionSurveyOther( StrQueryCondition );
  9057. #region 重组DataTable
  9058. backgroundWorker.ReportProgress( 0, "正在获取满意分值..." );
  9059. DataTable dt1 = dtSet.Tables["ds"];
  9060. if ( dt1.Rows.Count > 0 )
  9061. {
  9062. DataTable dt2 = dtSet.Tables["ds1"];
  9063. string StrWhere = "";
  9064. for ( int i = 0; i < dt1.Rows.Count; i++ )
  9065. {
  9066. StrWhere += "'" + dt1.Rows[i]["Ord_Number"].ToString().Trim() + "',";
  9067. }
  9068. StrWhere = " Where Sfs_Type = 7 And Sfs_SurveySetID in (17,18) And Sfs_OrderNumber in (" + StrWhere.TrimEnd( ',' ) + ")";
  9069. DataTable dt3 = LYFZ.BLL.BLL_ErpOrderView.GetData_SatisfactionSurvey( StrWhere );
  9070. for ( int i = 0; i < dt1.Rows.Count; i++ )
  9071. {
  9072. DataRow dtNewRow = newtable.NewRow();
  9073. #region 满意度
  9074. string StrPerson = "";
  9075. string StrPersonName = "";
  9076. string StrPersonTime = "";
  9077. string StrPersonRemark = "";
  9078. DataRow[] dtRows1 = dt3.Select( "Sfs_OrderNumber = '" + dt1.Rows[i]["Ord_Number"].ToString().Trim() + "' And Sfs_SurveySetID = 17" );
  9079. if ( dtRows1.Length > 0 )
  9080. {
  9081. decimal intPerson = 0;
  9082. int PersonCount = 0;
  9083. Hashtable htDataDesignName = new Hashtable();
  9084. Hashtable htDataDesignTime = new Hashtable();
  9085. Hashtable htDataDesignRemark = new Hashtable();
  9086. for ( int j = 0; j < dtRows1.Length; j++ )
  9087. {
  9088. if ( dtRows1[j]["Sfrs_Scores"].ToString().Trim().Length > 0 )
  9089. {
  9090. intPerson += Convert.ToDecimal( dtRows1[j]["Sfrs_Scores"] );
  9091. PersonCount++;
  9092. }
  9093. string StrName = dtRows1[j]["Sfs_CreateName"].ToString().Trim();
  9094. if ( !string.IsNullOrEmpty( StrName.Trim() ) )
  9095. {
  9096. DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrName );
  9097. if ( dtRow != null && dtRow["User_Name"].ToString().Trim().Length > 0 )
  9098. {
  9099. htDataDesignName[dtRow["User_Name"].ToString().Trim()] = "";
  9100. }
  9101. }
  9102. if ( LYFZ.BLL.OtherCommonModel.DateTimeToString( dtRows1[j]["Sfs_CreateTime"] ).Length > 0 )
  9103. {
  9104. htDataDesignTime[LYFZ.BLL.OtherCommonModel.DateTimeToString( dtRows1[j]["Sfs_CreateTime"] )] = "";
  9105. }
  9106. if ( dtRows1[j]["Sfs_Remark"].ToString().Trim().Length > 0 )
  9107. {
  9108. htDataDesignRemark[dtRows1[j]["Sfs_Remark"].ToString().Trim()] = "";
  9109. }
  9110. }
  9111. if ( intPerson > 0 )
  9112. {
  9113. string Strs = (intPerson / Convert.ToDecimal( PersonCount )).ToString( "0.00" );
  9114. DataRow[] dt3Value = dt2.Select( "Sfrs_Scores <= " + Strs + "", sort: "Sfrs_Scores DESC" );
  9115. if ( dt3Value.Length > 0 )
  9116. {
  9117. StrPerson = dt3Value[0]["Sfrs_Name"].ToString().Trim();
  9118. }
  9119. }
  9120. // 没有分数时,也要显示回访人员, 回访备注, 回访日期;
  9121. foreach ( string item in htDataDesignName.Keys )
  9122. StrPersonName += item.Trim() + ",";
  9123. foreach ( string item in htDataDesignTime.Keys )
  9124. StrPersonTime += item.Trim() + ",";
  9125. foreach ( string item in htDataDesignRemark.Keys )
  9126. StrPersonRemark += item.Trim() + ";";
  9127. }
  9128. string StrPerson2 = "";
  9129. string StrPersonName2 = "";
  9130. string StrPersonTime2 = "";
  9131. string StrPersonRemark2 = "";
  9132. DataRow[] dtRows2 = dt3.Select( "Sfs_OrderNumber = '" + dt1.Rows[i]["Ord_Number"].ToString().Trim() + "' And Sfs_SurveySetID = 17" );
  9133. if ( dtRows2.Length > 0 )
  9134. {
  9135. decimal intPerson = 0;
  9136. int PersonCount = 0;
  9137. Hashtable htDataDesignName = new Hashtable();
  9138. Hashtable htDataDesignTime = new Hashtable();
  9139. Hashtable htDataDesignRemark = new Hashtable();
  9140. for ( int j = 0; j < dtRows2.Length; j++ )
  9141. {
  9142. if ( dtRows2[j]["Sfrs_Scores"].ToString().Trim().Length > 0 )
  9143. {
  9144. intPerson += Convert.ToDecimal( dtRows2[j]["Sfrs_Scores"] );
  9145. PersonCount++;
  9146. }
  9147. string StrName = dtRows2[j]["Sfs_CreateName"].ToString().Trim();
  9148. if ( !string.IsNullOrEmpty( StrName.Trim() ) )
  9149. {
  9150. DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find( StrName );
  9151. if ( dtRow != null && dtRow["User_Name"].ToString().Trim().Length > 0 )
  9152. {
  9153. htDataDesignName[dtRow["User_Name"].ToString().Trim()] = "";
  9154. }
  9155. }
  9156. if ( LYFZ.BLL.OtherCommonModel.DateTimeToString( dtRows2[j]["Sfs_CreateTime"] ).Length > 0 )
  9157. {
  9158. htDataDesignTime[LYFZ.BLL.OtherCommonModel.DateTimeToString( dtRows2[j]["Sfs_CreateTime"] )] = "";
  9159. }
  9160. if ( dtRows2[j]["Sfs_Remark"].ToString().Trim().Length > 0 )
  9161. {
  9162. htDataDesignRemark[dtRows2[j]["Sfs_Remark"].ToString().Trim()] = "";
  9163. }
  9164. }
  9165. string Strs = (intPerson / Convert.ToDecimal( PersonCount )).ToString( "0.00" );
  9166. DataRow[] dt3Value = dt2.Select( "Sfrs_Scores <= " + Strs + "", sort: "Sfrs_Scores DESC" );
  9167. if ( dt3Value.Length > 0 )
  9168. {
  9169. StrPerson2 = dt3Value[0]["Sfrs_Name"].ToString().Trim();
  9170. foreach ( string item in htDataDesignName.Keys )
  9171. {
  9172. StrPersonName2 += item.Trim() + ",";
  9173. }
  9174. foreach ( string item in htDataDesignTime.Keys )
  9175. {
  9176. StrPersonTime2 += item.Trim() + ",";
  9177. }
  9178. foreach ( string item in htDataDesignRemark.Keys )
  9179. {
  9180. StrPersonRemark2 += item.Trim() + ";";
  9181. }
  9182. }
  9183. }
  9184. #endregion
  9185. dtNewRow["Ord_Number"] = dt1.Rows[i]["Ord_Number"].ToString().Trim();
  9186. dtNewRow["订单号"] = dt1.Rows[i]["订单号"].ToString().Trim();
  9187. dtNewRow["客户姓名"] = dt1.Rows[i]["客户姓名"].ToString().Trim();
  9188. dtNewRow["客户电话"] = dt1.Rows[i]["客户电话"].ToString().Trim();
  9189. dtNewRow["订单类型"] = Enum.ToObject( typeof( LYFZ.EnumPublic.OrderType ), Convert.ToInt32( dt1.Rows[i]["订单类型"] ) ).ToString();
  9190. dtNewRow["订单日期"] = LYFZ.BLL.OtherCommonModel.DateTimeToString( dt1.Rows[i]["订单日期"] );
  9191. dtNewRow["沟通满意度"] = StrPerson;
  9192. dtNewRow["产品回访人员"] = StrPersonName.TrimEnd( ',' );
  9193. dtNewRow["产品回访日期"] = StrPersonTime.TrimEnd( ',' );
  9194. dtNewRow["产品回访备注"] = StrPersonRemark.TrimEnd( ';' );
  9195. dtNewRow["质量满意度"] = StrPerson2;
  9196. dtNewRow["进度回访人员"] = StrPersonName2.TrimEnd( ',' );
  9197. dtNewRow["进度回访日期"] = StrPersonTime2.TrimEnd( ',' );
  9198. dtNewRow["进度回访备注"] = StrPersonRemark2.TrimEnd( ';' );
  9199. newtable.Rows.Add( dtNewRow );
  9200. }
  9201. }
  9202. #endregion
  9203. } );
  9204. if ( newtable.Rows.Count > 0 )
  9205. {
  9206. dgvData.DataSource( newtable, strHideField: "Ord_Number" );
  9207. }
  9208. else
  9209. {
  9210. dgvData.DataColumns( StrTableColumnName, strHideField: "Ord_Number" );
  9211. }
  9212. dgvData.Columns["客户姓名"].Frozen = true;
  9213. dgvData.Columns["订单日期"].Width = 110;
  9214. dgvData.Columns["产品回访日期"].Width = 110;
  9215. dgvData.Columns["进度回访日期"].Width = 120;
  9216. dgvData.Columns["产品回访备注"].Width = 300;
  9217. dgvData.Columns["进度回访备注"].Width = 300;
  9218. }
  9219. /// <summary>
  9220. ///
  9221. /// </summary>
  9222. /// <param name="dictColumns"></param>
  9223. /// <param name="StrQueryCondition"></param>
  9224. /// <param name="inTopCount"></param>
  9225. /// <param name="StrOrderBy"></param>
  9226. /// <returns></returns>
  9227. public static DataTable GetDataTableOrderPhotographReportService( Dictionary<string, string> dictColumns, string StrQueryCondition, int inTopCount, string StrOrderBy )
  9228. {
  9229. DataSet dtSet = new DataSet();
  9230. dtSet = LYFZ.BLL.BLL_ErpOrderView.GetData_OrderReportPhotographService( dictColumns, StrQueryCondition, inTopCount, StrOrderBy );
  9231. return dtSet.Tables[0];
  9232. }
  9233. }
  9234. }