123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562 |
- using LYFZ.ComponentLibrary;
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- namespace LYFZ.Software.MainBusiness.FinancialManagement
- {
- public partial class FrmPayroll : LYFZ.Software.UI.FinancialManagement.FrmPayroll
- {
- LYFZ.BLL.BLL_ErpOrder orbll = new LYFZ.BLL.BLL_ErpOrder();
- LYFZ.BLL.BLL_ErpPayment ptbll = new BLL.BLL_ErpPayment();
- LYFZ.BLL.BLL_AllViewSet avsbll = new BLL.BLL_AllViewSet();
- LYFZ.BLL.BLL_ErpWagesSet wsbll = new BLL.BLL_ErpWagesSet();
- LYFZ.BLL.BLL_ErpSystemConfigure sgbll = new BLL.BLL_ErpSystemConfigure();
- LYFZ.BLL.BLL_ErpOrdersPhotography opbll = new BLL.BLL_ErpOrdersPhotography();
- LYFZ.BLL.BLL_ErpWageCommissionSet wcsbll = new BLL.BLL_ErpWageCommissionSet();
- LYFZ.BLL.BLL_ErpCommissionPercentage cpbll = new BLL.BLL_ErpCommissionPercentage();
- LYFZ.BLL.BLL_ErpWageCommissionRecords wcrbll = new BLL.BLL_ErpWageCommissionRecords();
- LYFZ.BLL.BLL_ErpPieceCommissionRecords pcrbll = new BLL.BLL_ErpPieceCommissionRecords();
- private delegate void UpdateControl();
- public FrmPayroll()
- {
- this.dgv.RowsAdded += dgv_RowsAdded;
- this.txtTimeStart.Leave += txtTimeStart_Leave;
- this.Resize += FrmPayroll_Resize;
- }
- /// <summary>
- /// 一级景点个数
- /// </summary>
- int OneLevelCount = 0;
- /// <summary>
- /// 二级景点个数
- /// </summary>
- int TwoLevelCount = 0;
- /// <summary>
- /// 三级景点个数
- /// </summary>
- int ThreeLevelCount = 0;
- //景点等级比重
- /// <summary>
- /// 一级景点比重
- /// </summary>
- decimal OneLevel = 0;
- /// <summary>
- /// 二级景点比重
- /// </summary>
- decimal TwoLevel = 0;
- /// <summary>
- /// 三级景点比重
- /// </summary>
- decimal ThreeLevel = 0;
- /// <summary>
- /// 摄影比重
- /// </summary>
- decimal MainPhotography = 0;
- /// <summary>
- /// 摄影助理比重
- /// </summary>
- decimal DeputyPhotography = 0;
- /// <summary>
- /// 化妆比重
- /// </summary>
- decimal MainMake = 0;
- /// <summary>
- /// 化妆助理比重
- /// </summary>
- decimal DeputyMake = 0;
- /// <summary>
- /// 引导比重
- /// </summary>
- decimal MainBootDivision = 0;
- /// <summary>
- /// 引导助理比重
- /// </summary>
- decimal DeputyBootDivision = 0;
- /// <summary>
- ///
- /// </summary>
- DataTable dt_SystemConfigure = new DataTable();
- /// <summary>
- ///
- /// </summary>
- DataTable tblSystemCategory = new DataTable();
- /// <summary>
- /// 是否首次远行
- /// </summary>
- bool IsFirstRun = true;
- /// <summary>
- /// 窗体加载事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected override void FrmPayroll_Shown(object sender, EventArgs e)
- {
- this.tblSystemCategory = new LYFZ.BLL.BLL_ErpSystemCategory().GetAllList(filedOrder: "ID asc").Tables[0];
- this.txtTimeStart.DateValue = SDateTime.Now.Year + "-" + SDateTime.Now.Month + "-01";
- this.txtTimeEnd.DateValue = Convert.ToDateTime(this.txtTimeStart.DateValue).AddMonths(1).AddSeconds(-1).ToString("yyyy-MM-dd");
- dt_SystemConfigure = sgbll.GetAllList().Tables[0];
- // 部门人员绑定
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_DepartmentAndEmployee(this.cmbEmployeeName, IsFirstNodeNull: true, IsFirstNodeName: "全部", IsShowResign: false, IsShowAdmin: true);
- //项目类别
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboxTreeView(this.cmbItemCategory, StrBindData: "订单前期,服务前期,订单后期,服务后期,其它消费,会员充值,服务卡充值,计件提成,礼服租售", IsFirstNodeNull: true);
- //流程状态
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboxTreeView(this.cmbProcessStatus, StrBindData: "拍照OK,选片OK,取件OK", IsFirstNodeNull: true);
- //客户来源
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_SystemCategory("AAAAAAF", this.cmbCustomerSource, IsFirstNodeNull: true, tbl: tblSystemCategory);
- //套系类别
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_SystemCategory("BFAGAHBFDGCABAJIH", this.CtvPak_Name, IsFirstNodeNull: true, tbl: tblSystemCategory);
- //计件提成
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_SystemCategory("BEBBAFACDCCFBJFI", this.cmbCommissionScheme, IsFirstNodeNull: true, tbl: tblSystemCategory);
- ////景点类别
- //LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboxTreeView(this.cmbtreevSightsCategory, "内景,外景", IsFirstNodeNull: true);
- // 查看
- this.cmbEmployeeName.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StatisticalInquiryAllWagesCompetence, CustomAttributes.OperatingAuthority.ViewAll);
- if (LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_Account != LYFZ.AuthorizeUserName.AdministratorsName)
- {
- this.cmbEmployeeName.TagFindText(LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID);
- this.cmbEmployeeName_ComboBoxTree_NodeMouseClick(null, null);
- }
- // 录入
- btnSave.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StatisticalInquiryAllWagesCompetence, CustomAttributes.OperatingAuthority.Add);
- // 导出
- btnExPort.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StatisticalInquiryAllWagesCompetence, CustomAttributes.OperatingAuthority.DataExport);
- // 获取景点等级级别比重
- if (cpbll.GetList("Cp_ProportionCode='BEBBBCADDEBFJDFFC'").Tables[0].Rows.Count > 0)
- { OneLevel = Convert.ToDecimal(cpbll.GetList("Cp_ProportionCode='BEBBBCADDEBFJDFFC'").Tables[0].Rows[0]["Cp_Proportion"]); }
- if (cpbll.GetList("Cp_ProportionCode='BEBBBCADEGBGAFFJC'").Tables[0].Rows.Count > 0)
- { TwoLevel = Convert.ToDecimal(cpbll.GetList("Cp_ProportionCode='BEBBBCADEGBGAFFJC'").Tables[0].Rows[0]["Cp_Proportion"]); }
- if (cpbll.GetList("Cp_ProportionCode='BEBBBCADAFBHBCHCI'").Tables[0].Rows.Count > 0)
- { ThreeLevel = Convert.ToDecimal(cpbll.GetList("Cp_ProportionCode='BEBBBCADAFBHBCHCI'").Tables[0].Rows[0]["Cp_Proportion"]); }
- // 获取摄影比重
- if (cpbll.GetList("Cp_ProportionCode='MainPhotography'").Tables[0].Rows.Count > 0)
- { MainPhotography = Convert.ToDecimal(cpbll.GetList("Cp_ProportionCode='MainPhotography'").Tables[0].Rows[0]["Cp_Proportion"]); }
- if (cpbll.GetList("Cp_ProportionCode='DeputyPhotography'").Tables[0].Rows.Count > 0)
- { DeputyPhotography = Convert.ToDecimal(cpbll.GetList("Cp_ProportionCode='DeputyPhotography'").Tables[0].Rows[0]["Cp_Proportion"]); }
- // 获取化妆比重
- if (cpbll.GetList("Cp_ProportionCode='MainMake'").Tables[0].Rows.Count > 0)
- { MainMake = Convert.ToDecimal(cpbll.GetList("Cp_ProportionCode='MainMake'").Tables[0].Rows[0]["Cp_Proportion"]); }
- if (cpbll.GetList("Cp_ProportionCode='DeputyMake'").Tables[0].Rows.Count > 0)
- { DeputyMake = Convert.ToDecimal(cpbll.GetList("Cp_ProportionCode='DeputyMake'").Tables[0].Rows[0]["Cp_Proportion"]); }
- // 获取引导比重
- if (cpbll.GetList("Cp_ProportionCode='MainBootDivision'").Tables[0].Rows.Count > 0)
- { MainBootDivision = Convert.ToDecimal(cpbll.GetList("Cp_ProportionCode='MainBootDivision'").Tables[0].Rows[0]["Cp_Proportion"]); }
- if (cpbll.GetList("Cp_ProportionCode='DeputyBootDivision'").Tables[0].Rows.Count > 0)
- { DeputyBootDivision = Convert.ToDecimal(cpbll.GetList("Cp_ProportionCode='DeputyBootDivision'").Tables[0].Rows[0]["Cp_Proportion"]); }
- this.IsFirstRun = false;
- this.FrmPayroll_Resize(this, null);
- }
- /// <summary>
- /// 获取儿童阶段金额
- /// </summary>
- /// <param name="OrdNumber">主订单号</param>
- /// <param name="YsAmount">应该金额</param>
- /// <param name="BcAmount">本次收款金额</param>
- /// <param name="SightsName">景点名称</param>
- /// <returns></returns>
- public decimal GetChildrenAmount(string OrdNumber, decimal YsAmount, decimal BcAmount, string SightsName)
- {
- decimal Sum = 0;
- decimal ChildrenAmount = 0;
- decimal EveryAmount = 0;
- DataTable tbl = opbll.GetList("Ordpg_Number = '" + OrdNumber + "'", "Ordpg_ViceNumber ASC").Tables[0];
- int Count = tbl.Rows.Count;
- //每次收款金额(平均分)
- if (Count > 0)
- { EveryAmount = YsAmount / Count; }
- //获取收款金额
- DataTable dt = ptbll.GetSum("Pay_OrdNumber = '" + OrdNumber + "' and Pay_Category != '后期收款'").Tables[0];
- if (!string.IsNullOrEmpty(dt.Rows[0]["Pay_AmountOf"].ToString()))
- { ChildrenAmount = Convert.ToDecimal(dt.Rows[0]["Pay_AmountOf"].ToString()); }
- //for (int i = 0; i < tbl.Rows.Count; i++)
- //{
- // if (SightsName == tbl.Rows[i]["Ordpg_Sights"].ToString().Trim())
- // {
- // ChildrenAmount = ChildrenAmount - EveryAmount;
- // if (ChildrenAmount > EveryAmount)
- // { Sum = EveryAmount; }
- // else
- // { Sum = ChildrenAmount; }
- // break;
- // }
- // else
- // { ChildrenAmount = ChildrenAmount - EveryAmount; }
- //}
- if ((ChildrenAmount / Count) == EveryAmount)
- {
- if (ptbll.GetList("Pay_OrdNumber = '" + OrdNumber + "' and Pay_Category != '后期收款'").Tables[0].Rows.Count == 1)
- { Sum = EveryAmount; }
- else
- { Sum = BcAmount / Count; }
- }
- else
- {
- if (ChildrenAmount < EveryAmount)
- {
- for (int i = 0; i < tbl.Rows.Count; i++)
- {
- string Ordpg_Sights = tbl.Rows[i]["Ordpg_Sights"].ToString();
- if (SightsName == Ordpg_Sights)
- {
- if (i + 1 == 1)
- { Sum = ChildrenAmount / ptbll.GetList("Pay_OrdNumber='" + OrdNumber + "' and Pay_Category!='后期收款'").Tables[0].Rows.Count; }
- else
- { Sum = 0; }
- }
- }
- }
- if (ChildrenAmount >= EveryAmount)
- {
- for (int i = 0; i < tbl.Rows.Count; i++)
- {
- string Ordpg_Sights = tbl.Rows[i]["Ordpg_Sights"].ToString();
- if (SightsName == Ordpg_Sights)
- {
- if (ChildrenAmount > (EveryAmount * (i + 1)))
- {
- if (ptbll.GetList("Pay_OrdNumber='" + OrdNumber + "' and Pay_Category!='后期收款'").Tables[0].Rows.Count == 1)
- { Sum = EveryAmount; }
- else
- { Sum = EveryAmount / ptbll.GetList("Pay_OrdNumber='" + OrdNumber + "' and Pay_Category!='后期收款'").Tables[0].Rows.Count; }
- }
- else
- { Sum = 0; }
- }
- }
- }
- }
- return Convert.ToDecimal(Sum.ToString("N2"));
- }
- /// <summary>
- /// 获取所有业绩列表
- /// </summary>
- /// <param name="StartTime"></param>
- /// <param name="EndTime"></param>
- /// <param name="EmployeeName"></param>
- /// <param name="backgroundWorker"></param>
- /// <returns></returns>
- public decimal BindPerformance(string StartTime, string EndTime, string EmployeeName, BackgroundWorker backgroundWorker)
- {
- this.Invoke(new UpdateControl(delegate()
- {
- this.dgv.Rows.Clear();
- }));
- string StrUserName = "";
- if (!string.IsNullOrEmpty(EmployeeName))
- {
- DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find(EmployeeName);
- if (dtRow != null)
- { StrUserName = dtRow["User_Name"].ToString().Trim(); }
- }
- decimal Sum = 0;
- string s = "";
- StringBuilder strBuilder = new StringBuilder();
- #region 列表
- if (string.IsNullOrEmpty(this.Str_ItemCategory.Trim()) || this.Str_ItemCategory.Trim() == "订单前期" || this.Str_ItemCategory.Trim() == "订单后期" || this.Str_ItemCategory.Trim() == "其它消费" || this.Str_ItemCategory.Trim() == "礼服租售")
- {
- #region 获取订单收款(前期收款,后期收款,其它消费)收款后即分提成
- strBuilder.Append(" 1 = 1 ");
- string StrPaymentWhere = "";
- if (string.IsNullOrEmpty(this.Str_ProcessStatus.Trim()))
- { strBuilder.Append("and 收款时间>='" + StartTime + "' and 收款时间<='" + EndTime + " 23:59:59.000' "); }
- //if (string.IsNullOrEmpty(this.Str_ProcessStatus.Trim()))
- //{ StrPaymentWhere = "and Pay_CreateDatetime >= '" + StartTime + "' and 收款时间<='" + EndTime + " 23:59:59.000' "; }
- else if (!string.IsNullOrEmpty(this.Str_ProcessStatus.Trim()))
- {
- if (this.Str_ProcessStatus.Trim() == "拍照OK")
- { strBuilder.Append("and 未拍个数 = 0 and (最后拍摄时间 >= '" + StartTime + "' and 最后拍摄时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "选片OK")
- { strBuilder.Append("and 选片状态 = '1' and (选片时间 >= '" + StartTime + "' and 选片时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "取件OK")
- { strBuilder.Append("and 取件状态 = 'OK' and (取件日期 >= '" + StartTime + "' and 取件日期 <= '" + EndTime + " 23:59:59.000')"); }
- strBuilder.Append("and (收款类别 = '全款' or 收款类别 = '预约补款' or 收款类别 = '预约收款' or 二销类别编号 = 'BEBCABBAAHFCJBJGJ')");
- }
- if (EmployeeName != null && !string.IsNullOrEmpty(EmployeeName))
- { strBuilder.Append("and 接单人编号 like '%" + EmployeeName + "%'"); }
- if (!string.IsNullOrEmpty(this.Str_Scores1))
- { strBuilder.Append("and (门市满意总分>=" + this.Str_Scores1 + " and 门市满意总分<=" + this.Str_Scores2 + ")"); }
- bool IsQuery = true;
- s = BindSelect1(ref IsQuery);
- if (IsQuery)
- {
- DataTable dtCount = orbll.GetView_Custom("Vw_StaffPerformance_OrdersPerson", StrWhere: strBuilder.ToString() + s.ToString(), ShowColumnName: "Count(ID) CountID").Tables[0];
- //DataTable dtCount = LYFZ.BLL.BLL_ErpPaymentPayrollClass.GetPayrollOrderPerson(StrPaymentWhere, strBuilder.ToString() + s.ToString()); // orbll.GetView_Custom("Vw_StaffPerformance_OrdersPerson", StrWhere: strBuilder.ToString() + s.ToString(), ShowColumnName: "Count(ID) CountID").Tables[0];
- if (dtCount.Rows.Count > 0)
- {
- if (Convert.ToInt32(dtCount.Rows[0]["CountID"]) > 0)
- {
- backgroundWorker.ReportProgress(0, "正在获取'门市接单' ...");
- string StrColumnName = "订单号,接单人名称,主门市,客户名称,主门市金额,副门市金额,收款时间,收款类型,套系类别,套系名称,项目名称,应收金额,收款类别,付款方式名称,未拍个数,最后拍摄时间,选片状态,选片时间,取件状态,取件日期,拍摄阶段,门市满意总分";
- //DataTable dt_OrderPayment = avsbll.Vw_StaffPerformance_OrdersPerson(str.ToString() + s.ToString()).Tables[0];
- DataTable dt_OrderPayment = orbll.GetView_Custom("Vw_StaffPerformance_OrdersPerson", StrWhere: strBuilder.ToString() + s.ToString(), ShowColumnName: StrColumnName).Tables[0];
- for (int t = 0; t < dt_OrderPayment.Rows.Count; t++)
- {
- #region
- DataGridViewRow dgvr = new DataGridViewRow();
- DataGridViewCell cell = null;
- //订单号
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_OrderPayment.Rows[t]["订单号"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //员工
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_OrderPayment.Rows[t]["接单人名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //职务
- cell = new DataGridViewTextBoxCell();
- #region 前期收款,后期收款
- if (!string.IsNullOrEmpty(dt_OrderPayment.Rows[t]["主门市"].ToString()))
- {
- if (dt_OrderPayment.Rows[t]["主门市"].ToString() == EmployeeName)
- { cell.Value = "主接单人"; }
- else
- { cell.Value = "副接单人"; }
- }
- #endregion
- dgvr.Cells.Add(cell);
- //客户姓名
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_OrderPayment.Rows[t]["客户名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //收款金额
- cell = new DataGridViewTextBoxCell();
- #region 前期收款,后期收款
- if (!string.IsNullOrEmpty(dt_OrderPayment.Rows[t]["主门市"].ToString()))
- {
- if (dt_OrderPayment.Rows[t]["主门市"].ToString() == EmployeeName)
- { cell.Value = Convert.ToDecimal(dt_OrderPayment.Rows[t]["主门市金额"]).ToString("N2"); }
- else
- { cell.Value = Convert.ToDecimal(dt_OrderPayment.Rows[t]["副门市金额"]).ToString("N2"); }
- }
- #endregion
- dgvr.Cells.Add(cell);
- //收款时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_OrderPayment.Rows[t]["收款时间"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //套系类别
- cell = new DataGridViewTextBoxCell();
- if (dt_OrderPayment.Rows[t]["收款类型"].ToString() == "0")
- { cell.Value = dt_OrderPayment.Rows[t]["套系类别"].ToString().Trim(); }
- if (dt_OrderPayment.Rows[t]["收款类型"].ToString() == "1")
- { cell.Value = "/其它消费"; }
- if (dt_OrderPayment.Rows[t]["收款类型"].ToString() == "2")
- { cell.Value = "/礼服租售"; }
- dgvr.Cells.Add(cell);
- //套系名称
- cell = new DataGridViewTextBoxCell();
- if (dt_OrderPayment.Rows[t]["收款类型"].ToString() == "0")
- { cell.Value = dt_OrderPayment.Rows[t]["套系名称"].ToString().Trim(); }
- if (dt_OrderPayment.Rows[t]["收款类型"].ToString() == "1")
- { cell.Value = dt_OrderPayment.Rows[t]["项目名称"].ToString().Trim(); }
- dgvr.Cells.Add(cell);
- //应收金额
- cell = new DataGridViewTextBoxCell();
- if (!string.IsNullOrEmpty(dt_OrderPayment.Rows[t]["应收金额"].ToString().Trim()))
- { cell.Value = Convert.ToDecimal(dt_OrderPayment.Rows[t]["应收金额"]).ToString("N2").Trim(); }
- else
- { cell.Value = 0; }
- dgvr.Cells.Add(cell);
- //项目名称
- cell = new DataGridViewTextBoxCell();
- if (dt_OrderPayment.Rows[t]["收款类型"].ToString() == "0")
- {
- if (string.IsNullOrEmpty(dt_OrderPayment.Rows[t]["项目名称"].ToString().Trim()))
- { cell.Value = dt_OrderPayment.Rows[t]["收款类别"].ToString(); }
- else
- { cell.Value = dt_OrderPayment.Rows[t]["项目名称"].ToString().Trim(); }
- }
- else
- { cell.Value = dt_OrderPayment.Rows[t]["项目名称"].ToString().Trim(); }
- dgvr.Cells.Add(cell);
- //付款名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_OrderPayment.Rows[t]["付款方式名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- #region
- if (dt_OrderPayment.Rows[t]["收款类型"].ToString() == "0")
- {
- //拍摄状态
- cell = new DataGridViewTextBoxCell();
- if (Convert.ToInt32(dt_OrderPayment.Rows[t]["未拍个数"]) == 0)
- { cell.Value = "OK"; }
- else
- { cell.Value = "未拍"; }
- dgvr.Cells.Add(cell);
- //拍摄时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_OrderPayment.Rows[t]["最后拍摄时间"].ToString();
- dgvr.Cells.Add(cell);
- //选片状态
- cell = new DataGridViewTextBoxCell();
- if (dt_OrderPayment.Rows[t]["选片状态"].ToString() == "1")
- { cell.Value = "OK"; }
- else
- { cell.Value = "未选"; }
- dgvr.Cells.Add(cell);
- //选片时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = LYFZ.Command.Command_Validate.DateTimeToString(dt_OrderPayment.Rows[t]["选片时间"], "yyyy-MM-dd HH:mm");
- dgvr.Cells.Add(cell);
- //取件状态
- cell = new DataGridViewTextBoxCell();
- if (dt_OrderPayment.Rows[t]["取件状态"].ToString() == "OK")
- { cell.Value = "OK"; }
- else
- { cell.Value = "未取"; }
- dgvr.Cells.Add(cell);
- //拍摄阶段
- cell = new DataGridViewTextBoxCell();
- cell.Value = LYFZ.Command.Command_Validate.DateTimeToString(dt_OrderPayment.Rows[t]["取件日期"], "yyyy-MM-dd HH:mm");
- dgvr.Cells.Add(cell);
- //取件时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_OrderPayment.Rows[t]["拍摄阶段"].ToString();
- dgvr.Cells.Add(cell);
- //订单类型
- cell = new DataGridViewTextBoxCell();
- cell.Value = "";
- dgvr.Cells.Add(cell);
- //收款类型
- cell = new DataGridViewTextBoxCell();
- cell.Value = "";
- dgvr.Cells.Add(cell);
- //副订单
- cell = new DataGridViewTextBoxCell();
- cell.Value = "";
- dgvr.Cells.Add(cell);
- //门市满意度
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_OrderPayment.Rows[t]["门市满意总分"].ToString();
- dgvr.Cells.Add(cell);
- }
- #endregion
- this.Invoke(new UpdateControl(delegate()
- {
- this.dgv.Rows.Add(dgvr);
- }));
- #endregion
- }
- }
- }
- }
- #endregion
- }
- if (this.Str_ItemCategory.Trim() == "" || this.Str_ItemCategory.Trim() == "服务前期" || this.Str_ItemCategory.Trim() == "服务后期")
- {
- #region 获取流程状态(前期收款(摄影,化妆,引导,初修,精修,设计)前期业绩,选片二销业绩)
- if (this.Str_ItemCategory.Trim() == "" || this.Str_ItemCategory.Trim() == "服务前期")
- {
- #region 前期业绩
- DataRow[] ConfigureRow = dt_SystemConfigure.Select("Sconfig_Code='PhotographersEarly' and Sconfig_IsEnabled=1");
- if (ConfigureRow.Length > 0)
- {
- if (ConfigureRow[0]["Sconfig_Value"].ToString() == "1")
- {
- if (this.Str_ProjectTitle.Trim() == "" || this.Str_ProjectTitle.Trim() == "摄影前期")
- {
- #region 主摄影师
- s = "";
- strBuilder = new StringBuilder();
- strBuilder.Append(" 收款类别 <> '后期收款'");
- if (EmployeeName != null && !string.IsNullOrEmpty(EmployeeName))
- { strBuilder.Append(" And 主摄影师ID like '%" + EmployeeName + "%' "); }
- if (this.Str_ProcessStatus.Trim() == "")
- { strBuilder.Append(" And 未拍个数 = 0 And (服务前期查询时间 >= '" + StartTime + "' And 服务前期查询时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "拍照OK")
- { strBuilder.Append(" And 未拍个数 = 0 And (最后拍摄时间>='" + StartTime + "' And 最后拍摄时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "选片OK")
- { strBuilder.Append(" And 选片状态 = 'OK' And (选片时间 >= '" + StartTime + "' And 选片时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "取件OK")
- { strBuilder.Append(" And 取件状态 = 'OK' And (取件日期 >= '" + StartTime + "' And 取件日期 <= '" + EndTime + " 23:59:59.000')"); }
- if (!string.IsNullOrEmpty(this.Str_Scores1))
- { strBuilder.Append(" and (主摄影满意总分>=" + this.Str_Scores1 + " and 主摄影满意总分<=" + this.Str_Scores2 + ")"); }
- s = BindSelect5();
- DataTable dtCount1 = orbll.GetView_Custom("Vw_StaffPerformance_Photograph", StrWhere: strBuilder.ToString() + s.ToString(), ShowColumnName: "Count(ID) CountID").Tables[0];
- if (dtCount1.Rows.Count > 0)
- {
- if (Convert.ToInt32(dtCount1.Rows[0]["CountID"]) > 0)
- {
- backgroundWorker.ReportProgress(0, "正在获取'主摄影师前期业绩' ...");
- string StrColumnName = "订单号,客户名称,订单类型,收款金额,应收金额,拍摄名称,收款时间,套系类别,套系名称,项目名称,收款类别,付款方式名称,未拍个数,最后拍摄时间,选片状态,选片时间,取件状态,取件日期,副订单,主摄影满意总分";
- DataTable dt_MainPhotographer = orbll.GetView_Custom("Vw_StaffPerformance_Photograph", StrWhere: strBuilder.ToString() + s.ToString(), ShowColumnName: StrColumnName).Tables[0];
- for (int t = 0; t < dt_MainPhotographer.Rows.Count; t++)
- {
- #region
- DataGridViewRow dgvr = new DataGridViewRow();
- DataGridViewCell cell = null;
- //订单号
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_MainPhotographer.Rows[t]["订单号"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //员工
- cell = new DataGridViewTextBoxCell();
- cell.Value = StrUserName;
- dgvr.Cells.Add(cell);
- //职务
- cell = new DataGridViewTextBoxCell();
- cell.Value = "主摄影师";
- dgvr.Cells.Add(cell);
- //客户姓名
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_MainPhotographer.Rows[t]["客户名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //收款金额
- cell = new DataGridViewTextBoxCell();
- if (dt_MainPhotographer.Rows[t]["订单类型"].ToString() != "1")
- { cell.Value = Convert.ToDecimal(dt_MainPhotographer.Rows[t]["收款金额"]).ToString("N2"); }
- else
- { cell.Value = GetChildrenAmount(dt_MainPhotographer.Rows[t]["订单号"].ToString().Trim(), Convert.ToDecimal(dt_MainPhotographer.Rows[t]["应收金额"]), Convert.ToDecimal(dt_MainPhotographer.Rows[t]["收款金额"]), dt_MainPhotographer.Rows[t]["拍摄名称"].ToString()); }
- dgvr.Cells.Add(cell);
- //收款时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_MainPhotographer.Rows[t]["收款时间"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //套系类别
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_MainPhotographer.Rows[t]["套系类别"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //套系名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_MainPhotographer.Rows[t]["套系名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //应收金额
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDecimal(dt_MainPhotographer.Rows[t]["应收金额"]).ToString("N2").Trim();
- dgvr.Cells.Add(cell);
- //项目名称
- cell = new DataGridViewTextBoxCell();
- if (string.IsNullOrEmpty(dt_MainPhotographer.Rows[t]["项目名称"].ToString().Trim()))
- { cell.Value = dt_MainPhotographer.Rows[t]["收款类别"].ToString(); }
- else
- { cell.Value = dt_MainPhotographer.Rows[t]["项目名称"].ToString().Trim(); }
- dgvr.Cells.Add(cell);
- //付款名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_MainPhotographer.Rows[t]["付款方式名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //拍摄状态
- cell = new DataGridViewTextBoxCell();
- if (Convert.ToInt32(dt_MainPhotographer.Rows[t]["未拍个数"]) == 0)
- { cell.Value = "OK"; }
- else
- { cell.Value = "未拍"; }
- dgvr.Cells.Add(cell);
- //拍摄时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_MainPhotographer.Rows[t]["最后拍摄时间"].ToString();
- dgvr.Cells.Add(cell);
- //选片状态
- cell = new DataGridViewTextBoxCell();
- if (dt_MainPhotographer.Rows[t]["选片状态"].ToString() == "OK")
- { cell.Value = "OK"; }
- else
- { cell.Value = "未选"; }
- dgvr.Cells.Add(cell);
- //选片时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = LYFZ.Command.Command_Validate.DateTimeToString(dt_MainPhotographer.Rows[t]["选片时间"], "yyyy-MM-dd HH:mm");
- dgvr.Cells.Add(cell);
- //取件状态
- cell = new DataGridViewTextBoxCell();
- if (dt_MainPhotographer.Rows[t]["取件状态"].ToString() == "OK")
- { cell.Value = "OK"; }
- else
- { cell.Value = "未取"; }
- dgvr.Cells.Add(cell);
- //取件时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = LYFZ.Command.Command_Validate.DateTimeToString(dt_MainPhotographer.Rows[t]["取件日期"], "yyyy-MM-dd HH:mm");
- dgvr.Cells.Add(cell);
- //拍摄名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_MainPhotographer.Rows[t]["拍摄名称"].ToString();
- dgvr.Cells.Add(cell);
- //订单类型
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_MainPhotographer.Rows[t]["订单类型"].ToString();
- dgvr.Cells.Add(cell);
- //收款类型
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_MainPhotographer.Rows[t]["收款类别"].ToString();
- dgvr.Cells.Add(cell);
- //副订单
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_MainPhotographer.Rows[t]["副订单"].ToString();
- dgvr.Cells.Add(cell);
- //主摄影满意总分
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_MainPhotographer.Rows[t]["主摄影满意总分"].ToString();
- dgvr.Cells.Add(cell);
- this.Invoke(new UpdateControl(delegate()
- {
- this.dgv.Rows.Add(dgvr);
- }));
- #endregion
- }
- }
- }
- #endregion
- #region 摄影助理
- s = "";
- strBuilder = new StringBuilder();
- strBuilder.Append(" 收款类别 <> '后期收款'");
- if (EmployeeName != null && !string.IsNullOrEmpty(EmployeeName))
- { strBuilder.Append(" And 摄影助理ID like '%" + EmployeeName + "%' "); }
- if (this.Str_ProcessStatus.Trim() == "")
- { strBuilder.Append(" And 未拍个数 = 0 And (服务前期查询时间 >= '" + StartTime + "' And 服务前期查询时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "拍照OK")
- { strBuilder.Append(" And 未拍个数 = 0 And (最后拍摄时间 >= '" + StartTime + "' And 最后拍摄时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "选片OK")
- { strBuilder.Append(" And 选片状态 = 'OK' And (选片时间 >= '" + StartTime + "' And 选片时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "取件OK")
- { strBuilder.Append(" And 取件状态 = 'OK' And (取件日期 >= '" + StartTime + "' And 取件日期 <= '" + EndTime + " 23:59:59.000')"); }
- if (!string.IsNullOrEmpty(this.Str_Scores1))
- { strBuilder.Append(" and (摄影助理满意总分>=" + this.Str_Scores1 + " and 摄影助理满意总分<=" + this.Str_Scores2 + ")"); }
- s = BindSelect5();
- DataTable dtCount2 = orbll.GetView_Custom("Vw_StaffPerformance_Photograph", StrWhere: strBuilder.ToString() + s.ToString(), ShowColumnName: "Count(ID) CountID").Tables[0];
- if (dtCount2.Rows.Count > 0)
- {
- if (Convert.ToInt32(dtCount2.Rows[0]["CountID"]) > 0)
- {
- backgroundWorker.ReportProgress(0, "正在获取'摄影助理前期业绩' ...");
- string StrColumnName = "订单号,客户名称,订单类型,收款金额,应收金额,拍摄名称,收款时间,套系类别,套系名称,项目名称,收款类别,付款方式名称,未拍个数,最后拍摄时间,选片状态,选片时间,取件状态,取件日期,副订单,摄影助理满意总分";
- DataTable dt_VicePhotographer = orbll.GetView_Custom("Vw_StaffPerformance_Photograph", StrWhere: strBuilder.ToString() + s.ToString(), ShowColumnName: StrColumnName).Tables[0];
- for (int t = 0; t < dt_VicePhotographer.Rows.Count; t++)
- {
- #region
- DataGridViewRow dgvr = new DataGridViewRow();
- DataGridViewCell cell = null;
- //订单号
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_VicePhotographer.Rows[t]["订单号"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //员工
- cell = new DataGridViewTextBoxCell();
- cell.Value = StrUserName;
- dgvr.Cells.Add(cell);
- //职务
- cell = new DataGridViewTextBoxCell();
- cell.Value = "摄影助理";
- dgvr.Cells.Add(cell);
- //客户姓名
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_VicePhotographer.Rows[t]["客户名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //收款金额
- cell = new DataGridViewTextBoxCell();
- if (dt_VicePhotographer.Rows[t]["订单类型"].ToString() != "1")
- { cell.Value = Convert.ToDecimal(dt_VicePhotographer.Rows[t]["收款金额"]).ToString("N2"); }
- else
- { cell.Value = GetChildrenAmount(dt_VicePhotographer.Rows[t]["订单号"].ToString().Trim(), Convert.ToDecimal(dt_VicePhotographer.Rows[t]["应收金额"]), Convert.ToDecimal(dt_VicePhotographer.Rows[t]["收款金额"]), dt_VicePhotographer.Rows[t]["拍摄名称"].ToString()); }
- dgvr.Cells.Add(cell);
- //收款时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_VicePhotographer.Rows[t]["收款时间"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //套系类别
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_VicePhotographer.Rows[t]["套系类别"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //套系名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_VicePhotographer.Rows[t]["套系名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //应收金额
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_VicePhotographer.Rows[t]["应收金额"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //项目名称
- cell = new DataGridViewTextBoxCell();
- if (string.IsNullOrEmpty(dt_VicePhotographer.Rows[t]["项目名称"].ToString().Trim()))
- { cell.Value = dt_VicePhotographer.Rows[t]["收款类别"].ToString(); }
- else { cell.Value = dt_VicePhotographer.Rows[t]["项目名称"].ToString().Trim(); }
- dgvr.Cells.Add(cell);
- //付款名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_VicePhotographer.Rows[t]["付款方式名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //拍摄状态
- cell = new DataGridViewTextBoxCell();
- if (Convert.ToInt32(dt_VicePhotographer.Rows[t]["未拍个数"]) == 0)
- { cell.Value = "OK"; }
- else { cell.Value = "未拍"; }
- dgvr.Cells.Add(cell);
- //拍摄时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_VicePhotographer.Rows[t]["最后拍摄时间"].ToString();
- dgvr.Cells.Add(cell);
- //选片状态
- cell = new DataGridViewTextBoxCell();
- if (dt_VicePhotographer.Rows[t]["选片状态"].ToString() == "OK")
- { cell.Value = "OK"; }
- else { cell.Value = "未选"; }
- dgvr.Cells.Add(cell);
- //选片时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = LYFZ.Command.Command_Validate.DateTimeToString(dt_VicePhotographer.Rows[t]["选片时间"], "yyyy-MM-dd HH:mm");
- dgvr.Cells.Add(cell);
- //取件状态
- cell = new DataGridViewTextBoxCell();
- if (dt_VicePhotographer.Rows[t]["取件状态"].ToString() == "OK")
- { cell.Value = "OK"; }
- else { cell.Value = "未取"; }
- dgvr.Cells.Add(cell);
- //取件时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = LYFZ.Command.Command_Validate.DateTimeToString(dt_VicePhotographer.Rows[t]["取件日期"], "yyyy-MM-dd HH:mm");
- dgvr.Cells.Add(cell);
- //拍摄名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_VicePhotographer.Rows[t]["拍摄名称"].ToString();
- dgvr.Cells.Add(cell);
- //订单类型
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_VicePhotographer.Rows[t]["订单类型"].ToString();
- dgvr.Cells.Add(cell);
- //收款类型
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_VicePhotographer.Rows[t]["收款类别"].ToString();
- dgvr.Cells.Add(cell);
- //副订单
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_VicePhotographer.Rows[t]["副订单"].ToString();
- dgvr.Cells.Add(cell);
- //摄影助理满意总分
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_VicePhotographer.Rows[t]["摄影助理满意总分"].ToString();
- dgvr.Cells.Add(cell);
- this.Invoke(new UpdateControl(delegate()
- {
- this.dgv.Rows.Add(dgvr);
- }));
- #endregion
- }
- }
- }
- #endregion
- }
- }
- }
- ConfigureRow = dt_SystemConfigure.Select("Sconfig_Code='MakeupArtistEarly' and Sconfig_IsEnabled=1");
- if (ConfigureRow.Length > 0)
- {
- if (ConfigureRow[0]["Sconfig_Value"].ToString() == "1")
- {
- if (this.Str_ProjectTitle.Trim() == "" || this.Str_ProjectTitle.Trim() == "化妆前期")
- {
- #region 主化妆师
- s = "";
- strBuilder = new StringBuilder();
- strBuilder.Append(" 收款类别 <> '后期收款'");
- if (EmployeeName != null && !string.IsNullOrEmpty(EmployeeName))
- { strBuilder.Append(" And 主化妆ID like '%" + EmployeeName + "%' "); }
- if (this.Str_ProcessStatus.Trim() == "")
- { strBuilder.Append(" And 未拍个数 = 0 And (服务前期查询时间 >= '" + StartTime + "' And 服务前期查询时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "拍照OK")
- { strBuilder.Append(" And 未拍个数 = 0 And (最后拍摄时间 >= '" + StartTime + "' And 最后拍摄时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "选片OK")
- { strBuilder.Append(" And 选片状态 = 'OK' And (选片时间 >= '" + StartTime + "' And 选片时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "取件OK")
- { strBuilder.Append(" And 取件状态 = 'OK' And (取件日期 >= '" + StartTime + "' And 取件日期 <= '" + EndTime + " 23:59:59.000')"); }
- if (!string.IsNullOrEmpty(this.Str_Scores1))
- { strBuilder.Append(" and (主化妆满意总分>=" + this.Str_Scores1 + " and 主化妆满意总分<=" + this.Str_Scores2 + ")"); }
- s = BindSelect5();
- DataTable dtCount1 = orbll.GetView_Custom("Vw_StaffPerformance_Photograph", StrWhere: strBuilder.ToString() + s.ToString(), ShowColumnName: "Count(ID) CountID").Tables[0];
- if (dtCount1.Rows.Count > 0)
- {
- if (Convert.ToInt32(dtCount1.Rows[0]["CountID"]) > 0)
- {
- backgroundWorker.ReportProgress(0, "正在获取'主化妆师前期业绩' ...");
- string StrColumnName = "订单号,客户名称,订单类型,收款金额,应收金额,拍摄名称,收款时间,套系类别,套系名称,项目名称,收款类别,付款方式名称,未拍个数,最后拍摄时间,选片状态,选片时间,取件状态,取件日期,副订单,主化妆满意总分";
- DataTable dt_MainMakeupArtist = orbll.GetView_Custom("Vw_StaffPerformance_Photograph", StrWhere: strBuilder.ToString() + s.ToString(), ShowColumnName: StrColumnName).Tables[0];
- for (int t = 0; t < dt_MainMakeupArtist.Rows.Count; t++)
- {
- #region
- DataGridViewRow dgvr = new DataGridViewRow();
- DataGridViewCell cell = null;
- //订单号
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_MainMakeupArtist.Rows[t]["订单号"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //员工
- cell = new DataGridViewTextBoxCell();
- cell.Value = StrUserName;
- dgvr.Cells.Add(cell);
- //职务
- cell = new DataGridViewTextBoxCell();
- cell.Value = "主化妆师";
- dgvr.Cells.Add(cell);
- //客户姓名
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_MainMakeupArtist.Rows[t]["客户名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //收款金额
- cell = new DataGridViewTextBoxCell();
- if (dt_MainMakeupArtist.Rows[t]["订单类型"].ToString() != "1")
- { cell.Value = Convert.ToDecimal(dt_MainMakeupArtist.Rows[t]["收款金额"]).ToString("N2"); }
- else
- { cell.Value = GetChildrenAmount(dt_MainMakeupArtist.Rows[t]["订单号"].ToString().Trim(), Convert.ToDecimal(dt_MainMakeupArtist.Rows[t]["应收金额"]), Convert.ToDecimal(dt_MainMakeupArtist.Rows[t]["收款金额"]), dt_MainMakeupArtist.Rows[t]["拍摄名称"].ToString()); }
- dgvr.Cells.Add(cell);
- //收款时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_MainMakeupArtist.Rows[t]["收款时间"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //套系类别
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_MainMakeupArtist.Rows[t]["套系类别"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //套系名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_MainMakeupArtist.Rows[t]["套系名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //应收金额
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDecimal(dt_MainMakeupArtist.Rows[t]["应收金额"]).ToString("N2").Trim();
- dgvr.Cells.Add(cell);
- //项目名称
- cell = new DataGridViewTextBoxCell();
- if (string.IsNullOrEmpty(dt_MainMakeupArtist.Rows[t]["项目名称"].ToString().Trim()))
- { cell.Value = dt_MainMakeupArtist.Rows[t]["收款类别"].ToString(); }
- else
- { cell.Value = dt_MainMakeupArtist.Rows[t]["项目名称"].ToString().Trim(); }
- dgvr.Cells.Add(cell);
- //付款名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_MainMakeupArtist.Rows[t]["付款方式名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //拍摄状态
- cell = new DataGridViewTextBoxCell();
- if (Convert.ToInt32(dt_MainMakeupArtist.Rows[t]["未拍个数"]) == 0)
- { cell.Value = "OK"; }
- else
- { cell.Value = "未拍"; }
- dgvr.Cells.Add(cell);
- //拍摄时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_MainMakeupArtist.Rows[t]["最后拍摄时间"].ToString();
- dgvr.Cells.Add(cell);
- //选片状态
- cell = new DataGridViewTextBoxCell();
- if (dt_MainMakeupArtist.Rows[t]["选片状态"].ToString() == "OK")
- { cell.Value = "OK"; }
- else
- { cell.Value = "未选"; }
- dgvr.Cells.Add(cell);
- //选片时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = LYFZ.Command.Command_Validate.DateTimeToString(dt_MainMakeupArtist.Rows[t]["选片时间"], "yyyy-MM-dd HH:mm");
- dgvr.Cells.Add(cell);
- //取件状态
- cell = new DataGridViewTextBoxCell();
- if (dt_MainMakeupArtist.Rows[t]["取件状态"].ToString() == "OK")
- { cell.Value = "OK"; }
- else
- { cell.Value = "未取"; }
- dgvr.Cells.Add(cell);
- //取件时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = LYFZ.Command.Command_Validate.DateTimeToString(dt_MainMakeupArtist.Rows[t]["取件日期"], "yyyy-MM-dd HH:mm");
- dgvr.Cells.Add(cell);
- //拍摄名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_MainMakeupArtist.Rows[t]["拍摄名称"].ToString();
- dgvr.Cells.Add(cell);
- //订单类型
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_MainMakeupArtist.Rows[t]["订单类型"].ToString();
- dgvr.Cells.Add(cell);
- //收款类型
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_MainMakeupArtist.Rows[t]["收款类别"].ToString();
- dgvr.Cells.Add(cell);
- //副订单
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_MainMakeupArtist.Rows[t]["副订单"].ToString();
- dgvr.Cells.Add(cell);
- //主化妆满意总分
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_MainMakeupArtist.Rows[t]["主化妆满意总分"].ToString();
- dgvr.Cells.Add(cell);
- #endregion
- this.Invoke(new UpdateControl(delegate()
- {
- this.dgv.Rows.Add(dgvr);
- }));
- }
- }
- }
- #endregion
- #region 化妆助理
- s = "";
- strBuilder = new StringBuilder();
- strBuilder.Append(" 收款类别 <> '后期收款'");
- if (EmployeeName != null && !string.IsNullOrEmpty(EmployeeName))
- { strBuilder.Append(" And 化妆助理ID like '%" + EmployeeName + "%' "); }
- if (this.Str_ProcessStatus.Trim() == "")
- { strBuilder.Append(" And 未拍个数 = 0 And (服务前期查询时间 >= '" + StartTime + "' And 服务前期查询时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "拍照OK")
- { strBuilder.Append(" And 未拍个数 = 0 And (最后拍摄时间 >= '" + StartTime + "' And 最后拍摄时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "选片OK")
- { strBuilder.Append(" And 选片状态 = 'OK' And (选片时间 >= '" + StartTime + "' And 选片时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "取件OK")
- { strBuilder.Append(" And 取件状态 = 'OK' And (取件日期 >= '" + StartTime + "' And 取件日期 <= '" + EndTime + " 23:59:59.000')"); }
- if (!string.IsNullOrEmpty(this.Str_Scores1))
- { strBuilder.Append(" and (化妆助理满意总分>=" + this.Str_Scores1 + " and 化妆助理满意总分<=" + this.Str_Scores2 + ")"); }
- s = BindSelect5();
- DataTable dtCount2 = orbll.GetView_Custom("Vw_StaffPerformance_Photograph", StrWhere: strBuilder.ToString() + s.ToString(), ShowColumnName: "Count(ID) CountID").Tables[0];
- if (dtCount2.Rows.Count > 0)
- {
- if (Convert.ToInt32(dtCount2.Rows[0]["CountID"]) > 0)
- {
- backgroundWorker.ReportProgress(0, "正在获取'化妆助理前期业绩' ...");
- string StrColumnName = "订单号,客户名称,订单类型,收款金额,应收金额,拍摄名称,收款时间,套系类别,套系名称,项目名称,收款类别,付款方式名称,未拍个数,最后拍摄时间,选片状态,选片时间,取件状态,取件日期,副订单,化妆助理满意总分";
- DataTable dt_ViceMakeupArtist = orbll.GetView_Custom("Vw_StaffPerformance_Photograph", StrWhere: strBuilder.ToString() + s.ToString(), ShowColumnName: StrColumnName).Tables[0];
- for (int t = 0; t < dt_ViceMakeupArtist.Rows.Count; t++)
- {
- #region
- DataGridViewRow dgvr = new DataGridViewRow();
- DataGridViewCell cell = null;
- //订单号
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_ViceMakeupArtist.Rows[t]["订单号"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //员工
- cell = new DataGridViewTextBoxCell();
- cell.Value = StrUserName;
- dgvr.Cells.Add(cell);
- //职务
- cell = new DataGridViewTextBoxCell();
- cell.Value = "化妆助理";
- dgvr.Cells.Add(cell);
- //客户姓名
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_ViceMakeupArtist.Rows[t]["客户名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //收款金额
- cell = new DataGridViewTextBoxCell();
- if (dt_ViceMakeupArtist.Rows[t]["订单类型"].ToString() != "1")
- { cell.Value = Convert.ToDecimal(dt_ViceMakeupArtist.Rows[t]["收款金额"]).ToString("N2"); }
- else { cell.Value = GetChildrenAmount(dt_ViceMakeupArtist.Rows[t]["订单号"].ToString().Trim(), Convert.ToDecimal(dt_ViceMakeupArtist.Rows[t]["应收金额"]), Convert.ToDecimal(dt_ViceMakeupArtist.Rows[t]["收款金额"]), dt_ViceMakeupArtist.Rows[t]["拍摄名称"].ToString()); }
- dgvr.Cells.Add(cell);
- //收款时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_ViceMakeupArtist.Rows[t]["收款时间"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //套系类别
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_ViceMakeupArtist.Rows[t]["套系类别"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //套系名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_ViceMakeupArtist.Rows[t]["套系名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //应收金额
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDecimal(dt_ViceMakeupArtist.Rows[t]["应收金额"]).ToString("N2").Trim();
- dgvr.Cells.Add(cell);
- //项目名称
- cell = new DataGridViewTextBoxCell();
- if (string.IsNullOrEmpty(dt_ViceMakeupArtist.Rows[t]["项目名称"].ToString().Trim()))
- { cell.Value = dt_ViceMakeupArtist.Rows[t]["收款类别"].ToString(); }
- else { cell.Value = dt_ViceMakeupArtist.Rows[t]["项目名称"].ToString().Trim(); }
- dgvr.Cells.Add(cell);
- //付款名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_ViceMakeupArtist.Rows[t]["付款方式名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //拍摄状态
- cell = new DataGridViewTextBoxCell();
- if (Convert.ToInt32(dt_ViceMakeupArtist.Rows[t]["未拍个数"]) == 0)
- { cell.Value = "OK"; }
- else { cell.Value = "未拍"; }
- dgvr.Cells.Add(cell);
- //拍摄时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_ViceMakeupArtist.Rows[t]["最后拍摄时间"].ToString();
- dgvr.Cells.Add(cell);
- //选片状态
- cell = new DataGridViewTextBoxCell();
- if (dt_ViceMakeupArtist.Rows[t]["选片状态"].ToString() == "OK")
- { cell.Value = "OK"; }
- else { cell.Value = "未选"; }
- dgvr.Cells.Add(cell);
- //选片时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = LYFZ.Command.Command_Validate.DateTimeToString(dt_ViceMakeupArtist.Rows[t]["选片时间"], "yyyy-MM-dd HH:mm");
- dgvr.Cells.Add(cell);
- //取件状态
- cell = new DataGridViewTextBoxCell();
- if (dt_ViceMakeupArtist.Rows[t]["取件状态"].ToString() == "OK")
- { cell.Value = "OK"; }
- else { cell.Value = "未取"; }
- dgvr.Cells.Add(cell);
- //取件时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = LYFZ.Command.Command_Validate.DateTimeToString(dt_ViceMakeupArtist.Rows[t]["取件日期"], "yyyy-MM-dd HH:mm");
- dgvr.Cells.Add(cell);
- //拍摄名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_ViceMakeupArtist.Rows[t]["拍摄名称"].ToString();
- dgvr.Cells.Add(cell);
- //订单类型
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_ViceMakeupArtist.Rows[t]["订单类型"].ToString();
- dgvr.Cells.Add(cell);
- //收款类型
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_ViceMakeupArtist.Rows[t]["收款类别"].ToString();
- dgvr.Cells.Add(cell);
- //副订单
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_ViceMakeupArtist.Rows[t]["副订单"].ToString();
- dgvr.Cells.Add(cell);
- //化妆助理满意总分
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_ViceMakeupArtist.Rows[t]["化妆助理满意总分"].ToString();
- dgvr.Cells.Add(cell);
- #endregion
- this.Invoke(new UpdateControl(delegate()
- {
- this.dgv.Rows.Add(dgvr);
- }));
- }
- }
- }
- #endregion
- }
- }
- }
- ConfigureRow = dt_SystemConfigure.Select("Sconfig_Code='BootDivisionEarly' and Sconfig_IsEnabled=1");
- if (ConfigureRow.Length > 0)
- {
- if (ConfigureRow[0]["Sconfig_Value"].ToString() == "1")
- {
- if (this.Str_ProjectTitle.Trim() == "" || this.Str_ProjectTitle.Trim() == "引导前期")
- {
- #region 引导师
- s = "";
- strBuilder = new StringBuilder();
- strBuilder.Append(" 收款类别 <> '后期收款'");
- if (EmployeeName != null && !string.IsNullOrEmpty(EmployeeName))
- { strBuilder.Append(" And 引导师ID like '%" + EmployeeName + "%' "); }
- if (this.Str_ProcessStatus.Trim() == "")
- { strBuilder.Append(" And 未拍个数 = 0 And (服务前期查询时间 >= '" + StartTime + "' And 服务前期查询时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "拍照OK")
- { strBuilder.Append(" And 未拍个数 = 0 And (最后拍摄时间 >= '" + StartTime + "' And 最后拍摄时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "选片OK")
- { strBuilder.Append(" And 选片状态 = 'OK' And (选片时间 >= '" + StartTime + "' And 选片时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "取件OK")
- { strBuilder.Append(" And 取件状态 = 'OK' And (取件日期 >= '" + StartTime + "' And 取件日期 <= '" + EndTime + " 23:59:59.000')"); }
- if (!string.IsNullOrEmpty(this.Str_Scores1))
- { strBuilder.Append(" and (引导满意总分>=" + this.Str_Scores1 + " and 引导满意总分<=" + this.Str_Scores2 + ")"); }
- s = BindSelect5();
- DataTable dtCount1 = orbll.GetView_Custom("Vw_StaffPerformance_Photograph", StrWhere: strBuilder.ToString() + s.ToString(), ShowColumnName: "Count(ID) CountID").Tables[0];
- if (dtCount1.Rows.Count > 0)
- {
- if (Convert.ToInt32(dtCount1.Rows[0]["CountID"]) > 0)
- {
- backgroundWorker.ReportProgress(0, "正在获取'引导师前期业绩' ...");
- string StrColumnName = "订单号,客户名称,订单类型,收款金额,应收金额,拍摄名称,收款时间,套系类别,套系名称,项目名称,收款类别,付款方式名称,未拍个数,最后拍摄时间,选片状态,选片时间,取件状态,取件日期,副订单,引导满意总分";
- DataTable dt_BootDivisiont = orbll.GetView_Custom("Vw_StaffPerformance_Photograph", StrWhere: strBuilder.ToString() + s.ToString(), ShowColumnName: StrColumnName).Tables[0];
- for (int t = 0; t < dt_BootDivisiont.Rows.Count; t++)
- {
- #region
- DataGridViewRow dgvr = new DataGridViewRow();
- DataGridViewCell cell = null;
- //订单号
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_BootDivisiont.Rows[t]["订单号"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //员工
- cell = new DataGridViewTextBoxCell();
- cell.Value = StrUserName;
- dgvr.Cells.Add(cell);
- //职务
- cell = new DataGridViewTextBoxCell();
- cell.Value = "引导师";
- dgvr.Cells.Add(cell);
- //客户姓名
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_BootDivisiont.Rows[t]["客户名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //收款金额
- cell = new DataGridViewTextBoxCell();
- if (dt_BootDivisiont.Rows[t]["订单类型"].ToString() != "1")
- { cell.Value = Convert.ToDecimal(dt_BootDivisiont.Rows[t]["收款金额"]).ToString("N2"); }
- else { cell.Value = GetChildrenAmount(dt_BootDivisiont.Rows[t]["订单号"].ToString().Trim(), Convert.ToDecimal(dt_BootDivisiont.Rows[t]["应收金额"]), Convert.ToDecimal(dt_BootDivisiont.Rows[t]["收款金额"]), dt_BootDivisiont.Rows[t]["拍摄名称"].ToString()); }
- dgvr.Cells.Add(cell);
- //收款时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_BootDivisiont.Rows[t]["收款时间"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //套系类别
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_BootDivisiont.Rows[t]["套系类别"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //套系名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_BootDivisiont.Rows[t]["套系名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //应收金额
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDecimal(dt_BootDivisiont.Rows[t]["应收金额"]).ToString("N2").Trim();
- dgvr.Cells.Add(cell);
- //项目名称
- cell = new DataGridViewTextBoxCell();
- if (string.IsNullOrEmpty(dt_BootDivisiont.Rows[t]["项目名称"].ToString().Trim()))
- { cell.Value = dt_BootDivisiont.Rows[t]["收款类别"].ToString(); }
- else { cell.Value = dt_BootDivisiont.Rows[t]["项目名称"].ToString().Trim(); }
- dgvr.Cells.Add(cell);
- //付款名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_BootDivisiont.Rows[t]["付款方式名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //拍摄状态
- cell = new DataGridViewTextBoxCell();
- if (Convert.ToInt32(dt_BootDivisiont.Rows[t]["未拍个数"]) == 0)
- { cell.Value = "OK"; }
- else { cell.Value = "未拍"; }
- dgvr.Cells.Add(cell);
- //拍摄时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_BootDivisiont.Rows[t]["最后拍摄时间"].ToString();
- dgvr.Cells.Add(cell);
- //选片状态
- cell = new DataGridViewTextBoxCell();
- if (dt_BootDivisiont.Rows[t]["选片状态"].ToString() == "OK")
- { cell.Value = "OK"; }
- else { cell.Value = "未选"; }
- dgvr.Cells.Add(cell);
- //选片时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = LYFZ.Command.Command_Validate.DateTimeToString(dt_BootDivisiont.Rows[t]["选片时间"], "yyyy-MM-dd HH:mm");
- dgvr.Cells.Add(cell);
- //取件状态
- cell = new DataGridViewTextBoxCell();
- if (dt_BootDivisiont.Rows[t]["取件状态"].ToString() == "OK")
- { cell.Value = "OK"; }
- else { cell.Value = "未取"; }
- dgvr.Cells.Add(cell);
- //取件时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = LYFZ.Command.Command_Validate.DateTimeToString(dt_BootDivisiont.Rows[t]["取件日期"], "yyyy-MM-dd HH:mm");
- dgvr.Cells.Add(cell);
- //拍摄名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_BootDivisiont.Rows[t]["拍摄名称"].ToString();
- dgvr.Cells.Add(cell);
- //订单类型
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_BootDivisiont.Rows[t]["订单类型"].ToString();
- dgvr.Cells.Add(cell);
- //收款类型
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_BootDivisiont.Rows[t]["收款类别"].ToString();
- dgvr.Cells.Add(cell);
- //副订单
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_BootDivisiont.Rows[t]["副订单"].ToString();
- dgvr.Cells.Add(cell);
- //引导满意总分
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_BootDivisiont.Rows[t]["引导满意总分"].ToString();
- dgvr.Cells.Add(cell);
- #endregion
- this.Invoke(new UpdateControl(delegate()
- {
- this.dgv.Rows.Add(dgvr);
- }));
- }
- }
- }
- #endregion
- #region 引导助理
- s = "";
- strBuilder = new StringBuilder();
- strBuilder.Append(" 收款类别 <> '后期收款'");
- if (EmployeeName != null && !string.IsNullOrEmpty(EmployeeName))
- { strBuilder.Append(" And 引导助理ID like '%" + EmployeeName + "%' "); }
- if (this.Str_ProcessStatus.Trim() == "")
- { strBuilder.Append(" And 未拍个数 = 0 And (服务前期查询时间 >= '" + StartTime + "' And 服务前期查询时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "拍照OK")
- { strBuilder.Append(" And 未拍个数 = 0 And (最后拍摄时间 >= '" + StartTime + "' And 最后拍摄时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "选片OK")
- { strBuilder.Append(" And 选片状态 = 'OK' And (选片时间 >= '" + StartTime + "' And 选片时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "取件OK")
- { strBuilder.Append(" And 取件状态 = 'OK' And (取件日期 >= '" + StartTime + "' And 取件日期 <= '" + EndTime + " 23:59:59.000')"); }
- if (!string.IsNullOrEmpty(this.Str_Scores1))
- { strBuilder.Append(" and (引导助理满意总分>=" + this.Str_Scores1 + " and 引导助理满意总分<=" + this.Str_Scores2 + ")"); }
- s = BindSelect5();
- DataTable dtCount2 = orbll.GetView_Custom("Vw_StaffPerformance_Photograph", StrWhere: strBuilder.ToString() + s.ToString(), ShowColumnName: "Count(ID) CountID").Tables[0];
- if (dtCount2.Rows.Count > 0)
- {
- if (Convert.ToInt32(dtCount2.Rows[0]["CountID"]) > 0)
- {
- backgroundWorker.ReportProgress(0, "正在获取'引导师助理前期业绩' ...");
- string StrColumnName = "订单号,客户名称,订单类型,收款金额,应收金额,拍摄名称,收款时间,套系类别,套系名称,项目名称,收款类别,付款方式名称,未拍个数,最后拍摄时间,选片状态,选片时间,取件状态,取件日期,副订单,引导助理满意总分";
- DataTable dt_BootDivisiont = orbll.GetView_Custom("Vw_StaffPerformance_Photograph", StrWhere: strBuilder.ToString() + s.ToString(), ShowColumnName: StrColumnName).Tables[0];
- for (int t = 0; t < dt_BootDivisiont.Rows.Count; t++)
- {
- #region
- DataGridViewRow dgvr = new DataGridViewRow();
- DataGridViewCell cell = null;
- //订单号
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_BootDivisiont.Rows[t]["订单号"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //员工
- cell = new DataGridViewTextBoxCell();
- cell.Value = StrUserName;
- dgvr.Cells.Add(cell);
- //职务
- cell = new DataGridViewTextBoxCell();
- cell.Value = "引导助理";
- dgvr.Cells.Add(cell);
- //客户姓名
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_BootDivisiont.Rows[t]["客户名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //收款金额
- cell = new DataGridViewTextBoxCell();
- if (dt_BootDivisiont.Rows[t]["订单类型"].ToString() != "1")
- { cell.Value = Convert.ToDecimal(dt_BootDivisiont.Rows[t]["收款金额"]).ToString("N2"); }
- else { cell.Value = GetChildrenAmount(dt_BootDivisiont.Rows[t]["订单号"].ToString().Trim(), Convert.ToDecimal(dt_BootDivisiont.Rows[t]["应收金额"]), Convert.ToDecimal(dt_BootDivisiont.Rows[t]["收款金额"]), dt_BootDivisiont.Rows[t]["拍摄名称"].ToString()); }
- dgvr.Cells.Add(cell);
- //收款时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_BootDivisiont.Rows[t]["收款时间"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //套系类别
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_BootDivisiont.Rows[t]["套系类别"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //套系名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_BootDivisiont.Rows[t]["套系名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //应收金额
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDecimal(dt_BootDivisiont.Rows[t]["应收金额"]).ToString("N2").Trim();
- dgvr.Cells.Add(cell);
- //项目名称
- cell = new DataGridViewTextBoxCell();
- if (string.IsNullOrEmpty(dt_BootDivisiont.Rows[t]["项目名称"].ToString().Trim()))
- { cell.Value = dt_BootDivisiont.Rows[t]["收款类别"].ToString(); }
- else { cell.Value = dt_BootDivisiont.Rows[t]["项目名称"].ToString().Trim(); }
- dgvr.Cells.Add(cell);
- //付款名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_BootDivisiont.Rows[t]["付款方式名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //拍摄状态
- cell = new DataGridViewTextBoxCell();
- if (Convert.ToInt32(dt_BootDivisiont.Rows[t]["未拍个数"]) == 0)
- { cell.Value = "OK"; }
- else { cell.Value = "未拍"; }
- dgvr.Cells.Add(cell);
- //拍摄时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_BootDivisiont.Rows[t]["最后拍摄时间"].ToString();
- dgvr.Cells.Add(cell);
- //选片状态
- cell = new DataGridViewTextBoxCell();
- if (dt_BootDivisiont.Rows[t]["选片状态"].ToString() == "OK")
- { cell.Value = "OK"; }
- else { cell.Value = "未选"; }
- dgvr.Cells.Add(cell);
- //选片时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = LYFZ.Command.Command_Validate.DateTimeToString(dt_BootDivisiont.Rows[t]["选片时间"], "yyyy-MM-dd HH:mm");
- dgvr.Cells.Add(cell);
- //取件状态
- cell = new DataGridViewTextBoxCell();
- if (dt_BootDivisiont.Rows[t]["取件状态"].ToString() == "OK")
- { cell.Value = "OK"; }
- else { cell.Value = "未取"; }
- dgvr.Cells.Add(cell);
- //取件时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = LYFZ.Command.Command_Validate.DateTimeToString(dt_BootDivisiont.Rows[t]["取件日期"], "yyyy-MM-dd HH:mm");
- dgvr.Cells.Add(cell);
- //拍摄名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_BootDivisiont.Rows[t]["拍摄名称"].ToString();
- dgvr.Cells.Add(cell);
- //订单类型
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_BootDivisiont.Rows[t]["订单类型"].ToString();
- dgvr.Cells.Add(cell);
- //收款类型
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_BootDivisiont.Rows[t]["收款类别"].ToString();
- dgvr.Cells.Add(cell);
- //副订单
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_BootDivisiont.Rows[t]["副订单"].ToString();
- dgvr.Cells.Add(cell);
- //引导满意总分
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_BootDivisiont.Rows[t]["引导助理满意总分"].ToString();
- dgvr.Cells.Add(cell);
- #endregion
- this.Invoke(new UpdateControl(delegate()
- {
- this.dgv.Rows.Add(dgvr);
- }));
- }
- }
- }
- #endregion
- }
- }
- }
- ConfigureRow = dt_SystemConfigure.Select("Sconfig_Code='FirstRepairDivisionEarly' and Sconfig_IsEnabled=1");
- if (ConfigureRow.Length > 0)
- {
- if (ConfigureRow[0]["Sconfig_Value"].ToString() == "1")
- {
- if (this.Str_ProjectTitle.Trim() == "" || this.Str_ProjectTitle.Trim() == "初修前期")
- {
- #region 初修师
- s = "";
- strBuilder = new StringBuilder();
- strBuilder.Append(" 收款类别 <> '后期收款'");
- if (EmployeeName != null && !string.IsNullOrEmpty(EmployeeName))
- { strBuilder.Append(" And 初修师ID like '%" + EmployeeName + "%' "); }
- if (this.Str_ProcessStatus.Trim() == "")
- { strBuilder.Append(" And 未拍个数 = 0 And 服务前期初修查询状态 = '2' And (服务前期初修查询时间 >= '" + StartTime + "' And 服务前期初修查询时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "拍照OK")
- { strBuilder.Append(" And 未拍个数 = 0 And (最后拍摄时间 >= '" + StartTime + "' And 最后拍摄时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "选片OK")
- { strBuilder.Append(" And 选片状态 = 'OK' And (选片时间 >= '" + StartTime + "' And 选片时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "取件OK")
- { strBuilder.Append(" And 取件状态 = 'OK' And (取件日期 >= '" + StartTime + "' And 取件日期 <= '" + EndTime + " 23:59:59.000')"); }
- if (!string.IsNullOrEmpty(this.Str_Scores1))
- { strBuilder.Append(" and (初修师满意总分>=" + this.Str_Scores1 + " and 初修师满意总分<=" + this.Str_Scores2 + ")"); }
- s = BindSelect5();
- DataTable dtCount = orbll.GetView_Custom("Vw_StaffPerformance_Photograph", StrWhere: strBuilder.ToString() + s.ToString(), ShowColumnName: "Count(ID) CountID").Tables[0];
- if (dtCount.Rows.Count > 0)
- {
- if (Convert.ToInt32(dtCount.Rows[0]["CountID"]) > 0)
- {
- backgroundWorker.ReportProgress(0, "正在获取'初修师前期业绩' ...");
- string StrColumnName = "订单号,客户名称,订单类型,收款金额,应收金额,拍摄名称,收款时间,套系类别,套系名称,项目名称,收款类别,付款方式名称,未拍个数,最后拍摄时间,选片状态,选片时间,取件状态,取件日期,副订单,初修师满意总分";
- DataTable dt_EarlyRepair = orbll.GetView_Custom("Vw_StaffPerformance_Photograph", StrWhere: strBuilder.ToString() + s.ToString(), ShowColumnName: StrColumnName).Tables[0];
- for (int t = 0; t < dt_EarlyRepair.Rows.Count; t++)
- {
- #region
- DataGridViewRow dgvr = new DataGridViewRow();
- DataGridViewCell cell = null;
- //订单号
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_EarlyRepair.Rows[t]["订单号"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //员工
- cell = new DataGridViewTextBoxCell();
- cell.Value = StrUserName;
- dgvr.Cells.Add(cell);
- //职务
- cell = new DataGridViewTextBoxCell();
- cell.Value = "初修师";
- dgvr.Cells.Add(cell);
- //客户姓名
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_EarlyRepair.Rows[t]["客户名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //收款金额
- cell = new DataGridViewTextBoxCell();
- if (dt_EarlyRepair.Rows[t]["订单类型"].ToString() != "1")
- { cell.Value = Convert.ToDecimal(dt_EarlyRepair.Rows[t]["收款金额"]).ToString("N2"); }
- else { cell.Value = GetChildrenAmount(dt_EarlyRepair.Rows[t]["订单号"].ToString().Trim(), Convert.ToDecimal(dt_EarlyRepair.Rows[t]["应收金额"]), Convert.ToDecimal(dt_EarlyRepair.Rows[t]["收款金额"]), dt_EarlyRepair.Rows[t]["拍摄名称"].ToString()); }
- dgvr.Cells.Add(cell);
- //收款时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_EarlyRepair.Rows[t]["收款时间"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //套系类别
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_EarlyRepair.Rows[t]["套系类别"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //套系名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_EarlyRepair.Rows[t]["套系名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //应收金额
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDecimal(dt_EarlyRepair.Rows[t]["应收金额"]).ToString("N2").Trim();
- dgvr.Cells.Add(cell);
- //项目名称
- cell = new DataGridViewTextBoxCell();
- if (string.IsNullOrEmpty(dt_EarlyRepair.Rows[t]["项目名称"].ToString().Trim()))
- { cell.Value = dt_EarlyRepair.Rows[t]["收款类别"].ToString(); }
- else { cell.Value = dt_EarlyRepair.Rows[t]["项目名称"].ToString().Trim(); }
- dgvr.Cells.Add(cell);
- //付款名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_EarlyRepair.Rows[t]["付款方式名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //拍摄状态
- cell = new DataGridViewTextBoxCell();
- if (Convert.ToInt32(dt_EarlyRepair.Rows[t]["未拍个数"]) == 0)
- { cell.Value = "OK"; }
- else { cell.Value = "未拍"; }
- dgvr.Cells.Add(cell);
- //拍摄时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_EarlyRepair.Rows[t]["最后拍摄时间"].ToString();
- dgvr.Cells.Add(cell);
- //选片状态
- cell = new DataGridViewTextBoxCell();
- if (dt_EarlyRepair.Rows[t]["选片状态"].ToString() == "OK")
- { cell.Value = "OK"; }
- else { cell.Value = "未选"; }
- dgvr.Cells.Add(cell);
- //选片时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = LYFZ.Command.Command_Validate.DateTimeToString(dt_EarlyRepair.Rows[t]["选片时间"], "yyyy-MM-dd HH:mm");
- dgvr.Cells.Add(cell);
- //取件状态
- cell = new DataGridViewTextBoxCell();
- if (dt_EarlyRepair.Rows[t]["取件状态"].ToString() == "OK")
- { cell.Value = "OK"; }
- else { cell.Value = "未取"; }
- dgvr.Cells.Add(cell);
- //取件时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = LYFZ.Command.Command_Validate.DateTimeToString(dt_EarlyRepair.Rows[t]["取件日期"], "yyyy-MM-dd HH:mm");
- dgvr.Cells.Add(cell);
- //拍摄名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_EarlyRepair.Rows[t]["拍摄名称"].ToString();
- dgvr.Cells.Add(cell);
- //订单类型
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_EarlyRepair.Rows[t]["订单类型"].ToString();
- dgvr.Cells.Add(cell);
- //收款类型
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_EarlyRepair.Rows[t]["收款类别"].ToString();
- dgvr.Cells.Add(cell);
- //副订单
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_EarlyRepair.Rows[t]["副订单"].ToString();
- dgvr.Cells.Add(cell);
- //初修师满意总分
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_EarlyRepair.Rows[t]["初修师满意总分"].ToString();
- dgvr.Cells.Add(cell);
- #endregion
- this.Invoke(new UpdateControl(delegate()
- {
- this.dgv.Rows.Add(dgvr);
- }));
- }
- }
- }
- #endregion
- }
- }
- }
- ConfigureRow = dt_SystemConfigure.Select("Sconfig_Code='FinishingDivisionEarly' and Sconfig_IsEnabled=1");
- if (ConfigureRow.Length > 0)
- {
- if (ConfigureRow[0]["Sconfig_Value"].ToString() == "1")
- {
- if (this.Str_ProjectTitle.Trim() == "" || this.Str_ProjectTitle.Trim() == "精修前期")
- {
- #region 精修师
- s = "";
- strBuilder = new StringBuilder();
- strBuilder.Append(" 收款类别 <> '后期收款'");
- if (EmployeeName != null && !string.IsNullOrEmpty(EmployeeName))
- { strBuilder.Append(" And 精修师ID like '%" + EmployeeName + "%' "); }
- if (this.Str_ProcessStatus.Trim() == "")
- { strBuilder.Append(" And 未拍个数 = 0 And 服务前期精修查询状态 = '2' And (服务前期精修查询时间 >= '" + StartTime + "' And 服务前期精修查询时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "拍照OK")
- { strBuilder.Append(" And 未拍个数 = 0 And (最后拍摄时间 >= '" + StartTime + "' And 最后拍摄时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "选片OK")
- { strBuilder.Append(" And 选片状态 = 'OK' And (选片时间 >= '" + StartTime + "' And 选片时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "取件OK")
- { strBuilder.Append(" And 取件状态 = 'OK' And (取件日期 >= '" + StartTime + "' And 取件日期 <= '" + EndTime + " 23:59:59.000')"); }
- if (!string.IsNullOrEmpty(this.Str_Scores1))
- { strBuilder.Append(" and (精修师满意总分>=" + this.Str_Scores1 + " and 精修师满意总分<=" + this.Str_Scores2 + ")"); }
- s = BindSelect5();
- DataTable dtCount = orbll.GetView_Custom("Vw_StaffPerformance_Photograph", StrWhere: strBuilder.ToString() + s.ToString(), ShowColumnName: "Count(ID) CountID").Tables[0];
- if (dtCount.Rows.Count > 0)
- {
- if (Convert.ToInt32(dtCount.Rows[0]["CountID"]) > 0)
- {
- backgroundWorker.ReportProgress(0, "正在获取'精修师前期业绩' ...");
- string StrColumnName = "订单号,客户名称,订单类型,收款金额,应收金额,拍摄名称,收款时间,套系类别,套系名称,项目名称,收款类别,付款方式名称,未拍个数,最后拍摄时间,选片状态,选片时间,取件状态,取件日期,副订单,精修师满意总分";
- DataTable dt_Refinement = orbll.GetView_Custom("Vw_StaffPerformance_Photograph", StrWhere: strBuilder.ToString() + s.ToString(), ShowColumnName: StrColumnName).Tables[0];
- for (int t = 0; t < dt_Refinement.Rows.Count; t++)
- {
- #region
- DataGridViewRow dgvr = new DataGridViewRow();
- DataGridViewCell cell = null;
- //订单号
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_Refinement.Rows[t]["订单号"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //员工
- cell = new DataGridViewTextBoxCell();
- cell.Value = StrUserName;
- dgvr.Cells.Add(cell);
- //职务
- cell = new DataGridViewTextBoxCell();
- cell.Value = "精修师";
- dgvr.Cells.Add(cell);
- //客户姓名
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_Refinement.Rows[t]["客户名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //收款金额
- cell = new DataGridViewTextBoxCell();
- if (dt_Refinement.Rows[t]["订单类型"].ToString() != "1")
- { cell.Value = Convert.ToDecimal(dt_Refinement.Rows[t]["收款金额"]).ToString("N2"); }
- else { cell.Value = GetChildrenAmount(dt_Refinement.Rows[t]["订单号"].ToString().Trim(), Convert.ToDecimal(dt_Refinement.Rows[t]["应收金额"]), Convert.ToDecimal(dt_Refinement.Rows[t]["收款金额"]), dt_Refinement.Rows[t]["拍摄名称"].ToString()); }
- dgvr.Cells.Add(cell);
- //收款时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_Refinement.Rows[t]["收款时间"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //套系类别
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_Refinement.Rows[t]["套系类别"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //套系名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_Refinement.Rows[t]["套系名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //应收金额
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDecimal(dt_Refinement.Rows[t]["应收金额"]).ToString("N2").Trim();
- dgvr.Cells.Add(cell);
- //项目名称
- cell = new DataGridViewTextBoxCell();
- if (string.IsNullOrEmpty(dt_Refinement.Rows[t]["项目名称"].ToString().Trim()))
- { cell.Value = dt_Refinement.Rows[t]["收款类别"].ToString(); }
- else { cell.Value = dt_Refinement.Rows[t]["项目名称"].ToString().Trim(); }
- dgvr.Cells.Add(cell);
- //付款名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_Refinement.Rows[t]["付款方式名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //拍摄状态
- cell = new DataGridViewTextBoxCell();
- if (Convert.ToInt32(dt_Refinement.Rows[t]["未拍个数"]) == 0)
- { cell.Value = "OK"; }
- else { cell.Value = "未拍"; }
- dgvr.Cells.Add(cell);
- //拍摄时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_Refinement.Rows[t]["最后拍摄时间"].ToString();
- dgvr.Cells.Add(cell);
- //选片状态
- cell = new DataGridViewTextBoxCell();
- if (dt_Refinement.Rows[t]["选片状态"].ToString() == "OK")
- { cell.Value = "OK"; }
- else { cell.Value = "未选"; }
- dgvr.Cells.Add(cell);
- //选片时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = LYFZ.Command.Command_Validate.DateTimeToString(dt_Refinement.Rows[t]["选片时间"], "yyyy-MM-dd HH:mm");
- dgvr.Cells.Add(cell);
- //取件状态
- cell = new DataGridViewTextBoxCell();
- if (dt_Refinement.Rows[t]["取件状态"].ToString() == "OK")
- { cell.Value = "OK"; }
- else { cell.Value = "未取"; }
- dgvr.Cells.Add(cell);
- //取件时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = LYFZ.Command.Command_Validate.DateTimeToString(dt_Refinement.Rows[t]["取件日期"], "yyyy-MM-dd HH:mm");
- dgvr.Cells.Add(cell);
- //拍摄名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_Refinement.Rows[t]["拍摄名称"].ToString();
- dgvr.Cells.Add(cell);
- //订单类型
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_Refinement.Rows[t]["订单类型"].ToString();
- dgvr.Cells.Add(cell);
- //收款类型
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_Refinement.Rows[t]["收款类别"].ToString();
- dgvr.Cells.Add(cell);
- //副订单
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_Refinement.Rows[t]["副订单"].ToString();
- dgvr.Cells.Add(cell);
- //精修师满意总分
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_Refinement.Rows[t]["精修师满意总分"].ToString();
- dgvr.Cells.Add(cell);
- #endregion
- this.Invoke(new UpdateControl(delegate()
- {
- this.dgv.Rows.Add(dgvr);
- }));
- }
- }
- }
- #endregion
- }
- }
- }
- ConfigureRow = dt_SystemConfigure.Select("Sconfig_Code='DesignersEarly' and Sconfig_IsEnabled=1");
- if (ConfigureRow.Length > 0)
- {
- if (ConfigureRow[0]["Sconfig_Value"].ToString() == "1")
- {
- if (this.Str_ProjectTitle.Trim() == "" || this.Str_ProjectTitle.Trim() == "设计前期")
- {
- #region 设计师
- s = "";
- strBuilder = new StringBuilder();
- strBuilder.Append(" 收款类别 <> '后期收款'");
- if (EmployeeName != null && !string.IsNullOrEmpty(EmployeeName))
- { strBuilder.Append(" And 设计师ID like '%" + EmployeeName + "%' "); }
- if (this.Str_ProcessStatus.Trim() == "")
- { strBuilder.Append(" And 未拍个数 = 0 And 服务前期设计查询状态 = '2' And (服务前期设计查询时间 >= '" + StartTime + "' And 服务前期设计查询时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "拍照OK")
- { strBuilder.Append(" And 未拍个数 = 0 And (最后拍摄时间 >= '" + StartTime + "' And 最后拍摄时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "选片OK")
- { strBuilder.Append(" And 选片状态 = 'OK' And (选片时间 >= '" + StartTime + "' And 选片时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "取件OK")
- { strBuilder.Append(" And 取件状态 = 'OK' And (取件日期 >= '" + StartTime + "' And 取件日期 <= '" + EndTime + " 23:59:59.000')"); }
- if (!string.IsNullOrEmpty(this.Str_Scores1))
- { strBuilder.Append(" and (设计师满意总分>=" + this.Str_Scores1 + " and 设计师满意总分<=" + this.Str_Scores2 + ")"); }
- s = BindSelect5();
- DataTable dtCount = orbll.GetView_Custom("Vw_StaffPerformance_Photograph", StrWhere: strBuilder.ToString() + s.ToString(), ShowColumnName: "Count(ID) CountID").Tables[0];
- if (dtCount.Rows.Count > 0)
- {
- if (Convert.ToInt32(dtCount.Rows[0]["CountID"]) > 0)
- {
- backgroundWorker.ReportProgress(0, "正在获取'设计师前期业绩' ...");
- string StrColumnName = "订单号,客户名称,订单类型,收款金额,应收金额,拍摄名称,收款时间,套系类别,套系名称,项目名称,收款类别,付款方式名称,未拍个数,最后拍摄时间,选片状态,选片时间,取件状态,取件日期,副订单,设计师满意总分";
- DataTable dt_Designer = orbll.GetView_Custom("Vw_StaffPerformance_Photograph", StrWhere: strBuilder.ToString() + s.ToString(), ShowColumnName: StrColumnName).Tables[0];
- for (int t = 0; t < dt_Designer.Rows.Count; t++)
- {
- #region
- DataGridViewRow dgvr = new DataGridViewRow();
- DataGridViewCell cell = null;
- //订单号
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_Designer.Rows[t]["订单号"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //员工
- cell = new DataGridViewTextBoxCell();
- cell.Value = StrUserName;
- dgvr.Cells.Add(cell);
- //职务
- cell = new DataGridViewTextBoxCell();
- cell.Value = "设计师";
- dgvr.Cells.Add(cell);
- //客户姓名
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_Designer.Rows[t]["客户名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //收款金额
- cell = new DataGridViewTextBoxCell();
- if (dt_Designer.Rows[t]["订单类型"].ToString() != "1")
- { cell.Value = Convert.ToDecimal(dt_Designer.Rows[t]["收款金额"]).ToString("N2"); }
- else
- { cell.Value = GetChildrenAmount(dt_Designer.Rows[t]["订单号"].ToString().Trim(), Convert.ToDecimal(dt_Designer.Rows[t]["应收金额"]), Convert.ToDecimal(dt_Designer.Rows[t]["收款金额"]), dt_Designer.Rows[t]["拍摄名称"].ToString()); }
- dgvr.Cells.Add(cell);
- //收款时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_Designer.Rows[t]["收款时间"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //套系类别
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_Designer.Rows[t]["套系类别"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //套系名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_Designer.Rows[t]["套系名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //应收金额
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDecimal(dt_Designer.Rows[t]["应收金额"]).ToString("N2").Trim();
- dgvr.Cells.Add(cell);
- //项目名称
- cell = new DataGridViewTextBoxCell();
- if (string.IsNullOrEmpty(dt_Designer.Rows[t]["项目名称"].ToString().Trim()))
- { cell.Value = dt_Designer.Rows[t]["收款类别"].ToString(); }
- else
- { cell.Value = dt_Designer.Rows[t]["项目名称"].ToString().Trim(); }
- dgvr.Cells.Add(cell);
- //付款名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_Designer.Rows[t]["付款方式名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //拍摄状态
- cell = new DataGridViewTextBoxCell();
- if (Convert.ToInt32(dt_Designer.Rows[t]["未拍个数"]) == 0)
- { cell.Value = "OK"; }
- else
- { cell.Value = "未拍"; }
- dgvr.Cells.Add(cell);
- //拍摄时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_Designer.Rows[t]["最后拍摄时间"].ToString();
- dgvr.Cells.Add(cell);
- //选片状态
- cell = new DataGridViewTextBoxCell();
- if (dt_Designer.Rows[t]["选片状态"].ToString() == "OK")
- { cell.Value = "OK"; }
- else
- { cell.Value = "未选"; }
- dgvr.Cells.Add(cell);
- //选片时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = LYFZ.Command.Command_Validate.DateTimeToString(dt_Designer.Rows[t]["选片时间"], "yyyy-MM-dd HH:mm");
- dgvr.Cells.Add(cell);
- //取件状态
- cell = new DataGridViewTextBoxCell();
- if (dt_Designer.Rows[t]["取件状态"].ToString() == "OK")
- { cell.Value = "OK"; }
- else
- { cell.Value = "未取"; }
- dgvr.Cells.Add(cell);
- //取件时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = LYFZ.Command.Command_Validate.DateTimeToString(dt_Designer.Rows[t]["取件日期"], "yyyy-MM-dd HH:mm");
- dgvr.Cells.Add(cell);
- //拍摄名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_Designer.Rows[t]["拍摄名称"].ToString();
- dgvr.Cells.Add(cell);
- //订单类型
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_Designer.Rows[t]["订单类型"].ToString();
- dgvr.Cells.Add(cell);
- //收款类型
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_Designer.Rows[t]["收款类别"].ToString();
- dgvr.Cells.Add(cell);
- //副订单
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_Designer.Rows[t]["副订单"].ToString();
- dgvr.Cells.Add(cell);
- //设计师满意总分
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_Designer.Rows[t]["设计师满意总分"].ToString();
- dgvr.Cells.Add(cell);
- #endregion
- this.Invoke(new UpdateControl(delegate()
- {
- this.dgv.Rows.Add(dgvr);
- }));
- }
- }
- }
- #endregion
- }
- }
- }
- #endregion
- }
- if (this.Str_ItemCategory.Trim() == "" || this.Str_ItemCategory.Trim() == "服务后期")
- {
- #region 选片二销业绩
- DataRow[] ConfigureRow = dt_SystemConfigure.Select("Sconfig_Code='PhotographerSelectionFilms' and Sconfig_IsEnabled=1");
- if (ConfigureRow.Length > 0)
- {
- if (ConfigureRow[0]["Sconfig_Value"].ToString() == "1")
- {
- if (this.Str_ProjectTitle.Trim() == "" || this.Str_ProjectTitle.Trim() == "摄影选片二销")
- {
- #region 主摄影师
- s = "";
- strBuilder = new StringBuilder();
- if (EmployeeName != null && !string.IsNullOrEmpty(EmployeeName))
- { strBuilder.Append(" And 主摄影师ID like '%" + EmployeeName + "%' "); }
- if (this.Str_ProcessStatus.Trim() == "")
- { strBuilder.Append(" And 未拍个数 = 0 And (收款时间 >= '" + StartTime + "' And 收款时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "拍照OK")
- { strBuilder.Append(" And 未拍个数 = 0 And (最后拍摄时间 >= '" + StartTime + "' And 最后拍摄时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "选片OK")
- { strBuilder.Append(" And 选片状态 = 'OK' And (选片时间 >= '" + StartTime + "' And 选片时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "取件OK")
- { strBuilder.Append(" And 取件状态 = 'OK' And (取件日期 >= '" + StartTime + "' And 取件日期 <= '" + EndTime + " 23:59:59.000')"); }
- if (!string.IsNullOrEmpty(this.Str_Scores1))
- { strBuilder.Append(" and (主摄影满意总分>=" + this.Str_Scores1 + " and 主摄影满意总分<=" + this.Str_Scores2 + ")"); }
- s = BindSelect5();
- DataTable dtCount1 = orbll.GetView_Custom("Vw_StaffPerformance_Photograph", StrWhere: "二销类别编号='BEBCABBAAHFCJBJGJ'" + strBuilder.ToString() + s.ToString(), ShowColumnName: "Count(ID) CountID").Tables[0];
- if (dtCount1.Rows.Count > 0)
- {
- if (Convert.ToInt32(dtCount1.Rows[0]["CountID"]) > 0)
- {
- backgroundWorker.ReportProgress(0, "正在获取'主摄影师选片二销业绩' ...");
- string StrColumnName = "订单号,客户名称,收款金额,收款时间,套系类别,套系名称,应收金额,项目名称,收款类别,付款方式名称,未拍个数,最后拍摄时间,选片状态,选片时间,取件状态,取件日期,拍摄名称,订单类型,副订单,主摄影满意总分";
- DataTable dt_MainPhotographer = orbll.GetView_Custom("Vw_StaffPerformance_Photograph", StrWhere: "二销类别编号='BEBCABBAAHFCJBJGJ'" + strBuilder.ToString() + s.ToString(), ShowColumnName: StrColumnName).Tables[0];
- for (int t = 0; t < dt_MainPhotographer.Rows.Count; t++)
- {
- #region
- DataGridViewRow dgvr = new DataGridViewRow();
- DataGridViewCell cell = null;
- //订单号
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_MainPhotographer.Rows[t]["订单号"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //员工
- cell = new DataGridViewTextBoxCell();
- cell.Value = StrUserName;
- dgvr.Cells.Add(cell);
- //职务
- cell = new DataGridViewTextBoxCell();
- cell.Value = "主摄影选片二销";
- dgvr.Cells.Add(cell);
- //客户姓名
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_MainPhotographer.Rows[t]["客户名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //收款金额
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDecimal(dt_MainPhotographer.Rows[t]["收款金额"]).ToString("N2");
- dgvr.Cells.Add(cell);
- //收款时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_MainPhotographer.Rows[t]["收款时间"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //套系类别
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_MainPhotographer.Rows[t]["套系类别"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //套系名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_MainPhotographer.Rows[t]["套系名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //应收金额
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDecimal(dt_MainPhotographer.Rows[t]["应收金额"]).ToString("N2").Trim();
- dgvr.Cells.Add(cell);
- //项目名称
- cell = new DataGridViewTextBoxCell();
- if (string.IsNullOrEmpty(dt_MainPhotographer.Rows[t]["项目名称"].ToString().Trim()))
- { cell.Value = dt_MainPhotographer.Rows[t]["收款类别"].ToString(); }
- else { cell.Value = dt_MainPhotographer.Rows[t]["项目名称"].ToString().Trim(); }
- dgvr.Cells.Add(cell);
- //付款名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_MainPhotographer.Rows[t]["付款方式名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //拍摄状态
- cell = new DataGridViewTextBoxCell();
- if (Convert.ToInt32(dt_MainPhotographer.Rows[t]["未拍个数"]) == 0)
- { cell.Value = "OK"; }
- else { cell.Value = "未拍"; }
- dgvr.Cells.Add(cell);
- //拍摄时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_MainPhotographer.Rows[t]["最后拍摄时间"].ToString();
- dgvr.Cells.Add(cell);
- //选片状态
- cell = new DataGridViewTextBoxCell();
- if (dt_MainPhotographer.Rows[t]["选片状态"].ToString() == "OK")
- { cell.Value = "OK"; }
- else { cell.Value = "未选"; }
- dgvr.Cells.Add(cell);
- //选片时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = LYFZ.Command.Command_Validate.DateTimeToString(dt_MainPhotographer.Rows[t]["选片时间"], "yyyy-MM-dd HH:mm");
- dgvr.Cells.Add(cell);
- //取件状态
- cell = new DataGridViewTextBoxCell();
- if (dt_MainPhotographer.Rows[t]["取件状态"].ToString() == "OK")
- { cell.Value = "OK"; }
- else { cell.Value = "未取"; }
- dgvr.Cells.Add(cell);
- //取件时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = LYFZ.Command.Command_Validate.DateTimeToString(dt_MainPhotographer.Rows[t]["取件日期"], "yyyy-MM-dd HH:mm");
- dgvr.Cells.Add(cell);
- //拍摄名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_MainPhotographer.Rows[t]["拍摄名称"].ToString();
- dgvr.Cells.Add(cell);
- //订单类型
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_MainPhotographer.Rows[t]["订单类型"].ToString();
- dgvr.Cells.Add(cell);
- //收款类型
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_MainPhotographer.Rows[t]["收款类别"].ToString();
- dgvr.Cells.Add(cell);
- //副订单
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_MainPhotographer.Rows[t]["副订单"].ToString();
- dgvr.Cells.Add(cell);
- //主摄影满意总分
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_MainPhotographer.Rows[t]["主摄影满意总分"].ToString();
- dgvr.Cells.Add(cell);
- #endregion
- this.Invoke(new UpdateControl(delegate()
- {
- this.dgv.Rows.Add(dgvr);
- }));
- }
- }
- }
- #endregion
- #region 摄影助理
- s = "";
- strBuilder = new StringBuilder();
- if (EmployeeName != null && !string.IsNullOrEmpty(EmployeeName))
- { strBuilder.Append(" And 摄影助理ID like '%" + EmployeeName + "%' "); }
- if (this.Str_ProcessStatus.Trim() == "")
- { strBuilder.Append(" And 未拍个数 = 0 And (收款时间 >= '" + StartTime + "' And 收款时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "拍照OK")
- { strBuilder.Append(" And 未拍个数 = 0 And (最后拍摄时间 >= '" + StartTime + "' And 最后拍摄时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "选片OK")
- { strBuilder.Append(" And 选片状态 = 'OK' And (选片时间 >= '" + StartTime + "' And 选片时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "取件OK")
- { strBuilder.Append(" And 取件状态 = 'OK' And (取件日期 >= '" + StartTime + "' And 取件日期 <= '" + EndTime + " 23:59:59.000')"); }
- if (!string.IsNullOrEmpty(this.Str_Scores1))
- { strBuilder.Append(" and (摄影助理满意总分>=" + this.Str_Scores1 + " and 摄影助理满意总分<=" + this.Str_Scores2 + ")"); }
- s = BindSelect5();
- DataTable dtCount2 = orbll.GetView_Custom("Vw_StaffPerformance_Photograph", StrWhere: "二销类别编号='BEBCABBAAHFCJBJGJ'" + strBuilder.ToString() + s.ToString(), ShowColumnName: "Count(ID) CountID").Tables[0];
- if (dtCount2.Rows.Count > 0)
- {
- if (Convert.ToInt32(dtCount2.Rows[0]["CountID"]) > 0)
- {
- backgroundWorker.ReportProgress(0, "正在获取'摄影助理选片二销业绩' ...");
- string StrColumnName = "订单号,客户名称,收款金额,收款时间,套系类别,套系名称,应收金额,项目名称,收款类别,付款方式名称,未拍个数,最后拍摄时间,选片状态,选片时间,取件状态,取件日期,拍摄名称,订单类型,副订单,摄影助理满意总分";
- DataTable dt_VicePhotographer = orbll.GetView_Custom("Vw_StaffPerformance_Photograph", StrWhere: "二销类别编号='BEBCABBAAHFCJBJGJ'" + strBuilder.ToString() + s.ToString(), ShowColumnName: StrColumnName).Tables[0];
- for (int t = 0; t < dt_VicePhotographer.Rows.Count; t++)
- {
- #region
- DataGridViewRow dgvr = new DataGridViewRow();
- DataGridViewCell cell = null;
- //订单号
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_VicePhotographer.Rows[t]["订单号"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //员工
- cell = new DataGridViewTextBoxCell();
- cell.Value = StrUserName;
- dgvr.Cells.Add(cell);
- //职务
- cell = new DataGridViewTextBoxCell();
- cell.Value = "摄影助理选片二销";
- dgvr.Cells.Add(cell);
- //客户姓名
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_VicePhotographer.Rows[t]["客户名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //收款金额
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDecimal(dt_VicePhotographer.Rows[t]["收款金额"]).ToString("N2");
- dgvr.Cells.Add(cell);
- //收款时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_VicePhotographer.Rows[t]["收款时间"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //套系类别
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_VicePhotographer.Rows[t]["套系类别"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //套系名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_VicePhotographer.Rows[t]["套系名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //应收金额
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDecimal(dt_VicePhotographer.Rows[t]["应收金额"]).ToString("N2").Trim();
- dgvr.Cells.Add(cell);
- //项目名称
- cell = new DataGridViewTextBoxCell();
- if (string.IsNullOrEmpty(dt_VicePhotographer.Rows[t]["项目名称"].ToString().Trim()))
- { cell.Value = dt_VicePhotographer.Rows[t]["收款类别"].ToString(); }
- else { cell.Value = dt_VicePhotographer.Rows[t]["项目名称"].ToString().Trim(); }
- dgvr.Cells.Add(cell);
- //付款名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_VicePhotographer.Rows[t]["付款方式名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //拍摄状态
- cell = new DataGridViewTextBoxCell();
- if (Convert.ToInt32(dt_VicePhotographer.Rows[t]["未拍个数"]) == 0)
- { cell.Value = "OK"; }
- else { cell.Value = "未拍"; }
- dgvr.Cells.Add(cell);
- //拍摄时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_VicePhotographer.Rows[t]["最后拍摄时间"].ToString();
- dgvr.Cells.Add(cell);
- //选片状态
- cell = new DataGridViewTextBoxCell();
- if (dt_VicePhotographer.Rows[t]["选片状态"].ToString() == "OK")
- { cell.Value = "OK"; }
- else { cell.Value = "未选"; }
- dgvr.Cells.Add(cell);
- //选片时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = LYFZ.Command.Command_Validate.DateTimeToString(dt_VicePhotographer.Rows[t]["选片时间"], "yyyy-MM-dd HH:mm");
- dgvr.Cells.Add(cell);
- //取件状态
- cell = new DataGridViewTextBoxCell();
- if (dt_VicePhotographer.Rows[t]["取件状态"].ToString() == "OK")
- { cell.Value = "OK"; }
- else { cell.Value = "未取"; }
- dgvr.Cells.Add(cell);
- //取件时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = LYFZ.Command.Command_Validate.DateTimeToString(dt_VicePhotographer.Rows[t]["取件日期"], "yyyy-MM-dd HH:mm");
- dgvr.Cells.Add(cell);
- //拍摄名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_VicePhotographer.Rows[t]["拍摄名称"].ToString();
- dgvr.Cells.Add(cell);
- //订单类型
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_VicePhotographer.Rows[t]["订单类型"].ToString();
- dgvr.Cells.Add(cell);
- //收款类型
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_VicePhotographer.Rows[t]["收款类别"].ToString();
- dgvr.Cells.Add(cell);
- //副订单
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_VicePhotographer.Rows[t]["副订单"].ToString();
- dgvr.Cells.Add(cell);
- //摄影助理满意总分
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_VicePhotographer.Rows[t]["摄影助理满意总分"].ToString();
- dgvr.Cells.Add(cell);
- #endregion
- this.Invoke(new UpdateControl(delegate()
- {
- this.dgv.Rows.Add(dgvr);
- }));
- }
- }
- }
- #endregion
- }
- }
- }
- ConfigureRow = dt_SystemConfigure.Select("Sconfig_Code='MakeupArtistSelectionFilms' and Sconfig_IsEnabled=1");
- if (ConfigureRow.Length > 0)
- {
- if (ConfigureRow[0]["Sconfig_Value"].ToString() == "1")
- {
- if (this.Str_ProjectTitle.Trim() == "" || this.Str_ProjectTitle.Trim() == "化妆选片二销")
- {
- #region 主化妆师
- s = "";
- strBuilder = new StringBuilder();
- if (EmployeeName != null && !string.IsNullOrEmpty(EmployeeName))
- { strBuilder.Append(" And 主化妆ID like '%" + EmployeeName + "%' "); }
- if (this.Str_ProcessStatus.Trim() == "")
- { strBuilder.Append(" And 未拍个数 = 0 And (收款时间 >= '" + StartTime + "' And 收款时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "拍照OK")
- { strBuilder.Append(" And 未拍个数 = 0 And (最后拍摄时间 >= '" + StartTime + "' And 最后拍摄时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "选片OK")
- { strBuilder.Append(" And 选片状态 = 'OK' And (选片时间 >= '" + StartTime + "' And 选片时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "取件OK")
- { strBuilder.Append(" And 取件状态 = 'OK' And (取件日期 >= '" + StartTime + "' And 取件日期 <= '" + EndTime + " 23:59:59.000')"); }
- if (!string.IsNullOrEmpty(this.Str_Scores1))
- { strBuilder.Append(" and (主化妆满意总分>=" + this.Str_Scores1 + " and 主化妆满意总分<=" + this.Str_Scores2 + ")"); }
- s = BindSelect5();
- DataTable dtCount1 = orbll.GetView_Custom("Vw_StaffPerformance_Photograph", StrWhere: "二销类别编号='BEBCABBAAHFCJBJGJ'" + strBuilder.ToString() + s.ToString(), ShowColumnName: "Count(ID) CountID").Tables[0];
- if (dtCount1.Rows.Count > 0)
- {
- if (Convert.ToInt32(dtCount1.Rows[0]["CountID"]) > 0)
- {
- backgroundWorker.ReportProgress(0, "正在获取'主化妆师选片二销业绩' ...");
- string StrColumnName = "订单号,客户名称,收款金额,收款时间,套系类别,套系名称,应收金额,项目名称,收款类别,付款方式名称,未拍个数,最后拍摄时间,选片状态,选片时间,取件状态,取件日期,拍摄名称,订单类型,副订单,主化妆满意总分";
- DataTable dt_MainMakeupArtist = orbll.GetView_Custom("Vw_StaffPerformance_Photograph", StrWhere: "二销类别编号='BEBCABBAAHFCJBJGJ'" + strBuilder.ToString() + s.ToString(), ShowColumnName: StrColumnName).Tables[0];
- for (int t = 0; t < dt_MainMakeupArtist.Rows.Count; t++)
- {
- #region
- DataGridViewRow dgvr = new DataGridViewRow();
- DataGridViewCell cell = null;
- //订单号
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_MainMakeupArtist.Rows[t]["订单号"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //员工
- cell = new DataGridViewTextBoxCell();
- cell.Value = StrUserName;
- dgvr.Cells.Add(cell);
- //职务
- cell = new DataGridViewTextBoxCell();
- cell.Value = "主化妆选片二销";
- dgvr.Cells.Add(cell);
- //客户姓名
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_MainMakeupArtist.Rows[t]["客户名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //收款金额
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDecimal(dt_MainMakeupArtist.Rows[t]["收款金额"]).ToString("N2");
- dgvr.Cells.Add(cell);
- //收款时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_MainMakeupArtist.Rows[t]["收款时间"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //套系类别
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_MainMakeupArtist.Rows[t]["套系类别"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //套系名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_MainMakeupArtist.Rows[t]["套系名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //应收金额
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDecimal(dt_MainMakeupArtist.Rows[t]["应收金额"]).ToString("N2").Trim();
- dgvr.Cells.Add(cell);
- //项目名称
- cell = new DataGridViewTextBoxCell();
- if (string.IsNullOrEmpty(dt_MainMakeupArtist.Rows[t]["项目名称"].ToString().Trim()))
- { cell.Value = dt_MainMakeupArtist.Rows[t]["收款类别"].ToString(); }
- else { cell.Value = dt_MainMakeupArtist.Rows[t]["项目名称"].ToString().Trim(); }
- dgvr.Cells.Add(cell);
- //付款名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_MainMakeupArtist.Rows[t]["付款方式名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //拍摄状态
- cell = new DataGridViewTextBoxCell();
- if (Convert.ToInt32(dt_MainMakeupArtist.Rows[t]["未拍个数"]) == 0)
- { cell.Value = "OK"; }
- else { cell.Value = "未拍"; }
- dgvr.Cells.Add(cell);
- //拍摄时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_MainMakeupArtist.Rows[t]["最后拍摄时间"].ToString();
- dgvr.Cells.Add(cell);
- //选片状态
- cell = new DataGridViewTextBoxCell();
- if (dt_MainMakeupArtist.Rows[t]["选片状态"].ToString() == "OK")
- { cell.Value = "OK"; }
- else { cell.Value = "未选"; }
- dgvr.Cells.Add(cell);
- //选片时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = LYFZ.Command.Command_Validate.DateTimeToString(dt_MainMakeupArtist.Rows[t]["选片时间"], "yyyy-MM-dd HH:mm");
- dgvr.Cells.Add(cell);
- //取件状态
- cell = new DataGridViewTextBoxCell();
- if (dt_MainMakeupArtist.Rows[t]["取件状态"].ToString() == "OK")
- { cell.Value = "OK"; }
- else { cell.Value = "未取"; }
- dgvr.Cells.Add(cell);
- //取件时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = LYFZ.Command.Command_Validate.DateTimeToString(dt_MainMakeupArtist.Rows[t]["取件日期"], "yyyy-MM-dd HH:mm");
- dgvr.Cells.Add(cell);
- //拍摄名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_MainMakeupArtist.Rows[t]["拍摄名称"].ToString();
- dgvr.Cells.Add(cell);
- //订单类型
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_MainMakeupArtist.Rows[t]["订单类型"].ToString();
- dgvr.Cells.Add(cell);
- //收款类型
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_MainMakeupArtist.Rows[t]["收款类别"].ToString();
- dgvr.Cells.Add(cell);
- //副订单
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_MainMakeupArtist.Rows[t]["副订单"].ToString();
- dgvr.Cells.Add(cell);
- //主化妆满意总分
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_MainMakeupArtist.Rows[t]["主化妆满意总分"].ToString();
- dgvr.Cells.Add(cell);
- #endregion
- this.Invoke(new UpdateControl(delegate()
- {
- this.dgv.Rows.Add(dgvr);
- }));
- }
- }
- }
- #endregion
- #region 化妆助理
- s = "";
- strBuilder = new StringBuilder();
- if (EmployeeName != null && !string.IsNullOrEmpty(EmployeeName))
- { strBuilder.Append(" And 化妆助理ID like '%" + EmployeeName + "%' "); }
- if (this.Str_ProcessStatus.Trim() == "")
- { strBuilder.Append(" And 未拍个数 = 0 And (收款时间 >= '" + StartTime + "' And 收款时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "拍照OK")
- { strBuilder.Append(" And 未拍个数 = 0 And (最后拍摄时间 >= '" + StartTime + "' And 最后拍摄时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "选片OK")
- { strBuilder.Append(" And 选片状态 = 'OK' And (选片时间 >= '" + StartTime + "' And 选片时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "取件OK")
- { strBuilder.Append(" And 取件状态 = 'OK' And (取件日期 >= '" + StartTime + "' And 取件日期 <= '" + EndTime + " 23:59:59.000')"); }
- if (!string.IsNullOrEmpty(this.Str_Scores1))
- { strBuilder.Append(" and (化妆助理满意总分>=" + this.Str_Scores1 + " and 化妆助理满意总分<=" + this.Str_Scores2 + ")"); }
- s = BindSelect5();
- DataTable dtCount2 = orbll.GetView_Custom("Vw_StaffPerformance_Photograph", StrWhere: "二销类别编号='BEBCABBAAHFCJBJGJ'" + strBuilder.ToString() + s.ToString(), ShowColumnName: "Count(ID) CountID").Tables[0];
- if (dtCount2.Rows.Count > 0)
- {
- if (Convert.ToInt32(dtCount2.Rows[0]["CountID"]) > 0)
- {
- backgroundWorker.ReportProgress(0, "正在获取'化妆助理选片二销业绩' ...");
- string StrColumnName = "订单号,客户名称,收款金额,收款时间,套系类别,套系名称,应收金额,项目名称,收款类别,付款方式名称,未拍个数,最后拍摄时间,选片状态,选片时间,取件状态,取件日期,拍摄名称,订单类型,副订单,化妆助理满意总分";
- DataTable dt_ViceMakeupArtist = orbll.GetView_Custom("Vw_StaffPerformance_Photograph", StrWhere: "二销类别编号='BEBCABBAAHFCJBJGJ'" + strBuilder.ToString() + s.ToString(), ShowColumnName: StrColumnName).Tables[0];
- for (int t = 0; t < dt_ViceMakeupArtist.Rows.Count; t++)
- {
- #region
- DataGridViewRow dgvr = new DataGridViewRow();
- DataGridViewCell cell = null;
- //订单号
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_ViceMakeupArtist.Rows[t]["订单号"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //员工
- cell = new DataGridViewTextBoxCell();
- cell.Value = StrUserName;
- dgvr.Cells.Add(cell);
- //职务
- cell = new DataGridViewTextBoxCell();
- cell.Value = "化妆助理选片二销";
- dgvr.Cells.Add(cell);
- //客户姓名
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_ViceMakeupArtist.Rows[t]["客户名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //收款金额
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDecimal(dt_ViceMakeupArtist.Rows[t]["收款金额"]).ToString("N2");
- dgvr.Cells.Add(cell);
- //收款时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_ViceMakeupArtist.Rows[t]["收款时间"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //套系类别
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_ViceMakeupArtist.Rows[t]["套系类别"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //套系名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_ViceMakeupArtist.Rows[t]["套系名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //应收金额
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDecimal(dt_ViceMakeupArtist.Rows[t]["应收金额"]).ToString("N2").Trim();
- dgvr.Cells.Add(cell);
- //项目名称
- cell = new DataGridViewTextBoxCell();
- if (string.IsNullOrEmpty(dt_ViceMakeupArtist.Rows[t]["项目名称"].ToString().Trim()))
- { cell.Value = dt_ViceMakeupArtist.Rows[t]["收款类别"].ToString(); }
- else { cell.Value = dt_ViceMakeupArtist.Rows[t]["项目名称"].ToString().Trim(); }
- dgvr.Cells.Add(cell);
- //付款名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_ViceMakeupArtist.Rows[t]["付款方式名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //拍摄状态
- cell = new DataGridViewTextBoxCell();
- if (Convert.ToInt32(dt_ViceMakeupArtist.Rows[t]["未拍个数"]) == 0)
- { cell.Value = "OK"; }
- else { cell.Value = "未拍"; }
- dgvr.Cells.Add(cell);
- //拍摄时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_ViceMakeupArtist.Rows[t]["最后拍摄时间"].ToString();
- dgvr.Cells.Add(cell);
- //选片状态
- cell = new DataGridViewTextBoxCell();
- if (dt_ViceMakeupArtist.Rows[t]["选片状态"].ToString() == "OK")
- { cell.Value = "OK"; }
- else { cell.Value = "未选"; }
- dgvr.Cells.Add(cell);
- //选片时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = LYFZ.Command.Command_Validate.DateTimeToString(dt_ViceMakeupArtist.Rows[t]["选片时间"], "yyyy-MM-dd HH:mm");
- dgvr.Cells.Add(cell);
- //取件状态
- cell = new DataGridViewTextBoxCell();
- if (dt_ViceMakeupArtist.Rows[t]["取件状态"].ToString() == "OK")
- { cell.Value = "OK"; }
- else { cell.Value = "未取"; }
- dgvr.Cells.Add(cell);
- //取件时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = LYFZ.Command.Command_Validate.DateTimeToString(dt_ViceMakeupArtist.Rows[t]["取件日期"], "yyyy-MM-dd HH:mm");
- dgvr.Cells.Add(cell);
- //拍摄名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_ViceMakeupArtist.Rows[t]["拍摄名称"].ToString();
- dgvr.Cells.Add(cell);
- //订单类型
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_ViceMakeupArtist.Rows[t]["订单类型"].ToString();
- dgvr.Cells.Add(cell);
- //收款类型
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_ViceMakeupArtist.Rows[t]["收款类别"].ToString();
- dgvr.Cells.Add(cell);
- //副订单
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_ViceMakeupArtist.Rows[t]["副订单"].ToString();
- dgvr.Cells.Add(cell);
- //化妆助理满意总分
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_ViceMakeupArtist.Rows[t]["化妆助理满意总分"].ToString();
- dgvr.Cells.Add(cell);
- #endregion
- this.Invoke(new UpdateControl(delegate()
- {
- this.dgv.Rows.Add(dgvr);
- }));
- }
- }
- }
- #endregion
- }
- }
- }
- ConfigureRow = dt_SystemConfigure.Select("Sconfig_Code='GuideSelectionFilmsDivision' and Sconfig_IsEnabled=1");
- if (ConfigureRow.Length > 0)
- {
- if (ConfigureRow[0]["Sconfig_Value"].ToString() == "1")
- {
- if (this.Str_ProjectTitle.Trim() == "" || this.Str_ProjectTitle.Trim() == "引导选片二销")
- {
- #region 引导师
- s = "";
- strBuilder = new StringBuilder();
- if (EmployeeName != null && !string.IsNullOrEmpty(EmployeeName))
- { strBuilder.Append(" And 引导师ID like '%" + EmployeeName + "%' "); }
- if (this.Str_ProcessStatus.Trim() == "")
- { strBuilder.Append(" And 未拍个数 = 0 And (收款时间 >= '" + StartTime + "' And 收款时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "拍照OK")
- { strBuilder.Append(" And 未拍个数 = 0 And (最后拍摄时间 >= '" + StartTime + "' And 最后拍摄时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "选片OK")
- { strBuilder.Append(" And 选片状态 = 'OK' And (选片时间 >= '" + StartTime + "' And 选片时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "取件OK")
- { strBuilder.Append(" And 取件状态 = 'OK' And (取件日期 >= '" + StartTime + "' And 取件日期 <= '" + EndTime + " 23:59:59.000')"); }
- if (!string.IsNullOrEmpty(this.Str_Scores1))
- { strBuilder.Append(" and (引导满意总分>=" + this.Str_Scores1 + " and 引导满意总分<=" + this.Str_Scores2 + ")"); }
- s = BindSelect5();
- DataTable dtCount1 = orbll.GetView_Custom("Vw_StaffPerformance_Photograph", StrWhere: "二销类别编号='BEBCABBAAHFCJBJGJ'" + strBuilder.ToString() + s.ToString(), ShowColumnName: "Count(ID) CountID").Tables[0];
- if (dtCount1.Rows.Count > 0)
- {
- if (Convert.ToInt32(dtCount1.Rows[0]["CountID"]) > 0)
- {
- backgroundWorker.ReportProgress(0, "正在获取'引导师选片二销业绩' ...");
- string StrColumnName = "订单号,客户名称,收款金额,收款时间,套系类别,套系名称,应收金额,项目名称,收款类别,付款方式名称,未拍个数,最后拍摄时间,选片状态,选片时间,取件状态,取件日期,拍摄名称,订单类型,副订单,引导满意总分";
- DataTable dt_BootDivisiont = orbll.GetView_Custom("Vw_StaffPerformance_Photograph", StrWhere: "二销类别编号='BEBCABBAAHFCJBJGJ'" + strBuilder.ToString() + s.ToString(), ShowColumnName: StrColumnName).Tables[0];
- for (int t = 0; t < dt_BootDivisiont.Rows.Count; t++)
- {
- #region
- DataGridViewRow dgvr = new DataGridViewRow();
- DataGridViewCell cell = null;
- //订单号
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_BootDivisiont.Rows[t]["订单号"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //员工
- cell = new DataGridViewTextBoxCell();
- cell.Value = StrUserName;
- dgvr.Cells.Add(cell);
- //职务
- cell = new DataGridViewTextBoxCell();
- cell.Value = "引导选片二销";
- dgvr.Cells.Add(cell);
- //客户姓名
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_BootDivisiont.Rows[t]["客户名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //收款金额
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDecimal(dt_BootDivisiont.Rows[t]["收款金额"]).ToString("N2");
- dgvr.Cells.Add(cell);
- //收款时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_BootDivisiont.Rows[t]["收款时间"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //套系类别
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_BootDivisiont.Rows[t]["套系类别"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //套系名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_BootDivisiont.Rows[t]["套系名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //应收金额
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDecimal(dt_BootDivisiont.Rows[t]["应收金额"]).ToString("N2").Trim();
- dgvr.Cells.Add(cell);
- //项目名称
- cell = new DataGridViewTextBoxCell();
- if (string.IsNullOrEmpty(dt_BootDivisiont.Rows[t]["项目名称"].ToString().Trim()))
- { cell.Value = dt_BootDivisiont.Rows[t]["收款类别"].ToString(); }
- else { cell.Value = dt_BootDivisiont.Rows[t]["项目名称"].ToString().Trim(); }
- dgvr.Cells.Add(cell);
- //付款名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_BootDivisiont.Rows[t]["付款方式名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //拍摄状态
- cell = new DataGridViewTextBoxCell();
- if (Convert.ToInt32(dt_BootDivisiont.Rows[t]["未拍个数"]) == 0)
- { cell.Value = "OK"; }
- else { cell.Value = "未拍"; }
- dgvr.Cells.Add(cell);
- //拍摄时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_BootDivisiont.Rows[t]["最后拍摄时间"].ToString();
- dgvr.Cells.Add(cell);
- //选片状态
- cell = new DataGridViewTextBoxCell();
- if (dt_BootDivisiont.Rows[t]["选片状态"].ToString() == "OK")
- { cell.Value = "OK"; }
- else { cell.Value = "未选"; }
- dgvr.Cells.Add(cell);
- //选片时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = LYFZ.Command.Command_Validate.DateTimeToString(dt_BootDivisiont.Rows[t]["选片时间"], "yyyy-MM-dd HH:mm");
- dgvr.Cells.Add(cell);
- //取件状态
- cell = new DataGridViewTextBoxCell();
- if (dt_BootDivisiont.Rows[t]["取件状态"].ToString() == "OK")
- { cell.Value = "OK"; }
- else { cell.Value = "未取"; }
- dgvr.Cells.Add(cell);
- //取件时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = LYFZ.Command.Command_Validate.DateTimeToString(dt_BootDivisiont.Rows[t]["取件日期"], "yyyy-MM-dd HH:mm");
- dgvr.Cells.Add(cell);
- //拍摄名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_BootDivisiont.Rows[t]["拍摄名称"].ToString();
- dgvr.Cells.Add(cell);
- //订单类型
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_BootDivisiont.Rows[t]["订单类型"].ToString();
- dgvr.Cells.Add(cell);
- //收款类型
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_BootDivisiont.Rows[t]["收款类别"].ToString();
- dgvr.Cells.Add(cell);
- //副订单
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_BootDivisiont.Rows[t]["副订单"].ToString();
- dgvr.Cells.Add(cell);
- //引导满意总分
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_BootDivisiont.Rows[t]["引导满意总分"].ToString();
- dgvr.Cells.Add(cell);
- #endregion
- this.Invoke(new UpdateControl(delegate()
- {
- this.dgv.Rows.Add(dgvr);
- }));
- }
- }
- }
- #endregion
- #region 引导助理
- s = "";
- strBuilder = new StringBuilder();
- if (EmployeeName != null && !string.IsNullOrEmpty(EmployeeName))
- { strBuilder.Append(" And 引导助理ID like '%" + EmployeeName + "%' "); }
- if (this.Str_ProcessStatus.Trim() == "")
- { strBuilder.Append(" And 未拍个数 = 0 And (收款时间 >= '" + StartTime + "' And 收款时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "拍照OK")
- { strBuilder.Append(" And 未拍个数 = 0 And (最后拍摄时间 >= '" + StartTime + "' And 最后拍摄时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "选片OK")
- { strBuilder.Append(" And 选片状态 = 'OK' And (选片时间 >= '" + StartTime + "' And 选片时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "取件OK")
- { strBuilder.Append(" And 取件状态 = 'OK' And (取件日期 >= '" + StartTime + "' And 取件日期 <= '" + EndTime + " 23:59:59.000')"); }
- if (!string.IsNullOrEmpty(this.Str_Scores1))
- { strBuilder.Append(" and (引导助理满意总分>=" + this.Str_Scores1 + " and 引导助理满意总分<=" + this.Str_Scores2 + ")"); }
- s = BindSelect5();
- DataTable dtCount2 = orbll.GetView_Custom("Vw_StaffPerformance_Photograph", StrWhere: "二销类别编号='BEBCABBAAHFCJBJGJ'" + strBuilder.ToString() + s.ToString(), ShowColumnName: "Count(ID) CountID").Tables[0];
- if (dtCount2.Rows.Count > 0)
- {
- if (Convert.ToInt32(dtCount2.Rows[0]["CountID"]) > 0)
- {
- backgroundWorker.ReportProgress(0, "正在获取'引导助理选片二销业绩' ...");
- string StrColumnName = "订单号,客户名称,收款金额,收款时间,套系类别,套系名称,应收金额,项目名称,收款类别,付款方式名称,未拍个数,最后拍摄时间,选片状态,选片时间,取件状态,取件日期,拍摄名称,订单类型,副订单,引导助理满意总分";
- DataTable dt_BootDivisiont = orbll.GetView_Custom("Vw_StaffPerformance_Photograph", StrWhere: "二销类别编号='BEBCABBAAHFCJBJGJ'" + strBuilder.ToString() + s.ToString(), ShowColumnName: StrColumnName).Tables[0];
- for (int t = 0; t < dt_BootDivisiont.Rows.Count; t++)
- {
- #region
- DataGridViewRow dgvr = new DataGridViewRow();
- DataGridViewCell cell = null;
- //订单号
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_BootDivisiont.Rows[t]["订单号"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //员工
- cell = new DataGridViewTextBoxCell();
- cell.Value = StrUserName;
- dgvr.Cells.Add(cell);
- //职务
- cell = new DataGridViewTextBoxCell();
- cell.Value = "引导助理选片二销";
- dgvr.Cells.Add(cell);
- //客户姓名
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_BootDivisiont.Rows[t]["客户名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //收款金额
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDecimal(dt_BootDivisiont.Rows[t]["收款金额"]).ToString("N2");
- dgvr.Cells.Add(cell);
- //收款时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_BootDivisiont.Rows[t]["收款时间"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //套系类别
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_BootDivisiont.Rows[t]["套系类别"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //套系名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_BootDivisiont.Rows[t]["套系名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //应收金额
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDecimal(dt_BootDivisiont.Rows[t]["应收金额"]).ToString("N2").Trim();
- dgvr.Cells.Add(cell);
- //项目名称
- cell = new DataGridViewTextBoxCell();
- if (string.IsNullOrEmpty(dt_BootDivisiont.Rows[t]["项目名称"].ToString().Trim()))
- { cell.Value = dt_BootDivisiont.Rows[t]["收款类别"].ToString(); }
- else { cell.Value = dt_BootDivisiont.Rows[t]["项目名称"].ToString().Trim(); }
- dgvr.Cells.Add(cell);
- //付款名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_BootDivisiont.Rows[t]["付款方式名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //拍摄状态
- cell = new DataGridViewTextBoxCell();
- if (Convert.ToInt32(dt_BootDivisiont.Rows[t]["未拍个数"]) == 0)
- { cell.Value = "OK"; }
- else { cell.Value = "未拍"; }
- dgvr.Cells.Add(cell);
- //拍摄时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_BootDivisiont.Rows[t]["最后拍摄时间"].ToString();
- dgvr.Cells.Add(cell);
- //选片状态
- cell = new DataGridViewTextBoxCell();
- if (dt_BootDivisiont.Rows[t]["选片状态"].ToString() == "OK")
- { cell.Value = "OK"; }
- else { cell.Value = "未选"; }
- dgvr.Cells.Add(cell);
- //选片时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = LYFZ.Command.Command_Validate.DateTimeToString(dt_BootDivisiont.Rows[t]["选片时间"], "yyyy-MM-dd HH:mm");
- dgvr.Cells.Add(cell);
- //取件状态
- cell = new DataGridViewTextBoxCell();
- if (dt_BootDivisiont.Rows[t]["取件状态"].ToString() == "OK")
- { cell.Value = "OK"; }
- else { cell.Value = "未取"; }
- dgvr.Cells.Add(cell);
- //取件时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = LYFZ.Command.Command_Validate.DateTimeToString(dt_BootDivisiont.Rows[t]["取件日期"], "yyyy-MM-dd HH:mm");
- dgvr.Cells.Add(cell);
- //拍摄名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_BootDivisiont.Rows[t]["拍摄名称"].ToString();
- dgvr.Cells.Add(cell);
- //订单类型
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_BootDivisiont.Rows[t]["订单类型"].ToString();
- dgvr.Cells.Add(cell);
- //收款类型
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_BootDivisiont.Rows[t]["收款类别"].ToString();
- dgvr.Cells.Add(cell);
- //副订单
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_BootDivisiont.Rows[t]["副订单"].ToString();
- dgvr.Cells.Add(cell);
- //引导满意总分
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_BootDivisiont.Rows[t]["引导助理满意总分"].ToString();
- dgvr.Cells.Add(cell);
- #endregion
- this.Invoke(new UpdateControl(delegate()
- {
- this.dgv.Rows.Add(dgvr);
- }));
- }
- }
- }
- #endregion
- }
- }
- }
- ConfigureRow = dt_SystemConfigure.Select("Sconfig_Code='FirstRepairDivisionSelectionFilms' and Sconfig_IsEnabled=1");
- if (ConfigureRow.Length > 0)
- {
- if (ConfigureRow[0]["Sconfig_Value"].ToString() == "1")
- {
- if (this.Str_ProjectTitle.Trim() == "" || this.Str_ProjectTitle.Trim() == "初修选片二销")
- {
- #region 初修师
- s = "";
- strBuilder = new StringBuilder();
- if (EmployeeName != null && !string.IsNullOrEmpty(EmployeeName))
- { strBuilder.Append(" And 初修师ID like '%" + EmployeeName + "%' "); }
- if (this.Str_ProcessStatus.Trim() == "")
- { strBuilder.Append(" And 未拍个数 = 0 And 服务前期初修查询状态 = '2' And (初修二销查询时间 >= '" + StartTime + "' And 初修二销查询时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "拍照OK")
- { strBuilder.Append(" And 未拍个数 = 0 And (最后拍摄时间 >= '" + StartTime + "' And 最后拍摄时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "选片OK")
- { strBuilder.Append(" And 选片状态 = 'OK' And (选片时间 >= '" + StartTime + "' And 选片时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "取件OK")
- { strBuilder.Append(" And 取件状态 = 'OK' And (取件日期 >= '" + StartTime + "' And 取件日期 <= '" + EndTime + " 23:59:59.000')"); }
- if (!string.IsNullOrEmpty(this.Str_Scores1))
- { strBuilder.Append(" and (初修师满意总分>=" + this.Str_Scores1 + " and 初修师满意总分<=" + this.Str_Scores2 + ")"); }
- s = BindSelect5();
- DataTable dtCount = orbll.GetView_Custom("Vw_StaffPerformance_Photograph", StrWhere: "二销类别编号='BEBCABBAAHFCJBJGJ'" + strBuilder.ToString() + s.ToString(), ShowColumnName: "Count(ID) CountID").Tables[0];
- if (dtCount.Rows.Count > 0)
- {
- if (Convert.ToInt32(dtCount.Rows[0]["CountID"]) > 0)
- {
- backgroundWorker.ReportProgress(0, "正在获取'初修师选片二销业绩' ...");
- string StrColumnName = "订单号,客户名称,收款金额,收款时间,套系类别,套系名称,应收金额,项目名称,收款类别,付款方式名称,未拍个数,最后拍摄时间,选片状态,选片时间,初修状态,初修时间,取件状态,取件日期,拍摄名称,订单类型,副订单,初修师满意总分";
- DataTable dt_EarlyRepair = orbll.GetView_Custom("Vw_StaffPerformance_Photograph", StrWhere: "二销类别编号='BEBCABBAAHFCJBJGJ'" + strBuilder.ToString() + s.ToString(), ShowColumnName: StrColumnName).Tables[0];
- for (int t = 0; t < dt_EarlyRepair.Rows.Count; t++)
- {
- #region
- DataGridViewRow dgvr = new DataGridViewRow();
- DataGridViewCell cell = null;
- //订单号
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_EarlyRepair.Rows[t]["订单号"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //员工
- cell = new DataGridViewTextBoxCell();
- cell.Value = StrUserName;
- dgvr.Cells.Add(cell);
- //职务
- cell = new DataGridViewTextBoxCell();
- cell.Value = "初修师选片二销";
- dgvr.Cells.Add(cell);
- //客户姓名
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_EarlyRepair.Rows[t]["客户名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //收款金额
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDecimal(dt_EarlyRepair.Rows[t]["收款金额"]).ToString("N2");
- dgvr.Cells.Add(cell);
- //收款时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_EarlyRepair.Rows[t]["收款时间"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //套系类别
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_EarlyRepair.Rows[t]["套系类别"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //套系名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_EarlyRepair.Rows[t]["套系名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //应收金额
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDecimal(dt_EarlyRepair.Rows[t]["应收金额"]).ToString("N2").Trim();
- dgvr.Cells.Add(cell);
- //项目名称
- cell = new DataGridViewTextBoxCell();
- if (string.IsNullOrEmpty(dt_EarlyRepair.Rows[t]["项目名称"].ToString().Trim()))
- { cell.Value = dt_EarlyRepair.Rows[t]["收款类别"].ToString(); }
- else { cell.Value = dt_EarlyRepair.Rows[t]["项目名称"].ToString().Trim(); }
- dgvr.Cells.Add(cell);
- //付款名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_EarlyRepair.Rows[t]["付款方式名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //拍摄状态
- cell = new DataGridViewTextBoxCell();
- if (Convert.ToInt32(dt_EarlyRepair.Rows[t]["未拍个数"]) == 0)
- { cell.Value = "OK"; }
- else { cell.Value = "未拍"; }
- dgvr.Cells.Add(cell);
- //拍摄时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_EarlyRepair.Rows[t]["最后拍摄时间"].ToString();
- dgvr.Cells.Add(cell);
- //选片状态
- cell = new DataGridViewTextBoxCell();
- if (dt_EarlyRepair.Rows[t]["选片状态"].ToString() == "OK")
- { cell.Value = "OK"; }
- else { cell.Value = "未选"; }
- dgvr.Cells.Add(cell);
- //选片时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = LYFZ.Command.Command_Validate.DateTimeToString(dt_EarlyRepair.Rows[t]["选片时间"], "yyyy-MM-dd HH:mm");
- dgvr.Cells.Add(cell);
- //取件状态
- cell = new DataGridViewTextBoxCell();
- if (dt_EarlyRepair.Rows[t]["取件状态"].ToString() == "OK")
- { cell.Value = "OK"; }
- else { cell.Value = "未取"; }
- dgvr.Cells.Add(cell);
- //取件时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = LYFZ.Command.Command_Validate.DateTimeToString(dt_EarlyRepair.Rows[t]["取件日期"], "yyyy-MM-dd HH:mm");
- dgvr.Cells.Add(cell);
- //拍摄名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_EarlyRepair.Rows[t]["拍摄名称"].ToString();
- dgvr.Cells.Add(cell);
- //订单类型
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_EarlyRepair.Rows[t]["订单类型"].ToString();
- dgvr.Cells.Add(cell);
- //收款类型
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_EarlyRepair.Rows[t]["收款类别"].ToString();
- dgvr.Cells.Add(cell);
- //副订单
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_EarlyRepair.Rows[t]["副订单"].ToString();
- dgvr.Cells.Add(cell);
- //初修师满意总分
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_EarlyRepair.Rows[t]["初修师满意总分"].ToString();
- dgvr.Cells.Add(cell);
- #endregion
- this.Invoke(new UpdateControl(delegate()
- {
- this.dgv.Rows.Add(dgvr);
- }));
- }
- }
- }
- #endregion
- }
- }
- }
- ConfigureRow = dt_SystemConfigure.Select("Sconfig_Code = 'StoreSelectionFilms' and Sconfig_IsEnabled = 1");
- if (ConfigureRow.Length > 0)
- {
- if (ConfigureRow[0]["Sconfig_Value"].ToString() == "1")
- {
- if (this.Str_ProjectTitle.Trim() == "" || this.Str_ProjectTitle.Trim() == "门市选片二销")
- {
- #region 门市
- s = "";
- strBuilder = new StringBuilder();
- if (EmployeeName != null && !string.IsNullOrEmpty(EmployeeName))
- { strBuilder.Append(" And 订单门市 like '%" + EmployeeName + "%' "); }
- if (this.Str_ProcessStatus.Trim() == "")
- { strBuilder.Append(" And 未拍个数 = 0 And (收款时间 >= '" + StartTime + " 00:00:00.000' And 收款时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "拍照OK")
- { strBuilder.Append(" And 未拍个数 = 0 And (最后拍摄时间 >= '" + StartTime + "' And 最后拍摄时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "选片OK")
- { strBuilder.Append(" And 选片状态 = 'OK' And (选片时间 >= '" + StartTime + "' And 选片时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "取件OK")
- { strBuilder.Append(" And 取件状态 = 'OK' And (取件日期 >= '" + StartTime + "' And 取件日期 <= '" + EndTime + " 23:59:59.000')"); }
- s = BindSelect5();
- DataTable dtCount = orbll.GetView_Custom("Vw_StaffPerformance_Photograph", StrWhere: "二销类别编号='BEBCABBAAHFCJBJGJ'" + strBuilder.ToString() + s.ToString(), ShowColumnName: "Count(ID) CountID").Tables[0];
- if (dtCount.Rows.Count > 0)
- {
- if (Convert.ToInt32(dtCount.Rows[0]["CountID"]) > 0)
- {
- backgroundWorker.ReportProgress(0, "正在获取'门市选片二销业绩' ...");
- string StrColumnName = "订单号,客户名称,收款金额,收款时间,套系类别,套系名称,应收金额,项目名称,收款类别,付款方式名称,未拍个数,最后拍摄时间,选片状态,选片时间,取件状态,取件日期,拍摄名称,订单类型,副订单";
- DataTable dt_OrderPerson = orbll.GetView_Custom("Vw_StaffPerformance_Photograph", StrWhere: "二销类别编号='BEBCABBAAHFCJBJGJ'" + strBuilder.ToString() + s.ToString(), ShowColumnName: StrColumnName).Tables[0];
- for (int t = 0; t < dt_OrderPerson.Rows.Count; t++)
- {
- #region
- DataGridViewRow dgvr = new DataGridViewRow();
- DataGridViewCell cell = null;
- //订单号
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_OrderPerson.Rows[t]["订单号"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //员工
- cell = new DataGridViewTextBoxCell();
- cell.Value = StrUserName;
- dgvr.Cells.Add(cell);
- //职务
- cell = new DataGridViewTextBoxCell();
- cell.Value = "门市选片二销";
- dgvr.Cells.Add(cell);
- //客户姓名
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_OrderPerson.Rows[t]["客户名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //收款金额
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDecimal(dt_OrderPerson.Rows[t]["收款金额"]).ToString("N2");
- dgvr.Cells.Add(cell);
- //收款时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_OrderPerson.Rows[t]["收款时间"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //套系类别
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_OrderPerson.Rows[t]["套系类别"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //套系名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_OrderPerson.Rows[t]["套系名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //应收金额
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDecimal(dt_OrderPerson.Rows[t]["应收金额"]).ToString("N2").Trim();
- dgvr.Cells.Add(cell);
- //项目名称
- cell = new DataGridViewTextBoxCell();
- if (string.IsNullOrEmpty(dt_OrderPerson.Rows[t]["项目名称"].ToString().Trim()))
- { cell.Value = dt_OrderPerson.Rows[t]["收款类别"].ToString(); }
- else { cell.Value = dt_OrderPerson.Rows[t]["项目名称"].ToString().Trim(); }
- dgvr.Cells.Add(cell);
- //付款名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_OrderPerson.Rows[t]["付款方式名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //拍摄状态
- cell = new DataGridViewTextBoxCell();
- if (Convert.ToInt32(dt_OrderPerson.Rows[t]["未拍个数"]) == 0)
- { cell.Value = "OK"; }
- else { cell.Value = "未拍"; }
- dgvr.Cells.Add(cell);
- //拍摄时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_OrderPerson.Rows[t]["最后拍摄时间"].ToString();
- dgvr.Cells.Add(cell);
- //选片状态
- cell = new DataGridViewTextBoxCell();
- if (dt_OrderPerson.Rows[t]["选片状态"].ToString() == "OK")
- { cell.Value = "OK"; }
- else { cell.Value = "未选"; }
- dgvr.Cells.Add(cell);
- //选片时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = LYFZ.Command.Command_Validate.DateTimeToString(dt_OrderPerson.Rows[t]["选片时间"], "yyyy-MM-dd HH:mm");
- dgvr.Cells.Add(cell);
- //取件状态
- cell = new DataGridViewTextBoxCell();
- if (dt_OrderPerson.Rows[t]["取件状态"].ToString() == "OK")
- { cell.Value = "OK"; }
- else { cell.Value = "未取"; }
- dgvr.Cells.Add(cell);
- //取件时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = LYFZ.Command.Command_Validate.DateTimeToString(dt_OrderPerson.Rows[t]["取件日期"], "yyyy-MM-dd HH:mm");
- dgvr.Cells.Add(cell);
- //拍摄名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_OrderPerson.Rows[t]["拍摄名称"].ToString();
- dgvr.Cells.Add(cell);
- //订单类型
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_OrderPerson.Rows[t]["订单类型"].ToString();
- dgvr.Cells.Add(cell);
- //收款类型
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_OrderPerson.Rows[t]["收款类别"].ToString();
- dgvr.Cells.Add(cell);
- //副订单
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_OrderPerson.Rows[t]["副订单"].ToString();
- dgvr.Cells.Add(cell);
- //门市满意总分
- cell = new DataGridViewTextBoxCell();
- cell.Value = "";
- dgvr.Cells.Add(cell);
- #endregion
- this.Invoke(new UpdateControl(delegate()
- {
- this.dgv.Rows.Add(dgvr);
- }));
- }
- }
- }
- #endregion
- }
- }
- }
- ConfigureRow = dt_SystemConfigure.Select("Sconfig_Code='DesignerSelectionFilms' and Sconfig_IsEnabled=1");
- if (ConfigureRow.Length > 0)
- {
- if (ConfigureRow[0]["Sconfig_Value"].ToString() == "1")
- {
- if (this.Str_ProjectTitle.Trim() == "" || this.Str_ProjectTitle.Trim() == "设计选片二销")
- {
- #region 设计师
- s = "";
- strBuilder = new StringBuilder();
- if (EmployeeName != null && !string.IsNullOrEmpty(EmployeeName))
- { strBuilder.Append(" And 设计师ID like '%" + EmployeeName + "%' "); }
- if (this.Str_ProcessStatus.Trim() == "")
- { strBuilder.Append(" And 未拍个数 = 0 And 服务前期设计查询状态 = '2' And (设计二销查询时间 >= '" + StartTime + "' And 设计二销查询时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "拍照OK")
- { strBuilder.Append(" And 未拍个数 = 0 And (最后拍摄时间 >= '" + StartTime + "' And 最后拍摄时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "选片OK")
- { strBuilder.Append(" And 选片状态 = 'OK' And (选片时间 >= '" + StartTime + "' And 选片时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "取件OK")
- { strBuilder.Append(" And 取件状态 = 'OK' And (取件日期 >= '" + StartTime + "' And 取件日期 <= '" + EndTime + " 23:59:59.000')"); }
- if (!string.IsNullOrEmpty(this.Str_Scores1))
- { strBuilder.Append(" and (设计师满意总分>=" + this.Str_Scores1 + " and 设计师满意总分<=" + this.Str_Scores2 + ")"); }
- s = BindSelect5();
- DataTable dtCount = orbll.GetView_Custom("Vw_StaffPerformance_Photograph", StrWhere: "二销类别编号='BEBCABBAAHFCJBJGJ'" + strBuilder.ToString() + s.ToString(), ShowColumnName: "Count(ID) CountID").Tables[0];
- if (dtCount.Rows.Count > 0)
- {
- if (Convert.ToInt32(dtCount.Rows[0]["CountID"]) > 0)
- {
- backgroundWorker.ReportProgress(0, "正在获取'设计师选片二销业绩' ...");
- string StrColumnName = "订单号,客户名称,收款金额,收款时间,套系类别,套系名称,应收金额,项目名称,收款类别,付款方式名称,未拍个数,最后拍摄时间,选片状态,选片时间,设计状态,设计时间,取件状态,取件日期,拍摄名称,订单类型,副订单,设计师满意总分";
- DataTable dt_EarlyRepair = orbll.GetView_Custom("Vw_StaffPerformance_Photograph", StrWhere: "二销类别编号='BEBCABBAAHFCJBJGJ'" + strBuilder.ToString() + s.ToString(), ShowColumnName: StrColumnName).Tables[0];
- for (int t = 0; t < dt_EarlyRepair.Rows.Count; t++)
- {
- #region
- DataGridViewRow dgvr = new DataGridViewRow();
- DataGridViewCell cell = null;
- //订单号
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_EarlyRepair.Rows[t]["订单号"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //员工
- cell = new DataGridViewTextBoxCell();
- cell.Value = StrUserName;
- dgvr.Cells.Add(cell);
- //职务
- cell = new DataGridViewTextBoxCell();
- cell.Value = "设计师选片二销";
- dgvr.Cells.Add(cell);
- //客户姓名
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_EarlyRepair.Rows[t]["客户名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //收款金额
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDecimal(dt_EarlyRepair.Rows[t]["收款金额"]).ToString("N2");
- dgvr.Cells.Add(cell);
- //收款时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_EarlyRepair.Rows[t]["收款时间"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //套系类别
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_EarlyRepair.Rows[t]["套系类别"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //套系名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_EarlyRepair.Rows[t]["套系名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //应收金额
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDecimal(dt_EarlyRepair.Rows[t]["应收金额"]).ToString("N2").Trim();
- dgvr.Cells.Add(cell);
- //项目名称
- cell = new DataGridViewTextBoxCell();
- if (string.IsNullOrEmpty(dt_EarlyRepair.Rows[t]["项目名称"].ToString().Trim()))
- { cell.Value = dt_EarlyRepair.Rows[t]["收款类别"].ToString(); }
- else { cell.Value = dt_EarlyRepair.Rows[t]["项目名称"].ToString().Trim(); }
- dgvr.Cells.Add(cell);
- //付款名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_EarlyRepair.Rows[t]["付款方式名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //拍摄状态
- cell = new DataGridViewTextBoxCell();
- if (Convert.ToInt32(dt_EarlyRepair.Rows[t]["未拍个数"]) == 0)
- { cell.Value = "OK"; }
- else { cell.Value = "未拍"; }
- dgvr.Cells.Add(cell);
- //拍摄时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_EarlyRepair.Rows[t]["最后拍摄时间"].ToString();
- dgvr.Cells.Add(cell);
- //选片状态
- cell = new DataGridViewTextBoxCell();
- if (dt_EarlyRepair.Rows[t]["选片状态"].ToString() == "OK")
- { cell.Value = "OK"; }
- else { cell.Value = "未选"; }
- dgvr.Cells.Add(cell);
- //选片时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = LYFZ.Command.Command_Validate.DateTimeToString(dt_EarlyRepair.Rows[t]["选片时间"], "yyyy-MM-dd HH:mm");
- dgvr.Cells.Add(cell);
- //取件状态
- cell = new DataGridViewTextBoxCell();
- if (dt_EarlyRepair.Rows[t]["取件状态"].ToString() == "OK")
- { cell.Value = "OK"; }
- else { cell.Value = "未取"; }
- dgvr.Cells.Add(cell);
- //取件时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = LYFZ.Command.Command_Validate.DateTimeToString(dt_EarlyRepair.Rows[t]["取件日期"], "yyyy-MM-dd HH:mm");
- dgvr.Cells.Add(cell);
- //拍摄名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_EarlyRepair.Rows[t]["拍摄名称"].ToString();
- dgvr.Cells.Add(cell);
- //订单类型
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_EarlyRepair.Rows[t]["订单类型"].ToString();
- dgvr.Cells.Add(cell);
- //收款类型
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_EarlyRepair.Rows[t]["收款类别"].ToString();
- dgvr.Cells.Add(cell);
- //副订单
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_EarlyRepair.Rows[t]["副订单"].ToString();
- dgvr.Cells.Add(cell);
- //初修师满意总分
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_EarlyRepair.Rows[t]["设计师满意总分"].ToString();
- dgvr.Cells.Add(cell);
- #endregion
- this.Invoke(new UpdateControl(delegate()
- {
- this.dgv.Rows.Add(dgvr);
- }));
- }
- }
- }
- #endregion
- }
- }
- }
- ConfigureRow = dt_SystemConfigure.Select("Sconfig_Code='RefinedRepairSelectionFilms' and Sconfig_IsEnabled=1");
- if (ConfigureRow.Length > 0)
- {
- if (ConfigureRow[0]["Sconfig_Value"].ToString() == "1")
- {
- if (this.Str_ProjectTitle.Trim() == "" || this.Str_ProjectTitle.Trim() == "精修选片二销")
- {
- #region 精修师
- s = "";
- strBuilder = new StringBuilder();
- if (EmployeeName != null && !string.IsNullOrEmpty(EmployeeName))
- { strBuilder.Append(" And 精修师ID like '%" + EmployeeName + "%' "); }
- if (this.Str_ProcessStatus.Trim() == "")
- { strBuilder.Append(" And 未拍个数 = 0 And 服务前期精修查询状态 = '2' And (精修二销查询时间 >= '" + StartTime + "' And 精修二销查询时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "拍照OK")
- { strBuilder.Append(" And 未拍个数 = 0 And (最后拍摄时间 >= '" + StartTime + "' And 最后拍摄时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "选片OK")
- { strBuilder.Append(" And 选片状态 = 'OK' And (选片时间 >= '" + StartTime + "' And 选片时间 <= '" + EndTime + " 23:59:59.000')"); }
- if (this.Str_ProcessStatus.Trim() == "取件OK")
- { strBuilder.Append(" And 取件状态 = 'OK' And (取件日期 >= '" + StartTime + "' And 取件日期 <= '" + EndTime + " 23:59:59.000')"); }
- if (!string.IsNullOrEmpty(this.Str_Scores1))
- { strBuilder.Append(" and (精修师满意总分>=" + this.Str_Scores1 + " and 精修师满意总分<=" + this.Str_Scores2 + ")"); }
- s = BindSelect5();
- DataTable dtCount = orbll.GetView_Custom("Vw_StaffPerformance_Photograph", StrWhere: "二销类别编号='BEBCABBAAHFCJBJGJ'" + strBuilder.ToString() + s.ToString(), ShowColumnName: "Count(ID) CountID").Tables[0];
- if (dtCount.Rows.Count > 0)
- {
- if (Convert.ToInt32(dtCount.Rows[0]["CountID"]) > 0)
- {
- backgroundWorker.ReportProgress(0, "正在获取'精修师选片二销业绩' ...");
- string StrColumnName = "订单号,客户名称,收款金额,收款时间,套系类别,套系名称,应收金额,项目名称,收款类别,付款方式名称,未拍个数,最后拍摄时间,选片状态,选片时间,精修状态,精修时间,取件状态,取件日期,拍摄名称,订单类型,副订单,精修师满意总分";
- DataTable dt_EarlyRepair = orbll.GetView_Custom("Vw_StaffPerformance_Photograph", StrWhere: "二销类别编号='BEBCABBAAHFCJBJGJ'" + strBuilder.ToString() + s.ToString(), ShowColumnName: StrColumnName).Tables[0];
- for (int t = 0; t < dt_EarlyRepair.Rows.Count; t++)
- {
- #region
- DataGridViewRow dgvr = new DataGridViewRow();
- DataGridViewCell cell = null;
- //订单号
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_EarlyRepair.Rows[t]["订单号"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //员工
- cell = new DataGridViewTextBoxCell();
- cell.Value = StrUserName;
- dgvr.Cells.Add(cell);
- //职务
- cell = new DataGridViewTextBoxCell();
- cell.Value = "精修师选片二销";
- dgvr.Cells.Add(cell);
- //客户姓名
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_EarlyRepair.Rows[t]["客户名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //收款金额
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDecimal(dt_EarlyRepair.Rows[t]["收款金额"]).ToString("N2");
- dgvr.Cells.Add(cell);
- //收款时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_EarlyRepair.Rows[t]["收款时间"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //套系类别
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_EarlyRepair.Rows[t]["套系类别"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //套系名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_EarlyRepair.Rows[t]["套系名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //应收金额
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDecimal(dt_EarlyRepair.Rows[t]["应收金额"]).ToString("N2").Trim();
- dgvr.Cells.Add(cell);
- //项目名称
- cell = new DataGridViewTextBoxCell();
- if (string.IsNullOrEmpty(dt_EarlyRepair.Rows[t]["项目名称"].ToString().Trim()))
- { cell.Value = dt_EarlyRepair.Rows[t]["收款类别"].ToString(); }
- else { cell.Value = dt_EarlyRepair.Rows[t]["项目名称"].ToString().Trim(); }
- dgvr.Cells.Add(cell);
- //付款名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_EarlyRepair.Rows[t]["付款方式名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //拍摄状态
- cell = new DataGridViewTextBoxCell();
- if (Convert.ToInt32(dt_EarlyRepair.Rows[t]["未拍个数"]) == 0)
- { cell.Value = "OK"; }
- else { cell.Value = "未拍"; }
- dgvr.Cells.Add(cell);
- //拍摄时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_EarlyRepair.Rows[t]["最后拍摄时间"].ToString();
- dgvr.Cells.Add(cell);
- //选片状态
- cell = new DataGridViewTextBoxCell();
- if (dt_EarlyRepair.Rows[t]["选片状态"].ToString() == "OK")
- { cell.Value = "OK"; }
- else { cell.Value = "未选"; }
- dgvr.Cells.Add(cell);
- //选片时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = LYFZ.Command.Command_Validate.DateTimeToString(dt_EarlyRepair.Rows[t]["选片时间"], "yyyy-MM-dd HH:mm");
- dgvr.Cells.Add(cell);
- //取件状态
- cell = new DataGridViewTextBoxCell();
- if (dt_EarlyRepair.Rows[t]["取件状态"].ToString() == "OK")
- { cell.Value = "OK"; }
- else { cell.Value = "未取"; }
- dgvr.Cells.Add(cell);
- //取件时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = LYFZ.Command.Command_Validate.DateTimeToString(dt_EarlyRepair.Rows[t]["取件日期"], "yyyy-MM-dd HH:mm");
- dgvr.Cells.Add(cell);
- //拍摄名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_EarlyRepair.Rows[t]["拍摄名称"].ToString();
- dgvr.Cells.Add(cell);
- //订单类型
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_EarlyRepair.Rows[t]["订单类型"].ToString();
- dgvr.Cells.Add(cell);
- //收款类型
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_EarlyRepair.Rows[t]["收款类别"].ToString();
- dgvr.Cells.Add(cell);
- //副订单
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_EarlyRepair.Rows[t]["副订单"].ToString();
- dgvr.Cells.Add(cell);
- //初修师满意总分
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_EarlyRepair.Rows[t]["精修师满意总分"].ToString();
- dgvr.Cells.Add(cell);
- #endregion
- this.Invoke(new UpdateControl(delegate()
- {
- this.dgv.Rows.Add(dgvr);
- }));
- }
- }
- }
- #endregion
- }
- }
- }
- #endregion
- }
- #endregion
- }
- if (this.Str_ItemCategory.Trim() == "" || this.Str_ItemCategory.Trim() == "会员充值")
- {
- #region 获取会员充值
- s = "";
- strBuilder = new StringBuilder();
- bool IsQuery = true;
- if (string.IsNullOrEmpty(this.Str_ProcessStatus.Trim()))
- {
- strBuilder.Append("and 创建时间 >= '" + StartTime + "' and 创建时间 <= '" + EndTime + " 23:59:59.000' ");
- if (EmployeeName != null && !string.IsNullOrEmpty(EmployeeName))
- { strBuilder.Append("and 接单人编号 like '%" + EmployeeName + "%'"); }
- s = BindSelect2(ref IsQuery);
- }
- else
- { IsQuery = false; }
- if (IsQuery)
- {
- DataTable dtCount = orbll.GetView_Custom("Vw_StaffPerformance_MemberCardRechargeRecord", StrWhere: " 1 = 1 " + strBuilder.ToString() + s.ToString(), ShowColumnName: "Count(ID) CountID").Tables[0];
- if (dtCount.Rows.Count > 0)
- {
- if (Convert.ToInt32(dtCount.Rows[0]["CountID"]) > 0)
- {
- backgroundWorker.ReportProgress(0, "正在获取'会员充值' ...");
- DataTable dt_MemberRecharge = avsbll.Vw_StaffPerformance_MemberCardRechargeRecord(strBuilder.ToString() + s.ToString()).Tables[0];
- for (int t = 0; t < dt_MemberRecharge.Rows.Count; t++)
- {
- #region
- DataGridViewRow dgvr = new DataGridViewRow();
- DataGridViewCell cell = null;
- //订单号
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_MemberRecharge.Rows[t]["充值编号"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //员工
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_MemberRecharge.Rows[t]["接单人名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //职务
- cell = new DataGridViewTextBoxCell();
- cell.Value = "会员接单人";
- dgvr.Cells.Add(cell);
- //客户姓名
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_MemberRecharge.Rows[t]["客户姓名"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //收款金额
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDecimal(dt_MemberRecharge.Rows[t]["充值金额"]).ToString("N2").Trim();
- dgvr.Cells.Add(cell);
- //收款时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_MemberRecharge.Rows[t]["创建时间"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //套系类别
- cell = new DataGridViewTextBoxCell();
- cell.Value = "/会员充值";
- dgvr.Cells.Add(cell);
- //套系名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_MemberRecharge.Rows[t]["充值名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //应收金额
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDecimal(dt_MemberRecharge.Rows[t]["充值金额"]).ToString("N2").Trim();
- dgvr.Cells.Add(cell);
- //项目名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_MemberRecharge.Rows[t]["充值名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //付款名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_MemberRecharge.Rows[t]["支付方式名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //拍摄状态
- cell = new DataGridViewTextBoxCell();
- cell.Value = "";
- dgvr.Cells.Add(cell);
- //拍摄时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = "";
- dgvr.Cells.Add(cell);
- //选片状态
- cell = new DataGridViewTextBoxCell();
- cell.Value = "";
- dgvr.Cells.Add(cell);
- //选片时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = "";
- dgvr.Cells.Add(cell);
- //取件状态
- cell = new DataGridViewTextBoxCell();
- cell.Value = "";
- dgvr.Cells.Add(cell);
- //取件时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = "";
- dgvr.Cells.Add(cell);
- //副订单
- cell = new DataGridViewTextBoxCell();
- cell.Value = "";
- dgvr.Cells.Add(cell);
- #endregion
- this.Invoke(new UpdateControl(delegate()
- {
- this.dgv.Rows.Add(dgvr);
- }));
- }
- }
- }
- }
- #endregion
- }
- if (this.Str_ItemCategory.Trim() == "" || this.Str_ItemCategory.Trim() == "服务卡充值")
- {
- #region 获取服务卡充值
- s = "";
- strBuilder = new StringBuilder();
- bool IsQuery = true;
- if (string.IsNullOrEmpty(this.Str_ProcessStatus.Trim()))
- {
- strBuilder.Append("and 创建日期>='" + StartTime + "' and 创建日期<='" + EndTime + " 23:59:59.000' ");
- if (EmployeeName != null && !string.IsNullOrEmpty(EmployeeName))
- { strBuilder.Append("and 接单人编号 like '%" + EmployeeName + "%'"); }
- s = BindSelect3(ref IsQuery);
- }
- else
- { IsQuery = false; }
- if (IsQuery)
- {
- DataTable dtCount = orbll.GetView_Custom("Vw_ErpMemberCardPayment", StrWhere: " 1 = 1 " + strBuilder.ToString() + s.ToString(), ShowColumnName: "Count(ID) CountID").Tables[0];
- if (dtCount.Rows.Count > 0)
- {
- if (Convert.ToInt32(dtCount.Rows[0]["CountID"]) > 0)
- {
- backgroundWorker.ReportProgress(0, "正在获取'服务卡充值' ...");
- DataTable dt_ServiceRecharge = avsbll.Vw_ErpMemberCardPayment(strBuilder.ToString() + s.ToString()).Tables[0];
- for (int t = 0; t < dt_ServiceRecharge.Rows.Count; t++)
- {
- #region
- DataGridViewRow dgvr = new DataGridViewRow();
- DataGridViewCell cell = null;
- //订单号
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_ServiceRecharge.Rows[t]["收款编号"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //员工
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_ServiceRecharge.Rows[t]["接单人名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //职务
- cell = new DataGridViewTextBoxCell();
- cell.Value = "服务卡接单人";
- dgvr.Cells.Add(cell);
- //客户姓名
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_ServiceRecharge.Rows[t]["客户姓名"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //收款金额
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDecimal(dt_ServiceRecharge.Rows[t]["收款金额"]).ToString("N2").Trim();
- dgvr.Cells.Add(cell);
- //收款时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_ServiceRecharge.Rows[t]["创建日期"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //套系类别
- cell = new DataGridViewTextBoxCell();
- cell.Value = "/服务卡充值";
- dgvr.Cells.Add(cell);
- //套系名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_ServiceRecharge.Rows[t]["服务套系类别名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //应收金额
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDecimal(dt_ServiceRecharge.Rows[t]["收款金额"]).ToString("N2").Trim();
- dgvr.Cells.Add(cell);
- //项目名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_ServiceRecharge.Rows[t]["服务套系类别名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //付款名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_ServiceRecharge.Rows[t]["支付方式名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //拍摄状态
- cell = new DataGridViewTextBoxCell();
- cell.Value = "";
- dgvr.Cells.Add(cell);
- //拍摄时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = "";
- dgvr.Cells.Add(cell);
- //选片状态
- cell = new DataGridViewTextBoxCell();
- cell.Value = "";
- dgvr.Cells.Add(cell);
- //选片时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = "";
- dgvr.Cells.Add(cell);
- //取件状态
- cell = new DataGridViewTextBoxCell();
- cell.Value = "";
- dgvr.Cells.Add(cell);
- //取件时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = "";
- dgvr.Cells.Add(cell);
- //副订单
- cell = new DataGridViewTextBoxCell();
- cell.Value = "";
- dgvr.Cells.Add(cell);
- #endregion
- this.Invoke(new UpdateControl(delegate()
- {
- this.dgv.Rows.Add(dgvr);
- }));
- }
- }
- }
- }
- #endregion
- }
- if (this.Str_ItemCategory.Trim() == "" || this.Str_ItemCategory.Trim() == "计件提成")
- {
- #region 获取计件提成
- s = "";
- strBuilder = new StringBuilder();
- bool IsQuery = true;
- if (string.IsNullOrEmpty(this.Str_ProcessStatus.Trim()))
- {
- strBuilder.Append("and Pcr_Date >= '" + StartTime + "' and Pcr_Date <= '" + EndTime + " 23:59:59.000' ");
- if (EmployeeName != null && !string.IsNullOrEmpty(EmployeeName))
- { strBuilder.Append("and Pcr_DigitalDivision like '%" + EmployeeName + "%'"); }
- s = BindSelect4(ref IsQuery);
- }
- else
- { IsQuery = false; }
- if (IsQuery)
- {
- DataTable dtCount = orbll.GetView_Custom("Vw_ErpPieceCommissionRecords", StrWhere: " 1 = 1 " + strBuilder.ToString() + s.ToString(), ShowColumnName: "Count(ID) CountID").Tables[0];
- if (dtCount.Rows.Count > 0)
- {
- if (Convert.ToInt32(dtCount.Rows[0]["CountID"]) > 0)
- {
- backgroundWorker.ReportProgress(0, "正在获取'计件提成' ...");
- DataTable dt_PieceCommission = pcrbll.Vw_ErpPieceCommissionRecords(strBuilder.ToString() + s.ToString()).Tables[0];
- for (int t = 0; t < dt_PieceCommission.Rows.Count; t++)
- {
- #region
- DataGridViewRow dgvr = new DataGridViewRow();
- DataGridViewCell cell = null;
- //订单号
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_PieceCommission.Rows[t]["Pcr_OrderNumber"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //员工
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_PieceCommission.Rows[t]["Pcr_DigitalDivisionName"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //职务
- cell = new DataGridViewTextBoxCell();
- cell.Value = "计件接单人";
- dgvr.Cells.Add(cell);
- //客户姓名
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_PieceCommission.Rows[t]["Cus_Name"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //收款金额
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_PieceCommission.Rows[t]["总价格"].ToString() == "" ? "0" : Convert.ToDecimal(dt_PieceCommission.Rows[t]["总价格"]).ToString("N2");
- dgvr.Cells.Add(cell);
- //收款时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_PieceCommission.Rows[t]["Pcr_Date"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //套系类别
- cell = new DataGridViewTextBoxCell();
- cell.Value = "/计件提成";
- dgvr.Cells.Add(cell);
- //套系名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_PieceCommission.Rows[t]["Pcr_CompletionContentsName"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //应收金额
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_PieceCommission.Rows[t]["总价格"].ToString() == "" ? "0" : Convert.ToDecimal(dt_PieceCommission.Rows[t]["总价格"]).ToString("N2");
- dgvr.Cells.Add(cell);
- //项目名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt_PieceCommission.Rows[t]["Pcr_CompletionContentsName"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //付款名称
- cell = new DataGridViewTextBoxCell();
- cell.Value = "";
- dgvr.Cells.Add(cell);
- //拍摄状态
- cell = new DataGridViewTextBoxCell();
- cell.Value = "";
- dgvr.Cells.Add(cell);
- //拍摄时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = "";
- dgvr.Cells.Add(cell);
- //选片状态
- cell = new DataGridViewTextBoxCell();
- cell.Value = "";
- dgvr.Cells.Add(cell);
- //选片时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = "";
- dgvr.Cells.Add(cell);
- //取件状态
- cell = new DataGridViewTextBoxCell();
- cell.Value = "";
- dgvr.Cells.Add(cell);
- //取件时间
- cell = new DataGridViewTextBoxCell();
- cell.Value = "";
- dgvr.Cells.Add(cell);
- //副订单
- cell = new DataGridViewTextBoxCell();
- cell.Value = "";
- dgvr.Cells.Add(cell);
- //满意总分
- cell = new DataGridViewTextBoxCell();
- cell.Value = "";
- dgvr.Cells.Add(cell);
- //
- cell = new DataGridViewTextBoxCell();
- cell.Value = "";
- dgvr.Cells.Add(cell);
- //
- cell = new DataGridViewTextBoxCell();
- cell.Value = "";
- dgvr.Cells.Add(cell);
- //
- cell = new DataGridViewTextBoxCell();
- cell.Value = "";
- dgvr.Cells.Add(cell);
- //数量
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToInt32(dt_PieceCommission.Rows[t]["Pcr_Quantity"]).ToString().Trim();
- dgvr.Cells.Add(cell);
- #endregion
- this.Invoke(new UpdateControl(delegate()
- {
- this.dgv.Rows.Add(dgvr);
- }));
- }
- }
- }
- }
- #endregion
- }
- #endregion
- #region 显示绘画(计算业绩)
- backgroundWorker.ReportProgress(0, "正在计算业绩 ...");
- string StrWhere1 = "";
- string StrWhere2 = "";
- string StrMainNumber = "";
- string StrViceNumber = "";
- this.Invoke(new UpdateControl(delegate()
- {
- for (int i = 0; i < this.dgv.Rows.Count; i++)
- {
- if (this.dgv.Rows[i].Cells["Column19"].Value != null)
- {
- if (this.dgv.Rows[i].Cells["Column19"].Value.ToString().Trim() != "1")
- { StrMainNumber += "'" + this.dgv.Rows[i].Cells["Column1"].Value.ToString().Trim() + "',"; }
- else
- { StrViceNumber += "'" + this.dgv.Rows[i].Cells["Column21"].Value.ToString().Trim() + "',"; }
- }
- }
- }));
- if (!string.IsNullOrEmpty(StrMainNumber))
- {
- //StrWhere1 += "主订单 in (" + StrMainNumber.TrimEnd(',') + ")";
- StrWhere1 += "Ordv_Number in (" + StrMainNumber.TrimEnd(',') + ")";
- StrWhere2 += "Ordpg_Number in (" + StrMainNumber.TrimEnd(',') + ")";
- }
- if (!string.IsNullOrEmpty(StrViceNumber))
- {
- if (string.IsNullOrEmpty(StrMainNumber))
- {
- //StrWhere1 += "副订单 in (" + StrViceNumber.TrimEnd(',') + ")";
- StrWhere1 += "Ordv_ViceNumber in (" + StrViceNumber.TrimEnd(',') + ")";
- StrWhere2 += "Ordpg_ViceNumber in (" + StrViceNumber.TrimEnd(',') + ")";
- }
- else
- {
- //StrWhere1 += " Or 副订单 in (" + StrViceNumber.TrimEnd(',') + ")";
- StrWhere1 += " Or Ordv_ViceNumber in (" + StrViceNumber.TrimEnd(',') + ")";
- StrWhere2 += " Or Ordpg_ViceNumber in (" + StrViceNumber.TrimEnd(',') + ")";
- }
- }
- DataTable dt_Level = new DataTable();
- DataTable dt_Sights = new DataTable();
- if (!string.IsNullOrEmpty(StrWhere1))
- {
- //dt_Level = orbll.GetView_Custom("Vw_StaffPerformance_Photograph", StrWhere: StrWhere1, ShowColumnName: "*").Tables[0];
- dt_Level = LYFZ.BLL.BLL_ErpPaymentPayrollClass.GetPayrollLevel(StrWhere1);
- }
- if (!string.IsNullOrEmpty(StrWhere2))
- { dt_Sights = orbll.GetView_Custom("tb_ErpOrdersPhotography", StrWhere: StrWhere2, ShowColumnName: "*").Tables[0]; }
- this.Invoke(new UpdateControl(delegate()
- {
- if (this.dgv.Rows.Count > 0)
- {
- decimal CurrentPerformance = 0; //业绩
- decimal PieceCommission = 0;
- for (int i = 0; i < this.dgv.Rows.Count; i++)
- {
- #region 参数
- string Ord_Number = this.dgv.Rows[i].Cells["Column1"].Value.ToString();
- object DeputyOrd_Number = this.dgv.Rows[i].Cells["Column21"].Value;
- object Ord_Type = this.dgv.Rows[i].Cells["Column19"].Value;
- object Pay_Category = this.dgv.Rows[i].Cells["Column20"].Value;
- object Project_Name = this.dgv.Rows[i].Cells["Column8"].Value;
- object Post = this.dgv.Rows[i].Cells["Column17"].Value;
- decimal Pay_AmountOf = Convert.ToDecimal(this.dgv.Rows[i].Cells["Column3"].Value);
- //摄影师
- string OrdPg_Photographer = "";
- string OrdPg_PhotographyAssistant = "";
- //等级
- string OrdPg_SightsLevel = "";
- //化妆
- string OrdPg_MakeupArtist = "";
- string OrdPg_MakeupAssistant = "";
- //引导
- string Ordpg_BootDivision = "";
- string Ordpg_BootDivisionAssistant = "";
- #endregion
- #region 绘画前期业绩(摄影,化妆)
- if (Ord_Type != null)
- {
- if (Pay_Category.ToString() == "预约收款" || Pay_Category.ToString() == "全款" || Pay_Category.ToString() == "预约补款" || Project_Name.ToString() == "选片二销")
- {
- if (Ord_Type.ToString() != "")
- {
- #region 获取等级级别个数
- //以下为滕工版
- string StrWhere = "";
- //if (Ord_Type.ToString() != "1")
- //{ StrWhere = " 主订单='" + Ord_Number + "'"; }
- //else
- //{ StrWhere = " 副订单='" + DeputyOrd_Number + "'"; }
- if (Ord_Type.ToString() != "1")
- { StrWhere = " Ordv_Number='" + Ord_Number + "'"; }
- else
- { StrWhere = " Ordv_ViceNumber='" + DeputyOrd_Number + "'"; }
- DataRow[] dtRows = dt_Level.Select(StrWhere);
- if (dtRows.Length > 0)
- {
- OneLevelCount = Convert.ToInt32(dtRows[0]["景点一级个数"]);
- TwoLevelCount = Convert.ToInt32(dtRows[0]["景点二级个数"]);
- ThreeLevelCount = Convert.ToInt32(dtRows[0]["景点三级个数"]);
- OrdPg_Photographer = dtRows[0]["主摄影师ID"].ToString();
- OrdPg_PhotographyAssistant = dtRows[0]["摄影助理ID"].ToString();
- OrdPg_MakeupArtist = dtRows[0]["主化妆ID"].ToString();
- OrdPg_MakeupAssistant = dtRows[0]["化妆助理ID"].ToString();
- Ordpg_BootDivision = dtRows[0]["引导师ID"].ToString();
- Ordpg_BootDivisionAssistant = dtRows[0]["引导助理ID"].ToString();
- }
- #region 摄影工资
- if (Post.ToString() == "主摄影师" || Post.ToString() == "摄影助理" || Post.ToString() == "主摄影选片二销" || Post.ToString() == "摄影助理选片二销")
- {
- //修改前 if ((OneLevelCount >= 1 && TwoLevelCount == 0 && ThreeLevelCount == 0) || (OneLevelCount == 0 && TwoLevelCount >= 1 && ThreeLevelCount == 0) || (OneLevelCount == 0 && TwoLevelCount == 0 && ThreeLevelCount >= 1))
- //刘工修改
- if ((OneLevelCount + TwoLevelCount + ThreeLevelCount) == 1)
- {
- #region 1.如果所以景点阶段都相同
- decimal Amount = 0;
- if (Post.ToString() == "主摄影师" || Post.ToString() == "主摄影选片二销")
- {
- OrdPg_Photographer = OrdPg_Photographer.TrimEnd(',');
- string[] OrdPg_Photographer_O = OrdPg_Photographer.Split(',');
- for (int t = 0; t < OrdPg_Photographer_O.Length; t++)
- {
- if (OrdPg_Photographer_O[t] == EmployeeName)
- {
- if (!string.IsNullOrEmpty(OrdPg_Photographer.ToString().TrimEnd(',')) && !string.IsNullOrEmpty(OrdPg_PhotographyAssistant.ToString().TrimEnd(',')))
- { Amount += (Pay_AmountOf * (MainPhotography / 100)) / OrdPg_Photographer_O.Length; }
- else
- { Amount += Pay_AmountOf / OrdPg_Photographer_O.Length; }
- }
- }
- }
- if (Post.ToString() == "摄影助理" || Post.ToString() == "摄影助理选片二销")
- {
- OrdPg_PhotographyAssistant = OrdPg_PhotographyAssistant.TrimEnd(',');
- string[] OrdPg_PhotographyAssistant_O = OrdPg_PhotographyAssistant.Split(',');
- for (int t = 0; t < OrdPg_PhotographyAssistant_O.Length; t++)
- {
- if (OrdPg_PhotographyAssistant_O[t] == EmployeeName)
- {
- if (!string.IsNullOrEmpty(OrdPg_Photographer.ToString().TrimEnd(',')) && !string.IsNullOrEmpty(OrdPg_PhotographyAssistant.ToString().TrimEnd(',')))
- { Amount += (Pay_AmountOf * (DeputyPhotography / 100)) / OrdPg_PhotographyAssistant_O.Length; }
- else
- { Amount += Pay_AmountOf / OrdPg_PhotographyAssistant_O.Length; }
- }
- }
- }
- this.dgv.Rows[i].Cells["Column3"].Value = Convert.ToDecimal(Amount).ToString("N2");
- #endregion
- }
- else
- {
- #region 2.如果等级不相同
- decimal Amount = 0;
- decimal Amount_A = 0;
- decimal Onej = 0;//一级景点工资
- decimal Twoj = 0; //二级景点工资
- decimal Threej = 0; //三级景点工资
- //获取景点等级总百分比
- decimal AttractionsPercentage = (OneLevelCount * OneLevel) + (TwoLevelCount * TwoLevel) + (ThreeLevelCount * ThreeLevel);
- if (AttractionsPercentage != 0)
- {
- Onej = Pay_AmountOf / AttractionsPercentage * OneLevel;
- Twoj = Pay_AmountOf / AttractionsPercentage * TwoLevel;
- Threej = Pay_AmountOf / AttractionsPercentage * ThreeLevel;
- }
- if (!string.IsNullOrEmpty(OrdPg_Photographer.ToString().TrimEnd(',')))
- {
- #region 主等于副
- if (OrdPg_Photographer.ToString().TrimEnd(',') == OrdPg_PhotographyAssistant.ToString().TrimEnd(','))
- {
- if (Post.ToString() == "主摄影师" || Post.ToString() == "主摄影选片二销")
- { Amount = (Pay_AmountOf * (MainPhotography / 100)); }
- if (Post.ToString() == "摄影助理" || Post.ToString() == "摄影助理选片二销")
- { Amount = (Pay_AmountOf * (DeputyPhotography / 100)); }
- }
- #endregion
- #region 副为空
- if (string.IsNullOrEmpty(OrdPg_PhotographyAssistant.ToString().TrimEnd(',')))
- {
- //按照景点等级比重
- if (Post.ToString() == "主摄影师" || Post.ToString() == "主摄影选片二销")
- {
- //获取摄影人员
- DataRow[] dtRow = null;
- if (Ord_Type.ToString() != "1")
- { dtRow = dt_Sights.Select("Ordpg_Number='" + Ord_Number + "' and Ordpg_Photographer = '" + EmployeeName + "'"); }
- else
- { dtRow = dt_Sights.Select("Ordpg_ViceNumber='" + DeputyOrd_Number + "' and Ordpg_Photographer = '" + EmployeeName + "'"); }
- if (dtRow != null)
- {
- for (int y = 0; y < dtRow.Length; y++)
- {
- OrdPg_SightsLevel = dtRow[y]["OrdPg_SightsLevel"].ToString();
- //一级
- if (OrdPg_SightsLevel == "BEBBBCADDEBFJDFFC")
- { Amount += Onej; }
- //二级
- if (OrdPg_SightsLevel == "BEBBBCADEGBGAFFJC")
- { Amount += Twoj; }
- //三级
- if (OrdPg_SightsLevel == "BEBBBCADAFBHBCHCI")
- { Amount += Threej; }
- }
- }
- }
- }
- #endregion
- #region 主副不为空并且不相等
- if ((!string.IsNullOrEmpty(OrdPg_Photographer.ToString().TrimEnd(',')) && !string.IsNullOrEmpty(OrdPg_PhotographyAssistant.ToString().TrimEnd(','))) && OrdPg_Photographer.ToString().TrimEnd(',') != OrdPg_PhotographyAssistant.ToString().TrimEnd(','))
- {
- #region 主
- if (Post.ToString() == "主摄影师" || Post.ToString() == "主摄影选片二销")
- {
- //获取摄影人员
- DataRow[] dtRow = null;
- if (Ord_Type.ToString() != "1")
- { dtRow = dt_Sights.Select("Ordpg_Number='" + Ord_Number + "' and Ordpg_Photographer = '" + EmployeeName + "'"); }
- else
- { dtRow = dt_Sights.Select("Ordpg_ViceNumber='" + DeputyOrd_Number + "' and Ordpg_Photographer = '" + EmployeeName + "'"); }
- if (dtRow != null)
- {
- Amount_A = Pay_AmountOf * (MainPhotography / 100);
- for (int y = 0; y < dtRow.Length; y++)
- {
- OrdPg_SightsLevel = dtRow[y]["OrdPg_SightsLevel"].ToString();
- if (AttractionsPercentage != 0)
- {
- //一级
- if (OrdPg_SightsLevel == "BEBBBCADDEBFJDFFC")
- { Amount += Amount_A / AttractionsPercentage * OneLevel; }
- //二级
- if (OrdPg_SightsLevel == "BEBBBCADEGBGAFFJC")
- { Amount += Amount_A / AttractionsPercentage * TwoLevel; }
- //三级
- if (OrdPg_SightsLevel == "BEBBBCADAFBHBCHCI")
- { Amount += Amount_A / AttractionsPercentage * ThreeLevel; }
- }
- }
- }
- }
- #endregion
- #region 副
- if (Post.ToString() == "摄影助理" || Post.ToString() == "摄影助理选片二销")
- {
- //获取摄影人员
- DataRow[] dtRow = null;
- if (Ord_Type.ToString() != "1")
- { dtRow = dt_Sights.Select("Ordpg_Number='" + Ord_Number + "' and Ordpg_PhotographyAssistant = '" + EmployeeName + "'"); }
- else
- { dtRow = dt_Sights.Select("Ordpg_ViceNumber='" + DeputyOrd_Number + "' and Ordpg_PhotographyAssistant = '" + EmployeeName + "'"); }
- if (dtRow != null)
- {
- Amount_A = Pay_AmountOf * (DeputyPhotography / 100);
- for (int y = 0; y < dtRow.Length; y++)
- {
- OrdPg_SightsLevel = dtRow[y]["OrdPg_SightsLevel"].ToString();
- if (AttractionsPercentage != 0)
- {
- //一级
- if (OrdPg_SightsLevel == "BEBBBCADDEBFJDFFC")
- { Amount += Amount_A / AttractionsPercentage * OneLevel; }
- //二级
- if (OrdPg_SightsLevel == "BEBBBCADEGBGAFFJC")
- { Amount += Amount_A / AttractionsPercentage * TwoLevel; }
- //三级
- if (OrdPg_SightsLevel == "BEBBBCADAFBHBCHCI")
- { Amount += Amount_A / AttractionsPercentage * ThreeLevel; }
- }
- }
- }
- }
- #endregion
- }
- #endregion
- }
- this.dgv.Rows[i].Cells["Column3"].Value = Convert.ToDecimal(Amount).ToString("N2");
- #endregion
- }
- }
- #endregion
- #region 化妆工资
- if (Post.ToString() == "主化妆师" || Post.ToString() == "化妆助理" || Post.ToString() == "主化妆选片二销" || Post.ToString() == "化妆助理选片二销")
- {
- //修改前 if ((OneLevelCount >= 1 && TwoLevelCount == 0 && ThreeLevelCount == 0) || (OneLevelCount == 0 && TwoLevelCount >= 1 && ThreeLevelCount == 0) || (OneLevelCount == 0 && TwoLevelCount == 0 && ThreeLevelCount >= 1))
- //刘工修改
- if ((OneLevelCount + TwoLevelCount + ThreeLevelCount) == 1)
- {
- #region 1.如果所以景点阶段都相同
- decimal Amount = 0;
- if (Post.ToString() == "主化妆师" || Post.ToString() == "主化妆选片二销")
- {
- OrdPg_MakeupArtist = OrdPg_MakeupArtist.TrimEnd(',');
- string[] OrdPg_MakeupArtist_O = OrdPg_MakeupArtist.Split(',');
- for (int t = 0; t < OrdPg_MakeupArtist_O.Length; t++)
- {
- if (OrdPg_MakeupArtist_O[t] == EmployeeName)
- {
- if (!string.IsNullOrEmpty(OrdPg_MakeupArtist.ToString().TrimEnd(',')) && !string.IsNullOrEmpty(OrdPg_MakeupAssistant.ToString().TrimEnd(',')))
- { Amount += (Pay_AmountOf * (MainMake / 100)) / OrdPg_MakeupArtist_O.Length; }
- else
- { Amount += Pay_AmountOf / OrdPg_MakeupArtist_O.Length; }
- }
- }
- }
- if (Post.ToString() == "化妆助理" || Post.ToString() == "化妆助理选片二销")
- {
- OrdPg_MakeupAssistant = OrdPg_MakeupAssistant.TrimEnd(',');
- string[] OrdPg_MakeupAssistant_O = OrdPg_MakeupAssistant.Split(',');
- for (int t = 0; t < OrdPg_MakeupAssistant_O.Length; t++)
- {
- if (OrdPg_MakeupAssistant_O[t] == EmployeeName)
- {
- if (!string.IsNullOrEmpty(OrdPg_MakeupArtist.ToString().TrimEnd(',')) && !string.IsNullOrEmpty(OrdPg_MakeupAssistant.ToString().TrimEnd(',')))
- { Amount += (Pay_AmountOf * (DeputyMake / 100)) / OrdPg_MakeupAssistant_O.Length; }
- else
- { Amount += Pay_AmountOf / OrdPg_MakeupAssistant_O.Length; }
- }
- }
- }
- this.dgv.Rows[i].Cells["Column3"].Value = Convert.ToDecimal(Amount).ToString("N2");
- #endregion
- }
- else
- {
- #region 2.如果等级不相同
- decimal Amount = 0;
- decimal Amount_A = 0;
- decimal Onej = 0;//一级景点工资
- decimal Twoj = 0; //二级景点工资
- decimal Threej = 0; //三级景点工资
- //获取景点等级总百分比
- decimal AttractionsPercentage = (OneLevelCount * OneLevel) + (TwoLevelCount * TwoLevel) + (ThreeLevelCount * ThreeLevel);
- if (AttractionsPercentage != 0)
- {
- Onej = Pay_AmountOf / AttractionsPercentage * OneLevel;
- Twoj = Pay_AmountOf / AttractionsPercentage * TwoLevel;
- Threej = Pay_AmountOf / AttractionsPercentage * ThreeLevel;
- }
- if (!string.IsNullOrEmpty(OrdPg_MakeupArtist.ToString().TrimEnd(',')))
- {
- #region 主等于副
- if (OrdPg_MakeupArtist.ToString().TrimEnd(',') == OrdPg_MakeupAssistant.ToString().TrimEnd(','))
- {
- if (Post.ToString() == "主化妆师" || Post.ToString() == "主化妆选片二销")
- { Amount = (Pay_AmountOf * (MainMake / 100)); }
- if (Post.ToString() == "化妆助理" || Post.ToString() == "化妆助理选片二销")
- { Amount = (Pay_AmountOf * (DeputyMake / 100)); }
- }
- #endregion
- #region 副为空
- if (string.IsNullOrEmpty(OrdPg_MakeupAssistant.ToString().TrimEnd(',')))
- {
- //按照景点等级比重
- if (Post.ToString() == "主化妆师" || Post.ToString() == "主化妆选片二销")
- {
- //获取化妆人员
- DataRow[] dtRow = null;
- if (Ord_Type.ToString() != "1")
- { dtRow = dt_Sights.Select("Ordpg_Number='" + Ord_Number + "' and Ordpg_MakeupArtist = '" + EmployeeName + "'"); }
- else
- { dtRow = dt_Sights.Select("Ordpg_ViceNumber='" + DeputyOrd_Number + "' and Ordpg_MakeupArtist = '" + EmployeeName + "'"); }
- if (dtRow != null)
- {
- for (int y = 0; y < dtRow.Length; y++)
- {
- OrdPg_SightsLevel = dtRow[y]["OrdPg_SightsLevel"].ToString();
- //一级
- if (OrdPg_SightsLevel == "BEBBBCADDEBFJDFFC")
- { Amount += Onej; }
- //二级
- if (OrdPg_SightsLevel == "BEBBBCADEGBGAFFJC")
- { Amount += Twoj; }
- //三级
- if (OrdPg_SightsLevel == "BEBBBCADAFBHBCHCI")
- { Amount += Threej; }
- }
- }
- }
- }
- #endregion
- #region 主副不为空并且不相等
- if ((!string.IsNullOrEmpty(OrdPg_MakeupArtist.ToString().TrimEnd(',')) && !string.IsNullOrEmpty(OrdPg_MakeupAssistant.ToString().TrimEnd(','))) && OrdPg_MakeupArtist.ToString().TrimEnd(',') != OrdPg_MakeupAssistant.ToString().TrimEnd(','))
- {
- #region 主
- if (Post.ToString() == "主化妆师" || Post.ToString() == "主化妆选片二销")
- {
- //获取摄影人员
- DataRow[] dtRow = null;
- if (Ord_Type.ToString() != "1")
- { dtRow = dt_Sights.Select("Ordpg_Number='" + Ord_Number + "' and Ordpg_MakeupArtist = '" + EmployeeName + "'"); }
- else
- { dtRow = dt_Sights.Select("Ordpg_ViceNumber='" + DeputyOrd_Number + "' and Ordpg_MakeupArtist = '" + EmployeeName + "'"); }
- if (dtRow != null)
- {
- Amount_A = Pay_AmountOf * (MainMake / 100);
- for (int y = 0; y < dtRow.Length; y++)
- {
- OrdPg_SightsLevel = dtRow[y]["OrdPg_SightsLevel"].ToString();
- if (AttractionsPercentage != 0)
- {
- //一级
- if (OrdPg_SightsLevel == "BEBBBCADDEBFJDFFC")
- { Amount += Amount_A / AttractionsPercentage * OneLevel; }
- //二级
- if (OrdPg_SightsLevel == "BEBBBCADEGBGAFFJC")
- { Amount += Amount_A / AttractionsPercentage * TwoLevel; }
- //三级
- if (OrdPg_SightsLevel == "BEBBBCADAFBHBCHCI")
- { Amount += Amount_A / AttractionsPercentage * ThreeLevel; }
- }
- }
- }
- }
- #endregion
- #region 副
- if (Post.ToString() == "化妆助理" || Post.ToString() == "化妆助理选片二销")
- {
- //获取摄影人员
- DataRow[] dtRow = null;
- if (Ord_Type.ToString() != "1")
- { dtRow = dt_Sights.Select("Ordpg_Number='" + Ord_Number + "' and Ordpg_MakeupAssistant = '" + EmployeeName + "'"); }
- else
- { dtRow = dt_Sights.Select("Ordpg_ViceNumber='" + DeputyOrd_Number + "' and Ordpg_MakeupAssistant = '" + EmployeeName + "'"); }
- if (dtRow != null)
- {
- Amount_A = Pay_AmountOf * (DeputyMake / 100);
- for (int y = 0; y < dtRow.Length; y++)
- {
- OrdPg_SightsLevel = dtRow[y]["OrdPg_SightsLevel"].ToString();
- if (AttractionsPercentage != 0)
- {
- //一级
- if (OrdPg_SightsLevel == "BEBBBCADDEBFJDFFC")
- { Amount += Amount_A / AttractionsPercentage * OneLevel; }
- //二级
- if (OrdPg_SightsLevel == "BEBBBCADEGBGAFFJC")
- { Amount += Amount_A / AttractionsPercentage * TwoLevel; }
- //三级
- if (OrdPg_SightsLevel == "BEBBBCADAFBHBCHCI")
- { Amount += Amount_A / AttractionsPercentage * ThreeLevel; }
- }
- }
- }
- }
- #endregion
- }
- #endregion
- }
- this.dgv.Rows[i].Cells["Column3"].Value = Convert.ToDecimal(Amount).ToString("N2");
- #endregion
- }
- }
- #endregion
- #region 引导工资
- if (Post.ToString() == "引导师" || Post.ToString() == "引导助理" || Post.ToString() == "引导选片二销" || Post.ToString() == "引导助理选片二销")
- {
- //修改前 if ((OneLevelCount >= 1 && TwoLevelCount == 0 && ThreeLevelCount == 0) || (OneLevelCount == 0 && TwoLevelCount >= 1 && ThreeLevelCount == 0) || (OneLevelCount == 0 && TwoLevelCount == 0 && ThreeLevelCount >= 1))
- //刘工修改
- if ((OneLevelCount + TwoLevelCount + ThreeLevelCount) == 1)
- {
- #region 1.如果所以景点阶段都相同
- decimal Amount = 0;
- if (Post.ToString() == "引导师" || Post.ToString() == "引导选片二销")
- {
- Ordpg_BootDivision = Ordpg_BootDivision.TrimEnd(',');
- string[] OrdPg_MakeupArtist_O = Ordpg_BootDivision.Split(',');
- for (int t = 0; t < OrdPg_MakeupArtist_O.Length; t++)
- {
- if (OrdPg_MakeupArtist_O[t] == EmployeeName)
- {
- if (!string.IsNullOrEmpty(Ordpg_BootDivision.ToString().TrimEnd(',')) && !string.IsNullOrEmpty(Ordpg_BootDivisionAssistant.ToString().TrimEnd(',')))
- { Amount += (Pay_AmountOf * (MainBootDivision / 100)) / OrdPg_MakeupArtist_O.Length; }
- else
- { Amount += Pay_AmountOf / OrdPg_MakeupArtist_O.Length; }
- }
- }
- }
- if (Post.ToString() == "引导助理" || Post.ToString() == "引导助理选片二销")
- {
- Ordpg_BootDivisionAssistant = Ordpg_BootDivisionAssistant.TrimEnd(',');
- string[] OrdPg_MakeupAssistant_O = Ordpg_BootDivisionAssistant.Split(',');
- for (int t = 0; t < OrdPg_MakeupAssistant_O.Length; t++)
- {
- if (OrdPg_MakeupAssistant_O[t] == EmployeeName)
- {
- if (!string.IsNullOrEmpty(Ordpg_BootDivision.ToString().TrimEnd(',')) && !string.IsNullOrEmpty(Ordpg_BootDivisionAssistant.ToString().TrimEnd(',')))
- { Amount += (Pay_AmountOf * (DeputyBootDivision / 100)) / OrdPg_MakeupAssistant_O.Length; }
- else
- { Amount += Pay_AmountOf / OrdPg_MakeupAssistant_O.Length; }
- }
- }
- }
- this.dgv.Rows[i].Cells["Column3"].Value = Convert.ToDecimal(Amount).ToString("N2");
- #endregion
- }
- else
- {
- #region 2.如果等级不相同
- decimal Amount = 0;
- decimal Amount_A = 0;
- decimal Onej = 0;//一级景点工资
- decimal Twoj = 0; //二级景点工资
- decimal Threej = 0; //三级景点工资
- //获取景点等级总百分比
- decimal AttractionsPercentage = (OneLevelCount * OneLevel) + (TwoLevelCount * TwoLevel) + (ThreeLevelCount * ThreeLevel);
- if (AttractionsPercentage != 0)
- {
- Onej = Pay_AmountOf / AttractionsPercentage * OneLevel;
- Twoj = Pay_AmountOf / AttractionsPercentage * TwoLevel;
- Threej = Pay_AmountOf / AttractionsPercentage * ThreeLevel;
- }
- if (!string.IsNullOrEmpty(Ordpg_BootDivision.ToString().TrimEnd(',')))
- {
- #region 主等于副
- if (Ordpg_BootDivision.ToString().TrimEnd(',') == Ordpg_BootDivisionAssistant.ToString().TrimEnd(','))
- {
- if (Post.ToString() == "引导师" || Post.ToString() == "引导选片二销")
- { Amount = (Pay_AmountOf * (MainBootDivision / 100)); }
- if (Post.ToString() == "引导助理" || Post.ToString() == "引导助理选片二销")
- { Amount = (Pay_AmountOf * (DeputyBootDivision / 100)); }
- }
- #endregion
- #region 副为空
- if (string.IsNullOrEmpty(Ordpg_BootDivisionAssistant.ToString().TrimEnd(',')))
- {
- //按照景点等级比重
- if (Post.ToString() == "引导师" || Post.ToString() == "引导选片二销")
- {
- //获取化妆人员
- DataRow[] dtRow = null;
- if (Ord_Type.ToString() != "1")
- { dtRow = dt_Sights.Select("Ordpg_Number='" + Ord_Number + "' and Ordpg_BootDivision = '" + EmployeeName + "'"); }
- else
- { dtRow = dt_Sights.Select("Ordpg_ViceNumber='" + DeputyOrd_Number + "' and Ordpg_BootDivision = '" + EmployeeName + "'"); }
- if (dtRow != null)
- {
- for (int y = 0; y < dtRow.Length; y++)
- {
- OrdPg_SightsLevel = dtRow[y]["OrdPg_SightsLevel"].ToString();
- //一级
- if (OrdPg_SightsLevel == "BEBBBCADDEBFJDFFC")
- { Amount += Onej; }
- //二级
- if (OrdPg_SightsLevel == "BEBBBCADEGBGAFFJC")
- { Amount += Twoj; }
- //三级
- if (OrdPg_SightsLevel == "BEBBBCADAFBHBCHCI")
- { Amount += Threej; }
- }
- }
- }
- }
- #endregion
- #region 主副不为空并且不相等
- if ((!string.IsNullOrEmpty(Ordpg_BootDivision.ToString().TrimEnd(',')) && !string.IsNullOrEmpty(Ordpg_BootDivisionAssistant.ToString().TrimEnd(','))) && Ordpg_BootDivision.ToString().TrimEnd(',') != Ordpg_BootDivisionAssistant.ToString().TrimEnd(','))
- {
- #region 主
- if (Post.ToString() == "引导师" || Post.ToString() == "引导选片二销")
- {
- //获取摄影人员
- DataRow[] dtRow = null;
- if (Ord_Type.ToString() != "1")
- { dtRow = dt_Sights.Select("Ordpg_Number='" + Ord_Number + "' and Ordpg_BootDivision = '" + EmployeeName + "'"); }
- else
- { dtRow = dt_Sights.Select("Ordpg_ViceNumber='" + DeputyOrd_Number + "' and Ordpg_BootDivision = '" + EmployeeName + "'"); }
- if (dtRow != null)
- {
- Amount_A = Pay_AmountOf * (MainBootDivision / 100);
- for (int y = 0; y < dtRow.Length; y++)
- {
- OrdPg_SightsLevel = dtRow[y]["OrdPg_SightsLevel"].ToString();
- if (AttractionsPercentage != 0)
- {
- //一级
- if (OrdPg_SightsLevel == "BEBBBCADDEBFJDFFC")
- { Amount += Amount_A / AttractionsPercentage * OneLevel; }
- //二级
- if (OrdPg_SightsLevel == "BEBBBCADEGBGAFFJC")
- { Amount += Amount_A / AttractionsPercentage * TwoLevel; }
- //三级
- if (OrdPg_SightsLevel == "BEBBBCADAFBHBCHCI")
- { Amount += Amount_A / AttractionsPercentage * ThreeLevel; }
- }
- }
- }
- }
- #endregion
- #region 副
- if (Post.ToString() == "引导助理" || Post.ToString() == "引导助理选片二销")
- {
- //获取摄影人员
- DataRow[] dtRow = null;
- if (Ord_Type.ToString() != "1")
- { dtRow = dt_Sights.Select("Ordpg_Number='" + Ord_Number + "' and Ordpg_BootDivisionAssistant = '" + EmployeeName + "'"); }
- else
- { dtRow = dt_Sights.Select("Ordpg_ViceNumber='" + DeputyOrd_Number + "' and Ordpg_BootDivisionAssistant = '" + EmployeeName + "'"); }
- if (dtRow != null)
- {
- Amount_A = Pay_AmountOf * (DeputyBootDivision / 100);
- for (int y = 0; y < dtRow.Length; y++)
- {
- OrdPg_SightsLevel = dtRow[y]["OrdPg_SightsLevel"].ToString();
- if (AttractionsPercentage != 0)
- {
- //一级
- if (OrdPg_SightsLevel == "BEBBBCADDEBFJDFFC")
- { Amount += Amount_A / AttractionsPercentage * OneLevel; }
- //二级
- if (OrdPg_SightsLevel == "BEBBBCADEGBGAFFJC")
- { Amount += Amount_A / AttractionsPercentage * TwoLevel; }
- //三级
- if (OrdPg_SightsLevel == "BEBBBCADAFBHBCHCI")
- { Amount += Amount_A / AttractionsPercentage * ThreeLevel; }
- }
- }
- }
- }
- #endregion
- }
- #endregion
- }
- this.dgv.Rows[i].Cells["Column3"].Value = Convert.ToDecimal(Amount).ToString("N2");
- #endregion
- }
- }
- #endregion
- #endregion
- }
- }
- }
- #endregion
- #region 计件提成
- object ItemName = this.dgv.Rows[i].Cells["Column5"].Value;
- if (ItemName != null)
- {
- if (ItemName.ToString().Trim() == "/计件提成")
- { PieceCommission += Convert.ToDecimal(this.dgv.Rows[i].Cells["Column3"].Value); }
- else
- { CurrentPerformance += Convert.ToDecimal(this.dgv.Rows[i].Cells["Column3"].Value); }
- }
- #endregion
- }
- //当前业绩
- Sum = Convert.ToDecimal(CurrentPerformance);
- // 计件提成
- this.txtPieceCommission.Text = Convert.ToDecimal(PieceCommission).ToString("N2");
- }
- else
- {
- this.txtCurrentPerformance.Text = "0.00";
- this.txtPieceCommission.Text = "0.00";
- }
- }));
- #endregion
- return Sum;
- }
- /// <summary>
- /// 绑定业绩列表查询方法1(全部收款记录)
- /// </summary>
- /// <param name="IsQuery"></param>
- /// <returns></returns>
- public string BindSelect1(ref bool IsQuery)
- {
- StringBuilder str = new StringBuilder();
- if (!string.IsNullOrEmpty(Str_CustomerSource.Trim()) && Str_CustomerSourceTag != null)
- { str.Append(" and 客户来源='" + Str_CustomerSource.Trim() + "'"); }
- if (!string.IsNullOrEmpty(Str_PakName.Trim()) && Str_PakNameTag != null)
- { str.Append(" and 订单类别='" + Str_PakName.Trim() + "'"); }
- if (this.Str_ProjectTitle.Trim() != "选片二销")
- {
- if (!string.IsNullOrEmpty(this.Str_AmountRange1.Trim()))
- { str.Append(" and (应收金额>=" + this.Str_AmountRange1.Trim() + " and 应收金额<=" + this.Str_AmountRange2.Trim() + ")"); }
- }
- // 订单前期
- if (this.Str_ItemCategory.Trim() == "订单前期")
- {
- if (!string.IsNullOrEmpty(this.Str_ProjectTitle.Trim()))
- {
- if (this.Str_ProjectTitle.Trim() == "实收")
- { str.Append(" and 收款类别 <> '后期收款'"); }
- if (this.Str_ProjectTitle.Trim() == "全款")
- { str.Append(" and 应收金额 = 前期实收金额"); }
- }
- str.Append(" and 收款类别 <> '后期收款'");
- }
- // 订单后期
- if (this.Str_ItemCategory.Trim() == "订单后期")
- {
- if (!string.IsNullOrEmpty(this.Str_ProjectTitle.Trim()))
- {
- if (!string.IsNullOrEmpty(this.Str_AmountRange1.Trim()))
- {
- if (this.Str_ProjectTitle.Trim() == "选片二销")
- { str.Append(" and (收款金额>=" + this.Str_AmountRange1.Trim() + " and 收款金额<=" + this.Str_AmountRange2.Trim() + ")"); }
- }
- str.Append(" and 二销类别编号='" + this.Str_ProjectTitleTag.ToString().Trim() + "'");
- }
- str.Append(" and 收款类别='后期收款' and 收款类型=0");
- }
- // 其它消费
- if (this.Str_ItemCategory.Trim() == "其它消费")
- {
- if (!string.IsNullOrEmpty(this.Str_ProjectTitle.Trim()))
- { str.Append(" and 二销类别编号='" + this.Str_ProjectTitleTag.ToString().Trim() + "'"); }
- str.Append(" and 收款类型=1");
- }
- if (this.Str_ItemCategory.Trim() == "礼服租售")
- { str.Append(" and 收款类型 = '2' "); }
- // 其它
- //if (this.Str_ItemCategory.Trim() == "会员充值")
- //{ str.Append(" and id=-3"); }
- //if (this.Str_ItemCategory.Trim() == "服务卡充值")
- //{ str.Append(" and id=-3"); }
- //if (this.Str_ItemCategory.Trim() == "礼服租售")
- //{ str.Append(" and id=-3"); }
- //if (this.Str_ItemCategory.Trim() == "计件提成")
- //{ str.Append(" and id=-3"); }
- switch (this.Str_ItemCategory.Trim())
- {
- case "会员充值":
- case "服务卡充值":
- //case "礼服租售":
- case "计件提成":
- IsQuery = false;
- break;
- default:
- IsQuery = true;
- break;
- }
- return str.ToString();
- }
- /// <summary>
- /// 绑定业绩列表查询方法2
- /// </summary>
- /// <param name="IsQuery"></param>
- /// <returns></returns>
- public string BindSelect2(ref bool IsQuery)
- {
- if (!string.IsNullOrEmpty(this.Str_CustomerSource.Trim()) || (!string.IsNullOrEmpty(this.Str_PakName.Trim()) && this.Str_PakNameTag != null) || !string.IsNullOrEmpty(this.Str_ProcessStatus.Trim()) || (!string.IsNullOrEmpty(this.Str_ItemCategory.Trim()) && this.Str_ItemCategory.Trim() != "会员充值"))
- { IsQuery = false; }
- else
- { IsQuery = true; }
- StringBuilder str = new StringBuilder();
- if (!string.IsNullOrEmpty(this.Str_AmountRange1.Trim()))
- { str.Append(" and 充值金额 >= " + this.Str_AmountRange1.Trim() + " and 充值金额 <= " + this.Str_AmountRange2.Trim() + ""); }
- return str.ToString();
- //StringBuilder str = new StringBuilder();
- //if (!string.IsNullOrEmpty(this.Str_CustomerSource.Trim()))
- //{ str.Append(" and id = -3"); }
- //if (!string.IsNullOrEmpty(this.Str_PakName.Trim()) && this.Str_PakNameTag != null)
- //{ str.Append(" and id = -3"); }
- //if (!string.IsNullOrEmpty(this.Str_AmountRange1.Trim()))
- //{ str.Append(" and 充值金额 >= " + this.Str_AmountRange1.Trim() + " and 充值金额 <= " + this.Str_AmountRange2.Trim() + ""); }
- //if (!string.IsNullOrEmpty(this.Str_ProcessStatus.Trim()))
- //{ str.Append(" and id = -3"); }
- //// 会员充值
- //if (!string.IsNullOrEmpty(this.Str_ItemCategory.Trim()))
- //{
- // if (this.Str_ItemCategory.Trim() != "会员充值")
- // { str.Append("and id = -3"); }
- //}
- //return str.ToString();
- }
- /// <summary>
- /// 绑定业绩列表查询方法3(服务卡)
- /// </summary>
- /// <param name="IsQuery"></param>
- /// <returns></returns>
- public string BindSelect3(ref bool IsQuery)
- {
- if (!string.IsNullOrEmpty(this.Str_CustomerSource.Trim()) || (!string.IsNullOrEmpty(this.Str_PakName.Trim()) && this.Str_PakNameTag != null) || !string.IsNullOrEmpty(this.Str_ProcessStatus.Trim()) || (!string.IsNullOrEmpty(this.Str_ItemCategory.Trim()) && this.Str_ItemCategory.Trim() != "服务卡充值"))
- { IsQuery = false; }
- else
- { IsQuery = true; }
- StringBuilder str = new StringBuilder();
- if (!string.IsNullOrEmpty(this.Str_AmountRange1.Trim()))
- { str.Append(" and 收款金额 >= " + this.Str_AmountRange1.Trim() + " and 收款金额 <= " + this.Str_AmountRange2.Trim() + ""); }
- return str.ToString();
- //StringBuilder str = new StringBuilder();
- //if (!string.IsNullOrEmpty(cmbCustomerSource.Text.Trim()))
- //{ str.Append(" and id=-3"); }
- //if (!string.IsNullOrEmpty(CtvPak_Name.Text.Trim()) && CtvPak_Name.Tag != null)
- //{ str.Append(" and id=-3"); }
- //if (!string.IsNullOrEmpty(txtAmountRange1.Text))
- //{ str.Append(" and 收款金额>=" + txtAmountRange1.Text.Trim() + " and 收款金额<=" + txtAmountRange2.Text.Trim() + ""); }
- //if (!string.IsNullOrEmpty(cmbProcessStatus.Text.Trim()))
- //{ str.Append(" and id=-3"); }
- //// 会员充值
- //if (!string.IsNullOrEmpty(cmbItemCategory.Text.Trim()))
- //{
- // if (cmbItemCategory.Text.Trim() != "服务卡充值")
- // { str.Append("and id=-3"); }
- //}
- //return str.ToString();
- }
- /// <summary>
- /// 绑定业绩列表查询方法4(计件)
- /// </summary>
- /// <param name="IsQuery"></param>
- /// <returns></returns>
- public string BindSelect4(ref bool IsQuery)
- {
- if (!string.IsNullOrEmpty(this.Str_CustomerSource.Trim()) || !string.IsNullOrEmpty(this.Str_ProcessStatus.Trim()) || (!string.IsNullOrEmpty(this.Str_ItemCategory.Trim()) && this.Str_ItemCategory.Trim() != "计件提成"))
- { IsQuery = false; }
- else
- { IsQuery = true; }
- StringBuilder str = new StringBuilder();
- if (!string.IsNullOrEmpty(this.Str_PakName.Trim()) && this.Str_PakNameTag != null)
- { str.Append(" and Ord_SeriesName = '" + this.Str_PakName.Trim() + "'"); }
- if (!string.IsNullOrEmpty(this.Str_AmountRange1.Trim()))
- { str.Append(" and 总价格 >= " + this.Str_AmountRange1.Trim() + " and 总价格 <= " + this.Str_AmountRange2.Trim() + ""); }
- // 计件
- if (!string.IsNullOrEmpty(this.Str_ItemCategory.Trim()))
- {
- if (this.Str_ItemCategory.Trim() == "计件提成")
- {
- if (!string.IsNullOrEmpty(this.Str_ProjectTitle.Trim()))
- { str.Append(" and Pcr_CompletionContents = '" + this.Str_ProjectTitleTag + "'"); }
- }
- }
- return str.ToString();
- //StringBuilder str = new StringBuilder();
- //if (!string.IsNullOrEmpty(cmbCustomerSource.Text.Trim()))
- //{ str.Append(" and id=-3"); }
- //if (!string.IsNullOrEmpty(CtvPak_Name.Text.Trim()) && CtvPak_Name.Tag != null)
- //{ str.Append(" and Ord_SeriesName='" + CtvPak_Name.Text.Trim() + "'"); }
- //if (!string.IsNullOrEmpty(txtAmountRange1.Text))
- //{ str.Append(" and 总价格>=" + txtAmountRange1.Text.Trim() + " and 总价格<=" + txtAmountRange2.Text.Trim() + ""); }
- //if (!string.IsNullOrEmpty(cmbProcessStatus.Text.Trim()))
- //{ str.Append(" and id=-3"); }
- //// 计件
- //if (!string.IsNullOrEmpty(cmbItemCategory.Text.Trim()))
- //{
- // if (cmbItemCategory.Text.Trim() == "计件提成")
- // {
- // if (!string.IsNullOrEmpty(cmbProjectTitle.Text.Trim()))
- // { str.Append(" and Pcr_CompletionContents='" + cmbProjectTitle.Tag + "'"); }
- // }
- // else
- // { str.Append("and id=-3"); }
- //}
- //return str.ToString();
- }
- /// <summary>
- /// 绑定业绩列表查询方法5(拍照)
- /// </summary>
- /// <returns></returns>
- public string BindSelect5()
- {
- StringBuilder str = new StringBuilder();
- if (!string.IsNullOrEmpty(this.Str_CustomerSource.Trim()) && this.Str_CustomerSourceTag != null)
- { str.Append(" and 客户来源 = '" + this.Str_CustomerSource.Trim() + "'"); }
- if (!string.IsNullOrEmpty(this.Str_PakName.Trim()) && this.Str_PakNameTag != null)
- { str.Append(" and 订单类别 = '" + this.Str_PakName.Trim() + "'"); }
- if (!string.IsNullOrEmpty(this.Str_AmountRange1.Trim()))
- { str.Append(" and 应收金额 >= " + this.Str_AmountRange1.Trim() + " and 应收金额 <= " + this.Str_AmountRange2.Trim() + ""); }
- return str.ToString();
- }
- /// <summary>
- /// 统计业绩
- /// </summary>
- public void TotalPerformance()
- {
- DataTable dt = new DataTable();
- this.dgvAll.Rows.Clear();
- string StrWhere = "";
- if (this.cmbEmployeeName.StrGetName.ToString() == "Department")
- { StrWhere = " And User_Department = '" + this.cmbEmployeeName.Tag.ToString().Trim() + "'"; }
- else if (this.cmbEmployeeName.StrGetName.ToString() == "StoreName")
- { StrWhere = " And User_DividedShop = '" + this.cmbEmployeeName.Tag.ToString().Trim() + "'"; }
- string StrTimeStart = this.txtTimeStart.DateValue.ToString().Trim();
- string StrTimeEnd = this.txtTimeEnd.DateValue.ToString().Trim();
- LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate(object obj, BackgroundWorker backgroundWorker)
- {
- dt = orbll.GetView_Custom("tb_ErpUser", StrWhere: "User_Status='在职'" + StrWhere, ShowColumnName: "User_Name,User_EmployeeID").Tables[0];
- for (int t = 0; t < dt.Rows.Count; t++)
- {
- DataGridViewRow dgvr = new DataGridViewRow();
- DataGridViewCell cell = null;
- //员工编号
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["User_EmployeeID"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //员工姓名
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["User_Name"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //当前业绩
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDecimal(BindPerformance(StrTimeStart, StrTimeEnd, dt.Rows[t]["User_EmployeeID"].ToString().Trim(), backgroundWorker)).ToString();
- dgvr.Cells.Add(cell);
- this.Invoke(new UpdateControl(delegate()
- {
- this.dgvAll.Rows.Add(dgvr);
- }));
- }
- });
- }
- /// <summary>
- /// 获取业绩个数
- /// </summary>
- /// <param name="Ord_OrdersPersonID"></param>
- /// <param name="StartTime"></param>
- /// <param name="EndTime"></param>
- /// <returns></returns>
- public string GetNumberOfResults(string Ord_OrdersPersonID, string StartTime, string EndTime)
- {
- //DataTable dt = new DataTable();
- //int OrderCount = 0;
- //int PhotographyCount = 0;
- //int PhotographyAssistantCount = 0;
- //int MakeUpCount = 0;
- //int MakeUpAssistantCount = 0;
- //int GuideCount = 0;
- //int FirstRepairCount = 0;
- //int RefinementCount = 0;
- //int DesignCount = 0;
- Hashtable htDataOrder = new Hashtable();
- Hashtable htDataPhotography = new Hashtable();
- Hashtable htDataPhotographyAssistant = new Hashtable();
- Hashtable htDataMakeUp = new Hashtable();
- Hashtable htDataMakeUpAssistant = new Hashtable();
- Hashtable htDataGuide = new Hashtable();
- Hashtable htDataGuideAssistant = new Hashtable();
- Hashtable htDataFirstRepair = new Hashtable();
- Hashtable htDataRefinement = new Hashtable();
- Hashtable htDataDesign = new Hashtable();
- #region 获取订单数
- //dt = orbll.GetView_Custom("Vw_Customer_PaymentOrders", StrWhere: "Ord_OrdersPersonID like '%" + Ord_OrdersPersonID + "%' and Ord_Class=1 and Ord_CreateDatetime>='" + StartTime + "' and Ord_CreateDatetime<='" + EndTime + "' ", ShowColumnName: "ID").Tables[0];
- //if (dt.Rows.Count > 0)
- //{ OrderCount = dt.Rows.Count; }
- this.Invoke(new UpdateControl(delegate()
- {
- for (int i = 0; i < this.dgv.Rows.Count; i++)
- {
- if (this.dgv.Rows[i].Cells["Column18"].Value != null && !string.IsNullOrEmpty(this.dgv.Rows[i].Cells["Column18"].Value.ToString().Trim()))
- {
- string StrKeys = this.dgv.Rows[i].Cells["Column1"].Value.ToString().Trim() + this.dgv.Rows[i].Cells["Column17"].Value.ToString().Trim();
- switch (this.dgv.Rows[i].Cells["Column17"].Value.ToString().Trim())
- {
- case "主接单人":
- case "副接单人":
- case "门市选片二销":
- if (!htDataOrder.ContainsKey(StrKeys))
- { htDataOrder[StrKeys] = 1; }
- break;
- case "主摄影师":
- case "主摄影选片二销":
- if (!htDataPhotography.ContainsKey(StrKeys))
- { htDataPhotography[StrKeys] = 1; }
- break;
- case "摄影助理":
- case "摄影助理选片二销":
- if (!htDataPhotographyAssistant.ContainsKey(StrKeys))
- { htDataPhotographyAssistant[StrKeys] = 1; }
- break;
- case "主化妆师":
- case "主化妆选片二销":
- if (!htDataMakeUp.ContainsKey(StrKeys))
- { htDataMakeUp[StrKeys] = 1; }
- break;
- case "化妆助理":
- case "化妆助理选片二销":
- if (!htDataMakeUpAssistant.ContainsKey(StrKeys))
- { htDataMakeUpAssistant[StrKeys] = 1; }
- break;
- case "引导师":
- case "引导选片二销":
- if (!htDataGuide.ContainsKey(StrKeys))
- { htDataGuide[StrKeys] = 1; }
- break;
- case "引导助理":
- case "引导助理选片二销":
- if (!htDataGuideAssistant.ContainsKey(StrKeys))
- { htDataGuideAssistant[StrKeys] = 1; }
- break;
- case "初修师":
- case "初修师选片二销":
- if (!htDataFirstRepair.ContainsKey(StrKeys))
- { htDataFirstRepair[StrKeys] = 1; }
- break;
- case "精修师":
- case "精修师选片二销":
- if (!htDataRefinement.ContainsKey(StrKeys))
- { htDataRefinement[StrKeys] = 1; }
- break;
- case "设计师":
- case "设计师选片二销":
- if (!htDataDesign.ContainsKey(StrKeys))
- { htDataDesign[StrKeys] = 1; }
- break;
- }
- }
- }
- }));
- #endregion
- #region 摄影师个数
- //dt = new DataTable();
- //dt = orbll.GetView_Custom("Vw_OrdersWagePhotography", StrWhere: "摄影师ID like '%" + Ord_OrdersPersonID + "%' and Ord_Class=1 and 拍摄状态=1 and 拍摄时间>='" + StartTime + "' and 拍摄时间<='" + EndTime + "' ", ShowColumnName: "ID").Tables[0];
- //if (dt.Rows.Count > 0)
- //{
- // PhotographyCount = dt.Rows.Count;
- //}
- #endregion
- #region 摄影助理个数
- //dt = new DataTable();
- //dt = orbll.GetView_Custom("Vw_OrdersWagePhotography", StrWhere: "摄影助理ID like '%" + Ord_OrdersPersonID + "%' and Ord_Class=1 and 拍摄状态=1 and 拍摄时间>='" + StartTime + "' and 拍摄时间<='" + EndTime + "' ", ShowColumnName: "ID").Tables[0];
- //if (dt.Rows.Count > 0)
- //{ PhotographyAssistantCount = dt.Rows.Count; }
- #endregion
- #region 化妆师个数
- //dt = new DataTable();
- //dt = orbll.GetView_Custom("Vw_OrdersWagePhotography", StrWhere: "化妆师ID like '%" + Ord_OrdersPersonID + "%' and Ord_Class=1 and 拍摄状态=1 and 拍摄时间>='" + StartTime + "' and 拍摄时间<='" + EndTime + "' ", ShowColumnName: "ID").Tables[0];
- //if (dt.Rows.Count > 0)
- //{ MakeUpCount = dt.Rows.Count; }
- #endregion
- #region 化妆助理个数
- //dt = new DataTable();
- //dt = orbll.GetView_Custom("Vw_OrdersWagePhotography", StrWhere: "化妆助理ID like '%" + Ord_OrdersPersonID + "%' and Ord_Class=1 and 拍摄状态=1 and 拍摄时间>='" + StartTime + "' and 拍摄时间<='" + EndTime + "' ", ShowColumnName: "ID").Tables[0];
- //if (dt.Rows.Count > 0)
- //{ MakeUpAssistantCount = dt.Rows.Count; }
- #endregion
- #region 引导师个数
- //dt = new DataTable();
- //dt = orbll.GetView_Custom("Vw_OrdersWagePhotography", StrWhere: "引导师ID like '%" + Ord_OrdersPersonID + "%' and Ord_Class=1 and 拍摄状态=1 and 拍摄时间>='" + StartTime + "' and 拍摄时间<='" + EndTime + "' ", ShowColumnName: "ID").Tables[0];
- //if (dt.Rows.Count > 0)
- //{ GuideCount = dt.Rows.Count; }
- #endregion
- #region 初修师个数
- //dt = new DataTable();
- //dt = orbll.GetView_Custom("Vw_OrdersWageDigital", StrWhere: "初修师ID like '%" + Ord_OrdersPersonID + "%' and Ord_Class=1 and 初修状态=2 and 初修时间>='" + StartTime + "' and 初修时间<='" + EndTime + "' ", ShowColumnName: "ID").Tables[0];
- //if (dt.Rows.Count > 0)
- //{ FirstRepairCount = dt.Rows.Count; }
- #endregion
- #region 精修师个数
- //dt = new DataTable();
- //dt = orbll.GetView_Custom("Vw_OrdersWageDigital", StrWhere: "精修师ID like '%" + Ord_OrdersPersonID + "%' and Ord_Class=1 and 精修状态=2 and 精修时间>='" + StartTime + "' and 精修时间<='" + EndTime + "' ", ShowColumnName: "ID").Tables[0];
- //if (dt.Rows.Count > 0)
- //{ RefinementCount = dt.Rows.Count; }
- #endregion
- #region 设计师个数
- //dt = new DataTable();
- //dt = orbll.GetView_Custom("Vw_OrdersWageDigital", StrWhere: "设计师ID like '%" + Ord_OrdersPersonID + "%' and Ord_Class=1 and 设计状态=2 and 设计时间>='" + StartTime + "' and 设计时间<='" + EndTime + "' ", ShowColumnName: "ID").Tables[0];
- //if (dt.Rows.Count > 0)
- //{ RefinementCount = dt.Rows.Count; }
- #endregion
- string StrCountSum = "订单数:" + htDataOrder.Count + ";摄影景点数:" + htDataPhotography.Count + ";摄影助理景点数:" + htDataPhotographyAssistant.Count + ";化妆数:" + htDataMakeUp.Count + ";化妆助理数:" + htDataMakeUpAssistant.Count;
- StrCountSum += ";引导数:" + htDataGuide.Count + ";引导助理数:" + htDataGuideAssistant.Count + ";初修景点数:" + htDataFirstRepair.Count + ";精修景点数:" + htDataRefinement.Count + ";设计景点数:" + htDataDesign.Count;
- return StrCountSum;
- }
- string Str_ItemCategory = "";
- string Str_ProcessStatus = "";
- string Str_CustomerSource = "";
- object Str_CustomerSourceTag = "";
- string Str_ProjectTitle = "";
- object Str_ProjectTitleTag = "";
- string Str_PakName = "";
- object Str_PakNameTag = "";
- string Str_AmountRange1 = "";
- string Str_AmountRange2 = "";
- string Str_Scores1 = "";
- string Str_Scores2 = "";
- //======================================================================操作事件==================================
- /// <summary>
- /// 选择人员姓名查询人员工资基本信息
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected override void cmbEmployeeName_ComboBoxTree_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
- {
- if (this.cmbEmployeeName.Tag != null)
- {
- if (this.cmbEmployeeName.StrGetName.Trim() == "User")
- {
- this.dgvAll.Visible = false;
- this.dgv.Visible = true;
- DataTable dt = wsbll.GetList("Ws_StaffCode='" + this.cmbEmployeeName.Tag.ToString().Trim() + "'").Tables[0];
- if (dt.Rows.Count > 0)
- {
- this.txtBasicwage.Text = dt.Rows[0]["Ws_BasicWage"].ToString();
- this.txtPay_Remark.Text = dt.Rows[0]["Ws_Remark"].ToString();
- }
- else
- {
- this.txtBasicwage.Text = "0";
- this.txtPay_Remark.Text = "";
- }
- }
- else if (string.IsNullOrEmpty(this.cmbEmployeeName.StrGetName.Trim()) || this.cmbEmployeeName.StrGetName.Trim() == "StoreName" || this.cmbEmployeeName.StrGetName.Trim() == "Department")
- {
- this.dgvAll.Visible = true;
- this.dgv.Visible = false;
- this.dgv.Rows.Clear();
- this.txtBasicwage.Text = "0";
- this.txtPay_Remark.Text = "";
- this.txtCurrentPerformance.Text = "0";
- this.cmbCommissionScheme.Text = "";
- this.txtPieceCommission.Text = "0";
- this.txtCommissionWages.Text = "0";
- }
- }
- else
- { MessageBoxCustom.Show("请选择人员!"); }
- }
- /// <summary>
- /// 对象转为时间
- /// </summary>
- /// <param name="timeObj"></param>
- /// <returns></returns>
- DateTime GetObjectToDateTime(object timeObj)
- {
- try
- {
- if (timeObj != null)
- {
- return Convert.ToDateTime(timeObj.ToString());
- }
- else
- {
- return DateTime.MinValue;
- }
- }
- catch { return DateTime.MinValue; }
- }
- /// <summary>
- /// 选择项目类别
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected override void cmbItemCategory_ComboBoxTree_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
- {
- //清空项目名称
- this.cmbProjectTitle.TreeView.Nodes.Clear();
- this.cmbProjectTitle.Text = "";
- this.cmbCommissionScheme.SetTextAndTag_ValueNull();
- this.cmbCommissionScheme.Enabled = true;
- this.cmbProjectTitle.Enabled = true;
- if (this.cmbItemCategory.Text.Trim() == "订单前期")
- { LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboxTreeView(this.cmbProjectTitle, StrBindData: "实收,全款", IsFirstNodeNull: true); }
- else if (this.cmbItemCategory.Text.Trim() == "服务前期")
- { LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboxTreeView(this.cmbProjectTitle, StrBindData: "摄影前期,化妆前期,引导前期,初修前期,精修前期,设计前期", IsFirstNodeNull: true); }
- else if (this.cmbItemCategory.Text.Trim() == "订单后期" || this.cmbItemCategory.Text.Trim() == "其它消费")
- { LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_SystemCategory("BEBACDAJDFDDEACGJ", this.cmbProjectTitle, IsFirstNodeNull: true, StrWhere: "Sc_ClassCode!='BEBCADBFBCDFBGJHC' and Sc_ClassCode!='BEBCADBFBDDEGGABF' and Sc_ClassCode!='BEBCBFBICGDHCGBEJ' and Sc_ClassCode!='BEBCABBAAICBDHDHI' and Sc_ClassCode!='BEBCABBAAICJAAGDG' and Sc_ClassCode!='BEBCBFBICFCECBHFF'"); }
- else if (this.cmbItemCategory.Text.Trim() == "服务后期")
- { LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboxTreeView(this.cmbProjectTitle, StrBindData: "门市选片二销,摄影选片二销,化妆选片二销,引导选片二销,初修选片二销,设计选片二销,精修选片二销", IsFirstNodeNull: true); }
- else if (this.cmbItemCategory.Text.Trim() == "会员充值" || this.cmbItemCategory.Text.Trim() == "服务卡充值")
- { this.cmbProjectTitle.Enabled = false; }
- else if (this.cmbItemCategory.Text.Trim() == "礼服租售")
- { LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboxTreeView(this.cmbProjectTitle, StrBindData: "礼服出租,礼服出售", IsFirstNodeNull: true); }
- else if (this.cmbItemCategory.Text.Trim() == "计件提成")
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_SystemCategory("BEBBBABBEBAIHGDCB", this.cmbProjectTitle, IsFirstNodeNull: true, tbl: tblSystemCategory);
- this.cmbCommissionScheme.Enabled = false;
- this.cmbCommissionScheme.Text = "计件提成";
- }
- }
- /// <summary>
- /// 查询
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected override void btnSelect_Click(object sender, EventArgs e)
- {
- if (string.IsNullOrEmpty(this.txtTimeStart.DateValue))
- { MessageBoxCustom.Show("开始时间不能为空!"); return; }
- if (string.IsNullOrEmpty(this.txtTimeEnd.DateValue))
- { MessageBoxCustom.Show("结束时间不能为空!"); return; }
- if (this.cmbItemCategory.Text.Trim() == "订单后期" && this.cmbProjectTitle.Text.Trim() == "选片二销")
- { this.lblAmountDisplay.Text = "选片金额:"; }
- else
- { this.lblAmountDisplay.Text = "套系金额:"; }
- if (!string.IsNullOrEmpty(this.txtAmountRange1.Text))
- {
- if (string.IsNullOrEmpty(this.txtAmountRange2.Text))
- { MessageBoxCustom.Show("结束金额范围不能为空!"); return; }
- }
- if (!string.IsNullOrEmpty(this.txtAmountRange2.Text))
- {
- if (string.IsNullOrEmpty(this.txtAmountRange1.Text))
- { MessageBoxCustom.Show("开始金额范围不能为空!"); return; }
- }
- if (!string.IsNullOrEmpty(this.txtScores1.Text))
- {
- if (string.IsNullOrEmpty(this.txtScores2.Text))
- { MessageBoxCustom.Show("满意分值范围不能为空!"); return; }
- }
- if (!string.IsNullOrEmpty(this.txtScores2.Text))
- {
- if (string.IsNullOrEmpty(this.txtScores1.Text))
- { MessageBoxCustom.Show("满意分值范围不能为空!"); return; }
- }
- this.Str_ItemCategory = this.cmbItemCategory.Text.Trim();
- this.Str_ProcessStatus = this.cmbProcessStatus.Text.Trim();
- this.Str_CustomerSource = this.cmbCustomerSource.Text.Trim();
- this.Str_CustomerSourceTag = this.cmbCustomerSource.Tag;
- this.Str_ProjectTitle = this.cmbProjectTitle.Text.Trim();
- this.Str_ProjectTitleTag = this.cmbProjectTitle.Tag;
- this.Str_PakName = this.CtvPak_Name.Text.Trim();
- this.Str_PakNameTag = this.CtvPak_Name.Tag;
- this.Str_AmountRange1 = this.txtAmountRange1.Text.Trim();
- this.Str_AmountRange2 = this.txtAmountRange2.Text.Trim();
- this.Str_Scores1 = this.txtScores1.Text.Trim();
- this.Str_Scores2 = this.txtScores2.Text.Trim();
- if (this.cmbEmployeeName.Tag == null)
- { this.cmbEmployeeName.TagFindText(""); }
- string StrEmployeeNameTag = this.cmbEmployeeName.Tag.ToString().Trim();
- string StrDateStart = this.txtTimeStart.DateValue.ToString().Trim();
- string StrDateEnd = this.txtTimeEnd.DateValue.ToString().Trim();
- if (this.cmbEmployeeName.Tag != null)
- {
- if (this.cmbEmployeeName.StrGetName.Trim() == "User")
- {
- this.txtCommissionWages.Text = "0";
- LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate(object obj, BackgroundWorker backgroundWorker)
- {
- string strCurrentPerformance = Convert.ToDecimal(this.BindPerformance(StrDateStart, StrDateEnd, StrEmployeeNameTag, backgroundWorker)).ToString("N2");
- string StrCountSum = this.GetNumberOfResults(StrEmployeeNameTag, StrDateStart, StrDateEnd);
- this.Invoke(new UpdateControl(delegate()
- {
- //获取员工业绩列表
- this.txtCurrentPerformance.Text = strCurrentPerformance;
- this.lblCountSum.Text = StrCountSum;
- }));
- });
- }
- else
- {
- this.TotalPerformance();
- this.dgvAll.Visible = true;
- }
- }
- //以下为滕工加,2016-01-28
- this.cmbCommissionScheme_ComboBoxTree_NodeMouseClick(this, null);
- }
- /// <summary>
- /// 输入框设置
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected override void txtAmountRange2_KeyPress(object sender, KeyPressEventArgs e)
- {
- if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar))
- { e.Handled = true; }
- }
- /// <summary>
- /// 输入框设置
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected override void txtAmountRange1_KeyPress(object sender, KeyPressEventArgs e)
- {
- if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar))
- { e.Handled = true; }
- }
- /// <summary>
- /// 关闭
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected override void btnClose_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- /// <summary>
- /// 提成工资事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected override void cmbCommissionScheme_ComboBoxTree_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
- {
- if (!string.IsNullOrEmpty(this.cmbCommissionScheme.Text.Trim()) && this.cmbCommissionScheme.Tag != null)
- {
- if (this.cmbEmployeeName.Text.Trim() == "全部" || this.cmbEmployeeName.StrGetName.ToString() == "Department" || string.IsNullOrEmpty(this.cmbEmployeeName.Text.Trim()))
- {
- MessageBoxCustom.Show("请选择员工!");
- this.cmbCommissionScheme.Text = "";
- return;
- }
- DataTable dt = wcsbll.GetList("Wcs_TypeCode='" + this.cmbCommissionScheme.Tag.ToString() + "'").Tables[0];
- if (dt.Rows.Count == 0)
- {
- MessageBoxCustom.Show("请在工资设置,设置规则!");
- this.cmbCommissionScheme.Text = "";
- this.txtCommissionWages.Text = "0";
- return;
- }
- else
- { this.txtCommissionWages.Text = wcsbll.GetCommissionSpecifications(this.cmbCommissionScheme.Tag.ToString(), Convert.ToDecimal(this.txtCurrentPerformance.Text)).ToString("N2"); }
- }
- else
- { this.txtCommissionWages.Text = "0"; }
- }
- /// <summary>
- /// 排序
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected override void dgvAll_SortCompare(object sender, DataGridViewSortCompareEventArgs e)
- {
- if (e.Column.Name == "员工姓名" || e.Column.Name == "当前业绩")
- { e.SortResult = (Convert.ToDouble(e.CellValue1) - Convert.ToDouble(e.CellValue2) > 0) ? 1 : (Convert.ToDouble(e.CellValue1) - Convert.ToDouble(e.CellValue2) < 0) ? -1 : 0; }
- //否则,按字符串比较
- else
- { e.SortResult = System.String.Compare(Convert.ToString(e.CellValue1), Convert.ToString(e.CellValue2)); }
- e.Handled = true;//不能省掉,不然没效果
- }
- /// <summary>
- /// 保存记录
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected override void btnSave_Click(object sender, EventArgs e)
- {
- if (string.IsNullOrEmpty(txtTimeStart.DateValue))
- { MessageBoxCustom.Show("开始时间不能为空!"); return; }
- if (string.IsNullOrEmpty(txtTimeEnd.DateValue))
- { MessageBoxCustom.Show("结束时间不能为空!"); return; }
- if (cmbEmployeeName.Text.Trim() == "全部" || cmbEmployeeName.StrGetName.ToString() == "Department" || string.IsNullOrEmpty(cmbEmployeeName.Text.Trim()))
- { MessageBoxCustom.Show("请选择员工!"); return; }
- if (string.IsNullOrEmpty(cmbCommissionScheme.Text.Trim()))
- { MessageBoxCustom.Show("请选择提成方案!"); return; }
- if (cmbCommissionScheme.Text.Trim() != "计件提成")
- {
- DataTable dt = wcsbll.GetList("Wcs_TypeCode='" + cmbCommissionScheme.Tag.ToString() + "'").Tables[0];
- if (dt.Rows.Count == 0)
- {
- MessageBoxCustom.Show("请在工资设置,设置规则!");
- cmbCommissionScheme.SetTextAndTag_ValueNull();
- txtCommissionWages.Text = "0";
- return;
- }
- }
- #region 保存工资提成记录
- LYFZ.Model.Model_ErpWageCommissionRecords WageCommissionRecordsModel = new Model.Model_ErpWageCommissionRecords();
- WageCommissionRecordsModel.Wcr_DividedShop = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID();
- WageCommissionRecordsModel.Wcr_EmployeeID = cmbEmployeeName.Tag.ToString();
- if (cmbCommissionScheme.Text.Trim() == "计件提成")
- { WageCommissionRecordsModel.Wcr_CommissionScheme = cmbCommissionScheme.Text.Trim(); }
- else
- { WageCommissionRecordsModel.Wcr_CommissionScheme = cmbCommissionScheme.Tag.ToString(); }
- WageCommissionRecordsModel.Wcr_CurrentPerformance = Convert.ToDecimal(txtCurrentPerformance.Text);
- WageCommissionRecordsModel.Wcr_PieceCommission = Convert.ToDecimal(txtPieceCommission.Text);
- WageCommissionRecordsModel.Wcr_CommissionWages = Convert.ToDecimal(txtCommissionWages.Text);
- WageCommissionRecordsModel.Wcr_PerformanceTimeStart = Convert.ToDateTime(txtTimeStart.Text);
- WageCommissionRecordsModel.Wcr_PerformanceTimeEnd = Convert.ToDateTime(txtTimeEnd.Text);
- WageCommissionRecordsModel.Wcr_CreateDateTime = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetServerDateTime();
- WageCommissionRecordsModel.Wcr_CreateName = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;
- if (wcrbll.Add(WageCommissionRecordsModel))
- {
- MessageBoxCustom.Show("保存成功!");
- cmbCommissionScheme.SetTextAndTag_ValueNull();
- txtCommissionWages.Text = "0";
- }
- #endregion
- }
- /// <summary>
- /// 查看记录
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected override void btnSearchRecord_Click(object sender, EventArgs e)
- {
- if (string.IsNullOrEmpty(cmbEmployeeName.Text.Trim()))
- { MessageBoxCustom.Show("员工姓名不能为空!请选择!"); return; }
- LYFZ.Software.MainBusiness.FinancialManagement.Payroll.FrmSearchRecord frm = new Payroll.FrmSearchRecord();
- frm.N_NameText = cmbEmployeeName.Text.Trim();
- if (cmbEmployeeName.Text.Trim() != "全部")
- {
- frm.N_NameTag = cmbEmployeeName.Tag.ToString();
- frm.N_Name = cmbEmployeeName.Name;
- }
- frm.ShowDialog();
- }
- /// <summary>
- /// 添加行事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void dgv_RowsAdded(object sender, DataGridViewRowsAddedEventArgs e)
- {
- if (this.dgv.Rows[e.RowIndex].Cells["Column4"].Value != null && !string.IsNullOrEmpty(this.dgv.Rows[e.RowIndex].Cells["Column4"].Value.ToString().Trim()))
- { this.dgv.Rows[e.RowIndex].Cells["Column4"].Value = LYFZ.Command.Command_Validate.DateTimeToString(this.dgv.Rows[e.RowIndex].Cells["Column4"].Value, "yyyy-MM-dd HH:mm"); }
- if (this.dgv.Rows[e.RowIndex].Cells["Column11"].Value != null && !string.IsNullOrEmpty(this.dgv.Rows[e.RowIndex].Cells["Column11"].Value.ToString().Trim()))
- { this.dgv.Rows[e.RowIndex].Cells["Column11"].Value = LYFZ.Command.Command_Validate.DateTimeToString(this.dgv.Rows[e.RowIndex].Cells["Column11"].Value, "yyyy-MM-dd HH:mm"); }
- if (this.dgv.Rows[e.RowIndex].Cells["Column3"].Value != null && !string.IsNullOrEmpty(this.dgv.Rows[e.RowIndex].Cells["Column3"].Value.ToString().Trim()))
- { this.dgv.Rows[e.RowIndex].Cells["Column3"].Value = this.dgv.Rows[e.RowIndex].Cells["Column3"].Value.ToString(); }
- }
- /// <summary>
- /// 导出
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected override void btnExPort_Click(object sender, EventArgs e)
- {
- if (this.dgv.Visible)
- { this.dgv.DataToExcelPayroll(this.cmbEmployeeName.Text.Trim()); }
- else
- { this.dgvAll.ExportDataTable(); }
- }
- /// <summary>
- /// 开始时间改变
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void txtTimeStart_Leave(object sender, EventArgs e)
- {
- if (!string.IsNullOrEmpty(this.txtTimeStart.DateValue.Trim()))
- { this.txtTimeEnd.DateValue = Convert.ToDateTime(this.txtTimeStart.DateValue).AddMonths(1).AddSeconds(-1).ToString("yyyy-MM-dd"); }
- }
- /// <summary>
- /// 窗体大小发生改变事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void FrmPayroll_Resize(object sender, EventArgs e)
- {
- if (!this.IsFirstRun)
- {
- switch (this.panelSaveed.Location.Y)
- {
- case 0: this.flowLayoutPanel1.Height = 29; break;
- case 29: this.flowLayoutPanel1.Height = 59; break;
- case 58: this.flowLayoutPanel1.Height = 89; break;
- case 87: this.flowLayoutPanel1.Height = 119; break;
- case 116: this.flowLayoutPanel1.Height = 149; break;
- }
- }
- }
- }
- }
|