MainCameraControlBook.cs 253 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316
  1. using LYFZ.BLL;
  2. using LYFZ.ComponentLibrary;
  3. using LYFZ.Helper;
  4. using LYFZ.Model;
  5. using System;
  6. using System.Collections;
  7. using System.Collections.Generic;
  8. using System.ComponentModel;
  9. using System.Data;
  10. using System.Drawing;
  11. using System.Linq;
  12. using System.Text;
  13. using System.Windows.Forms;
  14. namespace LYFZ.Software.MainBusiness.NewCameraControlBook
  15. {
  16. public partial class MainCameraControlBook : LYFZ.Software.NewCameraControlBook.MainCameraControlBook
  17. {
  18. PanelToDataTableView PanelDataView = null;
  19. public MainCameraControlBook()
  20. {
  21. this.IsShowUcNavigationTool = false;
  22. this.plCalendarInfo.Hide();
  23. this.plCalendarToolbar.BorderColor = UIBlueThemeResources.BorderAreaColor;
  24. this.plCalendarToolbar.BorderStyle = BorderStyle.None;
  25. this.plCalendarInfo.BorderColor = UIBlueThemeResources.BorderAreaColor;
  26. this.plCalendarInfo.BorderStyle = BorderStyle.FixedSingle;
  27. this.nudYears.Value = SDateTime.Now.Year;
  28. this.nudMonth.Value = SDateTime.Now.Month;
  29. this.Load += MainCameraControlBook_Load;
  30. this.Shown += MainCameraControlBook_Shown;
  31. this.plCalendarTable.Paint += PlCalendarTable_Paint;
  32. this.nudYears.ValueChanged += NudYears_ValueChanged;
  33. this.nudMonth.ValueChanged += NudMonth_ValueChanged;
  34. this.plCalendarTable.Height = weekTitleHeight + weekContentHeight * weekRowCount + 20;
  35. this.plCalendarTable.MouseMove += PlCalendarTable_MouseMove;
  36. this.plCalendarTable.MouseUp += PlCalendarTable_MouseUp;
  37. this.plCalendarTable.MouseDoubleClick += PlCalendarTable_MouseDoubleClick;
  38. this.cmenuCameraBook.ItemClicked += CmenuCameraBook_ItemClicked;
  39. this.cbxStoreList.SelectedIndexChanged += CbxStoreList_SelectedIndexChanged;
  40. this.cbxStoreList2.SelectedIndexChanged += CbxStoreList2_SelectedIndexChanged;
  41. this.plCalendarInfo.Paint += PlCalendarInfo_Paint;
  42. this.tabControlEx1.Selected += TabControlEx1_Selected;
  43. this.chbxFixedHeader.Click += ChbxFixedHeader_Click;
  44. this.btnUpdateQuery.Click += BtnUpdateQuery_Click;
  45. //第二选项卡
  46. this.dateTimePickerStar.ValueChanged += DateTimePickerStar_ValueChanged;
  47. this.dateTimePickerEnd.ValueChanged += DateTimePickerEnd_ValueChanged;
  48. this.lkBeforeDay.Click += BtnBeforeDay_Click;
  49. this.lkAfterDay.Click += BtnAfterDay_Click;
  50. this.lkNowaday.Click += BtnNowaday_Click;
  51. this.lkNearlyOneWeek.Click += BtnNearlyOneWeek_Click;
  52. this.lkNearlyHalfMonth.Click += BtnNearlyHalfMonth_Click;
  53. this.lkNearlyOneMonth.Click += BtnNearlyOneMonth_Click;
  54. this.likCustomColor.Click += BtnCustomColor_Click;
  55. this.btnSetTemplate.Click += BtnSetTemplate_Click;
  56. this.btnQuery.Click += BtnQuery_Click;
  57. this.PanelDataView = new PanelToDataTableView(this.plTbleContainer);
  58. //this.plTbleContainer.Controls.Add(this.PanelDataView);
  59. this.PanelDataView.EventCell_Click += PanelDataView_EventCell_Click;
  60. this.PanelDataView.EventCell_DoubleClick += PanelDataView_EventCell_DoubleClick;
  61. this.PanelDataView.EventCell_MouseEnter += PanelDataView_EventCell_MouseEnter;
  62. this.PanelDataView.EventCellThumbtack_MouseEnter += PanelDataView_EventCellThumbtack_MouseEnter;
  63. this.PanelDataView.EventCellThumbtack_DoubleClick += PanelDataView_EventCellThumbtack_DoubleClick;
  64. this.contextMenuStrip_Time.ItemClicked += ContextMenuStrip_Time_ItemClicked;
  65. this.contextMenuStrip_CustomLabel.ItemClicked += ContextMenuStrip_CustomLabel_ItemClicked;
  66. this.RegisteredRadioButtonEvent();
  67. this.RegisteredCheckBoxEvent();
  68. this.likUpPage.Click += LikUpPage_Click;
  69. this.likDownPage.Click += LikDownPage_Click;
  70. this.likStatisticsUnfinished.Click += LikStatisticsUnfinished_Click;
  71. this.likOverview.Click += LikOverview_Click;
  72. this.likCameraLogs.Click += LikCameraLogs_Click;
  73. this.likCameraQuer.Click += LikCameraQuer_Click;
  74. this.likSendSms.Click += LikSendSms_Click;
  75. this.likYuanGongDanQi.Click += LikYuanGongDanQi_Click;
  76. this.likJiLianRi.Click += LikJiLianRi_Click;
  77. // this.likcommunicationInfo.Click += LikcommunicationInfo_Click;
  78. // this.likAddCommunication.Click += LikAddCommunication_Click;
  79. this.likAnPaiKeFu.Click += LikAnPaiKeFu_Click;
  80. this.likConfirmDressing.Click += LikConfirmDressing_Click;
  81. this.likConfirmDressing.Hide();
  82. this.btnPrint.Click += btnPrint_Click;
  83. this.contextMenuStrip_OrderInfo.ItemClicked += ContextMenuStrip_OrderInfo_ItemClicked;
  84. this.btnReservation.Click += BtnReservation_Click;
  85. this.btnExport.Click += BtnExport_Click;
  86. this.btnSearch.Click += BtnSearch_Click;
  87. this.btnQueryAll.Click += BtnQueryAll_Click;
  88. this.txtKeyword.KeyUp += TxtKeyword_KeyUp;
  89. }
  90. private void TxtKeyword_KeyUp(object sender, KeyEventArgs e)
  91. {
  92. if (e.KeyCode == Keys.Enter)
  93. {
  94. this.BtnSearch_Click(null,null);
  95. }
  96. }
  97. private void BtnQueryAll_Click(object sender, EventArgs e)
  98. {
  99. this.ClearCondition();
  100. this.BindPanelDataView();
  101. }
  102. private void BtnSearch_Click(object sender, EventArgs e)
  103. {
  104. this.BindPanelDataView();
  105. }
  106. /// <summary>
  107. /// 清除条件
  108. /// </summary>
  109. void ClearCondition()
  110. {
  111. this.cbxOther.SelectedIndex = 0;
  112. this.cbxNotificationStatus.SelectedIndex = 0;
  113. if (this.cbxCustomLabel.Items.Count > 0)
  114. {
  115. this.cbxCustomLabel.SelectedIndex = 0;
  116. }
  117. this.txtKeyword.Text = "";
  118. }
  119. /// <summary>
  120. /// 导出
  121. /// </summary>
  122. /// <param name="sender"></param>
  123. /// <param name="e"></param>
  124. private void BtnExport_Click(object sender, EventArgs e)
  125. {
  126. if (!LYFZ.BLL.BLL_ErpUser.IsAdministrator())
  127. {
  128. // if (!VerificationRights(this.CurrentUserRights.CameraControlBook, LYFZ.CustomAttributes.OperatingAuthority.DataExport))
  129. if (!LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.CameraControlBook, LYFZ.CustomAttributes.OperatingAuthority.DataExport))
  130. {
  131. MessageBoxCustom.Show("您没有导出当前门店摄控数据的权限!");
  132. return;
  133. }
  134. }
  135. if (this.PanelDataView.DataRowList.Count <= 0)
  136. {
  137. MessageBoxCustom.Show("没有数据可供导出");
  138. return;
  139. }
  140. SaveFileDialog saveFile = new SaveFileDialog();
  141. saveFile.Title = "导出数据报表文件";
  142. saveFile.Filter = "EXECL文件(*.xls) |*.xls |文本文件(*.txt) |*.txt |所有文件(*.*) |*.*";
  143. saveFile.FilterIndex = 1;
  144. if (saveFile.ShowDialog() == DialogResult.OK)
  145. {
  146. System.Data.DataTable m_table = new DataTable();
  147. m_table.TableName = "摄控预约数据";
  148. List<string> ColumnLis = new List<string>();
  149. for (int i = 0; i < this.PanelDataView.HeadColumnRow.DataColumnList.Count; i++)
  150. {
  151. ColumnLis.Add(this.PanelDataView.HeadColumnRow.DataColumnList[i].Text);
  152. m_table.Columns.Add(this.PanelDataView.HeadColumnRow.DataColumnList[i].Text);
  153. }
  154. foreach (PDataRow row in this.PanelDataView.DataRowList)
  155. {
  156. DataRow dataRow= m_table.NewRow();
  157. for (int i = 0; i < row.DataColumnList.Count; i++)
  158. {
  159. dataRow[i] = row.DataColumnList[i].Text;
  160. }
  161. m_table.Rows.Add(dataRow);
  162. }
  163. //行数不可以大于65536
  164. if (m_table.Rows.Count > 65536)
  165. {
  166. MessageBoxCustom.Show("数据记录数太多(最多不能超过65536条),不能保存 ");
  167. return;
  168. }
  169. string FileName = saveFile.FileName;
  170. try
  171. {
  172. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate (object obj, BackgroundWorker backgroundWorker)
  173. {
  174. try
  175. {
  176. backgroundWorker.ReportProgress(0, "正在导出...");
  177. if (LYFZ.WinAPI.CustomPublicMethod.DataGridViewToExcel(FileName, m_table, ColumnLis, backgroundWorker))
  178. {
  179. MessageBoxCustom.Show("导出成功");
  180. }
  181. else
  182. {
  183. MessageBoxCustom.Show("导出失败,请重试!");
  184. }
  185. }
  186. catch (Exception ex)
  187. {
  188. MessageBoxCustom.Show(String.Format("导出成功数据时出错:{0}", ex.Message));
  189. }
  190. });
  191. }
  192. catch (Exception ex)
  193. {
  194. MessageBoxCustom.Show("导出失败,原因:" + ex.Message);
  195. }
  196. }
  197. }
  198. /// <summary>
  199. /// 客人预约
  200. /// </summary>
  201. /// <param name="sender"></param>
  202. /// <param name="e"></param>
  203. private void BtnReservation_Click(object sender, EventArgs e)
  204. {
  205. LYFZ.Model.CameraControlTemplate cameraTemplate = null;
  206. CameraTimeTemplate cameraTime = null;
  207. /* if (this.PanelDataView.CurrentSelectRow != null)
  208. {
  209. cameraTemplate = (LYFZ.Model.CameraControlTemplate)this.PanelDataView.CurrentSelectRow.Tag;
  210. cameraTime = (CameraTimeTemplate)this.PanelDataView.CurrentSelectRow.DataColumnList[2].Tag;
  211. }*/
  212. if (this.StartReservation(cameraTemplate, cameraTime))
  213. {
  214. this.LoadTemplateData();
  215. }
  216. }
  217. /// <summary>
  218. /// 打印
  219. /// </summary>
  220. /// <param name="sender"></param>
  221. /// <param name="e"></param>
  222. void btnPrint_Click(object sender, EventArgs e)
  223. {
  224. if (!LYFZ.BLL.BLL_ErpUser.IsAdministrator())
  225. {
  226. if (!VerificationRights(this.CurrentUserRights.CameraControlBook, LYFZ.CustomAttributes.OperatingAuthority.Print))
  227. {
  228. MessageBoxCustom.Show("您没有打印当前门店摄控数据的权限!");
  229. return;
  230. }
  231. }
  232. if (this.PanelDataView.CurrentSelectRow == null)
  233. {
  234. MessageBoxCustom.Show("请选客人");
  235. return;
  236. }
  237. // LYFZ.Model.CameraControlTemplate cameraTemplate = (LYFZ.Model.CameraControlTemplate)this.PanelDataView.CurrentSelectRow.Tag;
  238. // CameraTimeTemplate cameraTime = (CameraTimeTemplate)this.PanelDataView.CurrentSelectRow.DataColumnList[2].Tag;
  239. // string StrOrdNumber = cameraTime.ReservationTime.OrderNumber;
  240. Hashtable htData = new Hashtable();
  241. if ((this.chkPortraitVersion.Checked && this.chkPortraitVersion.Visible) || LYFZ.Software.MainBusiness.EnumPermissions.BusinessType.写真版 == LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetBusinessType())
  242. { htData["Ver"] = "2"; }
  243. else if ((this.chkDressVersion.Checked && this.chkDressVersion.Visible) || LYFZ.Software.MainBusiness.EnumPermissions.BusinessType.婚纱版 == LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetBusinessType())
  244. { htData["Ver"] = "0"; }
  245. else if ((this.chkKidsVersion.Checked && this.chkKidsVersion.Visible) || LYFZ.Software.MainBusiness.EnumPermissions.BusinessType.儿童版 == LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetBusinessType())
  246. { htData["Ver"] = "1"; }
  247. else if ((!this.chkKidsVersion.Checked && !this.chkDressVersion.Checked && !this.chkPortraitVersion.Checked) || LYFZ.Software.MainBusiness.EnumPermissions.BusinessType.旗舰版 == LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetBusinessType())
  248. { htData["Ver"] = "-1"; }
  249. ArrayList Alist = new ArrayList();
  250. List<string> tempList = new List<string>();
  251. if (this.rdoService.Checked)//服务客人预约
  252. {
  253. for (int i = 0; i < this.PanelDataView.SelectRowList.Count; i++)
  254. {
  255. CameraTimeTemplate cameraTime = (CameraTimeTemplate)this.PanelDataView.SelectRowList[i].DataColumnList[2].Tag;
  256. if (cameraTime.Parameter.DataRows != null && cameraTime.Parameter.DataRows.Length > 0)
  257. {
  258. foreach (DataRow row in cameraTime.Parameter.DataRows)
  259. {
  260. string viceNumber = row["Ordv_ViceNumber"].ToString().Trim();
  261. if (!tempList.Any(v => v.ToLower() == viceNumber.ToLower()))
  262. {
  263. tempList.Add(viceNumber);
  264. }
  265. }
  266. }
  267. }
  268. if (tempList.Count == 0)
  269. {
  270. MessageBoxCustom.Show("请选择已预约的客人");
  271. return;
  272. }
  273. else
  274. {
  275. Alist.AddRange(tempList);
  276. }
  277. htData["Alist"] = Alist;
  278. LYFZ.Software.MainBusiness.ReportPrint.ReportFixedFormat.PrintFixedFormat(LYFZ.EnumPublic.PrintTypeEnum.服务明细, ObjValue: htData);
  279. }
  280. else
  281. {
  282. if (this.rdoPhotographed.Checked)//拍照客人预约
  283. {
  284. for (int i = 0; i < this.PanelDataView.SelectRowList.Count; i++)
  285. {
  286. CameraTimeTemplate cameraTime = (CameraTimeTemplate)this.PanelDataView.SelectRowList[i].DataColumnList[2].Tag;
  287. if (cameraTime.Parameter.DataRows != null && cameraTime.Parameter.DataRows.Length > 0)
  288. {
  289. foreach (DataRow row in cameraTime.Parameter.DataRows)
  290. {
  291. string viceNumber = String.Format("{0}|{1}", row["Ordv_ViceNumber"].ToString().Trim(), row["拍摄名称"].ToString().Trim());
  292. if (!tempList.Any(v => v.ToLower() == viceNumber.ToLower()))
  293. {
  294. tempList.Add(viceNumber);
  295. }
  296. }
  297. }
  298. }
  299. if (tempList.Count == 0)
  300. {
  301. MessageBoxCustom.Show("请选择已预约的客人");
  302. return;
  303. }
  304. Alist.AddRange(tempList);
  305. }
  306. else
  307. {
  308. for (int i = 0; i < this.PanelDataView.SelectRowList.Count; i++)
  309. {
  310. CameraTimeTemplate cameraTime = (CameraTimeTemplate)this.PanelDataView.SelectRowList[i].DataColumnList[2].Tag;
  311. if (cameraTime.Parameter.DataRows != null && cameraTime.Parameter.DataRows.Length > 0)
  312. {
  313. foreach (DataRow row in cameraTime.Parameter.DataRows)
  314. {
  315. string viceNumber = row["Ordv_ViceNumber"].ToString().Trim();
  316. if (!tempList.Any(v => v.ToLower() == viceNumber.ToLower()))
  317. {
  318. tempList.Add(viceNumber);
  319. }
  320. }
  321. }
  322. }
  323. if (tempList.Count == 0)
  324. {
  325. MessageBoxCustom.Show("请选择已预约的客人");
  326. return;
  327. }
  328. else
  329. {
  330. Alist.AddRange(tempList);
  331. }
  332. }
  333. if (Alist.Count == 0)
  334. { return; }
  335. htData["Alist"] = Alist;
  336. if (this.rdoPhotographed.Checked)//拍照客人预约
  337. {
  338. htData["StrDate"] = this.dateTimePickerStar.Value.ToYYYY_MM_dd();
  339. LYFZ.Software.MainBusiness.CameraControlBook.SuperSmallForm.SelectPrintTypeSuperSmallForm frm = new CameraControlBook.SuperSmallForm.SelectPrintTypeSuperSmallForm();
  340. frm.ShowDialog();
  341. if (frm.IsOk)
  342. {
  343. if (frm.StrEnumType == EnumPublic.PrintTypeEnum.订单预约单)
  344. {
  345. if (this.PanelDataView.SelectRowList.Count == 1)
  346. {
  347. CameraTimeTemplate cameraTime = (CameraTimeTemplate)this.PanelDataView.SelectRowList[0].DataColumnList[2].Tag;
  348. string orderNumber = cameraTime.ReservationTime.OrderNumber;
  349. if (!String.IsNullOrWhiteSpace(orderNumber))
  350. {
  351. BtnPrint_Click(orderNumber);
  352. }
  353. else
  354. {
  355. MessageBoxCustom.Show("请选择已预约的客人");
  356. return;
  357. }
  358. }
  359. else
  360. {
  361. MessageBoxCustom.Show("打印“订单预约单”时间只能选择一个订单");
  362. }
  363. }
  364. else
  365. {
  366. LYFZ.Software.MainBusiness.ReportPrint.ReportFixedFormat.PrintFixedFormat(frm.StrEnumType, ObjValue: htData);
  367. }
  368. }
  369. }
  370. else if (this.rdoFilmSelection.Checked)//选片客人
  371. { LYFZ.Software.MainBusiness.ReportPrint.ReportFixedFormat.PrintFixedFormat(LYFZ.EnumPublic.PrintTypeEnum.选片明细表, ObjValue: htData); }
  372. else if (this.rdoLookDesign.Checked)//看版客人
  373. { LYFZ.Software.MainBusiness.ReportPrint.ReportFixedFormat.PrintFixedFormat(LYFZ.EnumPublic.PrintTypeEnum.看设计明细表, ObjValue: htData); }
  374. else if (rdoTotakePiece.Checked)//取件客人
  375. {
  376. htData["TakePieceDate"] = this.dateTimePickerStar.Value.ToYYYY_MM_dd();
  377. LYFZ.Software.MainBusiness.ReportPrint.ReportFixedFormat.PrintFixedFormat(LYFZ.EnumPublic.PrintTypeEnum.取件明细表, ObjValue: htData);
  378. }
  379. else
  380. { MessageBoxCustom.Show("此功能暂未开放"); }
  381. }
  382. }
  383. /// <summary>
  384. /// 打印订单(打印预约单)
  385. /// </summary>
  386. /// <param name="sender"></param>
  387. /// <param name="e"></param>
  388. private void BtnPrint_Click(string OrderNumber)
  389. {
  390. if (!String.IsNullOrEmpty(OrderNumber))
  391. {
  392. LYFZ.Model.Model_ErpOrder currentOrderModel = orbll.GetModel(OrderNumber);
  393. if (currentOrderModel.ID > 0)
  394. {
  395. EnumPublic.OrderType OrderType = (EnumPublic.OrderType)Convert.ToInt32(currentOrderModel.Ord_Type);
  396. Hashtable htData = new Hashtable();
  397. htData["strNumber"] = OrderNumber.Trim();
  398. htData["strOrdType"] = OrderType.ToString().Trim();
  399. // 获取全部景点;
  400. List<ReportPrint.SetSmallForm.PrintPreviewSmallForm.ScenicSpot2> listScenicSpot = null;
  401. if (OrderType == EnumPublic.OrderType.儿童订单)
  402. {
  403. listScenicSpot = new List<ReportPrint.SetSmallForm.PrintPreviewSmallForm.ScenicSpot2>();
  404. DataTable tb_Data = DAL.DAL_ErpOrder.GetOrdersPhotographyData(OrderNumber);
  405. for (int i = 0; i < tb_Data.Rows.Count; i++)
  406. {
  407. ReportPrint.SetSmallForm.PrintPreviewSmallForm.ScenicSpot2 scenic = new ReportPrint.SetSmallForm.PrintPreviewSmallForm.ScenicSpot2();
  408. scenic.strScenicName = tb_Data.Rows[i]["景点名"].ToString();
  409. scenic.strViceNumber = tb_Data.Rows[i]["子单号"].ToString();
  410. listScenicSpot.Add(scenic);
  411. }
  412. }
  413. LYFZ.Software.MainBusiness.ReportPrint.ReportFixedFormat.PrintFixedFormat(LYFZ.EnumPublic.PrintTypeEnum.订单预约单, htData, listScenicSpot);
  414. }
  415. else
  416. {
  417. MessageBoxCustom.Show("找不到要打印的订单号“" + OrderNumber + "”的订单");
  418. }
  419. }
  420. else
  421. {
  422. MessageBoxCustom.Show("订单号不能为空");
  423. }
  424. }
  425. /// <summary>
  426. /// 确认选衣
  427. /// </summary>
  428. /// <param name="sender"></param>
  429. /// <param name="e"></param>
  430. private void LikConfirmDressing_Click(object sender, EventArgs e)
  431. {
  432. if (this.PanelDataView.CurrentSelectRow == null)
  433. {
  434. MessageBoxCustom.Show("请选客人");
  435. return;
  436. }
  437. // LYFZ.Model.CameraControlTemplate cameraTemplate = (LYFZ.Model.CameraControlTemplate)this.PanelDataView.CurrentSelectRow.Tag;
  438. CameraTimeTemplate cameraTime = (CameraTimeTemplate)this.PanelDataView.CurrentSelectRow.DataColumnList[2].Tag;
  439. string StrOrdNumber = cameraTime.ReservationTime.OrderNumber;
  440. if (!String.IsNullOrWhiteSpace(StrOrdNumber))
  441. {
  442. if (cameraTime.Parameter.DataRows != null && cameraTime.Parameter.DataRows.Length > 0)
  443. {
  444. LYFZ.Software.MainBusiness.CameraControlBook.SmallForm.SelectDressConfirmSmallForm frm = new CameraControlBook.SmallForm.SelectDressConfirmSmallForm();
  445. frm.strViceNumber = cameraTime.Parameter.DataRows[0]["Ordv_ViceNumber"].ToString();
  446. frm.ShowDialog();
  447. if (frm.IsSave)
  448. { this.LoadTemplateData(); }
  449. }
  450. }
  451. else
  452. {
  453. MessageBoxCustom.Show("请选择已预约的客人");
  454. }
  455. }
  456. /// <summary>
  457. /// 客服安排
  458. /// </summary>
  459. /// <param name="sender"></param>
  460. /// <param name="e"></param>
  461. private void LikAnPaiKeFu_Click(object sender, EventArgs e)
  462. {
  463. LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.ClientServiceTaskAnPaiSmallForm frm = new DoorCityProcess.SetSmallForm.ClientServiceTaskAnPaiSmallForm();
  464. frm.ShowDialog();
  465. if (frm.IsSaveed)
  466. {
  467. LYFZ.EnumPublic.ClientServiceTaskItem ClientServiceAnPai = EnumPublic.ClientServiceTaskItem.拍照客人;
  468. CameraType cameraType = SetCameraTemplate.GetCameraType(this.flowLayoutPanel3.Controls);
  469. switch (cameraType)
  470. {
  471. case CameraType.拍照客人:
  472. ClientServiceAnPai = EnumPublic.ClientServiceTaskItem.拍照客人;
  473. break;
  474. case CameraType.选片客人:
  475. ClientServiceAnPai = EnumPublic.ClientServiceTaskItem.选片客人;
  476. break;
  477. case CameraType.看版客人:
  478. ClientServiceAnPai = EnumPublic.ClientServiceTaskItem.看版客人;
  479. break;
  480. case CameraType.取件客人:
  481. ClientServiceAnPai = EnumPublic.ClientServiceTaskItem.取件客人;
  482. break;
  483. case CameraType.选衣客人:
  484. ClientServiceAnPai = EnumPublic.ClientServiceTaskItem.选衣服客人;
  485. break;
  486. case CameraType.服务客人:
  487. ClientServiceAnPai = EnumPublic.ClientServiceTaskItem.服务客人;
  488. break;
  489. case CameraType.爱婴上门:
  490. ClientServiceAnPai = EnumPublic.ClientServiceTaskItem.摄控医院客人;
  491. break;
  492. default:
  493. break;
  494. }
  495. this.ClientServiceAnPai(LYFZ.EnumPublic.ClientServiceTaskType.摄控确认, frm.model, ClientServiceAnPai);
  496. }
  497. }
  498. /// <summary>
  499. /// 安排客服
  500. /// </summary>
  501. /// <param name="dgvData"></param>
  502. /// <param name="modelClientServiceTask"></param>
  503. /// <param name="ClientServiceTaskType"></param>
  504. public void ClientServiceAnPai(LYFZ.EnumPublic.ClientServiceTaskType EnumTaskModule, LYFZ.Model.ClientServiceTaskAnPaiModel modelClientServiceTask, LYFZ.EnumPublic.ClientServiceTaskItem ClientServiceTaskType)
  505. {
  506. if (this.PanelDataView.SelectRowList.Count<=0)
  507. {
  508. MessageBoxCustom.Show("请选择要添加沟通记录的客人");
  509. return;
  510. }
  511. string StrWhere = "";
  512. DateTime StrTime = SDateTime.Now;
  513. List<LYFZ.Helper.CommandInfo> clist = new List<CommandInfo>();
  514. LYFZ.BLL.BLL_ErpClientServiceTask cstbll = new BLL.BLL_ErpClientServiceTask();
  515. LYFZ.Model.Model_ErpClientServiceTask modelCst = null;
  516. DataTable dtprompt = new DataTable();
  517. DataTable dt = orbll.GetView_Custom("tb_ErpClientServiceTask", StrWhere: "Cst_TaskItem = '" + ClientServiceTaskType.ToString().Trim() + "' And Cst_TaskTermTime = '" + modelClientServiceTask.StrDateTime + "' And Cst_CompletionIntStatus = 0", ShowColumnName: "*").Tables[0];
  518. #region 获取查询条件
  519. switch (ClientServiceTaskType)
  520. {
  521. case EnumPublic.ClientServiceTaskItem.选衣服客人:
  522. case EnumPublic.ClientServiceTaskItem.选片客人:
  523. case EnumPublic.ClientServiceTaskItem.看版客人:
  524. for (int i = 0; i < this.PanelDataView.SelectRowList.Count; i++)
  525. {
  526. CameraTimeTemplate cameraTime = (CameraTimeTemplate)this.PanelDataView.SelectRowList[i].DataColumnList[2].Tag;
  527. if (cameraTime.Parameter.DataRows != null)
  528. {
  529. foreach (DataRow row in cameraTime.Parameter.DataRows)
  530. {
  531. StrWhere += "'" + row["Ordv_ViceNumber"].ToString().Trim() + "',";
  532. }
  533. }
  534. }
  535. if (StrWhere.Trim().Length > 0)
  536. {
  537. StrWhere = "Ords_ViceNumber in (" + StrWhere.TrimEnd(',') + ")";
  538. }
  539. break;
  540. case EnumPublic.ClientServiceTaskItem.拍照客人:
  541. case EnumPublic.ClientServiceTaskItem.取件客人:
  542. case EnumPublic.ClientServiceTaskItem.服务客人:
  543. Hashtable htData = new Hashtable();
  544. for (int i = 0; i < this.PanelDataView.SelectRowList.Count; i++)
  545. {
  546. CameraTimeTemplate cameraTime = (CameraTimeTemplate)this.PanelDataView.SelectRowList[i].DataColumnList[2].Tag;
  547. if (cameraTime.Parameter.DataRows != null)
  548. {
  549. foreach (DataRow row in cameraTime.Parameter.DataRows)
  550. {
  551. htData[row["Ordv_ViceNumber"].ToString().Trim()] = row["Ordv_ViceNumber"].ToString().Trim();
  552. }
  553. }
  554. }
  555. foreach (string item in htData.Keys)
  556. {
  557. StrWhere += "'" + item + "',";
  558. }
  559. if (StrWhere.Trim().Length > 0)
  560. {
  561. StrWhere = "Ords_ViceNumber in (" + StrWhere.TrimEnd(',') + ")";
  562. }
  563. break;
  564. case EnumPublic.ClientServiceTaskItem.摄控医院客人:
  565. for (int i = 0; i < this.PanelDataView.SelectRowList.Count; i++)
  566. {
  567. CameraTimeTemplate cameraTime = (CameraTimeTemplate)this.PanelDataView.SelectRowList[i].DataColumnList[2].Tag;
  568. if (cameraTime.Parameter.DataRows != null)
  569. {
  570. foreach (DataRow row in cameraTime.Parameter.DataRows)
  571. {
  572. StrWhere += "'" + row["ID"].ToString().Trim() + "',";
  573. }
  574. }
  575. }
  576. if (StrWhere.Trim().Length > 0)
  577. {
  578. StrWhere = "tb_ErpHospitalDispatchDoor.ID in (" + StrWhere.TrimEnd(',') + ")";
  579. }
  580. break;
  581. }
  582. #endregion
  583. #region 获取保存数据
  584. switch (ClientServiceTaskType)
  585. {
  586. case EnumPublic.ClientServiceTaskItem.选衣服客人:
  587. case EnumPublic.ClientServiceTaskItem.拍照客人:
  588. case EnumPublic.ClientServiceTaskItem.选片客人:
  589. case EnumPublic.ClientServiceTaskItem.看版客人:
  590. case EnumPublic.ClientServiceTaskItem.取件客人:
  591. case EnumPublic.ClientServiceTaskItem.服务客人:
  592. #region 按数码分
  593. if (StrWhere.Trim().Length > 0)
  594. {
  595. DataTable dtClientGroup = orbll.GetView_Custom("tempTB_AggregationCustomer Left Join tb_ErpOrderDigitalStatus on Ords_OrdNumber = GP_OrderNumber Left Join tb_ErpOrder on Ord_Number = GP_OrderNumber", StrWhere: StrWhere, ShowColumnName: "GP_OrderNumber,GP_CustomerGroupID,Cus_Name,Ords_ViceNumber,Ord_SinceOrderNumber,Ords_SightsName").Tables[0];
  596. for (int i = 0; i < dtClientGroup.Rows.Count; i++)
  597. {
  598. DataRow[] dtRows = dt.Select("Cst_OrderNumber = '" + dtClientGroup.Rows[i]["GP_OrderNumber"].ToString().Trim() + "' And Cst_ViceNumber = '" + dtClientGroup.Rows[i]["Ords_ViceNumber"].ToString().Trim() + "'");
  599. if (dtRows.Length > 0)
  600. {
  601. string StrUserName = LYFZ.BLL.BLL_ErpOrderView.GetUserName(dtRows[0]["Cst_ServicePerson"]);
  602. if (StrUserName.Trim().Equals(modelClientServiceTask.StrUserName.Trim()))
  603. {
  604. continue;
  605. }
  606. if (StrUserName.Trim().Length > 0)
  607. {
  608. if (MessageBoxCustom.Show("客户'" + dtClientGroup.Rows[i]["Cus_Name"].ToString().Trim() + "' 拍摄名称'" + dtClientGroup.Rows[i]["Ords_SightsName"].ToString().Trim() + "'\r\n'" + modelClientServiceTask.StrDateTime.Trim() + "'已安排了客服'" + StrUserName.Trim() + "'\r\n是否要修改客服人员为'" + modelClientServiceTask.StrUserName + "'?", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.No)
  609. {
  610. continue;
  611. }
  612. }
  613. modelCst = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetClientServiceUpdateModel(dtRows[0], StrTime, modelClientServiceTask);
  614. clist.Add(cstbll.GetUpdateCommandInfo(modelCst));
  615. }
  616. else
  617. {
  618. modelCst = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetClientServiceAddModel(EnumTaskModule, modelClientServiceTask, ClientServiceTaskType);
  619. modelCst.Cst_ClientGroupNumber = dtClientGroup.Rows[i]["GP_CustomerGroupID"].ToString().Trim();
  620. modelCst.Cst_OrderNumber = dtClientGroup.Rows[i]["GP_OrderNumber"].ToString().Trim();
  621. modelCst.Cst_ViceNumber = dtClientGroup.Rows[i]["Ords_ViceNumber"].ToString().Trim();
  622. modelCst.Cst_SightsName = dtClientGroup.Rows[i]["Ords_SightsName"].ToString().Trim();
  623. modelCst.Cst_ShowOrderNumber = dtClientGroup.Rows[i]["Ord_SinceOrderNumber"].ToString().Trim();
  624. modelCst.Cst_CreateDatetime = StrTime;
  625. clist.Add(cstbll.GetAddCommandInfo(modelCst));
  626. }
  627. }
  628. }
  629. #endregion
  630. break;
  631. case EnumPublic.ClientServiceTaskItem.摄控医院客人:
  632. #region 摄控医院客人
  633. if (StrWhere.Trim().Length > 0)
  634. {
  635. DataTable dtClientGroup = orbll.GetView_Custom("tb_ErpHospitalDispatchDoor Left Join tb_ErpHospitalClient on Hct_Oddnumber = Hdr_Number ", StrWhere: StrWhere, ShowColumnName: "tb_ErpHospitalDispatchDoor.ID,Hct_Oddnumber,Hct_CustomerName,Hct_MyselfMobile").Tables[0];
  636. for (int i = 0; i < dtClientGroup.Rows.Count; i++)
  637. {
  638. DataRow[] dtRows = dt.Select("Cst_OrderNumber = '" + dtClientGroup.Rows[i]["Hct_Oddnumber"].ToString().Trim() + "' And Cst_ViceNumber = '" + dtClientGroup.Rows[i]["ID"].ToString().Trim() + "'");
  639. if (dtRows.Length > 0)
  640. {
  641. string StrUserName = LYFZ.BLL.BLL_ErpOrderView.GetUserName(dtRows[0]["Cst_ServicePerson"]);
  642. if (StrUserName.Trim().Equals(modelClientServiceTask.StrUserName.Trim()))
  643. {
  644. continue;
  645. }
  646. if (StrUserName.Trim().Length > 0)
  647. {
  648. if (MessageBoxCustom.Show("医院客户'" + dtClientGroup.Rows[i]["Hct_CustomerName"].ToString().Trim() + "' 电话'" + dtClientGroup.Rows[i]["Hct_MyselfMobile"].ToString().Trim() + "'\r\n'" + modelClientServiceTask.StrDateTime.Trim() + "'已安排了客服'" + StrUserName.Trim() + "'\r\n是否要修改客服人员为'" + modelClientServiceTask.StrUserName + "'?", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.No)
  649. {
  650. continue;
  651. }
  652. }
  653. modelCst = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetClientServiceUpdateModel(dtRows[0], StrTime, modelClientServiceTask);
  654. clist.Add(cstbll.GetUpdateCommandInfo(modelCst));
  655. }
  656. else
  657. {
  658. modelCst = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetClientServiceAddModel(EnumTaskModule, modelClientServiceTask, ClientServiceTaskType);
  659. modelCst.Cst_ClientGroupNumber = dtClientGroup.Rows[i]["Hct_Oddnumber"].ToString().Trim();
  660. modelCst.Cst_OrderNumber = dtClientGroup.Rows[i]["Hct_Oddnumber"].ToString().Trim();
  661. modelCst.Cst_ViceNumber = dtClientGroup.Rows[i]["ID"].ToString().Trim();
  662. modelCst.Cst_SightsName = "派单上门";
  663. modelCst.Cst_ShowOrderNumber = dtClientGroup.Rows[i]["Hct_Oddnumber"].ToString().Trim();
  664. modelCst.Cst_CreateDatetime = StrTime;
  665. clist.Add(cstbll.GetAddCommandInfo(modelCst));
  666. }
  667. }
  668. }
  669. #endregion
  670. break;
  671. }
  672. #endregion
  673. if (clist.Count > 0)
  674. {
  675. if (MessageBoxCustom.Show("您确定要安排吗?", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.No)
  676. {
  677. return;
  678. }
  679. if (LYFZ.BLL.BaseBllOperate.ExecuteSqlTran(clist) > 0)
  680. {
  681. MessageBoxCustom.Show("安排成功!");
  682. }
  683. else
  684. {
  685. MessageBoxCustom.Show("安排失败!");
  686. }
  687. }
  688. else
  689. {
  690. MessageBoxCustom.Show("没有可以安排的数据!");
  691. }
  692. }
  693. LYFZ.BLL.BLL_ErpOrder orbll = new BLL.BLL_ErpOrder();
  694. private void LikAddCommunication_Click(object sender, EventArgs e)
  695. {
  696. if (this.PanelDataView.CurrentSelectRow == null)
  697. {
  698. MessageBoxCustom.Show("请选择要添加沟通记录的客人");
  699. return;
  700. }
  701. // LYFZ.Model.CameraControlTemplate cameraTemplate = (LYFZ.Model.CameraControlTemplate)this.PanelDataView.CurrentSelectRow.Tag;
  702. CameraTimeTemplate cameraTime = (CameraTimeTemplate)this.PanelDataView.CurrentSelectRow.DataColumnList[2].Tag;
  703. string StrOrdNumber = cameraTime.ReservationTime.OrderNumber;
  704. LYFZ.EnumPublic.ClientServiceTaskItem inputType = EnumPublic.ClientServiceTaskItem.拍照客人;
  705. CameraType cameraType = SetCameraTemplate.GetCameraType(this.flowLayoutPanel3.Controls);
  706. switch (cameraType)
  707. {
  708. case CameraType.拍照客人:
  709. inputType = EnumPublic.ClientServiceTaskItem.拍照客人;
  710. break;
  711. case CameraType.选片客人:
  712. inputType = EnumPublic.ClientServiceTaskItem.选片客人;
  713. break;
  714. case CameraType.看版客人:
  715. inputType = EnumPublic.ClientServiceTaskItem.看版客人;
  716. break;
  717. case CameraType.取件客人:
  718. inputType = EnumPublic.ClientServiceTaskItem.取件客人;
  719. break;
  720. case CameraType.选衣客人:
  721. inputType = EnumPublic.ClientServiceTaskItem.选衣服客人;
  722. break;
  723. case CameraType.服务客人:
  724. inputType = EnumPublic.ClientServiceTaskItem.服务客人;
  725. break;
  726. default:
  727. break;
  728. }
  729. if (cameraType == CameraType.爱婴上门)
  730. {
  731. if (cameraTime.Parameter.DataRows.Length > 0)
  732. {
  733. string StrOrderID = cameraTime.Parameter.DataRows[0]["id"].ToString();
  734. LYFZ.Software.MainBusiness.HospitalTrackingSystem.AddingTrackRecord frm = new HospitalTrackingSystem.AddingTrackRecord();
  735. frm.IsShowDatimeRemind = false;
  736. frm.StrOrderNumber = StrOrdNumber;
  737. frm.IsGoForm = false;
  738. frm.intDispatchDoorID = Convert.ToInt32(StrOrderID);
  739. frm.ShowDialog();
  740. if (frm.IsSaveed)
  741. { this.LoadTemplateData(); }
  742. }
  743. else
  744. {
  745. MessageBoxCustom.Show("请选择已预约的客人");
  746. }
  747. }
  748. else
  749. {
  750. if (!String.IsNullOrWhiteSpace(StrOrdNumber))
  751. {
  752. /* LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate (object obj, BackgroundWorker backgroundWorker)
  753. {
  754. try
  755. {
  756. backgroundWorker.ReportProgress(0, "正在...");
  757. }
  758. catch (Exception ex)
  759. {
  760. MessageBoxCustom.Show(String.Format("加载数据时出错:{0}", ex.Message));
  761. }
  762. });*/
  763. DataTable tbl = orbll.GetView_Custom("tb_ErpCustomerGroup", StrWhere: "GP_OrderNumber = '" + StrOrdNumber + "'", ShowColumnName: "GP_CustomerGroupID").Tables[0];
  764. if (tbl.Rows.Count > 0)
  765. {
  766. LYFZ.Software.MainBusiness.CameraControlBook.SuperSmallForm.A_AddCommunicateRecords frm = new CameraControlBook.SuperSmallForm.A_AddCommunicateRecords();
  767. frm.StrClientNumber = tbl.Rows[0]["GP_CustomerGroupID"].ToString().Trim();
  768. frm.EnumClientServiceTaskType = EnumPublic.ClientServiceTaskType.摄控确认;
  769. frm.EnumClientServiceTaskItem = inputType;
  770. frm.Areminderdate = true;
  771. frm.ShowDialog();
  772. if (frm.IsSaveed)
  773. {
  774. this.LoadTemplateData();
  775. }
  776. }
  777. }
  778. else {
  779. MessageBoxCustom.Show("请选择已预约的客人");
  780. }
  781. }
  782. }
  783. private void LikcommunicationInfo_Click(object sender, EventArgs e)
  784. {
  785. if (this.PanelDataView.CurrentSelectRow == null)
  786. {
  787. MessageBoxCustom.Show("请选择客人");
  788. return;
  789. }
  790. // LYFZ.Model.CameraControlTemplate cameraTemplate = (LYFZ.Model.CameraControlTemplate)this.PanelDataView.CurrentSelectRow.Tag;
  791. CameraTimeTemplate cameraTime = (CameraTimeTemplate)this.PanelDataView.CurrentSelectRow.DataColumnList[2].Tag;
  792. string StrOrdNumber = cameraTime.ReservationTime.OrderNumber;
  793. if (!String.IsNullOrWhiteSpace(StrOrdNumber))
  794. {
  795. if (this.rdoHospitalClient.Checked)
  796. {
  797. LYFZ.Software.MainBusiness.HospitalTrackingSystem.IntentionsEntered frm = new HospitalTrackingSystem.IntentionsEntered();
  798. frm.StrOrdNumber = StrOrdNumber;
  799. frm.ShowDialog();
  800. if (frm.IsSaveed)
  801. { this.LoadTemplateData(); }
  802. }
  803. else
  804. {
  805. LYFZ.Software.MainBusiness.CameraControlBook.SuperSmallForm.A_CommunicationDetails frm = new CameraControlBook.SuperSmallForm.A_CommunicationDetails();
  806. frm.StrNumber = StrOrdNumber;
  807. frm.ShowDialog();
  808. if (frm.IsSaveed)
  809. { this.LoadTemplateData(); }
  810. }
  811. }
  812. else
  813. {
  814. MessageBoxCustom.Show("请选择已预约的客人");
  815. }
  816. }
  817. private void LikJiLianRi_Click(object sender, EventArgs e)
  818. {
  819. LYFZ.Software.MainBusiness.CameraControlBook.A_EventAideFormMain frm = new CameraControlBook.A_EventAideFormMain();
  820. frm.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  821. frm.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y);
  822. frm.Size = new Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height);
  823. frm.Show();
  824. }
  825. private void LikYuanGongDanQi_Click(object sender, EventArgs e)
  826. {
  827. LYFZ.Software.MainBusiness.CameraControlBook.SmallForm.A_EmployeeScheduleSmallForm frm = new CameraControlBook.SmallForm.A_EmployeeScheduleSmallForm();
  828. frm.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  829. frm.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y);
  830. frm.Size = new Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height);
  831. frm.ShowDialog();
  832. }
  833. private void LikSendSms_Click(object sender, EventArgs e)
  834. {
  835. if (!LYFZ.BLL.BLL_ErpUser.IsAdministrator())
  836. {
  837. if (!VerificationRights(this.CurrentUserRights.CameraControlBook, LYFZ.CustomAttributes.OperatingAuthority.SMSSend))
  838. {
  839. MessageBoxCustom.Show("您没有打印当前门店摄控数据的权限!");
  840. return;
  841. }
  842. }
  843. if (this.PanelDataView.SelectRowList.Count > 0)
  844. {
  845. if (this.PanelDataView.HeadColumnRow.DataColumnList.Any(c=>c.Text=="客户电话"))
  846. {
  847. String StrTelephone = "";
  848. for (int i = 0; i < this.PanelDataView.SelectRowList.Count; i++)
  849. {
  850. StrTelephone += this.PanelDataView.SelectRowList[i].DataColumnList[this.PanelDataView.HeadColumnRow.DataColumnList.Find(c => c.Text == "客户电话").CellIndex].Text.Replace("/",",") + ",";
  851. }
  852. LYFZ.Software.MainBusiness.SMSManagement.SmsSend.FrmSendSms SendSMS = new SMSManagement.SmsSend.FrmSendSms();
  853. SendSMS.Phone = StrTelephone.TrimEnd(',');
  854. SendSMS.ShowDialog();
  855. return;
  856. }
  857. else
  858. { MessageBoxCustom.Show("找不到电话列,或已被您隐藏了!"); }
  859. }
  860. else
  861. {
  862. MessageBoxCustom.Show("请选中您要发送短信的客人");
  863. }
  864. }
  865. private void LikCameraQuer_Click(object sender, EventArgs e)
  866. {
  867. LYFZ.Software.MainBusiness.CameraControlBook.SuperSmallForm.WorkAnPaiRecordSuperSmallForm frm = new CameraControlBook.SuperSmallForm.WorkAnPaiRecordSuperSmallForm();
  868. frm.ShowDialog();
  869. }
  870. private void LikCameraLogs_Click(object sender, EventArgs e)
  871. {
  872. LYFZ.Software.MainBusiness.CameraControlBook.SuperSmallForm.WorkAnPaiRecordSuperSmallForm frm = new CameraControlBook.SuperSmallForm.WorkAnPaiRecordSuperSmallForm();
  873. frm.ShowDialog();
  874. }
  875. private void LikOverview_Click(object sender, EventArgs e)
  876. {
  877. LYFZ.Software.MainBusiness.CameraControlBook.SmallForm.CameraControlBookOverviewSmallForm frm = new CameraControlBook.SmallForm.CameraControlBookOverviewSmallForm();
  878. frm.StrDate = this.dateTimePickerStar.Value.ToYYYY_MM_dd();
  879. frm.ShowDialog();
  880. }
  881. private void LikStatisticsUnfinished_Click(object sender, EventArgs e)
  882. {
  883. CameraType cameraType = SetCameraTemplate.GetCameraType(this.flowLayoutPanel3.Controls);
  884. bool IsSaveed = false;
  885. switch (cameraType)
  886. {
  887. case CameraType.拍照客人:
  888. {
  889. LYFZ.Software.MainBusiness.CameraControlBook.SmallForm.CameraControlQuerySmallForm frm = new CameraControlBook.SmallForm.CameraControlQuerySmallForm();
  890. frm.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  891. frm.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y);
  892. frm.Size = new Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height);
  893. frm.ShowDialog();
  894. IsSaveed = frm.IsSaveed;
  895. }
  896. break;
  897. case CameraType.选片客人:
  898. {
  899. LYFZ.Software.MainBusiness.CameraControlBook.SmallForm.FilmsSelectionReservationQuerySmallForm frm = new CameraControlBook.SmallForm.FilmsSelectionReservationQuerySmallForm();
  900. frm.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  901. frm.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y);
  902. frm.Size = new Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height);
  903. frm.ShowDialog();
  904. IsSaveed = frm.IsSaveed;
  905. }
  906. break;
  907. case CameraType.看版客人:
  908. {
  909. LYFZ.Software.MainBusiness.CameraControlBook.SmallForm.LookSampleReservationQuerySmallForm frm = new CameraControlBook.SmallForm.LookSampleReservationQuerySmallForm();
  910. frm.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  911. frm.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y);
  912. frm.Size = new Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height);
  913. frm.ShowDialog();
  914. IsSaveed = frm.IsSave;
  915. }
  916. break;
  917. case CameraType.取件客人:
  918. {
  919. LYFZ.Software.MainBusiness.CameraControlBook.SmallForm.TakePiecesReservationQuerySmallForm frm = new CameraControlBook.SmallForm.TakePiecesReservationQuerySmallForm();
  920. frm.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  921. frm.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y);
  922. frm.Size = new Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height);
  923. frm.ShowDialog();
  924. IsSaveed = frm.IsSaveed;
  925. }
  926. break;
  927. case CameraType.选衣客人:
  928. {
  929. LYFZ.Software.MainBusiness.CameraControlBook.SmallForm.SelectDressReservationQuerySmallForm frm = new CameraControlBook.SmallForm.SelectDressReservationQuerySmallForm();
  930. frm.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  931. frm.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y);
  932. frm.Size = new Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height);
  933. frm.ShowDialog();
  934. IsSaveed = frm.IsSaveed;
  935. }
  936. break;
  937. case CameraType.服务客人:
  938. {
  939. LYFZ.Software.MainBusiness.CameraControlBook.SmallForm.WeddingReservationQuerySmallForm frm = new CameraControlBook.SmallForm.WeddingReservationQuerySmallForm();
  940. frm.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  941. frm.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y);
  942. frm.Size = new Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height);
  943. frm.ShowDialog();
  944. IsSaveed = frm.IsSaveed;
  945. }
  946. break;
  947. default:
  948. break;
  949. }
  950. if (IsSaveed)
  951. {
  952. this.isUpdateQuery = true;
  953. this.LoadTemplateData();
  954. }
  955. }
  956. LYFZ.BLL.ReservationTimeData timeDataBll = new BLL.ReservationTimeData();
  957. /// <summary>
  958. /// 档期预约和禁用等右键功能
  959. /// </summary>
  960. /// <param name="sender"></param>
  961. /// <param name="e"></param>
  962. private void ContextMenuStrip_Time_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
  963. {
  964. PDataColumn CurrentCell = (PDataColumn)this.contextMenuStrip_Time.Tag;
  965. PDataRow dataRow = this.PanelDataView.DataRowList[CurrentCell.RowIndex];
  966. LYFZ.Model.CameraControlTemplate cameraTemplate = (LYFZ.Model.CameraControlTemplate)dataRow.Tag;
  967. CameraTimeTemplate cameraTime = (CameraTimeTemplate)dataRow.DataColumnList[2].Tag;
  968. //MessageBoxCustom.Show(String.Format("{0}_{1}_{2}", ((CameraType)cameraTemplate.CameraType).ToString(), ((CameraOrderType)cameraTemplate.OrderType).ToString(), cameraTime.CameraTime));
  969. bool isSetStatus = false;
  970. switch (e.ClickedItem.Text)
  971. {
  972. case "档期客人预约":
  973. if (this.StartReservation(cameraTemplate, cameraTime))
  974. {
  975. this.LoadTemplateData();
  976. }
  977. break;
  978. case "客人预约改期":
  979. if (this.StartReservation(cameraTemplate, cameraTime,true))
  980. {
  981. this.LoadTemplateData();
  982. }
  983. break;
  984. case "取消档期预约": break;
  985. case "剪切档期预约": break;
  986. case "粘贴档期预约": break;
  987. case "禁用档期":
  988. if (cameraTime.ID <= 0)
  989. {
  990. MessageBoxCustom.Show("不是预设档期无法禁用");
  991. return;
  992. }
  993. if (this.IsMultiShopID(this.CurrentQueryStoreList2))
  994. {
  995. MessageBoxCustom.Show("禁用档期时,只能选择一个门店");
  996. return;
  997. }
  998. if (!LYFZ.BLL.BLL_ErpUser.GetRights(this.CurrentUserRights.CameraControlBook, LYFZ.CustomAttributes.OperatingAuthority.DisableOREnableSchedule))
  999. {
  1000. MessageBoxCustom.Show("您没有禁用当前门店档期的权限!");
  1001. return;
  1002. }
  1003. if (cameraTime.ReservationTime.ID > 0 && cameraTime.ReservationTime.IsEnable == 0)
  1004. {
  1005. return;
  1006. }
  1007. if (cameraTime.ReservationTime.ID > 0 && !String.IsNullOrWhiteSpace(cameraTime.ReservationTime.OrderNumber))
  1008. {
  1009. MessageBoxCustom.Show("当前档期已预约了客人,不能禁用");
  1010. return;
  1011. }
  1012. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate (object obj, BackgroundWorker backgroundWorker)
  1013. {
  1014. try
  1015. {
  1016. backgroundWorker.ReportProgress(0, "正在禁用档期...");
  1017. if (timeDataBll.SetTimeDisable(cameraTemplate.GetCameraTimeTemplate(cameraTime.ID), true))
  1018. {
  1019. cameraTime.ReservationTime = timeDataBll.GetReservationTimeData(cameraTime.ID);
  1020. isSetStatus = true;
  1021. }
  1022. else
  1023. {
  1024. MessageBoxCustom.Show(String.Format("禁用档期失败,刷新数据后重试"));
  1025. }
  1026. }
  1027. catch (Exception ex)
  1028. {
  1029. MessageBoxCustom.Show(String.Format("禁用档期时出错:{0}", ex.Message));
  1030. }
  1031. });
  1032. break;
  1033. case "取消禁用":
  1034. if (cameraTime.ID <= 0)
  1035. {
  1036. return;
  1037. }
  1038. if (this.IsMultiShopID(this.CurrentQueryStoreList2))
  1039. {
  1040. MessageBoxCustom.Show("取消禁用档期时,只能选择一个门店");
  1041. return;
  1042. }
  1043. if (!LYFZ.BLL.BLL_ErpUser.GetRights(this.CurrentUserRights.CameraControlBook, LYFZ.CustomAttributes.OperatingAuthority.DisableOREnableSchedule))
  1044. {
  1045. MessageBoxCustom.Show("您没有取消禁用当前门店档期的权限!");
  1046. return;
  1047. }
  1048. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate (object obj, BackgroundWorker backgroundWorker)
  1049. {
  1050. try
  1051. {
  1052. backgroundWorker.ReportProgress(0, "正在取消禁用档期...");
  1053. if (timeDataBll.SetTimeDisable(cameraTemplate.GetCameraTimeTemplate(cameraTime.ID), false))
  1054. {
  1055. cameraTime.ReservationTime = timeDataBll.GetReservationTimeData(cameraTime.ID);
  1056. isSetStatus = true;
  1057. }
  1058. else
  1059. {
  1060. MessageBoxCustom.Show(String.Format("取消禁用档期失败,刷新数据后重试"));
  1061. }
  1062. }
  1063. catch (Exception ex)
  1064. {
  1065. MessageBoxCustom.Show(String.Format("取消禁用档期时出错:{0}", ex.Message));
  1066. }
  1067. });
  1068. break;
  1069. case "清除异常预约":
  1070. if (cameraTime.ReservationError() && cameraTime.ReservationTime.ID > 0)
  1071. {
  1072. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate (object obj, BackgroundWorker backgroundWorker)
  1073. {
  1074. try
  1075. {
  1076. backgroundWorker.ReportProgress(0, "正在清除异常预约...");
  1077. if (timeDataBll.Delete(cameraTime.ReservationTime))
  1078. {
  1079. cameraTime.ReservationTime.OrderNumber = "";
  1080. cameraTime.ReservationTime.CameraReserveIDList = "";
  1081. isSetStatus = true;
  1082. }
  1083. else
  1084. {
  1085. MessageBoxCustom.Show(String.Format("清除异常预约失败,刷新数据后重试"));
  1086. }
  1087. }
  1088. catch (Exception ex)
  1089. {
  1090. MessageBoxCustom.Show(String.Format("清除异常预约时出错:{0}", ex.Message));
  1091. }
  1092. });
  1093. }
  1094. else {
  1095. MessageBoxCustom.Show("不是“预约异常”的客人预约信息不可清除。");
  1096. }
  1097. break;
  1098. }
  1099. if (isSetStatus)
  1100. {
  1101. CameraType cameraType = SetCameraTemplate.GetCameraType(this.flowLayoutPanel3.Controls);
  1102. this.BindPanelDataView(cameraType);
  1103. }
  1104. }
  1105. /// <summary>
  1106. /// 开始预约
  1107. /// </summary>
  1108. /// <param name="cameraTemplate"></param>
  1109. /// <param name="cameraTime"></param>
  1110. /// <returns></returns>
  1111. bool StartReservation(LYFZ.Model.CameraControlTemplate cameraTemplate, CameraTimeTemplate cameraTime,bool isEdit=false)
  1112. {
  1113. bool IsSaveed = false;
  1114. if (!isEdit)
  1115. {
  1116. if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.IsWithinSchedule)
  1117. {
  1118. if (cameraTime != null)
  1119. {
  1120. if (cameraTime.ReservationTime.IsEnable == 0)
  1121. {
  1122. MessageBoxCustom.Show("已禁用的档期不可以预约");
  1123. return false;
  1124. }
  1125. if (!String.IsNullOrWhiteSpace(cameraTime.ReservationTime.OrderNumber))
  1126. {
  1127. MessageBoxCustom.Show("当前档期已预约了客人,不可再预约其它客人");
  1128. return false;
  1129. }
  1130. if (cameraTime.ID <= 0)
  1131. {
  1132. MessageBoxCustom.Show("不是预设档期档,不可以预约");
  1133. return false;
  1134. }
  1135. bool isPublicHoliday = this.thumbtackRecordList.Any(t =>t.ThumbtackType==1&& t.DateTimeMark.JavaScriptTimeStampToDateTime().ToYYYY_MM_dd() == cameraTime.DayTemplate.CameraDateTime.JavaScriptTimeStampToDateTime().ToYYYY_MM_dd());
  1136. if (isPublicHoliday)
  1137. {
  1138. MessageBoxCustom.Show("公休日不可以预约");
  1139. return false;
  1140. }
  1141. if (Convert.ToDateTime(String.Format("{0} {1}", cameraTime.DayTemplate.CameraDateTime.JavaScriptTimeStampToDateTime().ToYYYY_MM_dd(), cameraTime.CameraTime)) < SDateTime.Now)
  1142. {
  1143. MessageBoxCustom.Show("不可以预约到已过去的时间");
  1144. return false;
  1145. }
  1146. }
  1147. }
  1148. }
  1149. CameraType cameraType = SetCameraTemplate.GetCameraType(this.flowLayoutPanel3.Controls);
  1150. switch (cameraType)
  1151. {
  1152. case CameraType.拍照客人:
  1153. {
  1154. LYFZ.Software.MainBusiness.CameraControlBook.SmallForm.PhotographedReservationSmallForm frm = new CameraControlBook.SmallForm.PhotographedReservationSmallForm();
  1155. frm.CurrentSelectCameraTime = cameraTime;
  1156. if (cameraTime != null&& isEdit)
  1157. {
  1158. frm.IsEditCameraTime = true;
  1159. frm.OrdNumber = cameraTime.ReservationTime.OrderNumber;
  1160. }
  1161. frm.ShowDialog();
  1162. IsSaveed = frm.IsSave;
  1163. }
  1164. break;
  1165. case CameraType.选片客人:
  1166. {
  1167. LYFZ.Software.MainBusiness.CameraControlBook.SmallForm.FilmsSelectionReservationSmallForm frm = new CameraControlBook.SmallForm.FilmsSelectionReservationSmallForm();
  1168. frm.CurrentSelectCameraTime = cameraTime;
  1169. if (cameraTime != null && isEdit)
  1170. {
  1171. if (cameraTime.Parameter.DataRows != null && cameraTime.Parameter.DataRows.Length > 0)
  1172. {
  1173. frm.OrdViceNumber = cameraTime.Parameter.DataRows[0]["Ordv_ViceNumber"].ToString();
  1174. }
  1175. }
  1176. frm.ShowDialog();
  1177. IsSaveed = frm.IsSave;
  1178. }
  1179. break;
  1180. case CameraType.看版客人:
  1181. {
  1182. LYFZ.Software.MainBusiness.CameraControlBook.SmallForm.LookDesignReservationSmallForm frm = new CameraControlBook.SmallForm.LookDesignReservationSmallForm();
  1183. frm.CurrentSelectCameraTime = cameraTime;
  1184. if (cameraTime != null && isEdit)
  1185. {
  1186. if (cameraTime.Parameter.DataRows != null && cameraTime.Parameter.DataRows.Length > 0)
  1187. {
  1188. frm.OrdViceNumber = cameraTime.Parameter.DataRows[0]["Ordv_ViceNumber"].ToString();
  1189. }
  1190. }
  1191. frm.ShowDialog();
  1192. IsSaveed = frm.IsSave;
  1193. }
  1194. break;
  1195. case CameraType.取件客人:
  1196. {
  1197. LYFZ.Software.MainBusiness.CameraControlBook.SmallForm.TakePiecesReservationSmallForm frm = new CameraControlBook.SmallForm.TakePiecesReservationSmallForm();
  1198. frm.CurrentSelectCameraTime = cameraTime;
  1199. if (cameraTime != null && isEdit)
  1200. {
  1201. frm.OrdNumber = cameraTime.ReservationTime.OrderNumber;
  1202. }
  1203. frm.ShowDialog();
  1204. IsSaveed = frm.IsSave;
  1205. }
  1206. break;
  1207. case CameraType.选衣客人:
  1208. {
  1209. LYFZ.Software.MainBusiness.CameraControlBook.SmallForm.SelectDressReservationSmallForm frm = new CameraControlBook.SmallForm.SelectDressReservationSmallForm();
  1210. frm.CurrentSelectCameraTime = cameraTime;
  1211. if (cameraTime != null && isEdit)
  1212. {
  1213. if (cameraTime.Parameter.DataRows != null && cameraTime.Parameter.DataRows.Length > 0)
  1214. {
  1215. frm.OrdViceNumber = cameraTime.Parameter.DataRows[0]["Ordv_ViceNumber"].ToString();
  1216. }
  1217. }
  1218. frm.ShowDialog();
  1219. IsSaveed = frm.IsSave;
  1220. }
  1221. break;
  1222. case CameraType.服务客人:
  1223. {
  1224. LYFZ.Software.MainBusiness.CameraControlBook.SmallForm.WeddingReservationSmallForm frm = new CameraControlBook.SmallForm.WeddingReservationSmallForm();
  1225. frm.CurrentSelectCameraTime = cameraTime;
  1226. if (cameraTime != null && isEdit)
  1227. {
  1228. frm.OrdNumber = cameraTime.ReservationTime.OrderNumber;
  1229. }
  1230. frm.ShowDialog();
  1231. IsSaveed = frm.IsSaveed;
  1232. }
  1233. break;
  1234. case CameraType.爱婴上门:
  1235. {
  1236. if (cameraTime != null && isEdit)
  1237. {
  1238. LYFZ.Software.MainBusiness.HospitalTrackingSystem.DispatchDoor frm = new HospitalTrackingSystem.DispatchDoor();
  1239. frm.CurrentSelectCameraTime = cameraTime;
  1240. if (cameraTime != null && isEdit)
  1241. {
  1242. frm.StrOrderNumber = cameraTime.ReservationTime.OrderNumber;
  1243. }
  1244. frm.ShowDialog();
  1245. IsSaveed = frm.IsSaveed;
  1246. }
  1247. else {
  1248. MessageBoxCustom.Show("爱婴上门不支持直接客人上门预约,请到爱婴跟踪系统中安排上门服务");
  1249. }
  1250. }
  1251. break;
  1252. default:
  1253. break;
  1254. }
  1255. return IsSaveed;
  1256. }
  1257. /// <summary>
  1258. /// 下一页
  1259. /// </summary>
  1260. /// <param name="sender"></param>
  1261. /// <param name="e"></param>
  1262. private void LikDownPage_Click(object sender, EventArgs e)
  1263. {
  1264. this.currentPage++;
  1265. if (this.currentPage > sumPageCount)
  1266. {
  1267. this.currentPage = sumPageCount;
  1268. return;
  1269. }
  1270. CameraType cameraType = SetCameraTemplate.GetCameraType(this.flowLayoutPanel3.Controls);
  1271. this.BindPanelDataView(cameraType);
  1272. }
  1273. /// <summary>
  1274. /// 上一页
  1275. /// </summary>
  1276. /// <param name="sender"></param>
  1277. /// <param name="e"></param>
  1278. private void LikUpPage_Click(object sender, EventArgs e)
  1279. {
  1280. this.currentPage--;
  1281. if (this.currentPage < 1)
  1282. {
  1283. this.currentPage = 1;
  1284. return;
  1285. }
  1286. CameraType cameraType = SetCameraTemplate.GetCameraType(this.flowLayoutPanel3.Controls);
  1287. this.BindPanelDataView(cameraType);
  1288. }
  1289. private void BtnUpdateQuery_Click(object sender, EventArgs e)
  1290. {
  1291. GetCurrentQueryStoreList(ref CurrentQueryStoreList, this.cbxStoreList);
  1292. this.InitializeCalendar();
  1293. }
  1294. private void BtnQuery_Click(object sender, EventArgs e)
  1295. {
  1296. this.LoadTemplateData();
  1297. }
  1298. /// <summary>
  1299. /// 设置订单类型复选框显示
  1300. /// </summary>
  1301. void SetOrderTypeChBoxShow()
  1302. {
  1303. CameraType cameraType = SetCameraTemplate.GetCameraType(this.flowLayoutPanel3.Controls);
  1304. List<CameraOrderType> cameraOrderTypeList = SetCameraTemplate.GetCameraOrderTypeList(cameraType, GetCurrentStoreBusinessType(this.CurrentQueryStoreList2));
  1305. foreach (Control con in this.flowLayoutPanel4.Controls)
  1306. {
  1307. if (con.GetType() == typeof(LYFZ.ComponentLibrary.CheckBoxEx))
  1308. {
  1309. LYFZ.ComponentLibrary.CheckBoxEx OrderCheckBox = (LYFZ.ComponentLibrary.CheckBoxEx)con;
  1310. int orderType =Convert.ToInt32(OrderCheckBox.Tag);
  1311. if (cameraOrderTypeList.Any(t => (int)t == orderType))
  1312. {
  1313. OrderCheckBox.Show();
  1314. }
  1315. else {
  1316. OrderCheckBox.Hide();
  1317. }
  1318. }
  1319. }
  1320. }
  1321. /// <summary>
  1322. /// 注册订单类型复选框事件
  1323. /// </summary>
  1324. void RegisteredCheckBoxEvent()
  1325. {
  1326. foreach (Control con in this.flowLayoutPanel4.Controls)
  1327. {
  1328. if (con.GetType() == typeof(LYFZ.ComponentLibrary.CheckBoxEx))
  1329. {
  1330. LYFZ.ComponentLibrary.CheckBoxEx OrderCheckBox = (LYFZ.ComponentLibrary.CheckBoxEx)con;
  1331. OrderCheckBox.Click += OrderCheckBox_Click;
  1332. }
  1333. }
  1334. }
  1335. private void OrderCheckBox_Click(object sender, EventArgs e)
  1336. {
  1337. LYFZ.ComponentLibrary.CheckBoxEx OrderCheckBox = (LYFZ.ComponentLibrary.CheckBoxEx)sender;
  1338. int orderType = Convert.ToInt32(OrderCheckBox.Tag);
  1339. this.BindPanelDataView((CameraType)orderType);
  1340. }
  1341. List<int> GetOrderTypeList()
  1342. {
  1343. List<int> orderTypeList = new List<int>();
  1344. foreach (Control con in this.flowLayoutPanel4.Controls)
  1345. {
  1346. if (con.GetType() == typeof(LYFZ.ComponentLibrary.CheckBoxEx))
  1347. {
  1348. LYFZ.ComponentLibrary.CheckBoxEx OrderCheckBox = (LYFZ.ComponentLibrary.CheckBoxEx)con;
  1349. int orderType = Convert.ToInt32(OrderCheckBox.Tag);
  1350. if (OrderCheckBox.Checked)
  1351. {
  1352. orderTypeList.Add(orderType);
  1353. }
  1354. }
  1355. }
  1356. return orderTypeList;
  1357. }
  1358. void RegisteredRadioButtonEvent()
  1359. {
  1360. foreach (Control con in this.flowLayoutPanel3.Controls)
  1361. {
  1362. if (con.GetType() == typeof(LYFZ.ComponentLibrary.RadioButtonEx))
  1363. {
  1364. LYFZ.ComponentLibrary.RadioButtonEx rdo = (LYFZ.ComponentLibrary.RadioButtonEx)con;
  1365. rdo.Click += Rdo_Click;
  1366. }
  1367. }
  1368. }
  1369. private void Rdo_Click(object sender, EventArgs e)
  1370. {
  1371. this.SetOrderTypeChBoxShow();
  1372. this.SetStatisticsUnfinished();
  1373. this.LoadTemplateData();
  1374. }
  1375. void SetStatisticsUnfinished()
  1376. {
  1377. CameraType cameraType = SetCameraTemplate.GetCameraType(this.flowLayoutPanel3.Controls);
  1378. if (cameraType == CameraType.选衣客人)
  1379. {
  1380. this.likConfirmDressing.Show();
  1381. }
  1382. else {
  1383. this.likConfirmDressing.Hide();
  1384. }
  1385. if (cameraType == CameraType.爱婴上门)
  1386. {
  1387. this.btnPrint.Hide();
  1388. this.btnReservation.Hide();
  1389. }
  1390. else {
  1391. this.btnPrint.Show();
  1392. this.btnReservation.Show();
  1393. }
  1394. switch (cameraType)
  1395. {
  1396. case CameraType.拍照客人:
  1397. this.likStatisticsUnfinished.Show();
  1398. this.likStatisticsUnfinished.Text = "统计未拍";
  1399. break;
  1400. case CameraType.选片客人:
  1401. this.likStatisticsUnfinished.Show();
  1402. this.likStatisticsUnfinished.Text = "统计未选片";
  1403. break;
  1404. case CameraType.看版客人:
  1405. this.likStatisticsUnfinished.Show();
  1406. this.likStatisticsUnfinished.Text = "统计未看版";
  1407. break;
  1408. case CameraType.取件客人:
  1409. this.likStatisticsUnfinished.Show();
  1410. this.likStatisticsUnfinished.Text = "统计未取件";
  1411. break;
  1412. case CameraType.选衣客人:
  1413. this.likStatisticsUnfinished.Show();
  1414. this.likStatisticsUnfinished.Text = "统计未选衣";
  1415. break;
  1416. case CameraType.服务客人:
  1417. this.likStatisticsUnfinished.Show();
  1418. this.likStatisticsUnfinished.Text = "统计未服务";
  1419. break;
  1420. default:
  1421. this.likStatisticsUnfinished.Hide();
  1422. break;
  1423. }
  1424. }
  1425. void SetCameraTypeRadioButton(CameraType cameraType)
  1426. {
  1427. foreach (Control con in this.flowLayoutPanel3.Controls)
  1428. {
  1429. if (con.GetType() == typeof(LYFZ.ComponentLibrary.RadioButtonEx))
  1430. {
  1431. LYFZ.ComponentLibrary.RadioButtonEx rdo = (LYFZ.ComponentLibrary.RadioButtonEx)con;
  1432. if (cameraType == (CameraType)Enum.Parse(typeof(CameraType), rdo.Text))
  1433. {
  1434. rdo.Checked=true;
  1435. break;
  1436. }
  1437. }
  1438. }
  1439. this.SetOrderTypeChBoxShow();
  1440. }
  1441. /// <summary>
  1442. /// 安排任务的任务类型
  1443. /// </summary>
  1444. public string StrClientServiceType = "";
  1445. void GoToCameraRecord()
  1446. {
  1447. if (!String.IsNullOrWhiteSpace(StrClientServiceType))
  1448. {
  1449. CameraType cameraType = CameraType.拍照客人;
  1450. /* StrList.Add(LYFZ.EnumPublic.ClientServiceTaskItem.选衣服客人.ToString());
  1451. StrList.Add(LYFZ.EnumPublic.ClientServiceTaskItem.拍照客人.ToString());
  1452. StrList.Add(LYFZ.EnumPublic.ClientServiceTaskItem.选片客人.ToString());
  1453. StrList.Add(LYFZ.EnumPublic.ClientServiceTaskItem.看版客人.ToString());
  1454. StrList.Add(LYFZ.EnumPublic.ClientServiceTaskItem.取件客人.ToString());
  1455. StrList.Add(LYFZ.EnumPublic.ClientServiceTaskItem.服务客人.ToString());
  1456. StrList.Add(LYFZ.EnumPublic.ClientServiceTaskItem.摄控医院客人.ToString());*/
  1457. LYFZ.EnumPublic.ClientServiceTaskItem serviceTaskItem = (LYFZ.EnumPublic.ClientServiceTaskItem)Enum.Parse(typeof(LYFZ.EnumPublic.ClientServiceTaskItem), StrClientServiceType);
  1458. switch (serviceTaskItem)
  1459. {
  1460. case LYFZ.EnumPublic.ClientServiceTaskItem.拍照客人:
  1461. cameraType = CameraType.拍照客人;
  1462. break;
  1463. case LYFZ.EnumPublic.ClientServiceTaskItem.选片客人:
  1464. cameraType = CameraType.选片客人;
  1465. break;
  1466. case LYFZ.EnumPublic.ClientServiceTaskItem.看版客人:
  1467. cameraType = CameraType.看版客人;
  1468. break;
  1469. case LYFZ.EnumPublic.ClientServiceTaskItem.取件客人:
  1470. cameraType = CameraType.取件客人;
  1471. break;
  1472. case LYFZ.EnumPublic.ClientServiceTaskItem.服务客人:
  1473. cameraType = CameraType.服务客人;
  1474. break;
  1475. case LYFZ.EnumPublic.ClientServiceTaskItem.选衣服客人:
  1476. cameraType = CameraType.选衣客人;
  1477. break;
  1478. case LYFZ.EnumPublic.ClientServiceTaskItem.摄控医院客人:
  1479. cameraType = CameraType.爱婴上门;
  1480. break;
  1481. }
  1482. this.GoToCameraRecord(this.cbxStoreList.SelectedIndex, cameraType, SDateTime.Now);
  1483. }
  1484. }
  1485. bool isGoToCameraRecord = false;
  1486. /// <summary>
  1487. /// 转到摄控记录
  1488. /// </summary>
  1489. /// <param name="shopIDSelectIndex"></param>
  1490. /// <param name="cameraType"></param>
  1491. /// <param name="dayDate"></param>
  1492. void GoToCameraRecord(int shopIDSelectIndex, CameraType cameraType,DateTime dayDate)
  1493. {
  1494. isGoToCameraRecord = true;
  1495. this.ClearDataTable(this.currentOrderDataTable);
  1496. this.dateTimePickerStar.Value = dayDate;
  1497. this.dateTimePickerEnd.Value = dayDate;
  1498. this.SetCameraTypeRadioButton(cameraType);
  1499. this.cbxStoreList2.SelectedIndex = shopIDSelectIndex;
  1500. this.tabControlEx1.SelectedIndex = 1;
  1501. // this.LoadTemplateData();
  1502. }
  1503. protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
  1504. {
  1505. return base.ProcessCmdKey(ref msg, keyData);
  1506. }
  1507. private void PanelDataView_EventCellThumbtack_MouseEnter(Panel viewPanel, DataEventArgs e)
  1508. {
  1509. this.tpsInfo.ToolTipTitle = "图钉内容预览";
  1510. this.tpsInfo.Show(String.Format("{0}",e.CurrentThumbtack.ThumbtackText), this.PanelDataView, new Point(e.MousePoint.X + 10, e.MousePoint.Y), 5000);
  1511. }
  1512. private void PanelDataView_EventCellThumbtack_DoubleClick(Panel viewPanel, DataEventArgs e)
  1513. {
  1514. if (e.CurrentThumbtack.Tag != null)
  1515. {
  1516. LYFZ.Model.ThumbtackRecord record = (LYFZ.Model.ThumbtackRecord)e.CurrentThumbtack.Tag;
  1517. ThumbtackType thumType = (ThumbtackType)e.CurrentThumbtack.ThumbtackType;
  1518. if (thumType == ThumbtackType.公休图钉 || thumType == ThumbtackType.摄控本日历图钉)
  1519. {
  1520. if (this.EditThumbtackRecord(record, e.CurrentCell.DateTimeTag, thumType))
  1521. {
  1522. if (record.ThumbtackInfo.ToLower() != e.CurrentThumbtack.ThumbtackText.ToLower())
  1523. {
  1524. e.CurrentThumbtack.ThumbtackText = record.ThumbtackInfo;
  1525. this.PanelDataView.RefreshCell(e.CrrrentRow, e.CurrentCell);
  1526. this.isUpdateQuery = true;
  1527. }
  1528. if (String.IsNullOrWhiteSpace(e.CurrentThumbtack.ThumbtackText))
  1529. {
  1530. e.CurrentCell.CrossRowCell.ThumbtackList.Remove(e.CurrentThumbtack);
  1531. this.thumbtackRecordList.Remove(this.thumbtackRecordList.Find(r => r.ID == record.ID));
  1532. CameraType cameraType = SetCameraTemplate.GetCameraType(this.flowLayoutPanel3.Controls);
  1533. this.BindPanelDataView(cameraType);
  1534. }
  1535. }
  1536. }
  1537. }
  1538. // MessageBoxCustom.Show(e.CurrentThumbtack.ThumbtackText);
  1539. }
  1540. QueryStoreInfo GetCurrentStoreInfo()
  1541. {
  1542. if (this.CurrentQueryStoreList2 != null && this.CurrentQueryStoreList2.QueryStoreInfoList.Count > 0)
  1543. {
  1544. return this.CurrentQueryStoreList2.QueryStoreInfoList[0];
  1545. }
  1546. return new QueryStoreInfo
  1547. {
  1548. DividedShop = LYFZ.BLL.BLL_ErpCompanyInfo.CurrentCompanyInfoID
  1549. ,
  1550. DividedShop_Name = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.CompanyName
  1551. };
  1552. }
  1553. Model_UserRights CurrentUserRights
  1554. {
  1555. get {
  1556. return LYFZ.BLL.BLL_ErpUser.GetSIDToUserRights(this.GetCurrentStoreInfo().DividedShop);
  1557. }
  1558. }
  1559. /// <summary>
  1560. /// 权限验证
  1561. /// </summary>
  1562. /// <param name="moduleBlock"></param>
  1563. /// <param name="operatingAuthority"></param>
  1564. /// <returns></returns>
  1565. bool VerificationRights(LYFZ.CustomAttributes.RightsValue moduleBlock, LYFZ.CustomAttributes.OperatingAuthority operatingAuthority)
  1566. {
  1567. if (this.IsMultiShopID(this.CurrentQueryStoreList2))
  1568. {
  1569. MessageBoxCustom.Show("此操作时,只能选择一个门店");
  1570. return false;
  1571. }
  1572. if (!LYFZ.BLL.BLL_ErpUser.GetRights(moduleBlock, operatingAuthority))
  1573. {
  1574. return false;
  1575. }
  1576. return true;
  1577. }
  1578. private void BtnSetTemplate_Click(object sender, EventArgs e)
  1579. {
  1580. if (this.IsMultiShopID(this.CurrentQueryStoreList2))
  1581. {
  1582. MessageBoxCustom.Show("设置摄控档期模板时,只能选择一个门店");
  1583. return;
  1584. }
  1585. if (!LYFZ.BLL.BLL_ErpUser.GetRights(this.CurrentUserRights.CameraControlBook, LYFZ.CustomAttributes.OperatingAuthority.SetCameraTemplate))
  1586. {
  1587. MessageBoxCustom.Show("您没有设置当前门店档期模板的权限!");
  1588. return;
  1589. }
  1590. SetCameraTemplate setTemplate = new SetCameraTemplate();
  1591. setTemplate.CurrentQueryStoreList = this.CurrentQueryStoreList2;
  1592. setTemplate.ShowDialog();
  1593. if (setTemplate.WhetherUpdate)
  1594. {
  1595. this.LoadTemplateData();
  1596. this.isUpdateQuery = true;
  1597. }
  1598. if (!setTemplate.IsDisposed)
  1599. {
  1600. setTemplate.Dispose();
  1601. }
  1602. }
  1603. private void BtnCustomColor_Click(object sender, EventArgs e)
  1604. {
  1605. CameraControlBook.SmallForm.frmColorManager frmColor = new CameraControlBook.SmallForm.frmColorManager();
  1606. if (frmColor.ShowDialog() == DialogResult.OK)
  1607. {
  1608. LoadColorList();
  1609. }
  1610. }
  1611. private void PanelDataView_EventCell_MouseEnter(Panel viewPanel, DataEventArgs e)
  1612. {
  1613. }
  1614. List<Model.TitleColumnDisplay> _TitleColumnDisplayList = new List<Model.TitleColumnDisplay>();
  1615. /// <summary>
  1616. /// 检查满意度字段是否存在
  1617. /// </summary>
  1618. /// <param name="columnText"></param>
  1619. /// <returns></returns>
  1620. bool CheckSatisfactionColumnDisplay(string columnText)
  1621. {
  1622. if (columnText.ToLower().Contains("满意度"))
  1623. {
  1624. return true;
  1625. }
  1626. return false;
  1627. }
  1628. /// <summary>
  1629. /// 检查沟通记录字段是否存在
  1630. /// </summary>
  1631. /// <param name="columnText"></param>
  1632. /// <returns></returns>
  1633. bool CheckCommunicateColumnDisplay(string columnText)
  1634. {
  1635. if (columnText.ToLower() == "客服人员"
  1636. || columnText.ToLower() == "沟通时间"
  1637. || columnText.ToLower() == "沟通状态"
  1638. || columnText.ToLower() == "沟通备注")
  1639. {
  1640. return true;
  1641. }
  1642. return false;
  1643. }
  1644. void LoadTitleColumnDisplayList(string ctDataViewID)
  1645. {
  1646. this._TitleColumnDisplayList.Clear();
  1647. LYFZ.Model.Model_GridViewDisplayIndex model_GridViewDisplay= LYFZ.DAL.DAL_GridViewDisplayIndex.GetGridViewDisplayIndexModel(LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID, ctDataViewID);
  1648. this._TitleColumnDisplayList= Model.TitleColumnDisplay.ToTitleColumnDisplayList(model_GridViewDisplay.DisplayIndexValue);
  1649. if (this._TitleColumnDisplayList == null)
  1650. {
  1651. this._TitleColumnDisplayList = new List<TitleColumnDisplay>();
  1652. }
  1653. if (this._TitleColumnDisplayList.Count <= 0)
  1654. {
  1655. EnumPermissions.BusinessType businessType = GetCurrentStoreBusinessType(this.CurrentQueryStoreList2);
  1656. CameraType cameraType = SetCameraTemplate.GetCameraType(this.flowLayoutPanel3.Controls);
  1657. List<string> tempcolumnsList= DAL.CameraDataQuery.GetCameraDataColumns(cameraType, businessType).FindAll(t=> CheckSatisfactionColumnDisplay(t)
  1658. || CheckCommunicateColumnDisplay(t));
  1659. foreach (string columnText in tempcolumnsList)
  1660. {
  1661. this._TitleColumnDisplayList.Add(new TitleColumnDisplay {
  1662. ColumnText = columnText
  1663. ,
  1664. Index = -99999
  1665. ,
  1666. Display = 0
  1667. });
  1668. }
  1669. }
  1670. }
  1671. private void PanelDataView_EventCell_DoubleClick(Panel viewPanel, DataEventArgs e)
  1672. {
  1673. if (e.IsHeadRow)
  1674. {
  1675. EnumPermissions.BusinessType businessType = GetCurrentStoreBusinessType(this.CurrentQueryStoreList2);
  1676. CameraType cameraType = SetCameraTemplate.GetCameraType(this.flowLayoutPanel3.Controls);
  1677. LYFZ.ComponentLibrary.DataViewColumnSet viewColumnSet = new DataViewColumnSet();
  1678. viewColumnSet.DgvGuidName = this.currentDataViewID;
  1679. viewColumnSet.DgvUserEmployeeID = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;
  1680. viewColumnSet.DataCoumnList = DAL.CameraDataQuery.GetCameraDataColumns(cameraType, businessType);
  1681. viewColumnSet.EnabledList= DAL.CameraDataQuery.GetColumnsEnabledList();
  1682. viewColumnSet.TitleColumnDisplayList = this._TitleColumnDisplayList;
  1683. if (viewColumnSet.ShowDialog() == DialogResult.OK)
  1684. {
  1685. this.LoadTitleColumnDisplayList(this.currentDataViewID);
  1686. this.BindPanelDataView(cameraType);
  1687. }
  1688. }
  1689. else
  1690. {
  1691. PDataColumn titleText = this.PanelDataView.HeadColumnRow.DataColumnList[e.CurrentCell.CellIndex];
  1692. if (titleText.Text=="通知状态" || titleText.Text == "通知备注")
  1693. {
  1694. // LYFZ.Model.CameraControlTemplate cameraTemplate = (LYFZ.Model.CameraControlTemplate)e.CrrrentRow.Tag;
  1695. CameraTimeTemplate cameraTime = (CameraTimeTemplate)e.CrrrentRow.DataColumnList[2].Tag;
  1696. if (cameraTime.Parameter.WithinSchedule)
  1697. {
  1698. if (cameraTime.ReservationTime.ID > 0&&!String.IsNullOrWhiteSpace(cameraTime.ReservationTime.OrderNumber))
  1699. {
  1700. frmNotifyCustomer frmNotify = new frmNotifyCustomer();
  1701. frmNotify.NotifyType = (NotifyCustomerType)cameraTime.ReservationTime.NotifyCustomerType;
  1702. frmNotify.CustomerText = cameraTime.ReservationTime.CustomerFeedback.Trim();
  1703. if (frmNotify.ShowDialog() == DialogResult.OK)
  1704. {
  1705. cameraTime.ReservationTime.NotifyCustomerType = (int)frmNotify.NotifyType;
  1706. cameraTime.ReservationTime.CustomerFeedback = frmNotify.CustomerText.Trim();
  1707. bool UpdateStatus = false;
  1708. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate (object obj, BackgroundWorker backgroundWorker)
  1709. {
  1710. try
  1711. {
  1712. backgroundWorker.ReportProgress(0, "正在设置通知方式...");
  1713. if (timeDataBll.Update(cameraTime.ReservationTime))
  1714. {
  1715. cameraTime.ReservationTime = timeDataBll.GetReservationTimeData(cameraTime.ID);
  1716. UpdateStatus = true;
  1717. }
  1718. else
  1719. {
  1720. MessageBoxCustom.Show(String.Format("设置通知方式失败,请重新刷新后重试"));
  1721. }
  1722. }
  1723. catch (Exception ex)
  1724. {
  1725. MessageBoxCustom.Show(String.Format("加载数据时出错:{0}", ex.Message));
  1726. }
  1727. });
  1728. if (UpdateStatus)
  1729. {
  1730. this.BindPanelDataView();
  1731. }
  1732. }
  1733. }
  1734. else {
  1735. MessageBoxCustom.Show(String.Format("当前档期还没预约客人,不可设置通知方式"));
  1736. }
  1737. }
  1738. else {
  1739. MessageBoxCustom.Show("不在档期内的预约不可设置通知方式");
  1740. }
  1741. }
  1742. // MessageBoxCustom.Show(e.CurrentCell.Text);
  1743. }
  1744. }
  1745. private void PanelDataView_EventCell_Click(Panel viewPanel, DataEventArgs e)
  1746. {
  1747. this.HideTpsInfo();
  1748. if (e.Button == MouseButtons.Right)
  1749. {
  1750. if (!e.IsHeadRow)
  1751. {
  1752. PDataColumn titleText = this.PanelDataView.HeadColumnRow.DataColumnList[e.CurrentCell.CellIndex];
  1753. if (e.CurrentCell.CellIndex == 0)
  1754. {
  1755. CellWeekContent cellWeek = new CellWeekContent(e.CurrentCell.DateTimeTag.Year, e.CurrentCell.DateTimeTag.Month, 0);
  1756. cellWeek.SetDayTime(e.CurrentCell.DateTimeTag);
  1757. cellWeek.Thumbtack = e.CurrentCell.ThumbtackList.Find(t => t.ThumbtackType == 2);
  1758. cellWeek.PublicHoliday = e.CurrentCell.ThumbtackList.Find(t => t.ThumbtackType == 1);
  1759. if (cellWeek.Thumbtack == null)
  1760. {
  1761. cellWeek.Thumbtack = new ThumbtackData();
  1762. cellWeek.Thumbtack.ThumbtackType = 2;
  1763. }
  1764. if (cellWeek.PublicHoliday == null)
  1765. {
  1766. cellWeek.PublicHoliday = new ThumbtackData();
  1767. cellWeek.PublicHoliday.ThumbtackType = 1;
  1768. }
  1769. cellWeek.Tag = e;
  1770. this.cmenuCameraBook.Tag = cellWeek;
  1771. this.cmenuCameraBook.Show(this.PanelDataView, e.MousePoint);
  1772. }
  1773. else if (e.CurrentCell.CellIndex >= 2 && e.CurrentCell.CellIndex <= 3)
  1774. {
  1775. // LYFZ.Model.CameraControlTemplate cameraTemplate = (LYFZ.Model.CameraControlTemplate)e.CrrrentRow.Tag;
  1776. CameraTimeTemplate cameraTime = (CameraTimeTemplate)e.CrrrentRow.DataColumnList[2].Tag;
  1777. if (String.IsNullOrWhiteSpace(cameraTime.ReservationTime.OrderNumber))
  1778. {
  1779. this.档期客人预约ToolStripMenuItem.Enabled = true;
  1780. this.取消档期预约ToolStripMenuItem.Enabled = false;
  1781. this.剪切档期预约toolStripMenuItem3.Enabled = false;
  1782. this.粘贴档期预约toolStripMenuItem4.Enabled = true;
  1783. this.客人预约改期ToolStripMenuItem.Enabled = false;
  1784. }
  1785. else
  1786. {
  1787. this.档期客人预约ToolStripMenuItem.Enabled = true;
  1788. this.取消档期预约ToolStripMenuItem.Enabled = true;
  1789. this.剪切档期预约toolStripMenuItem3.Enabled = true;
  1790. this.粘贴档期预约toolStripMenuItem4.Enabled = false;
  1791. this.客人预约改期ToolStripMenuItem.Enabled = true;
  1792. }
  1793. if (cameraTime.ReservationTime.IsEnable == 0)
  1794. {
  1795. this.禁用档期toolStripMenuItem1.Enabled = false;
  1796. this.取消禁用toolStripMenuItem2.Enabled = true;
  1797. }
  1798. else
  1799. {
  1800. this.禁用档期toolStripMenuItem1.Enabled = true;
  1801. this.取消禁用toolStripMenuItem2.Enabled = false;
  1802. }
  1803. this.contextMenuStrip_Time.Tag = e.CurrentCell;
  1804. this.contextMenuStrip_Time.Show(this.PanelDataView, e.MousePoint);
  1805. }
  1806. else if (titleText.Text == "自定义标签")
  1807. {
  1808. this.BidContextMenuStrip_CustomLabel();
  1809. this.contextMenuStrip_CustomLabel.Tag = e.CurrentCell;
  1810. this.contextMenuStrip_CustomLabel.Show(this.PanelDataView, e.MousePoint);
  1811. }
  1812. else if (e.CurrentCell.CellIndex > 3)
  1813. {
  1814. CameraTimeTemplate cameraTime = (CameraTimeTemplate)e.CrrrentRow.DataColumnList[2].Tag;
  1815. CameraType cameraType = SetCameraTemplate.GetCameraType(this.flowLayoutPanel3.Controls);
  1816. switch (cameraType)
  1817. {
  1818. case CameraType.拍照客人:
  1819. case CameraType.选片客人:
  1820. this.安排变更记录ToolStripMenuItem.Visible = true;
  1821. this.自定义颜色ToolStripMenuItem.Visible = true;
  1822. this.订单备注ToolStripMenuItem.Visible = true;
  1823. this.复制单元格内容ToolStripMenuItem.Visible = true;
  1824. this.SetRetakeMenuItemSubItem(this.订单备注ToolStripMenuItem, cameraTime);
  1825. //this.SetRetakeMenuItemSubItem(this.安排变更记录ToolStripMenuItem, cameraTime);
  1826. if (cameraType == CameraType.选片客人)
  1827. {
  1828. this.重拍ToolStripMenuItem.Visible = false;
  1829. this.重拍记录ToolStripMenuItem.Visible = false;
  1830. this.toolStripSeparator_1.Visible = true;
  1831. this.toolStripSeparator_2.Visible = false;
  1832. this.toolStripSeparator_3.Visible = true;
  1833. }
  1834. else
  1835. {
  1836. this.重拍ToolStripMenuItem.Visible = true;
  1837. this.重拍记录ToolStripMenuItem.Visible = true;
  1838. this.toolStripSeparator_1.Visible = true;
  1839. this.toolStripSeparator_2.Visible = true;
  1840. this.toolStripSeparator_3.Visible = true;
  1841. this.SetRetakeMenuItemSubItem(this.重拍ToolStripMenuItem, cameraTime);
  1842. this.SetRetakeMenuItemSubItem(this.重拍记录ToolStripMenuItem, cameraTime);
  1843. }
  1844. this.SetToolStripMenuItemSubItem(this.自定义颜色ToolStripMenuItem);
  1845. //bool IsPhotographRetake = true;//LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights(this.cmbtreevStoreName, "StoresPhotograph", LYFZ.CustomAttributes.OperatingAuthority.PhotographRetake);
  1846. break;
  1847. case CameraType.看版客人:
  1848. case CameraType.取件客人:
  1849. case CameraType.服务客人:
  1850. case CameraType.选衣客人:
  1851. this.安排变更记录ToolStripMenuItem.Visible = false;
  1852. this.自定义颜色ToolStripMenuItem.Visible = true;
  1853. this.订单备注ToolStripMenuItem.Visible = true;
  1854. this.复制单元格内容ToolStripMenuItem.Visible = true;
  1855. this.重拍ToolStripMenuItem.Visible = false;
  1856. this.重拍记录ToolStripMenuItem.Visible = false;
  1857. this.toolStripSeparator_1.Visible = true;
  1858. this.toolStripSeparator_2.Visible = false;
  1859. this.toolStripSeparator_3.Visible = true;
  1860. this.SetToolStripMenuItemSubItem(this.自定义颜色ToolStripMenuItem);
  1861. this.SetRetakeMenuItemSubItem(this.订单备注ToolStripMenuItem, cameraTime);
  1862. break;
  1863. case CameraType.爱婴上门:
  1864. this.安排变更记录ToolStripMenuItem.Visible = false;
  1865. this.自定义颜色ToolStripMenuItem.Visible = false;
  1866. this.订单备注ToolStripMenuItem.Visible = false;
  1867. this.复制单元格内容ToolStripMenuItem.Visible = true;
  1868. this.重拍ToolStripMenuItem.Visible = false;
  1869. this.重拍记录ToolStripMenuItem.Visible = false;
  1870. this.toolStripSeparator_1.Visible = false;
  1871. this.toolStripSeparator_2.Visible = false;
  1872. this.toolStripSeparator_3.Visible = false;
  1873. break;
  1874. }
  1875. if (String.IsNullOrWhiteSpace(cameraTime.ReservationTime.OrderNumber))
  1876. {
  1877. this.toolStripMenuItem_档期客人预约.Enabled = true;
  1878. this.ToolStripMenuItem_客人预约改期.Enabled = false;
  1879. }
  1880. else
  1881. {
  1882. this.toolStripMenuItem_档期客人预约.Enabled =false;
  1883. this.ToolStripMenuItem_客人预约改期.Enabled = true;
  1884. }
  1885. this.contextMenuStrip_OrderInfo.Tag = e.CurrentCell;
  1886. this.contextMenuStrip_OrderInfo.Show(this.PanelDataView, e.MousePoint);
  1887. }
  1888. }
  1889. }
  1890. }
  1891. BLL_ErpSystemConfigure systemConfigurebll = new BLL_ErpSystemConfigure();
  1892. CustomLabelData labelData = new CustomLabelData();
  1893. void BidContextMenuStrip_CustomLabel()
  1894. {
  1895. CameraType cameraType = SetCameraTemplate.GetCameraType(this.flowLayoutPanel3.Controls);
  1896. this.contextMenuStrip_CustomLabel.Items.Clear();
  1897. ToolStripMenuItem subItem0 = new ToolStripMenuItem();
  1898. subItem0.Text = String.Format("复制单元格");
  1899. ToolStripMenuItem subItem = new ToolStripMenuItem();
  1900. subItem.Text = String.Format("设置自定义标签");
  1901. this.contextMenuStrip_CustomLabel.Items.Add(subItem0);
  1902. this.contextMenuStrip_CustomLabel.Items.Add(new ToolStripSeparator());
  1903. this.contextMenuStrip_CustomLabel.Items.Add(subItem);
  1904. this.contextMenuStrip_CustomLabel.Items.Add(new ToolStripSeparator());
  1905. List<string> customLabelList = labelData.GetCustomLabelList(cameraType);
  1906. foreach(string item in customLabelList)
  1907. {
  1908. ToolStripMenuItem cItem = new ToolStripMenuItem();
  1909. cItem.Text = String.Format("{0}", item);
  1910. this.contextMenuStrip_CustomLabel.Items.Add(cItem);
  1911. }
  1912. }
  1913. private void ContextMenuStrip_CustomLabel_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
  1914. {
  1915. if (e.ClickedItem.Text == "设置自定义标签")
  1916. {
  1917. CameraType cameraType = SetCameraTemplate.GetCameraType(this.flowLayoutPanel3.Controls);
  1918. frmCustomLabel customLabel = new frmCustomLabel();
  1919. customLabel.AddCameraType = cameraType;
  1920. customLabel.LabelData = this.labelData;
  1921. if (customLabel.ShowDialog() == DialogResult.OK)
  1922. {
  1923. if (systemConfigurebll.SaveConfigureInfo(ConfigItemType.CameraCustomLabelData, this.labelData.ToString()))
  1924. {
  1925. MessageBoxCustom.Show("自定义标签设置成功");
  1926. this.BindCBXCustomLabel(cameraType);
  1927. }
  1928. else
  1929. {
  1930. MessageBoxCustom.Show("自定义标签设置失败");
  1931. }
  1932. }
  1933. }
  1934. else if (e.ClickedItem.Text == "复制单元格")
  1935. {
  1936. PDataColumn CurrentCell = (PDataColumn)this.contextMenuStrip_CustomLabel.Tag;
  1937. Clipboard.SetDataObject(CurrentCell.Text.Trim());
  1938. }
  1939. else
  1940. {
  1941. if (this.contextMenuStrip_CustomLabel.Tag == null)
  1942. {
  1943. MessageBoxCustom.Show("请选择行");
  1944. return;
  1945. }
  1946. PDataColumn CurrentCell = (PDataColumn)this.contextMenuStrip_CustomLabel.Tag;
  1947. PDataRow dataRow = this.PanelDataView.DataRowList[CurrentCell.RowIndex];
  1948. CameraTimeTemplate cameraTime = (CameraTimeTemplate)dataRow.DataColumnList[2].Tag;
  1949. if (cameraTime.Parameter.WithinSchedule)
  1950. {
  1951. if (cameraTime.ReservationTime.ID > 0 && !String.IsNullOrWhiteSpace(cameraTime.ReservationTime.OrderNumber))
  1952. {
  1953. cameraTime.ReservationTime.CustomLabel = e.ClickedItem.Text.Trim();
  1954. bool UpdateStatus = false;
  1955. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate (object obj, BackgroundWorker backgroundWorker)
  1956. {
  1957. try
  1958. {
  1959. backgroundWorker.ReportProgress(0, "正在设置自定义标签...");
  1960. if (timeDataBll.Update(cameraTime.ReservationTime))
  1961. {
  1962. cameraTime.ReservationTime = timeDataBll.GetReservationTimeData(cameraTime.ID);
  1963. UpdateStatus = true;
  1964. }
  1965. else
  1966. {
  1967. MessageBoxCustom.Show(String.Format("设置自定义标签失败,请重新刷新后重试"));
  1968. }
  1969. }
  1970. catch (Exception ex)
  1971. {
  1972. MessageBoxCustom.Show(String.Format("加载数据时出错:{0}", ex.Message));
  1973. }
  1974. });
  1975. if (UpdateStatus)
  1976. {
  1977. this.BindPanelDataView();
  1978. }
  1979. }
  1980. else
  1981. {
  1982. MessageBoxCustom.Show(String.Format("当前档期还没预约客人,不可设置自定义标签"));
  1983. }
  1984. }
  1985. else
  1986. {
  1987. MessageBoxCustom.Show("不在档期内的预约不能设置自定义标签");
  1988. }
  1989. }
  1990. }
  1991. /// <summary>
  1992. /// 设置重拍子菜单
  1993. /// </summary>
  1994. /// <param name="menuItem"></param>
  1995. /// <param name="cameraTime"></param>
  1996. void SetRetakeMenuItemSubItem(System.Windows.Forms.ToolStripMenuItem menuItem, CameraTimeTemplate cameraTime)
  1997. {
  1998. menuItem.DropDownItems.Clear();
  1999. if (cameraTime.ReservationTime.ToCameraReserveIDList().Count > 0)
  2000. {
  2001. if (cameraTime.ReservationTime.ToCameraReserveIDList().Count == 1)
  2002. {
  2003. if (cameraTime.Parameter.DataRows != null&& cameraTime.Parameter.DataRows.Length>0)
  2004. {
  2005. if (menuItem.Text.Trim() == "重拍")
  2006. {
  2007. menuItem.Tag = cameraTime.Parameter.DataRows[0]["VID"].ToString();
  2008. }
  2009. else if (menuItem.Text.Trim() == "重拍记录")
  2010. {
  2011. menuItem.Tag = cameraTime.Parameter.DataRows[0]["Ordpg_IDNumber"].ToString();
  2012. }
  2013. else if (menuItem.Text.Trim() == "订单备注")
  2014. {
  2015. menuItem.Tag = cameraTime.Parameter.DataRows[0]["Ordv_ViceNumber"].ToString();
  2016. }
  2017. else if (menuItem.Text.Trim() == "安排变更记录")
  2018. {
  2019. menuItem.Tag = cameraTime.Parameter.DataRows[0]["Ordv_ViceNumber"].ToString();
  2020. }
  2021. }
  2022. }
  2023. else {
  2024. if (cameraTime.Parameter.DataRows != null)
  2025. {
  2026. List<string> idList = cameraTime.ReservationTime.ToCameraReserveIDList();
  2027. foreach (DataRow row in cameraTime.Parameter.DataRows)
  2028. {
  2029. ToolStripMenuItem subItem = new ToolStripMenuItem();
  2030. subItem.Text =String.Format("{0}[{1}]", menuItem.Text.Trim(), row["拍摄名称"].ToString());
  2031. if (menuItem.Text.Trim() == "重拍")
  2032. {
  2033. subItem.Tag = row["VID"].ToString();
  2034. }
  2035. else if (menuItem.Text.Trim() == "重拍记录")
  2036. {
  2037. subItem.Tag = row["Ordpg_IDNumber"].ToString();
  2038. }
  2039. else if (menuItem.Text.Trim() == "订单备注")
  2040. {
  2041. subItem.Tag = row["Ordv_ViceNumber"].ToString();
  2042. }
  2043. else if (menuItem.Text.Trim() == "安排变更记录")
  2044. {
  2045. subItem.Tag = row["Ordv_ViceNumber"].ToString();
  2046. }
  2047. subItem.Click += SubItem_Click;
  2048. menuItem.DropDownItems.Add(subItem);
  2049. }
  2050. }
  2051. }
  2052. }
  2053. }
  2054. private void SubItem_Click(object sender, EventArgs e)
  2055. {
  2056. this.ContextMenuStrip_OrderInfo_ItemClicked(sender, new ToolStripItemClickedEventArgs((ToolStripMenuItem)sender));
  2057. }
  2058. /// <summary>
  2059. /// 获取颜色子菜单
  2060. /// </summary>
  2061. /// <param name="menuItem"></param>
  2062. void SetToolStripMenuItemSubItem(System.Windows.Forms.ToolStripMenuItem menuItem)
  2063. {
  2064. menuItem.DropDownItems.Clear();
  2065. ToolStripItem subItem= new ToolStripMenuItem();
  2066. subItem.Text = "清除颜色";
  2067. subItem.Tag = new Model.Model_ColorSetting();
  2068. subItem.Click += SubItem_Click;
  2069. menuItem.DropDownItems.Add(subItem);
  2070. foreach (Model.Model_ColorSetting color in this.ColorSettingList)
  2071. {
  2072. ToolStripItem subItem2 = new ToolStripMenuItem();
  2073. subItem2.Text = color.InfoText;
  2074. subItem2.ForeColor = color.ToColor();
  2075. subItem2.Tag = color;
  2076. subItem2.Click+= SubItem_Click;
  2077. menuItem.DropDownItems.Add(subItem2);
  2078. }
  2079. }
  2080. /// <summary>
  2081. ///
  2082. /// </summary>
  2083. /// <param name="sender"></param>
  2084. /// <param name="e"></param>
  2085. private void ContextMenuStrip_OrderInfo_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
  2086. {
  2087. string itemText = e.ClickedItem.Text.Trim();
  2088. if (e.ClickedItem.Text.Trim().StartsWith("重拍["))
  2089. {
  2090. itemText = "重拍";
  2091. }
  2092. else if (e.ClickedItem.Text.Trim().StartsWith("重拍记录["))
  2093. {
  2094. itemText = "重拍记录";
  2095. }
  2096. else if (e.ClickedItem.Text.Trim().StartsWith("订单备注["))
  2097. {
  2098. itemText = "订单备注";
  2099. }
  2100. else if (e.ClickedItem.Text.Trim().StartsWith("安排变更记录["))
  2101. {
  2102. itemText = "安排变更记录";
  2103. }
  2104. else if (e.ClickedItem.OwnerItem!=null&&e.ClickedItem.OwnerItem.Text == "自定义颜色")
  2105. {
  2106. itemText = "自定义颜色";
  2107. }
  2108. if (this.contextMenuStrip_OrderInfo.Tag == null)
  2109. {
  2110. MessageBoxCustom.Show("请选择行");
  2111. return;
  2112. }
  2113. PDataColumn CurrentCell = (PDataColumn)this.contextMenuStrip_OrderInfo.Tag;
  2114. PDataRow dataRow = this.PanelDataView.DataRowList[CurrentCell.RowIndex];
  2115. LYFZ.Model.CameraControlTemplate cameraTemplate = (LYFZ.Model.CameraControlTemplate)dataRow.Tag;
  2116. CameraTimeTemplate cameraTime = (CameraTimeTemplate)dataRow.DataColumnList[2].Tag;
  2117. string StrOrdNumber = cameraTime.ReservationTime.OrderNumber;
  2118. switch (itemText)
  2119. {
  2120. case "复制单元格内容":
  2121. Clipboard.SetDataObject(CurrentCell.Text.Trim());
  2122. break;
  2123. case "档期客人预约":
  2124. if (this.StartReservation(cameraTemplate, cameraTime))
  2125. {
  2126. this.LoadTemplateData();
  2127. }
  2128. break;
  2129. case "客人预约改期":
  2130. if (this.StartReservation(cameraTemplate, cameraTime, true))
  2131. {
  2132. this.LoadTemplateData();
  2133. }
  2134. break;
  2135. case "重拍":
  2136. {
  2137. if (!LYFZ.BLL.BLL_ErpUser.IsAdministrator())
  2138. {
  2139. if (!VerificationRights(this.CurrentUserRights.CameraControlBook, LYFZ.CustomAttributes.OperatingAuthority.PhotographRetake))
  2140. {
  2141. MessageBoxCustom.Show("您没有重拍当前门店摄控的权限!");
  2142. return;
  2143. }
  2144. }
  2145. if (e.ClickedItem.Tag != null)
  2146. {
  2147. LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.OrderSightsRetakeSmallForm frm = new DoorCityProcess.SetSmallForm.OrderSightsRetakeSmallForm();
  2148. frm.StrOrdNumber = StrOrdNumber.Trim();
  2149. frm.StrSightsID = e.ClickedItem.Tag.ToString().Trim();
  2150. frm.StrRetakeType = EnumPublic.EnumRetakeType.拍照重拍;
  2151. frm.ShowDialog();
  2152. if (frm.IsSaveed)
  2153. {
  2154. this.LoadTemplateData();
  2155. }
  2156. }
  2157. }
  2158. break;
  2159. case "重拍记录":
  2160. {
  2161. if (e.ClickedItem.Tag != null)
  2162. {
  2163. LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.OrderSightsRemakeRecordSmallForm frm = new DoorCityProcess.SetSmallForm.OrderSightsRemakeRecordSmallForm();
  2164. frm.StrRemakeRecordType = EnumPublic.EnumRetakeType.拍照重拍;
  2165. frm.StrOrdNumber = StrOrdNumber.Trim();
  2166. frm.StrSightsID = e.ClickedItem.Tag.ToString().Trim();
  2167. frm.IsCompetence = true;//是否有重拍权限
  2168. frm.ShowDialog();
  2169. if (frm.IsSaveed)
  2170. {
  2171. this.LoadTemplateData();
  2172. }
  2173. }
  2174. }
  2175. break;
  2176. case "订单备注":
  2177. {
  2178. if (e.ClickedItem.Tag != null)
  2179. {
  2180. LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.OrderRemarkRecordAddSuperSmallForm frm = new DoorCityProcess.SuperSmallForm.OrderRemarkRecordAddSuperSmallForm();
  2181. frm.StrOrderNumber = StrOrdNumber.Trim();
  2182. frm.StrOrdViceNumber = e.ClickedItem.Tag.ToString().Trim();
  2183. if (this.rdoPhotographed.Checked)
  2184. {
  2185. frm.StrOrdModuleName = LYFZ.EnumPublic.EnumOrderRemarkModule.预约拍照.ToString().Trim();
  2186. }
  2187. else if (this.rdoFilmSelection.Checked)
  2188. {
  2189. frm.StrOrdModuleName = LYFZ.EnumPublic.EnumOrderRemarkModule.预约选片.ToString().Trim();
  2190. }
  2191. else if (this.rdoLookDesign.Checked)
  2192. {
  2193. frm.StrOrdModuleName = LYFZ.EnumPublic.EnumOrderRemarkModule.预约看版.ToString().Trim();
  2194. }
  2195. else if (this.rdoSelectDress.Checked)
  2196. {
  2197. frm.StrOrdModuleName = LYFZ.EnumPublic.EnumOrderRemarkModule.预约选衣.ToString().Trim();
  2198. }
  2199. else if (this.rdoTotakePiece.Checked)
  2200. {
  2201. frm.StrOrdModuleName = LYFZ.EnumPublic.EnumOrderRemarkModule.预约取件.ToString().Trim();
  2202. }
  2203. else if (this.rdoService.Checked)
  2204. {
  2205. frm.StrOrdModuleName = LYFZ.EnumPublic.EnumOrderRemarkModule.预约服务.ToString().Trim();
  2206. }
  2207. frm.ShowDialog();
  2208. }
  2209. }
  2210. break;
  2211. case "安排变更记录":
  2212. {
  2213. string StrModuleName = "";
  2214. if (this.rdoFilmSelection.Checked)
  2215. {
  2216. StrModuleName = LYFZ.EnumPublic.WorkAnPaiChangeLogEnum.摄控安排选片客人.ToString();
  2217. }
  2218. else if (this.rdoLookDesign.Checked)
  2219. {
  2220. StrModuleName = LYFZ.EnumPublic.WorkAnPaiChangeLogEnum.摄控安排看版客人.ToString();
  2221. }
  2222. else if (this.rdoPhotographed.Checked)
  2223. {
  2224. StrModuleName = LYFZ.EnumPublic.WorkAnPaiChangeLogEnum.摄控安排拍照客人.ToString();
  2225. }
  2226. else if (this.rdoSelectDress.Checked)
  2227. {
  2228. StrModuleName = LYFZ.EnumPublic.WorkAnPaiChangeLogEnum.摄控安排选礼服客人.ToString();
  2229. }
  2230. else if (this.rdoService.Checked)
  2231. {
  2232. StrModuleName = LYFZ.EnumPublic.WorkAnPaiChangeLogEnum.摄控安排服务客人.ToString();
  2233. }
  2234. else if (this.rdoTotakePiece.Checked)
  2235. {
  2236. StrModuleName = LYFZ.EnumPublic.WorkAnPaiChangeLogEnum.摄控安排取件客人.ToString();
  2237. }
  2238. LYFZ.Software.MainBusiness.CameraControlBook.SuperSmallForm.WorkAnPaiRecordSuperSmallForm frm = new CameraControlBook.SuperSmallForm.WorkAnPaiRecordSuperSmallForm();
  2239. frm.StrOrdNumber = StrOrdNumber.Trim();
  2240. // frm.StrViceNumber = e.ClickedItem.Tag.ToString().Trim();
  2241. frm.StrModuleName = StrModuleName;
  2242. frm.ShowDialog();
  2243. }
  2244. break;
  2245. case "自定义颜色":
  2246. if (e.ClickedItem.Tag != null)
  2247. {
  2248. Model.Model_ColorSetting model_Color = (Model.Model_ColorSetting)e.ClickedItem.Tag;
  2249. string colorString = "";
  2250. if (!String.IsNullOrWhiteSpace(model_Color.ColorText))
  2251. {
  2252. colorString = model_Color.ColorText;
  2253. }
  2254. if (orbll.SetOrderColor(StrOrdNumber.Trim(), colorString))
  2255. {
  2256. cameraTime.Parameter.OrderAutoColor = colorString;
  2257. if (cameraTime.Parameter.DataRows != null)
  2258. {
  2259. foreach (DataRow row in cameraTime.Parameter.DataRows)
  2260. {
  2261. row["ord_AutoColor"] = colorString;
  2262. }
  2263. }
  2264. this.BindPanelDataView();
  2265. }
  2266. }
  2267. break;
  2268. case "添加记录":
  2269. this.LikAddCommunication_Click(null,null);
  2270. break;
  2271. case "沟通详情":
  2272. this.LikcommunicationInfo_Click(null, null);
  2273. break;
  2274. }
  2275. }
  2276. LYFZ.BLL.CameraControlTemplate cameraTemplateBll = new BLL.CameraControlTemplate();
  2277. LYFZ.DAL.CameraControlTemplate cameraTemplateDal = new DAL.CameraControlTemplate();
  2278. LYFZ.BLL.ThumbtackRecord thumbtackBll = new BLL.ThumbtackRecord();
  2279. List<LYFZ.Model.CameraControlTemplate> CameraControlTemplateList = new List<Model.CameraControlTemplate>();
  2280. /// <summary>
  2281. /// 预约数据报告图钉
  2282. /// </summary>
  2283. List<LYFZ.Model.ThumbtackRecord> thumbtackRecordList = new List<Model.ThumbtackRecord>();
  2284. public static string GetQueryStoreList(QueryStoreList queryStore)
  2285. {
  2286. StringBuilder strBuild = new StringBuilder();
  2287. if (queryStore != null)
  2288. {
  2289. if (queryStore.QueryType != 0)
  2290. {
  2291. foreach (QueryStoreInfo sid in queryStore.QueryStoreInfoList)
  2292. {
  2293. if (!string.IsNullOrEmpty(sid.DividedShop))
  2294. {
  2295. strBuild.Append(String.Format("{0},", sid.DividedShop.Trim()));
  2296. }
  2297. }
  2298. }
  2299. }
  2300. return strBuild.ToString().Trim(',');
  2301. }
  2302. string currentDataViewID = "";
  2303. /// <summary>
  2304. /// 加载模板数据
  2305. /// </summary>
  2306. void LoadTemplateData()
  2307. {
  2308. int tempDay = CameraTemplateHandle.GetSubtractDay(this.dateTimePickerStar.Value, this.dateTimePickerEnd.Value);
  2309. if (tempDay > 31)
  2310. {
  2311. MessageBoxCustom.Show("为了保证系统数据查询性能,时间查询最多不能超过31天");
  2312. }
  2313. else
  2314. {
  2315. if (this.CurrentQueryStoreList2 != null)
  2316. {
  2317. string shopIDString = "";
  2318. if (this.CurrentQueryStoreList2.QueryType != 0)
  2319. {
  2320. shopIDString = GetQueryStoreList(this.CurrentQueryStoreList2);
  2321. }
  2322. CameraType cameraType = SetCameraTemplate.GetCameraType(this.flowLayoutPanel3.Controls);
  2323. this.ClearCondition();
  2324. this.currentDataViewID = String.Format("CameraInfoDataViewID_{0}", (int)cameraType);
  2325. this.LoadCameraControlTemplate(this.dateTimePickerStar.Value.ToYYYYMMddDate(), this.dateTimePickerEnd.Value.ToYYYYMMddDate(), (int)cameraType, shopIDString);
  2326. this.BindCBXCustomLabel(cameraType);
  2327. this.BindSearchField(cameraType);
  2328. }
  2329. else
  2330. {
  2331. MessageBoxCustom.Show("请选择门店");
  2332. }
  2333. }
  2334. }
  2335. void BindCBXCustomLabel(CameraType cameraType)
  2336. {
  2337. this.cbxCustomLabel.Items.Clear();
  2338. this.cbxCustomLabel.Items.Add("全部");
  2339. this.cbxCustomLabel.Items.AddRange(labelData.GetCustomLabelList(cameraType).ToArray());
  2340. this.cbxCustomLabel.SelectedIndex = 0;
  2341. }
  2342. void BindSearchField(CameraType cameraType)
  2343. {
  2344. List<string> titleColumnList =new List<string>(this.GetCameraDataColumns(cameraType).ToArray());
  2345. titleColumnList.RemoveRange(0,4);
  2346. this.cbxSearchField.Items.Clear();
  2347. this.cbxSearchField.Items.Add("智能筛选");
  2348. this.cbxSearchField.Items.AddRange(titleColumnList.ToArray());
  2349. this.cbxSearchField.SelectedIndex = 0;
  2350. }
  2351. /// <summary>
  2352. /// 当前预约订单数据
  2353. /// </summary>
  2354. DataTable currentOrderDataTable = null;
  2355. /// <summary>
  2356. /// 满意度调查数据
  2357. /// </summary>
  2358. DataTable OrderSatisfactionSurveyData = null;
  2359. /// <summary>
  2360. /// 客户沟通记录
  2361. /// </summary>
  2362. DataTable OrderCustomersTrackRecordData = null;
  2363. /// <summary>
  2364. /// 摄控预约按排记录
  2365. /// </summary>
  2366. DataTable OrderWorkAnPaiRecordData = null;
  2367. /// <summary>
  2368. /// 摄控预约按排次数 集合
  2369. /// </summary>
  2370. Dictionary<string, int> OrderWorkAnPaiCountList = new Dictionary<string, int>();
  2371. void ClearDataTable(DataTable tb)
  2372. {
  2373. if (tb != null)
  2374. {
  2375. tb.Rows.Clear();
  2376. tb.Clear();
  2377. tb.Dispose();
  2378. tb.DataSet.Clear();
  2379. tb.DataSet.Dispose();
  2380. tb = null;
  2381. }
  2382. }
  2383. /// <summary>
  2384. /// 加载模板数据
  2385. /// </summary>
  2386. /// <param name="dateStart"></param>
  2387. /// <param name="dateEnd"></param>
  2388. void LoadCameraControlTemplate(DateTime dateStart, DateTime dateEnd, int cameraType, string shopID)
  2389. {
  2390. CameraType currentCameraType = (CameraType)cameraType;
  2391. ClearDataTable(currentOrderDataTable);
  2392. ClearDataTable(OrderSatisfactionSurveyData);
  2393. ClearDataTable(OrderCustomersTrackRecordData);
  2394. ClearDataTable(OrderWorkAnPaiRecordData);
  2395. this.CameraControlTemplateList.Clear();
  2396. this.thumbtackRecordList.Clear();
  2397. this.OrderWorkAnPaiCountList.Clear();
  2398. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate (object obj, BackgroundWorker backgroundWorker)
  2399. {
  2400. try
  2401. {
  2402. backgroundWorker.ReportProgress(0,"正在加载数据...");
  2403. this.labelData.SetCustomLabelData(systemConfigurebll.GetConfigureInfo(ConfigItemType.CameraCustomLabelData).Sconfig_Value);
  2404. this.LoadTitleColumnDisplayList(this.currentDataViewID);
  2405. this.CameraControlTemplateList = cameraTemplateBll.GetCameraControlTemplateList(dateStart, dateEnd, cameraType, shopID);
  2406. this.thumbtackRecordList = thumbtackBll.GetThumbtackRecordList(dateStart, dateEnd, shopID, !LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition);
  2407. currentOrderDataTable = DAL.CameraDataQuery.GetReservationOrderDataList(currentCameraType, dateStart, dateEnd, shopID);
  2408. List<string> titleColumnList = this.GetCameraDataColumns(currentCameraType);
  2409. List<string> ordNumberList = (from d in currentOrderDataTable.AsEnumerable() select d.Field<string>("Ord_Number")).Distinct().ToList<string>();
  2410. if (currentCameraType != CameraType.爱婴上门)
  2411. {
  2412. List<string> subOrdNumberList = (from d in currentOrderDataTable.AsEnumerable() select d.Field<string>("Ordv_ViceNumber")).Distinct().ToList<string>();
  2413. switch (currentCameraType)
  2414. {
  2415. case CameraType.拍照客人:
  2416. this.OrderWorkAnPaiRecordData = DAL.CameraDataQuery.GetOrderWorkAnPaiRecord(subOrdNumberList, EnumPublic.WorkAnPaiChangeLogEnum.摄控安排拍照客人);
  2417. break;
  2418. case CameraType.选片客人:
  2419. this.OrderWorkAnPaiRecordData = DAL.CameraDataQuery.GetOrderWorkAnPaiRecord(subOrdNumberList, EnumPublic.WorkAnPaiChangeLogEnum.摄控安排选片客人);
  2420. break;
  2421. case CameraType.看版客人:
  2422. this.OrderWorkAnPaiRecordData = DAL.CameraDataQuery.GetOrderWorkAnPaiRecord(subOrdNumberList, EnumPublic.WorkAnPaiChangeLogEnum.摄控安排看版客人);
  2423. break;
  2424. case CameraType.取件客人:
  2425. this.OrderWorkAnPaiRecordData = DAL.CameraDataQuery.GetOrderWorkAnPaiRecord(subOrdNumberList, EnumPublic.WorkAnPaiChangeLogEnum.摄控安排取件客人);
  2426. break;
  2427. case CameraType.选衣客人:
  2428. this.OrderWorkAnPaiRecordData = DAL.CameraDataQuery.GetOrderWorkAnPaiRecord(subOrdNumberList, EnumPublic.WorkAnPaiChangeLogEnum.摄控安排选礼服客人);
  2429. break;
  2430. case CameraType.服务客人:
  2431. this.OrderWorkAnPaiRecordData = DAL.CameraDataQuery.GetOrderWorkAnPaiRecord(subOrdNumberList, EnumPublic.WorkAnPaiChangeLogEnum.摄控安排服务客人);
  2432. break;
  2433. }
  2434. this.GetOrderWorkAnPaiCountList();
  2435. }
  2436. if (titleColumnList.Any(t => this.CheckSatisfactionColumnDisplay(t)))
  2437. {
  2438. OrderSatisfactionSurveyData = new LYFZ.BLL.BLL_ErpSatisfactionSurvey().GetOrderSatisfactionSurveyData(ordNumberList);
  2439. }
  2440. if (titleColumnList.Any(t => this.CheckCommunicateColumnDisplay(t)))
  2441. {
  2442. OrderCustomersTrackRecordData = DAL.CameraDataQuery.GetCustomersTrackRecord(currentCameraType, ordNumberList);
  2443. }
  2444. backgroundWorker.ReportProgress(0, "正在处理数据...");
  2445. AddDataToCameraControlTemplate(currentCameraType, dateStart, dateEnd);
  2446. // DataProcessing(currentCameraType);
  2447. } catch (Exception ex) {
  2448. MessageBoxCustom.Show(String.Format("加载数据时出错:{0}",ex.Message));
  2449. }
  2450. });
  2451. this.currentPage = 1;
  2452. this.BindPanelDataView(currentCameraType);
  2453. }
  2454. /// <summary>
  2455. /// 获取摄控预约按排改期次数
  2456. /// </summary>
  2457. void GetOrderWorkAnPaiCountList()
  2458. {
  2459. IEnumerable<IGrouping<string, DataRow>> dataRowListGroup= this.OrderWorkAnPaiRecordData.Select().GroupBy(r=>String.Format("{0},{1}", r.Field<string>("Ordwr_ViceNumber"), r.Field<string>("Ordwr_WorkNumber")));
  2460. foreach (IGrouping<string, DataRow> dataRows in dataRowListGroup)
  2461. {
  2462. string groupKey = dataRows.Key;
  2463. List<string> tempTimeList = new List<string>();
  2464. foreach (DataRow dataRow in dataRows)
  2465. {
  2466. try
  2467. {
  2468. string tempText = "";
  2469. if (dataRow["Ordwr_UpdateAgoData"].ToString().Split(' ').Any(s => s.Replace(":", ":").Contains("时间:")))
  2470. {
  2471. tempText = dataRow["Ordwr_UpdateAgoData"].ToString().Split(' ').First(s => s.Replace(":", ":").Contains("时间:"));
  2472. }
  2473. if (!String.IsNullOrWhiteSpace(tempText))
  2474. {
  2475. string[] temps = tempText.Split(':');
  2476. if (temps.Length >= 2)
  2477. {
  2478. if (!tempTimeList.Contains(temps[1]))
  2479. {
  2480. tempTimeList.Add(temps[1]);
  2481. }
  2482. }
  2483. }
  2484. }
  2485. catch (Exception ex){
  2486. MessageBoxCustom.Show("解析改期次数时出错:"+ex.Message);
  2487. }
  2488. }
  2489. this.OrderWorkAnPaiCountList.Add(groupKey,tempTimeList.Count);
  2490. }
  2491. ClearDataTable(this.OrderWorkAnPaiRecordData);
  2492. }
  2493. /// <summary>
  2494. /// 获取改期次数
  2495. /// </summary>
  2496. /// <param name="_WorkNumberID"></param>
  2497. /// <param name="subOrderNumber"></param>
  2498. /// <returns></returns>
  2499. int GetReschedulesCount(string _WorkNumberID, string subOrderNumber)
  2500. {
  2501. string key = String.Format("{0},{1}", subOrderNumber, _WorkNumberID);
  2502. if (this.OrderWorkAnPaiCountList.ContainsKey(key))
  2503. {
  2504. return this.OrderWorkAnPaiCountList[key];
  2505. }
  2506. else {
  2507. return 0;
  2508. }
  2509. }
  2510. /// <summary>
  2511. /// 把查询的预约订单数据转为 CameraControlTemplate 模板对象 并添加到模板集合中
  2512. /// </summary>
  2513. /// <param name="cameraType"></param>
  2514. void AddDataToCameraControlTemplate(CameraType cameraType, DateTime dateStart, DateTime dateEnd)
  2515. {
  2516. List<string> columnTitleList = this.GetCameraDataColumns(cameraType);
  2517. // LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.CameraStatisticNotReservedButCompletionTime
  2518. //String.Format("shopDate>='{0}' and shopDate<='{1}'", dateStart.ToYYYYMMddDate().ToYYYY_MM_dd_HH_mm(), dateEnd.ToDayDateMaxTime().ToYYYY_MM_dd_HH_mm())
  2519. IEnumerable<IGrouping<string, DataRow>> dataRowListGroup = null;
  2520. if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.CameraStatisticNotReservedButCompletionTime)
  2521. {
  2522. dataRowListGroup = this.currentOrderDataTable.Select(String.Format("shopDate>='{0}' and shopDate<='{1}'", dateStart.ToYYYYMMddDate().ToYYYY_MM_dd_HH_mm(), dateEnd.ToDayDateMaxTime().ToYYYY_MM_dd_HH_mm())).GroupBy(r => String.Format("{0},{1},{2}", r.Field<string>("shopID"), Convert.ToDateTime(r["shopDate"].ToString()).ToYYYY_MM_dd(), r.Field<string>("Ord_Type")));
  2523. }
  2524. else {
  2525. dataRowListGroup = this.currentOrderDataTable.Select(String.Format("shopDate>='{0}' and shopDate<='{1}'", dateStart.ToYYYYMMddDate().ToYYYY_MM_dd_HH_mm(), dateEnd.ToDayDateMaxTime().ToYYYY_MM_dd_HH_mm())).ToList().FindAll(r => String.IsNullOrWhiteSpace(r["resDate"].ToString()) ? false : r.Field<DateTime>("resDate") > LYFZ.WinAPI.CustomPublicMethod.GetNullDateTime()).GroupBy(r => String.Format("{0},{1},{2}", r.Field<string>("shopID"), Convert.ToDateTime(r["shopDate"].ToString()).ToYYYY_MM_dd(), r.Field<string>("Ord_Type")));
  2526. }
  2527. foreach (IGrouping<string, DataRow> items in dataRowListGroup)
  2528. {
  2529. string[] groupKeys = items.Key.Split(',');
  2530. string shopID = groupKeys[0];
  2531. string dayDate = groupKeys[1];
  2532. int orderType = Convert.ToInt32(groupKeys[2]);
  2533. LYFZ.Model.CameraControlTemplate template = this.CameraControlTemplateList.Find(t => t.ShopID.ToLower() == shopID.ToLower() && t.CameraDateTime.JavaScriptTimeStampToDateTime().ToYYYY_MM_dd() == dayDate && t.OrderType == orderType);
  2534. if (template == null)
  2535. {
  2536. template = new Model.CameraControlTemplate
  2537. {
  2538. OrderType = orderType
  2539. ,
  2540. CameraType = (int)cameraType
  2541. ,
  2542. CameraDateTime = Convert.ToDateTime(dayDate).ToJavaScriptTimeStamp()
  2543. ,
  2544. ShopID = shopID
  2545. };
  2546. this.CameraControlTemplateList.Add(template);
  2547. }
  2548. IEnumerable<IGrouping<string, DataRow>> dataRowOrderTimeListGroup = items.ToArray().GroupBy(r => String.Format("{0},{1}", r.Field<string>("Ord_Number"), Convert.ToDateTime(r["shopDate"].ToString()).ToString("HH:mm")));
  2549. foreach (IGrouping<string, DataRow> dataRows in dataRowOrderTimeListGroup)
  2550. {
  2551. string[] groupTimeKeys = dataRows.Key.Split(',');
  2552. string orderNumber = groupTimeKeys[0];
  2553. string timeText = groupTimeKeys[1];
  2554. List<CameraTimeTemplate> cameraTimeList = new List<CameraTimeTemplate>();
  2555. if (template.ID > 0)
  2556. {
  2557. cameraTimeList = template.TimeTemplateData.TimeTemplateDataList.FindAll(t => t.ReservationTime.OrderNumber.ToLower() == orderNumber.ToLower()
  2558. && t.ReservationTime.ToCameraReserveIDList().Any(id => dataRows.Any(r => r[DAL.CameraDataQuery.GetCameraDataItemTitlieName(cameraType)].ToString().ToLower() == id.ToLower())));
  2559. if (cameraTimeList.Count > 0)
  2560. {
  2561. foreach (CameraTimeTemplate cameraTime in cameraTimeList)
  2562. {
  2563. this.SetCameraTimeTemplate(cameraType, orderNumber, timeText, template, cameraTime, columnTitleList, dataRows);
  2564. }
  2565. }
  2566. else {
  2567. this.SetCameraTimeTemplate(cameraType, orderNumber, timeText, template, null, columnTitleList, dataRows);
  2568. }
  2569. }
  2570. else {
  2571. this.SetCameraTimeTemplate(cameraType, orderNumber, timeText, template, null, columnTitleList, dataRows);
  2572. }
  2573. }
  2574. //时间排序
  2575. template.TimeTemplateData.TimeTemplateDataList = template.TimeTemplateData.TimeTemplateDataList.OrderBy(t => t.CameraTime).ToList();
  2576. }
  2577. }
  2578. void SetCameraTimeTemplate(CameraType cameraType, string orderNumber, string timeText, LYFZ.Model.CameraControlTemplate template, CameraTimeTemplate cameraTime, List<string> columnTitleList, IGrouping<string, DataRow> dataRows)
  2579. {
  2580. if (cameraTime == null)
  2581. {
  2582. cameraTime = new CameraTimeTemplate
  2583. {
  2584. CameraTime = timeText
  2585. ,
  2586. DayTemplate = template
  2587. };
  2588. cameraTime.ReservationTime.OrderNumber = orderNumber;
  2589. cameraTime.Parameter.WithinSchedule = false;
  2590. template.TimeTemplateData.Add(cameraTime);
  2591. cameraTime.Parameter.DataRows = dataRows.ToArray();
  2592. }
  2593. else {
  2594. cameraTime.Parameter.DataRows = dataRows.ToList<DataRow>().FindAll(r => cameraTime.ReservationTime.ToCameraReserveIDList().Any(id => id.ToLower() == r[DAL.CameraDataQuery.GetCameraDataItemTitlieName(cameraType)].ToString().ToLower())).ToArray();
  2595. }
  2596. if (cameraTime.Parameter.DataRows.Length > 0)
  2597. {
  2598. DataRow cusRow = cameraTime.Parameter.DataRows[0];
  2599. cameraTime.ReservationTime.ShowOrderNumber = cusRow["订单号"].ToString();
  2600. if (!cameraTime.Parameter.WithinSchedule)
  2601. {
  2602. cameraTime.ReservationTime.CameraReserveIDList = String.Join(",", GetValueList(cameraTime.Parameter.DataRows, DAL.CameraDataQuery.GetCameraDataItemTitlieName(cameraType)));
  2603. }
  2604. if (cameraType == CameraType.爱婴上门)
  2605. {
  2606. this.SetReservationDispatchDoorParameter(columnTitleList, cameraTime);
  2607. }
  2608. else
  2609. {
  2610. if (cusRow["ord_AutoColor"] != null)
  2611. {
  2612. cameraTime.Parameter.OrderAutoColor = cusRow["ord_AutoColor"].ToString();
  2613. }
  2614. if (cusRow["Ord_Class"] != null)
  2615. {
  2616. cameraTime.Parameter.IsIntentionOrder = cusRow["Ord_Class"].ToString() == "0";
  2617. }
  2618. if (cusRow["欠款"] != null)
  2619. {
  2620. cameraTime.Parameter.IsArrears = String.IsNullOrWhiteSpace(cusRow["欠款"].ToString()) ? false : Convert.ToDecimal(cusRow["欠款"].ToString()) > 0;
  2621. }
  2622. if (cameraType == CameraType.拍照客人)
  2623. {
  2624. cameraTime.Parameter.RetakesCount = cameraTime.Parameter.DataRows.Max(r => String.IsNullOrWhiteSpace(r["重拍次数"].ToString()) ? 0 : Convert.ToInt32(r["重拍次数"].ToString()));
  2625. }
  2626. this.SetReservationParameter(cameraType, columnTitleList, cameraTime);
  2627. }
  2628. }
  2629. }
  2630. /// <summary>
  2631. /// 设置预约爱婴上门 参数
  2632. /// </summary>
  2633. /// <param name="columnTitleList"></param>
  2634. /// <param name="Parameter"></param>
  2635. void SetReservationDispatchDoorParameter(List<string> columnTitleList, CameraTimeTemplate cameraTime)
  2636. {
  2637. cameraTime.Parameter.KeyValues.Add("订单号", cameraTime.ReservationTime.ShowOrderNumber);
  2638. cameraTime.Parameter.KeyValues.Add("通知备注", cameraTime.ReservationTime.CustomerFeedback);
  2639. for (int i = 4; i < columnTitleList.Count; i++)
  2640. {
  2641. string columnTitle = columnTitleList[i];
  2642. if (cameraTime.Parameter.DataRows.Length > 0)
  2643. {
  2644. DataRow cusRow = cameraTime.Parameter.DataRows[0];
  2645. //订单号,客户姓名,客户电话,宝贝名称,上门时间,上门状态,车辆,上门人员1,上门人员2,上门人员3,上门人员4,派单备注,客服人员,录入时间,沟通备注"
  2646. cameraTime.Parameter.ReschedulesCount = cameraTime.Parameter.DataRows.Max(r => this.GetReschedulesCount(r[DAL.CameraDataQuery.GetCameraDataItemTitlieName(CameraType.爱婴上门)].ToString(), r.Field<string>("Ord_Number")));
  2647. switch (columnTitle)
  2648. {
  2649. case "订单号":
  2650. case "通知备注":
  2651. break;
  2652. case "上门时间":
  2653. cameraTime.Parameter.KeyValues.Add(columnTitle, String.IsNullOrWhiteSpace(cusRow[columnTitle].ToString()) ? LYFZ.WinAPI.CustomPublicMethod.GetNullDateTime().ToYYYY_MM_dd_HH_mm() : Convert.ToDateTime(cusRow[columnTitle].ToString()).ToYYYY_MM_dd_HH_mm());
  2654. break;
  2655. case "上门状态":
  2656. int digStatus = cameraTime.Parameter.DataRows.Sum(r => Convert.ToInt32(r[columnTitle].ToString()));
  2657. cameraTime.Parameter.KeyValues.Add(columnTitle, digStatus == 0 ? "未上门" : digStatus == cameraTime.Parameter.DataRows.Length ? "OK" : "部分已上门");
  2658. break;
  2659. case "车辆":
  2660. case "派单备注":
  2661. case "沟通备注":
  2662. case "上门人员1":
  2663. case "上门人员2":
  2664. case "上门人员3":
  2665. case "上门人员4":
  2666. cameraTime.Parameter.KeyValues.Add(columnTitle, String.Join(",", GetValueList(cameraTime.Parameter.DataRows, columnTitle)));
  2667. break;
  2668. case "客服人员":
  2669. cameraTime.Parameter.KeyValues.Add(columnTitle, LYFZ.DAL.DAL_ErpUser.GetUserIDToUserName(String.Join(",", GetValueList(cameraTime.Parameter.DataRows, columnTitle))));
  2670. break;
  2671. case "录入时间":
  2672. cameraTime.Parameter.KeyValues.Add(columnTitle, cameraTime.Parameter.DataRows.ToList().Max(r => String.IsNullOrWhiteSpace(cusRow[columnTitle].ToString()) ? LYFZ.WinAPI.CustomPublicMethod.GetNullDateTime(): Convert.ToDateTime(r[columnTitle].ToString())).ToYYYY_MM_dd_HH_mm());
  2673. break;
  2674. default:
  2675. if (cusRow.Table.Columns.Contains(columnTitle))
  2676. {
  2677. cameraTime.Parameter.KeyValues.Add(columnTitle, cusRow[columnTitle].ToString());
  2678. }
  2679. break;
  2680. }
  2681. }
  2682. }
  2683. }
  2684. /// <summary>
  2685. /// 设置预约 参数
  2686. /// </summary>
  2687. /// <param name="columnTitleList"></param>
  2688. /// <param name="Parameter"></param>
  2689. void SetReservationParameter(CameraType cameraType,List<string> columnTitleList, CameraTimeTemplate cameraTime)
  2690. {
  2691. cameraTime.Parameter.KeyValues.Add("订单号", cameraTime.ReservationTime.ShowOrderNumber);
  2692. cameraTime.Parameter.KeyValues.Add("通知备注", cameraTime.ReservationTime.CustomerFeedback);
  2693. for (int i = 4; i < columnTitleList.Count; i++)
  2694. {
  2695. string columnTitle = columnTitleList[i];
  2696. if (cameraTime.Parameter.DataRows.Length > 0)
  2697. {
  2698. DataRow cusRow = cameraTime.Parameter.DataRows[0];
  2699. cameraTime.Parameter.ReschedulesCount = cameraTime.Parameter.DataRows.Max(r => this.GetReschedulesCount(r[DAL.CameraDataQuery.GetCameraDataItemTitlieName(cameraType)].ToString(), r.Field<string>("Ordv_ViceNumber")));
  2700. switch (columnTitle)
  2701. {
  2702. case "订单号":
  2703. case "通知备注":
  2704. break;
  2705. case "会员信息":
  2706. string VipString = "";
  2707. string vipType = "";
  2708. if (!String.IsNullOrWhiteSpace(cusRow["Mc_CardType"].ToString().Trim()))
  2709. {
  2710. vipType = String.Format("{0}", cusRow["Mc_CardType"].ToString().Trim() == "无" ? "会员卡号" : cusRow["Mc_CardType"].ToString().Trim());
  2711. }
  2712. if (!String.IsNullOrWhiteSpace(cusRow["Mc_CradNumber"].ToString().Trim()))
  2713. {
  2714. VipString = String.Format("{0}:{1}"
  2715. , vipType
  2716. , cusRow["Mc_CradNumber"].ToString().Trim());
  2717. }
  2718. cameraTime.Parameter.KeyValues.Add(columnTitle, VipString);
  2719. break;
  2720. case "预约时间":
  2721. if (String.IsNullOrWhiteSpace(cusRow["resDate"].ToString()))
  2722. {
  2723. cameraTime.Parameter.KeyValues.Add(columnTitle,"");
  2724. }
  2725. else
  2726. {
  2727. cameraTime.Parameter.KeyValues.Add(columnTitle, Convert.ToDateTime(cusRow["resDate"].ToString()).ToYYYY_MM_dd_HH_mm());
  2728. }
  2729. break;
  2730. case "选片时间":
  2731. case "看版时间":
  2732. case "确认选礼服时间":
  2733. case "取件时间":
  2734. case "服务日期":
  2735. cameraTime.Parameter.KeyValues.Add(columnTitle, cameraTime.Parameter.DataRows.ToList().Max(r => String.IsNullOrWhiteSpace(r["stDate"].ToString()) ? LYFZ.WinAPI.CustomPublicMethod.GetNullDateTime() : Convert.ToDateTime(r["stDate"].ToString())).ToYYYY_MM_dd_HH_mm());
  2736. break;
  2737. case "拍摄状态":
  2738. int cameraStatus = cameraTime.Parameter.DataRows.Sum(r => Convert.ToInt32(r[columnTitle].ToString()));
  2739. string cameraStatusText = cameraStatus == 0 ? "未拍" : cameraStatus == cameraTime.Parameter.DataRows.Length ? "OK" : "拍照中";
  2740. if (cameraTime.Parameter.RetakesCount > 0)
  2741. {
  2742. cameraStatusText = String.Format("{0}(重拍)", cameraStatusText);
  2743. }
  2744. cameraTime.Parameter.KeyValues.Add(columnTitle, cameraStatusText);
  2745. break;
  2746. case "拍摄时间":
  2747. case "初修时间":
  2748. case "精修时间":
  2749. case "设计时间":
  2750. case "完成时间":
  2751. cameraTime.Parameter.KeyValues.Add(columnTitle, cameraTime.Parameter.DataRows.ToList().Max(r =>String.IsNullOrWhiteSpace(r[columnTitle].ToString())?LYFZ.WinAPI.CustomPublicMethod.GetNullDateTime(): Convert.ToDateTime(r[columnTitle].ToString())).ToYYYY_MM_dd_HH_mm());
  2752. break;
  2753. case "预约摄影师":
  2754. case "预约摄影助理":
  2755. case "预约化妆师":
  2756. case "预约化妆助理":
  2757. case "预约引导师":
  2758. case "预约引导助理":
  2759. case "摄影师":
  2760. case "摄影助理":
  2761. case "化妆师":
  2762. case "化妆助理":
  2763. case "引导师":
  2764. case "引导助理":
  2765. case "初修师":
  2766. case "精修师":
  2767. case "设计师":
  2768. case "预约看版师":
  2769. case "看版师":
  2770. case "预约选片师":
  2771. case "选片师":
  2772. case "预约取件人":
  2773. case "取件人":
  2774. case "服务人员1":
  2775. case "服务人员2":
  2776. case "预约选礼服师":
  2777. case "确认选礼服师":
  2778. cameraTime.Parameter.KeyValues.Add(columnTitle, LYFZ.DAL.DAL_ErpUser.GetUserIDToUserName(String.Join(",", GetValueList(cameraTime.Parameter.DataRows, columnTitle))));
  2779. break;
  2780. case "套系价格":
  2781. cameraTime.Parameter.KeyValues.Add(columnTitle, Convert.ToDecimal(cusRow[columnTitle].ToString()).ToString("n2"));
  2782. break;
  2783. case "欠款":
  2784. cameraTime.Parameter.KeyValues.Add(columnTitle, Convert.ToDecimal(cusRow[columnTitle].ToString()).ToString("n2"));
  2785. break;
  2786. case "婚期":
  2787. cameraTime.Parameter.KeyValues.Add(columnTitle, Convert.ToDateTime(cusRow[columnTitle].ToString()).ToYYYY_MM_dd());
  2788. break;
  2789. case "接单人":
  2790. cameraTime.Parameter.KeyValues.Add(columnTitle, cusRow[columnTitle].ToString());
  2791. break;
  2792. case "拍摄名称":
  2793. cameraTime.Parameter.KeyValues.Add(columnTitle, String.Join(",", GetValueList(cameraTime.Parameter.DataRows, columnTitle)));
  2794. break;
  2795. //star
  2796. case "服装套数":
  2797. cameraTime.Parameter.KeyValues.Add(columnTitle, cameraTime.Parameter.DataRows.Sum(r => r.Field<int>(columnTitle)).ToString());
  2798. break;
  2799. case "摄影师满意度":
  2800. cameraTime.Parameter.KeyValues.Add(columnTitle, this.GetOrderSatisfactionSurveyData(cameraTime.ReservationTime.OrderNumber, "摄影师"));
  2801. break;
  2802. case "摄影助理满意度":
  2803. cameraTime.Parameter.KeyValues.Add(columnTitle, this.GetOrderSatisfactionSurveyData(cameraTime.ReservationTime.OrderNumber, "摄影师助理"));
  2804. break;
  2805. case "化妆师满意度":
  2806. cameraTime.Parameter.KeyValues.Add(columnTitle, this.GetOrderSatisfactionSurveyData(cameraTime.ReservationTime.OrderNumber, "化妆师"));
  2807. break;
  2808. case "化妆助理满意度":
  2809. cameraTime.Parameter.KeyValues.Add(columnTitle, this.GetOrderSatisfactionSurveyData(cameraTime.ReservationTime.OrderNumber, "化妆师助理"));
  2810. break;
  2811. case "引导师满意度":
  2812. cameraTime.Parameter.KeyValues.Add(columnTitle, this.GetOrderSatisfactionSurveyData(cameraTime.ReservationTime.OrderNumber, "引导师"));
  2813. break;
  2814. case "引导助理满意度":
  2815. cameraTime.Parameter.KeyValues.Add(columnTitle, this.GetOrderSatisfactionSurveyData(cameraTime.ReservationTime.OrderNumber, "引导师助理"));
  2816. break;
  2817. case "选片师满意度":
  2818. cameraTime.Parameter.KeyValues.Add(columnTitle, this.GetOrderSatisfactionSurveyData(cameraTime.ReservationTime.OrderNumber, "选片师"));
  2819. break;
  2820. case "初修状态":
  2821. {
  2822. int digStatus = cameraTime.Parameter.DataRows.Sum(r => GetRepairAndDesignerStatus(r[columnTitle].ToString()));
  2823. cameraTime.Parameter.KeyValues.Add(columnTitle, digStatus == 0 ? "未修" : digStatus == cameraTime.Parameter.DataRows.Length ? "OK" : "修片中");
  2824. }
  2825. break;
  2826. case "选片状态":
  2827. {
  2828. int digStatus2 = cameraTime.Parameter.DataRows.Sum(r => Convert.ToInt32(r[columnTitle].ToString()));
  2829. cameraTime.Parameter.KeyValues.Add(columnTitle, digStatus2 == 0 ? "未选" : digStatus2 == cameraTime.Parameter.DataRows.Length ? "OK" : "选片中");
  2830. }
  2831. break;
  2832. case "看版师满意度":
  2833. cameraTime.Parameter.KeyValues.Add(columnTitle, this.GetOrderSatisfactionSurveyData(cameraTime.ReservationTime.OrderNumber, "看设计师"));
  2834. break;
  2835. case "设计状态":
  2836. {
  2837. int digStatus = cameraTime.Parameter.DataRows.Sum(r => GetRepairAndDesignerStatus(r[columnTitle].ToString()));
  2838. cameraTime.Parameter.KeyValues.Add(columnTitle, digStatus == 0 ? "未设计" : digStatus == cameraTime.Parameter.DataRows.Length ? "OK" : "设计中");
  2839. }
  2840. break;
  2841. case "看版状态":
  2842. {
  2843. int digStatus2 = cameraTime.Parameter.DataRows.Sum(r => Convert.ToInt32(r[columnTitle].ToString()));
  2844. cameraTime.Parameter.KeyValues.Add(columnTitle, digStatus2 == 0 ? "未看" : digStatus2 == cameraTime.Parameter.DataRows.Length ? "OK" : "看版中");
  2845. }
  2846. break;
  2847. case "预约取件商品":
  2848. cameraTime.Parameter.KeyValues.Add(columnTitle, String.Join(",", GetValueList(cameraTime.Parameter.DataRows, columnTitle)));
  2849. break;
  2850. case "取件师满意度":
  2851. cameraTime.Parameter.KeyValues.Add(columnTitle, this.GetOrderSatisfactionSurveyData(cameraTime.ReservationTime.OrderNumber, "取件师"));
  2852. break;
  2853. case "完成状态":
  2854. {
  2855. int digStatus = cameraTime.Parameter.DataRows.Sum(r => Convert.ToInt32(r[columnTitle].ToString()));
  2856. cameraTime.Parameter.KeyValues.Add(columnTitle, digStatus == 0 ? "未完成" : digStatus == cameraTime.Parameter.DataRows.Length ? "OK" : "部分完成");
  2857. }
  2858. break;
  2859. case "取件状态":
  2860. {
  2861. int digStatus2 = cameraTime.Parameter.DataRows.Sum(r => Convert.ToInt32(r[columnTitle].ToString()));
  2862. cameraTime.Parameter.KeyValues.Add(columnTitle, digStatus2 == 0 ? "未取" : digStatus2 == cameraTime.Parameter.DataRows.Length ? "OK" : "部分已取");
  2863. }
  2864. break;
  2865. case "预约服务内容":
  2866. cameraTime.Parameter.KeyValues.Add(columnTitle, String.Join(",", GetValueList(cameraTime.Parameter.DataRows, columnTitle)));
  2867. break;
  2868. case "服务人员1满意度":
  2869. cameraTime.Parameter.KeyValues.Add(columnTitle, this.GetOrderSatisfactionSurveyData(cameraTime.ReservationTime.OrderNumber, "服务人员1"));
  2870. break;
  2871. case "服务人员2满意度":
  2872. cameraTime.Parameter.KeyValues.Add(columnTitle, this.GetOrderSatisfactionSurveyData(cameraTime.ReservationTime.OrderNumber, "服务人员2"));
  2873. break;
  2874. case "服务状态":
  2875. {
  2876. int digStatus = cameraTime.Parameter.DataRows.Sum(r => Convert.ToInt32(r[columnTitle].ToString()));
  2877. cameraTime.Parameter.KeyValues.Add(columnTitle, digStatus == 0 ? "未进行" : digStatus == cameraTime.Parameter.DataRows.Length ? "OK" : "进行中");
  2878. }
  2879. break;
  2880. case "预约服装套数":
  2881. int LeiJingHuZhuang = cameraTime.Parameter.DataRows.Sum(r => Convert.ToInt32(r["内景服装套数"].ToString()));
  2882. int WaiJingHuZhuang = cameraTime.Parameter.DataRows.Sum(r => Convert.ToInt32(r["外景服装套数"].ToString()));
  2883. string textString = "";
  2884. if (LeiJingHuZhuang > 0)
  2885. {
  2886. textString = String.Format("内景:{0}", LeiJingHuZhuang);
  2887. }
  2888. string textString2 = "";
  2889. if (WaiJingHuZhuang > 0)
  2890. {
  2891. textString2 = String.Format("外景:{0}", WaiJingHuZhuang);
  2892. }
  2893. cameraTime.Parameter.KeyValues.Add(columnTitle, String.Format("{0}{1}", textString, textString2));
  2894. break;
  2895. case "礼服师满意度":
  2896. cameraTime.Parameter.KeyValues.Add(columnTitle, this.GetOrderSatisfactionSurveyData(cameraTime.ReservationTime.OrderNumber, "礼服师"));
  2897. break;
  2898. case "选礼服状态":
  2899. {
  2900. int digStatus = cameraTime.Parameter.DataRows.Sum(r => Convert.ToInt32(r[columnTitle].ToString()));
  2901. cameraTime.Parameter.KeyValues.Add(columnTitle, digStatus == 0 ? "未选" : digStatus == cameraTime.Parameter.DataRows.Length ? "OK" : "部分已选");
  2902. }
  2903. break;
  2904. //end
  2905. case "安排人":
  2906. cameraTime.Parameter.KeyValues.Add(columnTitle, LYFZ.DAL.DAL_ErpUser.GetUserIDToUserName(String.Join(",", GetValueList(cameraTime.Parameter.DataRows, columnTitle))));
  2907. break;
  2908. case "安排时间":
  2909. cameraTime.Parameter.KeyValues.Add(columnTitle, cameraTime.Parameter.DataRows.ToList().Max(r => String.IsNullOrWhiteSpace(r[columnTitle].ToString()) ? LYFZ.WinAPI.CustomPublicMethod.GetNullDateTime() : Convert.ToDateTime(r[columnTitle].ToString())).ToYYYY_MM_dd_HH_mm());
  2910. break;
  2911. case "沟通时间":
  2912. string tempDateTime = this.GetOrderCustomersTrackRecord(cameraTime.ReservationTime.OrderNumber, columnTitle);
  2913. cameraTime.Parameter.KeyValues.Add(columnTitle, String.IsNullOrWhiteSpace(tempDateTime) ? "" : Convert.ToDateTime(tempDateTime).ToYYYY_MM_dd_HH_mm());
  2914. break;
  2915. case "客服人员":
  2916. cameraTime.Parameter.KeyValues.Add(columnTitle, LYFZ.DAL.DAL_ErpUser.GetUserIDToUserName(this.GetOrderCustomersTrackRecord(cameraTime.ReservationTime.OrderNumber, columnTitle)));
  2917. break;
  2918. case "沟通状态":
  2919. case "沟通备注":
  2920. cameraTime.Parameter.KeyValues.Add(columnTitle, this.GetOrderCustomersTrackRecord(cameraTime.ReservationTime.OrderNumber, columnTitle));
  2921. break;
  2922. default:
  2923. if (cusRow.Table.Columns.Contains(columnTitle))
  2924. {
  2925. cameraTime.Parameter.KeyValues.Add(columnTitle, cusRow[columnTitle].ToString());
  2926. }
  2927. break;
  2928. }
  2929. }
  2930. }
  2931. }
  2932. /// <summary>
  2933. /// 转换初修和设计的状态值
  2934. /// </summary>
  2935. /// <param name="status"></param>
  2936. /// <returns></returns>
  2937. static int GetRepairAndDesignerStatus(string status)
  2938. {
  2939. switch (status)
  2940. {
  2941. case "1":return 2;
  2942. case "2": return 1;
  2943. default:
  2944. if (String.IsNullOrWhiteSpace(status))
  2945. {
  2946. return 0;
  2947. }
  2948. else {
  2949. return Convert.ToInt32(status);
  2950. }
  2951. }
  2952. }
  2953. string GetOrderCustomersTrackRecord(string orderNumber, string columnTitle)
  2954. {
  2955. string valueString = "";
  2956. if (this.OrderCustomersTrackRecordData != null && this.OrderCustomersTrackRecordData.Rows.Count > 0)
  2957. {
  2958. DataRow[] dataRows = this.OrderCustomersTrackRecordData.Select(String.Format("TR_OrdNumber='{0}'", orderNumber));
  2959. if (dataRows != null&& dataRows.Length>0)
  2960. {
  2961. valueString = dataRows[0][columnTitle].ToString();
  2962. }
  2963. }
  2964. return valueString;
  2965. }
  2966. /// <summary>
  2967. /// 获取满意度调查值
  2968. /// </summary>
  2969. /// <param name="orderNumber"></param>
  2970. /// <param name="SurveyType"></param>
  2971. /// <returns></returns>
  2972. string GetOrderSatisfactionSurveyData(string orderNumber,string SurveyType)
  2973. {
  2974. string _OrderSatisfaction = "";
  2975. if (this.OrderSatisfactionSurveyData != null&&this.OrderSatisfactionSurveyData.Rows.Count>0)
  2976. {
  2977. DataRow dataRow = this.OrderSatisfactionSurveyData.Select(String.Format("订单号='{0}'", orderNumber)).ToList().Find(r => r.Field<string>("回访对象") == SurveyType);
  2978. if (dataRow != null)
  2979. {
  2980. _OrderSatisfaction = dataRow["sfrs_Name"].ToString();
  2981. }
  2982. }
  2983. return _OrderSatisfaction;
  2984. }
  2985. /// <summary>
  2986. ///
  2987. /// </summary>
  2988. /// <param name="dataRows"></param>
  2989. /// <param name="columnName"></param>
  2990. /// <returns></returns>
  2991. List<string> GetValueList(DataRow[] dataRows, string columnName)
  2992. {
  2993. List<string> valueList = new List<string>();
  2994. foreach (DataRow row in dataRows)
  2995. {
  2996. if (row[columnName] != null)
  2997. {
  2998. string valueString = row[columnName].ToString();
  2999. if (!valueList.Contains(valueString))
  3000. {
  3001. valueList.Add(valueString);
  3002. }
  3003. }
  3004. }
  3005. return valueList;
  3006. }
  3007. List<string> GetCameraDataColumns(CameraType cameraType)
  3008. {
  3009. EnumPermissions.BusinessType businessType = GetCurrentStoreBusinessType(this.CurrentQueryStoreList2);
  3010. if (this._TitleColumnDisplayList!=null&&this._TitleColumnDisplayList.Count > 0)
  3011. {
  3012. return DAL.CameraDataQuery.GetCameraDataColumns(cameraType, businessType).FindAll(
  3013. c => this._TitleColumnDisplayList.Any(t => (t.ColumnText.ToLower() == c.ToLower() && t.Display == 1))
  3014. || !this._TitleColumnDisplayList.Any(t => t.ColumnText.ToLower() == c.ToLower())
  3015. );
  3016. }
  3017. else {
  3018. return DAL.CameraDataQuery.GetCameraDataColumns(cameraType, businessType);
  3019. }
  3020. }
  3021. int currentPage = 1;//当前页
  3022. int sumPageCount = 1;//共多少页
  3023. int PageCount = 1800;//每页多少行
  3024. /// <summary>
  3025. /// 绑定数据
  3026. /// </summary>
  3027. void BindPanelDataView()
  3028. {
  3029. CameraType cameraType = SetCameraTemplate.GetCameraType(this.flowLayoutPanel3.Controls);
  3030. this.BindPanelDataView(cameraType);
  3031. }
  3032. /// <summary>
  3033. /// 绑定数据
  3034. /// </summary>
  3035. void BindPanelDataView(CameraType cameraType)
  3036. {
  3037. PanelDataView.DataRowList.Clear();
  3038. PanelDataView.HeadColumnRow.DataColumnList.Clear();
  3039. string[] titleColumns = this.GetCameraDataColumns(cameraType).ToArray();
  3040. if (titleColumns.Length <= 6)
  3041. {
  3042. MessageBoxCustom.Show("表格列字段配置不正确");
  3043. return;
  3044. }
  3045. for (int i = 0; i < titleColumns.Length; i++)
  3046. {
  3047. PanelDataView.HeadColumnRow.DataColumnList.Add(new ComponentLibrary.PDataColumn
  3048. {
  3049. Text = String.Format("{0}", titleColumns[i])
  3050. ,
  3051. Width = GetTitleDataColumnWidth(titleColumns, titleColumns[i])
  3052. });
  3053. }
  3054. List<int> orderTypeList = GetOrderTypeList();
  3055. List<LYFZ.Model.CameraControlTemplate> PageTemplateList=this.CameraControlTemplateList.FindAll(t => orderTypeList.Any(orderType => orderType == t.OrderType)).OrderBy(c=>c.CameraDateTime).ThenBy(c=>c.OrderType).ToList();
  3056. int sumRowCount = PageTemplateList.Sum(t => t.TimeTemplateData.TimeTemplateDataList.Count);
  3057. if (sumRowCount > this.PageCount)
  3058. {
  3059. this.sumPageCount = sumRowCount / this.PageCount;
  3060. if ((sumRowCount % this.PageCount) > 0)
  3061. {
  3062. this.sumPageCount = this.sumPageCount + 1;
  3063. }
  3064. }
  3065. List<LYFZ.Model.CameraControlTemplate> currentPageTemplateList = this.GetCurrentPageTemplateList(this.currentPage, this.PageCount, PageTemplateList);
  3066. IEnumerable <IGrouping<long, LYFZ.Model.CameraControlTemplate>> templateListGroup = currentPageTemplateList.FindAll(t => orderTypeList.Any(orderType => orderType == t.OrderType)).GroupBy(s => s.CameraDateTime);
  3067. foreach (IGrouping<long, LYFZ.Model.CameraControlTemplate> items in templateListGroup)
  3068. {
  3069. this.AddCameraDate(items.Key.JavaScriptTimeStampToDateTime(), items);
  3070. }
  3071. this.likCurrentPage.Text = this.currentPage.ToString();
  3072. this.likSumPage.Text = this.sumPageCount.ToString();
  3073. PanelDataView.RefreshTableView();
  3074. // ScheduleStatisticsInfo(this.CameraControlTemplateList);
  3075. ScheduleStatisticsInfo(currentPageTemplateList);
  3076. this.PanelDataView.Focus();
  3077. }
  3078. /// <summary>
  3079. /// 搜索函数
  3080. /// </summary>
  3081. /// <param name="cameraTime"></param>
  3082. /// <returns></returns>
  3083. bool CheckFilterTemplateList(CameraTimeTemplate cameraTime)
  3084. {
  3085. bool filter = true;
  3086. if (this.cbxNotificationStatus.SelectedIndex > 0)
  3087. {
  3088. if (this.cbxNotificationStatus.Text == "不在预设档期")
  3089. {
  3090. if (cameraTime.Parameter.WithinSchedule)
  3091. {
  3092. return false;
  3093. }
  3094. }
  3095. else if (this.cbxNotificationStatus.Text == "未预约")
  3096. {
  3097. if (cameraTime.ReservationTime.NotifyCustomerType == 0 && String.IsNullOrWhiteSpace(cameraTime.ReservationTime.OrderNumber))
  3098. {
  3099. filter = true;
  3100. }
  3101. else {
  3102. return false;
  3103. }
  3104. }
  3105. else
  3106. {
  3107. if (((NotifyCustomerType)cameraTime.ReservationTime.NotifyCustomerType).ToString() == this.cbxNotificationStatus.Text)
  3108. {
  3109. if (((NotifyCustomerType)cameraTime.ReservationTime.NotifyCustomerType) == NotifyCustomerType.未通知)
  3110. {
  3111. if (String.IsNullOrWhiteSpace(cameraTime.ReservationTime.OrderNumber)|| !cameraTime.Parameter.WithinSchedule)
  3112. {
  3113. return false;
  3114. }
  3115. }
  3116. filter = true;
  3117. } else {
  3118. return false;
  3119. }
  3120. }
  3121. }
  3122. if (this.cbxCustomLabel.SelectedIndex > 0)
  3123. {
  3124. if (cameraTime.ReservationTime.CustomLabel != this.cbxCustomLabel.Text)
  3125. {
  3126. return false;
  3127. }
  3128. }
  3129. if (this.cbxOther.SelectedIndex > 0)
  3130. {
  3131. switch (this.cbxOther.Text)
  3132. {
  3133. case "欠款":
  3134. if (!cameraTime.Parameter.IsArrears)
  3135. {
  3136. return false;
  3137. }
  3138. break;
  3139. case "重拍过":
  3140. if (cameraTime.Parameter.RetakesCount<=0)
  3141. {
  3142. return false;
  3143. }
  3144. break;
  3145. case "意向订单":
  3146. if (!cameraTime.Parameter.IsIntentionOrder)
  3147. {
  3148. return false;
  3149. }
  3150. break;
  3151. case "预约异常":
  3152. if (!cameraTime.ReservationError())
  3153. {
  3154. return false;
  3155. }
  3156. break;
  3157. case "被禁用档期":
  3158. if (cameraTime.ReservationTime.IsEnable!=0)
  3159. {
  3160. return false;
  3161. }
  3162. break;
  3163. case "改期二次以上":
  3164. if (cameraTime.Parameter.ReschedulesCount<=2)
  3165. {
  3166. return false;
  3167. }
  3168. break;
  3169. case "超期完成":
  3170. if (!cameraTime.Parameter.AreExtendedComplete)
  3171. {
  3172. return false;
  3173. }
  3174. break;
  3175. }
  3176. }
  3177. if (!String.IsNullOrWhiteSpace(this.txtKeyword.Text.Trim()))
  3178. {
  3179. filter = false;
  3180. string keyWord = this.txtKeyword.Text.Trim();
  3181. if (this.cbxSearchField.SelectedIndex == 0)
  3182. {
  3183. if (this.PanelDataView.HeadColumnRow.DataColumnList.Count > 4)
  3184. {
  3185. for (int i = 4; i < this.PanelDataView.HeadColumnRow.DataColumnList.Count; i++)
  3186. {
  3187. string findKey = this.PanelDataView.HeadColumnRow.DataColumnList[i].Text;
  3188. if (cameraTime.Parameter.KeyValues.ContainsKey(findKey))
  3189. {
  3190. if (cameraTime.Parameter.KeyValues[findKey].ToLower().Contains(keyWord.ToLower()))
  3191. {
  3192. return true;
  3193. }
  3194. }
  3195. }
  3196. }
  3197. }
  3198. else {
  3199. string findKey = this.cbxSearchField.Text;
  3200. if (cameraTime.Parameter.KeyValues.ContainsKey(findKey))
  3201. {
  3202. if (cameraTime.Parameter.KeyValues[findKey].ToLower().Contains(keyWord.ToLower()))
  3203. {
  3204. return true;
  3205. }
  3206. }
  3207. }
  3208. }
  3209. return filter;
  3210. }
  3211. /// <summary>
  3212. /// 获取模板档期分页集合
  3213. /// </summary>
  3214. /// <param name="_currentPage"></param>
  3215. /// <param name="_PageCount"></param>
  3216. /// <param name="sumTemplateList"></param>
  3217. /// <returns></returns>
  3218. List<LYFZ.Model.CameraControlTemplate> GetCurrentPageTemplateList(int _currentPage, int _PageCount, List<LYFZ.Model.CameraControlTemplate> sumTemplateList)
  3219. {
  3220. List<LYFZ.Model.CameraControlTemplate> pageList = new List<Model.CameraControlTemplate>();
  3221. int pageRowCount = pageList.Sum(t => t.TimeTemplateData.TimeTemplateDataList.Count);
  3222. int rowIndex = 0;
  3223. foreach (LYFZ.Model.CameraControlTemplate controlTemplate in sumTemplateList)
  3224. {
  3225. LYFZ.Model.CameraControlTemplate Template = Newtonsoft.Json.JsonConvert.DeserializeObject<LYFZ.Model.CameraControlTemplate>(controlTemplate.ToString());
  3226. Template.TimeTemplateData.TimeTemplateDataList.Clear();
  3227. foreach (CameraTimeTemplate cameraTime in controlTemplate.TimeTemplateData.TimeTemplateDataList)
  3228. {
  3229. if (this.CheckFilterTemplateList(cameraTime))
  3230. {
  3231. if (rowIndex >= _currentPage * _PageCount - _PageCount && rowIndex < _currentPage * _PageCount)
  3232. {
  3233. if (pageRowCount + Template.TimeTemplateData.TimeTemplateDataList.Count < _currentPage * _PageCount)
  3234. {
  3235. Template.TimeTemplateData.TimeTemplateDataList.Add(cameraTime);
  3236. }
  3237. else
  3238. {
  3239. return pageList;
  3240. }
  3241. }
  3242. rowIndex++;
  3243. }
  3244. }
  3245. pageList.Add(Template);
  3246. }
  3247. return pageList;
  3248. }
  3249. /// <summary>
  3250. /// 统计摄控信息
  3251. /// </summary>
  3252. /// <param name="cameraTemplateList"></param>
  3253. void ScheduleStatisticsInfo(List<LYFZ.Model.CameraControlTemplate> cameraTemplateList)
  3254. {
  3255. IEnumerable<IGrouping<int, LYFZ.Model.CameraControlTemplate>> templateListGroup = cameraTemplateList.GroupBy(s => s.OrderType);
  3256. foreach (Control con in this.flowLayoutPanel4.Controls)
  3257. {
  3258. if (con.GetType() == typeof(LYFZ.ComponentLibrary.CheckBoxEx))
  3259. {
  3260. LYFZ.ComponentLibrary.CheckBoxEx OrderCheckBox = (LYFZ.ComponentLibrary.CheckBoxEx)con;
  3261. // if (OrderCheckBox.Visible)
  3262. {
  3263. int orderType = Convert.ToInt32(OrderCheckBox.Tag);
  3264. CameraOrderType cameraOrderType = (CameraOrderType)orderType;
  3265. IEnumerable<IGrouping<int, LYFZ.Model.CameraControlTemplate>> templateList = templateListGroup.Where(i => i.Key == orderType);
  3266. if (templateList.Count() > 0)
  3267. {
  3268. //总的档期数
  3269. int sumCount = templateList.Sum(i => i.Sum(t => t.TimeTemplateData.TimeTemplateDataList.FindAll(s=>s.Parameter.WithinSchedule).Count));
  3270. //已预约的档期数
  3271. int sumReservationCount = templateList.Sum(i => i.Sum(t => t.TimeTemplateData.TimeTemplateDataList.FindAll(time => !String.IsNullOrWhiteSpace(time.ReservationTime.OrderNumber)&& time.Parameter.WithinSchedule).Count));
  3272. //已禁用的档期数
  3273. int sumDisableCount = templateList.Sum(i => i.Sum(t => t.TimeTemplateData.TimeTemplateDataList.FindAll(time => time.ReservationTime.IsEnable == 0).Count));
  3274. //不在档期内的 预约客人
  3275. int NotWithinScheduleSumCount = templateList.Sum(i => i.Sum(t => t.TimeTemplateData.TimeTemplateDataList.FindAll(s => !s.Parameter.WithinSchedule).Count));
  3276. string DisableText = "";
  3277. if (sumDisableCount > 0)
  3278. {
  3279. DisableText = String.Format("-{0}", sumDisableCount);
  3280. }
  3281. string NotWithinScheduleText = "";
  3282. if (NotWithinScheduleSumCount > 0)
  3283. {
  3284. NotWithinScheduleText = String.Format("+{0}", NotWithinScheduleSumCount);
  3285. }
  3286. OrderCheckBox.Text = String.Format("{0}:({1}/{2}{3}){4}", cameraOrderType.ToString(), sumReservationCount, sumCount, DisableText, NotWithinScheduleText);
  3287. }
  3288. else {
  3289. OrderCheckBox.Text = String.Format("{0}:({1}/{2}{3})", cameraOrderType.ToString(), 0, 0, "");
  3290. }
  3291. }
  3292. }
  3293. }
  3294. }
  3295. ThumbtackData ToThumbtackData(LYFZ.Model.ThumbtackRecord record)
  3296. {
  3297. ThumbtackData thumbtack = new ThumbtackData();
  3298. thumbtack.Tag = record;
  3299. thumbtack.ThumbtackType = record.ThumbtackType;
  3300. thumbtack.ThumbtackText = record.ThumbtackInfo;
  3301. return thumbtack;
  3302. }
  3303. /// <summary>
  3304. /// 添加绑定数据
  3305. /// </summary>
  3306. /// <param name="dayDate"></param>
  3307. /// <param name="items"></param>
  3308. void AddCameraDate(DateTime dayDate, IGrouping<long, LYFZ.Model.CameraControlTemplate> items)
  3309. {
  3310. int Index = 0;
  3311. int sumRowCount = items.Sum(t => t.TimeTemplateData.TimeTemplateDataList.Count);
  3312. List<LYFZ.Model.ThumbtackRecord> thumbtackRecordList = this.thumbtackRecordList.FindAll(t=>t.DateTimeMark.JavaScriptTimeStampToDateTime().ToYYYY_MM_dd()==dayDate.ToYYYY_MM_dd());
  3313. List<ThumbtackData> ThumbtackList = new List<ThumbtackData>();
  3314. foreach (LYFZ.Model.ThumbtackRecord record in thumbtackRecordList)
  3315. {
  3316. ThumbtackList.Add(this.ToThumbtackData(record));
  3317. }
  3318. foreach (LYFZ.Model.CameraControlTemplate cameraTemplate in items)
  3319. {
  3320. int subIndex = 0;
  3321. foreach (LYFZ.Model.CameraTimeTemplate time in cameraTemplate.TimeTemplateData.TimeTemplateDataList.OrderBy(t=>t.CameraTime))
  3322. {
  3323. int dayDateCrossRowCount = 1;
  3324. if (Index == 0)
  3325. {
  3326. dayDateCrossRowCount = sumRowCount;
  3327. }
  3328. int orderTypeCrossRowCount = 1;
  3329. if (subIndex == 0)
  3330. {
  3331. orderTypeCrossRowCount = cameraTemplate.TimeTemplateData.TimeTemplateDataList.Count;
  3332. }
  3333. ComponentLibrary.PDataRow row = GetNewDataRow(dayDate, dayDateCrossRowCount, orderTypeCrossRowCount, cameraTemplate, time, ThumbtackList);
  3334. if (sumRowCount == 1)
  3335. {
  3336. row.Height = 64;
  3337. }
  3338. PanelDataView.DataRowList.Add(row);
  3339. Index++;
  3340. subIndex++;
  3341. }
  3342. }
  3343. }
  3344. string ShopIDToShopName(string shopid, System.Windows.Forms.ComboBox cbxStoreList)
  3345. {
  3346. foreach (ItemValue item in cbxStoreList.Items)
  3347. {
  3348. if (item.Tag != null)
  3349. {
  3350. QueryStoreInfo qStoreInfo = GetQueryStoreInfo(item);
  3351. if (qStoreInfo != null)
  3352. {
  3353. if (qStoreInfo.DividedShop.ToLower() == shopid.ToLower())
  3354. {
  3355. return qStoreInfo.DividedShop_Name;
  3356. }
  3357. }
  3358. }
  3359. }
  3360. return shopid;
  3361. }
  3362. /// <summary>
  3363. /// 获取行
  3364. /// </summary>
  3365. /// <param name="dayDate"></param>
  3366. /// <param name="dateCrossRowCount"></param>
  3367. /// <param name="orderTypeCrossRowCount"></param>
  3368. /// <param name="cameraTemplate"></param>
  3369. /// <param name="cameraTime"></param>
  3370. /// <returns></returns>
  3371. ComponentLibrary.PDataRow GetNewDataRow(DateTime dayDate, int dateCrossRowCount, int orderTypeCrossRowCount, LYFZ.Model.CameraControlTemplate cameraTemplate, CameraTimeTemplate cameraTime, List<ThumbtackData> dayThumbtackList)
  3372. {
  3373. ComponentLibrary.PDataRow row = new PDataRow();
  3374. CameraType cameraType = (CameraType)cameraTemplate.CameraType;
  3375. CameraOrderType cameraOrderType = (CameraOrderType)cameraTemplate.OrderType;
  3376. string LunarCalendarDayTime = Command.Command_CalendarTurnLunar.GetChineseDateTimeToNoYear(dayDate);
  3377. string weekName = weekNames[SetCameraTemplate.GetDayOfWeekIndex(dayDate.DayOfWeek) - 1];
  3378. ComponentLibrary.PDataColumn cell0 = new ComponentLibrary.PDataColumn
  3379. {
  3380. Text = String.Format("{0}\r\n{1}\r\n{2}", weekName, dayDate.ToString("yyyy-MM-dd"), LunarCalendarDayTime)
  3381. ,
  3382. CrossRow = dateCrossRowCount
  3383. ,
  3384. DateTimeTag = dayDate
  3385. ,
  3386. Tag = weekName
  3387. };
  3388. //不在档期内的 预约客人
  3389. int NotWithinScheduleSumCount = cameraTemplate.TimeTemplateData.TimeTemplateDataList.FindAll(t => !t.Parameter.WithinSchedule).Count;
  3390. string NotWithinScheduleText = "";
  3391. if (NotWithinScheduleSumCount > 0)
  3392. {
  3393. NotWithinScheduleText = String.Format("+{0}", NotWithinScheduleSumCount);
  3394. }
  3395. string DisableText = "";
  3396. if (cameraTemplate.TimeTemplateData.TimeTemplateDataList.Any(t => t.ReservationTime.IsEnable == 0))
  3397. {
  3398. DisableText = String.Format("-{0}", cameraTemplate.TimeTemplateData.TimeTemplateDataList.FindAll(t => t.ReservationTime.IsEnable == 0).Count);
  3399. }
  3400. string ScheduleStatistics = String.Format("({0}/{1}{2}){3}", cameraTemplate.TimeTemplateData.TimeTemplateDataList.FindAll(t => !String.IsNullOrWhiteSpace(t.ReservationTime.OrderNumber)&& t.Parameter.WithinSchedule).Count
  3401. , cameraTemplate.TimeTemplateData.TimeTemplateDataList.FindAll(t => t.Parameter.WithinSchedule).Count, DisableText, NotWithinScheduleText);
  3402. string ShopName = "";
  3403. if (IsMultiShopID(this.CurrentQueryStoreList2))
  3404. {
  3405. ShopName = String.Format("\r\n【{0}】", ShopIDToShopName(cameraTemplate.ShopID, this.cbxStoreList2));
  3406. }
  3407. Font columnTextFont = new Font("微软雅黑", 10, FontStyle.Regular);
  3408. Color columnTextColor = Color.Black;
  3409. if (cameraTime.ReservationTime.IsEnable == 0)
  3410. {
  3411. columnTextFont = new Font("微软雅黑", 10, FontStyle.Strikeout | FontStyle.Italic);
  3412. columnTextColor = Color.Gray;
  3413. }
  3414. else if (cameraTime.ReservationError())
  3415. {
  3416. columnTextFont = new Font("微软雅黑", 10, FontStyle.Strikeout | FontStyle.Italic);
  3417. columnTextColor = Color.Maroon;
  3418. }
  3419. else if (cameraTime.Parameter.IsArrears)
  3420. {
  3421. columnTextColor = Color.Red;
  3422. }
  3423. else if (cameraTime.Parameter.RetakesCount>0)
  3424. {
  3425. columnTextColor = Color.Orange;
  3426. }
  3427. else if (cameraTime.Parameter.IsIntentionOrder)
  3428. {
  3429. columnTextColor = Color.Violet;
  3430. }
  3431. else if (cameraTime.Parameter.ReschedulesCount>2)
  3432. {
  3433. columnTextColor = Color.Green;
  3434. }
  3435. else if (!String.IsNullOrWhiteSpace(cameraTime.Parameter.OrderAutoColor))
  3436. {
  3437. columnTextFont = new Font("微软雅黑", 10, FontStyle.Bold);
  3438. columnTextColor = cameraTime.Parameter.GetOrderAutoColor();
  3439. }
  3440. else if (cameraTime.Parameter.AreExtendedComplete)
  3441. {
  3442. columnTextColor = Color.DodgerBlue;
  3443. }
  3444. if (dayThumbtackList.Count > 0)
  3445. {
  3446. cell0.ThumbtackList.AddRange(dayThumbtackList);
  3447. if (dayThumbtackList.Any(t => t.ThumbtackType == 1))
  3448. {
  3449. columnTextFont = new Font("微软雅黑", 10, FontStyle.Strikeout | FontStyle.Italic);
  3450. columnTextColor = Color.BlueViolet;
  3451. }
  3452. }
  3453. ComponentLibrary.PDataColumn cell1 = new ComponentLibrary.PDataColumn
  3454. {
  3455. Text = String.Format("{0}[{1}]{2}", cameraOrderType.ToString(), ScheduleStatistics, ShopName)
  3456. ,
  3457. CrossRow = orderTypeCrossRowCount
  3458. };
  3459. ComponentLibrary.PDataColumn cell2 = new ComponentLibrary.PDataColumn
  3460. {
  3461. Text = String.Format("{1}{0}", cameraTime.CameraTime,cameraTime.Parameter.WithinSchedule?"": "☆ ")
  3462. ,TextFont= columnTextFont
  3463. ,TextColor= columnTextColor
  3464. ,
  3465. Tag = cameraTime
  3466. };
  3467. row.DataColumnList.AddRange(new ComponentLibrary.PDataColumn[] { cell0, cell1, cell2 });
  3468. for (int i = 3; i < this.PanelDataView.HeadColumnRow.DataColumnList.Count; i++)
  3469. {
  3470. string cellValue = "";
  3471. string cellKey = this.PanelDataView.HeadColumnRow.DataColumnList[i].Text.Trim();
  3472. if (cameraTime.Parameter != null && cameraTime.Parameter.KeyValues.Count > 0)
  3473. {
  3474. if (cameraTime.Parameter.KeyValues.ContainsKey(cellKey))
  3475. {
  3476. if (cellKey == "客户电话")
  3477. {
  3478. //ProhibitViewCustomerPhoneNumber
  3479. if (LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.OtherPermissionsSet, LYFZ.CustomAttributes.OperatingAuthority.ProhibitViewCustomerPhoneNumber) && !LYFZ.BLL.BLL_ErpUser.IsAdministrator())
  3480. {
  3481. cellValue = LYFZ.Command.Command_Validate.HidePhone(cameraTime.Parameter.KeyValues[cellKey]);
  3482. }
  3483. else {
  3484. cellValue = cameraTime.Parameter.KeyValues[cellKey];
  3485. }
  3486. }
  3487. else
  3488. {
  3489. cellValue = cameraTime.Parameter.KeyValues[cellKey];
  3490. }
  3491. }
  3492. }
  3493. ComponentLibrary.PDataColumn cell = new ComponentLibrary.PDataColumn
  3494. {
  3495. Text = String.Format("{0}", cellValue)
  3496. ,
  3497. TextColor = columnTextColor
  3498. ,
  3499. TextFont = columnTextFont
  3500. };
  3501. switch (cellKey)
  3502. {
  3503. case "通知状态":
  3504. cell.Text = String.Format("{0}", GetNotifyCustomerTypeText(cameraTime));
  3505. cell.Tag = cameraTime.ReservationTime.NotifyCustomerType;
  3506. break;
  3507. case "通知备注":
  3508. cell.Text = String.Format("{0}", cameraTime.ReservationTime.CustomerFeedback);
  3509. break;
  3510. case "自定义标签":
  3511. cell.Text = String.Format("{0}", cameraTime.ReservationTime.CustomLabel);
  3512. break;
  3513. case "订单号":
  3514. cell.Text = String.Format("{0}", cameraTime.ReservationTime.ShowOrderNumber);
  3515. break;
  3516. /* case "预约时间":
  3517. case "上门时间":
  3518. cell.Text = String.Format("{0} {1}", dayDate.ToString("yyyy-MM-dd"), cameraTime.CameraTime);
  3519. break;*/
  3520. }
  3521. row.DataColumnList.Add(cell);
  3522. }
  3523. row.Tag = cameraTemplate;
  3524. return row;
  3525. }
  3526. static string GetNotifyCustomerTypeText(CameraTimeTemplate cameraTime)
  3527. {
  3528. if (cameraTime.ReservationTime.NotifyCustomerType == 0 && String.IsNullOrWhiteSpace(cameraTime.ReservationTime.OrderNumber))
  3529. {
  3530. return "未预约";
  3531. }
  3532. else if (cameraTime.Parameter.WithinSchedule)
  3533. {
  3534. return ((NotifyCustomerType)cameraTime.ReservationTime.NotifyCustomerType).ToString();
  3535. }
  3536. else
  3537. {
  3538. return "不在预设档期";
  3539. }
  3540. }
  3541. int GetTitleDataColumnWidth(string[] titleNames, string titleName)
  3542. {
  3543. int cell_width = 160;
  3544. if (titleName.Trim() == titleNames[0])
  3545. {
  3546. cell_width = 130;
  3547. }
  3548. else if (titleName.Trim() == titleNames[1])
  3549. {
  3550. cell_width = 160;
  3551. }
  3552. else if (titleName.Trim() == titleNames[2])
  3553. {
  3554. cell_width = 110;
  3555. }
  3556. else if (titleName.Trim() == titleNames[3])
  3557. {
  3558. cell_width = 110;
  3559. }
  3560. return cell_width;
  3561. }
  3562. /// <summary>
  3563. /// 初始化摄控详情
  3564. /// </summary>
  3565. void initializationCamera()
  3566. {
  3567. this.dateTimePickerStar.Value = SDateTime.Now;
  3568. this.dateTimePickerEnd.Value = SDateTime.Now;
  3569. }
  3570. #region 摄控详情时间控制
  3571. /// <summary>
  3572. /// 近一个月
  3573. /// </summary>
  3574. /// <param name="sender"></param>
  3575. /// <param name="e"></param>
  3576. private void BtnNearlyOneMonth_Click(object sender, EventArgs e)
  3577. {
  3578. this.dateTimePickerStar.Value = SDateTime.Now;
  3579. this.dateTimePickerEnd.Value = SDateTime.Now.AddDays(29);
  3580. this.LoadTemplateData();
  3581. }
  3582. /// <summary>
  3583. /// 近半个月
  3584. /// </summary>
  3585. /// <param name="sender"></param>
  3586. /// <param name="e"></param>
  3587. private void BtnNearlyHalfMonth_Click(object sender, EventArgs e)
  3588. {
  3589. this.dateTimePickerStar.Value = SDateTime.Now;
  3590. this.dateTimePickerEnd.Value = SDateTime.Now.AddDays(14);
  3591. this.LoadTemplateData();
  3592. }
  3593. /// <summary>
  3594. /// 近一周
  3595. /// </summary>
  3596. /// <param name="sender"></param>
  3597. /// <param name="e"></param>
  3598. private void BtnNearlyOneWeek_Click(object sender, EventArgs e)
  3599. {
  3600. this.dateTimePickerStar.Value = SDateTime.Now;
  3601. this.dateTimePickerEnd.Value = SDateTime.Now.AddDays(6);
  3602. this.LoadTemplateData();
  3603. }
  3604. /// <summary>
  3605. /// 今天
  3606. /// </summary>
  3607. /// <param name="sender"></param>
  3608. /// <param name="e"></param>
  3609. private void BtnNowaday_Click(object sender, EventArgs e)
  3610. {
  3611. this.dateTimePickerStar.Value = SDateTime.Now;
  3612. this.dateTimePickerEnd.Value = SDateTime.Now;
  3613. this.LoadTemplateData();
  3614. }
  3615. /// <summary>
  3616. /// 后一天
  3617. /// </summary>
  3618. /// <param name="sender"></param>
  3619. /// <param name="e"></param>
  3620. private void BtnAfterDay_Click(object sender, EventArgs e)
  3621. {
  3622. int tempDay = CameraTemplateHandle.GetSubtractDay(this.dateTimePickerStar.Value, this.dateTimePickerEnd.Value) + 1;
  3623. this.dateTimePickerEnd.Value = this.dateTimePickerEnd.Value.AddDays(tempDay);
  3624. this.dateTimePickerStar.Value = this.dateTimePickerStar.Value.AddDays(tempDay);
  3625. this.LoadTemplateData();
  3626. }
  3627. /// <summary>
  3628. /// 前一天
  3629. /// </summary>
  3630. /// <param name="sender"></param>
  3631. /// <param name="e"></param>
  3632. private void BtnBeforeDay_Click(object sender, EventArgs e)
  3633. {
  3634. int tempDay = CameraTemplateHandle.GetSubtractDay(this.dateTimePickerStar.Value, this.dateTimePickerEnd.Value) + 1;
  3635. this.dateTimePickerStar.Value = this.dateTimePickerStar.Value.AddDays(-tempDay);
  3636. this.dateTimePickerEnd.Value = this.dateTimePickerEnd.Value.AddDays(-tempDay);
  3637. this.LoadTemplateData();
  3638. }
  3639. private void DateTimePickerEnd_ValueChanged(object sender, EventArgs e)
  3640. {
  3641. if (this.dateTimePickerStar.Value > this.dateTimePickerEnd.Value)
  3642. {
  3643. this.dateTimePickerStar.Value = this.dateTimePickerEnd.Value;
  3644. }
  3645. }
  3646. private void DateTimePickerStar_ValueChanged(object sender, EventArgs e)
  3647. {
  3648. if (this.dateTimePickerStar.Value > this.dateTimePickerEnd.Value)
  3649. {
  3650. this.dateTimePickerEnd.Value = this.dateTimePickerStar.Value;
  3651. }
  3652. }
  3653. #endregion
  3654. bool isUpdateQuery = false;
  3655. bool isUpdateOrderDataTableQuery = false;
  3656. private void TabControlEx1_Selected(object sender, TabControlEventArgs e)
  3657. {
  3658. this.HideTpsInfo();
  3659. if (this.tabControlEx1.SelectedIndex != 1)
  3660. {
  3661. this.lbColorText.Hide();
  3662. }
  3663. switch (this.tabControlEx1.SelectedIndex)
  3664. {
  3665. case 0:
  3666. if (isUpdateQuery)
  3667. {
  3668. this.BtnUpdateQuery_Click(null, null);
  3669. }
  3670. break;
  3671. case 1:
  3672. if (this.currentOrderDataTable == null||isUpdateOrderDataTableQuery|| this.isGoToCameraRecord)
  3673. {
  3674. this.LoadTemplateData();
  3675. this.isGoToCameraRecord = false;
  3676. }
  3677. this.lbColorText.Show();
  3678. break;
  3679. case 2:
  3680. {
  3681. }
  3682. break;
  3683. case 3:
  3684. break;
  3685. }
  3686. }
  3687. void HideTpsInfo()
  3688. {
  3689. this.tpsInfo.Hide(this.plCalendarTable);
  3690. this.tpsInfo.Hide(this.PanelDataView);
  3691. }
  3692. bool isShownLoad = true;
  3693. private void MainCameraControlBook_Shown(object sender, EventArgs e)
  3694. {
  3695. this.plCalendarInfo.Show();
  3696. this.cbxOther.SelectedIndex = 0;
  3697. this.BindNotificationStatus();
  3698. //绑定门店
  3699. BindStoreList(this.cbxStoreList,LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition);
  3700. BindStoreList(this.cbxStoreList2, LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition);
  3701. this.SetOrderTypeChBoxShow();
  3702. this.InitializeCalendar();
  3703. this.isShownLoad = false;
  3704. LoadColorList();
  3705. GoToCameraRecord();
  3706. }
  3707. void BindNotificationStatus()
  3708. {
  3709. this.cbxNotificationStatus.Items.Clear();
  3710. this.cbxNotificationStatus.Items.Add("全部");
  3711. this.cbxNotificationStatus.Items.Add("未预约");
  3712. this.cbxNotificationStatus.Items.Add("不在预设档期");
  3713. this.cbxNotificationStatus.Items.AddRange(Enum.GetNames(typeof(NotifyCustomerType)));
  3714. this.cbxNotificationStatus.SelectedIndex = 0;
  3715. }
  3716. List<Model.Model_ColorSetting> ColorSettingList = new List<Model_ColorSetting>();
  3717. /// <summary>
  3718. /// 加载自定义颜色
  3719. /// </summary>
  3720. void LoadColorList()
  3721. {
  3722. BLL.BLL_ColorSetting bLL_Color = new BLL.BLL_ColorSetting();
  3723. ColorSettingList = bLL_Color.GetDataTableToOblList<Model_ColorSetting>(bLL_Color.GetAllList().Tables[0]);
  3724. }
  3725. CameraReservationDataCount reservationDataCount = new CameraReservationDataCount();
  3726. /// <summary>
  3727. /// 加载预约统计数量数据
  3728. /// </summary>
  3729. void LoadCameraReservationData()
  3730. {
  3731. if (this.CurrentQueryStoreList != null)
  3732. {
  3733. string shopIDString = "";
  3734. if (this.CurrentQueryStoreList.QueryType != 0)
  3735. {
  3736. shopIDString = GetQueryStoreList(this.CurrentQueryStoreList);
  3737. }
  3738. //DateTime dateStar = Convert.ToDateTime(String.Format("{0}-{1}-01", this.selectYear, this.selectMonth));
  3739. //DateTime dateEnd = dateStar.AddMonths(1).AddDays(-1).ToDayDateMaxTime();
  3740. DateTime dateStar = CellWeekContent.GetDayDateTime(this.selectYear, this.selectMonth,1).ToYYYYMMddDate();
  3741. DateTime dateEnd = CellWeekContent.GetDayDateTime(this.selectYear, this.selectMonth, 42).ToDayDateMaxTime();
  3742. this.LoadCameraReservationData(dateStar, dateEnd, shopIDString);
  3743. }
  3744. else
  3745. {
  3746. MessageBoxCustom.Show("请选择门店");
  3747. }
  3748. }
  3749. /// <summary>
  3750. /// 加载预约统计数量数据
  3751. /// </summary>
  3752. /// <param name="dateStar"></param>
  3753. /// <param name="dateEnd"></param>
  3754. /// <param name="shopID"></param>
  3755. void LoadCameraReservationData(DateTime dateStar, DateTime dateEnd, string shopID)
  3756. {
  3757. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate (object obj, BackgroundWorker backgroundWorker)
  3758. {
  3759. try
  3760. {
  3761. backgroundWorker.ReportProgress(0, "正在加载预约统计数据...");
  3762. this.reservationDataCount.LoadData(dateStar, dateEnd, shopID, LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition);
  3763. }
  3764. catch(Exception ex) {
  3765. MessageBoxCustom.Show(String.Format("加载预约统计数据时出错:{0}",ex.Message));
  3766. }
  3767. });
  3768. }
  3769. private void MainCameraControlBook_Load(object sender, EventArgs e)
  3770. {
  3771. this.HideORShowStoresList(LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition);
  3772. this.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y);
  3773. this.Size = new Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height);
  3774. this.initializationCamera();
  3775. }
  3776. #region 摄控日历初始化
  3777. /// <summary>
  3778. /// 当前选择年
  3779. /// </summary>
  3780. int selectYear = SDateTime.Now.Year;
  3781. /// <summary>
  3782. /// 当前选择月
  3783. /// </summary>
  3784. int selectMonth = SDateTime.Now.Month;
  3785. private void NudMonth_ValueChanged(object sender, EventArgs e)
  3786. {
  3787. selectMonth = Convert.ToInt32(this.nudMonth.Value);
  3788. this.InitializeCalendar();
  3789. }
  3790. private void NudYears_ValueChanged(object sender, EventArgs e)
  3791. {
  3792. selectYear = Convert.ToInt32(this.nudYears.Value);
  3793. this.InitializeCalendar();
  3794. }
  3795. /// <summary>
  3796. /// 是否选择了多个门店
  3797. /// </summary>
  3798. /// <returns></returns>
  3799. bool IsMultiShopID(QueryStoreList StoreList)
  3800. {
  3801. if (!LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition)
  3802. {
  3803. return false;
  3804. }
  3805. if (StoreList != null)
  3806. {
  3807. if (StoreList.QueryStoreInfoList.Count > 1)
  3808. {
  3809. return true;
  3810. }
  3811. }
  3812. return false;
  3813. }
  3814. /// <summary>
  3815. /// 是否只选择了一个门店 或 是单店版
  3816. /// </summary>
  3817. /// <returns></returns>
  3818. bool IsOneShopID(QueryStoreList StoreList)
  3819. {
  3820. if (!LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition)
  3821. {
  3822. return true;
  3823. }
  3824. if (StoreList != null)
  3825. {
  3826. if (StoreList.QueryStoreInfoList.Count==1)
  3827. {
  3828. return true;
  3829. }
  3830. }
  3831. return false;
  3832. }
  3833. string GetShopID(QueryStoreList StoreList)
  3834. {
  3835. if (StoreList != null)
  3836. {
  3837. if (StoreList.QueryStoreInfoList.Count == 1)
  3838. {
  3839. return StoreList.QueryStoreInfoList[0].DividedShop;
  3840. }
  3841. }
  3842. return LYFZ.BLL.BLL_ErpCompanyInfo.CurrentCompanyInfoID;
  3843. }
  3844. int dayCount = 0;
  3845. /// <summary>
  3846. /// 日历数据
  3847. /// </summary>
  3848. List<CellWeekContent> CellWeekContentList = new List<CellWeekContent>();
  3849. /// <summary>
  3850. /// 初始化日历数据
  3851. /// </summary>
  3852. void InitializeCalendar()
  3853. {
  3854. isUpdateQuery = false;
  3855. dayCount = 0;
  3856. CellWeekContentList.Clear();
  3857. this.LoadCameraReservationData();
  3858. // LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate (object obj, BackgroundWorker backgroundWorker)
  3859. // {
  3860. try
  3861. {
  3862. // backgroundWorker.ReportProgress(0, "正在统计数据...");
  3863. for (int i = 0; i < weekRowCount; i++)
  3864. {
  3865. for (int j = 0; j < weekNames.Length; j++)
  3866. {
  3867. CellWeekContent cellWeek = new CellWeekContent(this.selectYear, this.selectMonth, ++dayCount);
  3868. cellWeek.RowIndex = i;
  3869. cellWeek.CellIndex = j;
  3870. cellWeek.WeekDayName = weekNames[cellWeek.CellIndex];
  3871. cellWeek.WeekDayNumber = cellWeek.CellIndex + 1;
  3872. // if (cellWeek.IsValid)
  3873. {
  3874. if (this.IsOneShopID(this.CurrentQueryStoreList))
  3875. {
  3876. this.SetThumbtack(this.reservationDataCount, cellWeek.DayTime, cellWeek.Thumbtack);
  3877. this.SetPublicHoliday(this.reservationDataCount, cellWeek.DayTime, cellWeek.PublicHoliday);
  3878. }
  3879. List<LYFZ.Model.CameraControlTemplate> dayCameraTemplateList = this.reservationDataCount.CameraControlTemplateList.FindAll(t =>t.CameraDateTime.JavaScriptTimeStampToDateTime().ToYYYY_MM_dd() == cellWeek.DayTime.ToYYYY_MM_dd());
  3880. cellWeek.CameraTypeItemList.Add(this.reservationDataCount.GetCameraTypeItem(LYFZ.Model.CameraType.拍照客人, cellWeek.DayTime, dayCameraTemplateList));
  3881. cellWeek.CameraTypeItemList.Add(this.reservationDataCount.GetCameraTypeItem(LYFZ.Model.CameraType.选片客人, cellWeek.DayTime, dayCameraTemplateList));
  3882. cellWeek.CameraTypeItemList.Add(this.reservationDataCount.GetCameraTypeItem(LYFZ.Model.CameraType.看版客人, cellWeek.DayTime, dayCameraTemplateList));
  3883. cellWeek.CameraTypeItemList.Add(this.reservationDataCount.GetCameraTypeItem(LYFZ.Model.CameraType.取件客人, cellWeek.DayTime, dayCameraTemplateList));
  3884. cellWeek.CameraTypeItemList.Add(this.reservationDataCount.GetCameraTypeItem(LYFZ.Model.CameraType.服务客人, cellWeek.DayTime, dayCameraTemplateList));
  3885. cellWeek.CameraTypeItemList.Add(this.reservationDataCount.GetCameraTypeItem(LYFZ.Model.CameraType.选衣客人, cellWeek.DayTime, dayCameraTemplateList));
  3886. cellWeek.CameraTypeItemList.Add(this.reservationDataCount.GetCameraTypeItem(LYFZ.Model.CameraType.爱婴上门, cellWeek.DayTime, dayCameraTemplateList));
  3887. }
  3888. this.CellWeekContentList.Add(cellWeek);
  3889. }
  3890. }
  3891. }
  3892. catch (Exception ex)
  3893. {
  3894. MessageBoxCustom.Show(String.Format("统计数据时出错:{0}", ex.Message));
  3895. }
  3896. // });
  3897. this.CalendarTableRefresh();
  3898. }
  3899. void SetThumbtack(CameraReservationDataCount reservationData,DateTime dayDate, ThumbtackData thumbtack)
  3900. {
  3901. Model.ThumbtackRecord record= reservationData.ThumbtackRecordList.Find(t=>t.ThumbtackType==2 && t.DateTimeMark.JavaScriptTimeStampToDateTime().ToYYYY_MM_dd()==dayDate.ToYYYY_MM_dd());
  3902. if (record != null)
  3903. {
  3904. thumbtack.Tag = record;
  3905. thumbtack.ThumbtackType = record.ThumbtackType;
  3906. thumbtack.ThumbtackText = record.ThumbtackInfo;
  3907. }
  3908. }
  3909. void SetPublicHoliday(CameraReservationDataCount reservationData, DateTime dayDate, ThumbtackData thumbtack)
  3910. {
  3911. Model.ThumbtackRecord record = reservationData.ThumbtackRecordList.Find(t => t.ThumbtackType == 1 && t.DateTimeMark.JavaScriptTimeStampToDateTime().ToYYYY_MM_dd() == dayDate.ToYYYY_MM_dd());
  3912. if (record != null)
  3913. {
  3914. thumbtack.Tag = record;
  3915. thumbtack.ThumbtackType = record.ThumbtackType;
  3916. thumbtack.ThumbtackText = record.ThumbtackInfo;
  3917. }
  3918. }
  3919. #endregion
  3920. #region 绘制日历表
  3921. int weekRowCount = 6;//日历行数
  3922. int weekTitleHeight = 32;//日历标题高度
  3923. int weekContentHeight = 180;//日历内容单元格高度
  3924. Font weekFont = new Font("微软雅黑", 12, FontStyle.Bold);
  3925. string[] weekNames = new string[7] { "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日" };
  3926. Pen borderPen = new Pen(Brushes.White, 2);
  3927. private void PlCalendarInfo_Paint(object sender, PaintEventArgs e)
  3928. {
  3929. if (this.chbxFixedHeader.Checked)
  3930. {
  3931. this.CalendarTableRefresh();
  3932. }
  3933. }
  3934. private void PlCalendarTable_Paint(object sender, PaintEventArgs e)
  3935. {
  3936. this.PlCalendarTableDraw(e.Graphics);
  3937. }
  3938. private void ChbxFixedHeader_Click(object sender, EventArgs e)
  3939. {
  3940. this.CalendarTableRefresh();
  3941. }
  3942. void CalendarTableRefresh()
  3943. {
  3944. this.plCalendarTable.Refresh();
  3945. }
  3946. void PlCalendarTableDraw(Graphics g)
  3947. {
  3948. int days = DateTime.DaysInMonth(selectYear, selectMonth);
  3949. Rectangle rec = new Rectangle(2, 2, (this.plCalendarTable.Width - 4) / 7, weekTitleHeight);
  3950. foreach (CellWeekContent cellWeek in CellWeekContentList)
  3951. {
  3952. this.DrawCellWeekContent(cellWeek, g, new Rectangle(rec.X, rec.Y + rec.Height, rec.Width, weekContentHeight),cellWeek.RowIndex,cellWeek.CellIndex);
  3953. }
  3954. if (this.chbxFixedHeader.Checked)
  3955. {
  3956. int VerticalScrollValue = this.plCalendarInfo.VerticalScroll.Value;
  3957. if (VerticalScrollValue > 20)
  3958. {
  3959. VerticalScrollValue = this.plCalendarInfo.VerticalScroll.Value - 7;
  3960. }
  3961. rec = new Rectangle(rec.X, rec.Y + VerticalScrollValue, rec.Width, rec.Height);
  3962. }
  3963. for (int i = 0; i < weekNames.Length; i++)
  3964. {
  3965. Rectangle weekRec = new Rectangle(rec.X + rec.Width * i, rec.Y-1, rec.Width, rec.Height);
  3966. g.DrawRectangle(borderPen, weekRec);
  3967. Brush brush = new SolidBrush(Color.FromArgb(90, 158, 203));
  3968. g.FillRectangle(brush, new Rectangle(weekRec.X + 1, weekRec.Y + 1, weekRec.Width - 2, weekRec.Height - 2));
  3969. g.DrawString(String.Format("{0}", weekNames[i]), weekFont, Brushes.White, weekRec.X + weekRec.Width / 2 - 11, weekRec.Y + weekRec.Height / 2 - 11);
  3970. }
  3971. }
  3972. /// <summary>
  3973. /// 画单元格
  3974. /// </summary>
  3975. /// <param name="cellWeek">单元格数据对象</param>
  3976. /// <param name="g">画笔</param>
  3977. /// <param name="rec">基础位置和大小</param>
  3978. /// <param name="rowIndex">行索引</param>
  3979. /// <param name="cellIndex">单元格索引</param>
  3980. void DrawCellWeekContent(CellWeekContent cellWeek, Graphics g, Rectangle rec, int rowIndex, int cellIndex)
  3981. {
  3982. Rectangle weekRec = new Rectangle(rec.X + rec.Width * cellIndex, rec.Y + rec.Height * rowIndex, rec.Width, rec.Height);
  3983. cellWeek.BorderRectangle = weekRec;
  3984. g.DrawRectangle(borderPen, cellWeek.BorderRectangle);
  3985. Brush brush = new SolidBrush(Color.FromArgb(220, 220, 220));
  3986. if (cellWeek.DayTime.Month == SDateTime.Now.Month && cellWeek.DayTime.Day == SDateTime.Now.Day)
  3987. {
  3988. brush = new SolidBrush(Color.FromArgb(135, 206, 235));
  3989. }
  3990. cellWeek.ContentRectangle = new Rectangle(weekRec.X + 1, weekRec.Y + 1, weekRec.Width - 2, weekRec.Height - 2);
  3991. g.FillRectangle(brush, cellWeek.ContentRectangle);
  3992. this.DrawCellWeekContentText(g, cellWeek);
  3993. }
  3994. Font weekDayNumberFont = new Font("微软雅黑", 12, FontStyle.Bold);
  3995. Font weekDayTextFont = new Font("微软雅黑", 10, FontStyle.Bold);
  3996. Font weekItemTextFont = new Font("微软雅黑", 10, FontStyle.Regular);
  3997. /// <summary>
  3998. /// 画单元格内容
  3999. /// </summary>
  4000. /// <param name="g">画笔</param>
  4001. /// <param name="cellWeek">单元格数据对象</param>
  4002. void DrawCellWeekContentText(Graphics g, CellWeekContent cellWeek)
  4003. {
  4004. Brush dayBrush = Brushes.Red;
  4005. Brush textBrush = Brushes.Black;
  4006. if (!cellWeek.IsValid)
  4007. {
  4008. dayBrush = Brushes.Gray;
  4009. textBrush = Brushes.Gray;
  4010. }
  4011. Rectangle weekRec = cellWeek.ContentRectangle;
  4012. Point locatePoint = new Point(weekRec.X + 5, weekRec.Y + 5);
  4013. // if (cellWeek.IsValid)
  4014. {
  4015. g.DrawString(String.Format("{0}", cellWeek.DayTime.Day), weekDayNumberFont, dayBrush, locatePoint);
  4016. g.DrawString(String.Format("{0}", cellWeek.LunarCalendarDayTime), weekDayTextFont, textBrush, new Point(locatePoint.X + 28, locatePoint.Y + 2));
  4017. }
  4018. //画图钉
  4019. Rectangle destRect = new Rectangle(locatePoint.X + 140, locatePoint.Y, 42, 42);
  4020. cellWeek.Thumbtack.ThumbtackRectangle = destRect;
  4021. cellWeek.PublicHoliday.ThumbtackRectangle = destRect;
  4022. // if (cellWeek.IsValid)
  4023. {
  4024. if (!cellWeek.Thumbtack.IsNullThumbtackText)
  4025. {
  4026. Rectangle srcRect = new Rectangle(0, 0, LYFZ.Software.Properties.Resources.TuDing1.Width, LYFZ.Software.Properties.Resources.TuDing1.Height);
  4027. g.DrawImage(LYFZ.Software.Properties.Resources.TuDing1, destRect, srcRect, GraphicsUnit.Pixel);
  4028. if (!cellWeek.PublicHoliday.IsNullThumbtackText)
  4029. {
  4030. //画公休图钉
  4031. cellWeek.PublicHoliday.ThumbtackRectangle = new Rectangle(destRect.X, destRect.Y + 50, 42, 42);
  4032. this.DrawPublicHoliday(g, cellWeek);
  4033. }
  4034. }
  4035. else if (!cellWeek.PublicHoliday.IsNullThumbtackText)
  4036. {
  4037. //画公休图钉
  4038. this.DrawPublicHoliday(g, cellWeek);
  4039. }
  4040. }
  4041. if (cellWeek.ContentRectangle.Contains(this.MouseClickLocation))
  4042. {
  4043. cellWeek.IsCurrent = true;
  4044. Pen tempPen = new Pen(new SolidBrush(Color.FromArgb(0, 181, 244)), 4);
  4045. // if (cellWeek.IsValid)
  4046. {
  4047. g.DrawRectangle(tempPen, new Rectangle(cellWeek.BorderRectangle.X + 2, cellWeek.BorderRectangle.Y + 2, cellWeek.BorderRectangle.Width - 5, cellWeek.BorderRectangle.Height - 5));
  4048. }
  4049. }
  4050. else
  4051. {
  4052. cellWeek.IsCurrent = false;
  4053. }
  4054. locatePoint = new Point(locatePoint.X + 2, locatePoint.Y + 24);
  4055. // if (cellWeek.IsValid)
  4056. {
  4057. for (int i = 0; i < cellWeek.CameraTypeItemList.Count; i++)
  4058. {
  4059. CameraTypeItem cameraItem = cellWeek.CameraTypeItemList[i];
  4060. Point tempPoint = new Point(locatePoint.X, locatePoint.Y + i * 20);
  4061. g.DrawString(String.Format("{0}:{1}", cameraItem.CurrCameraType.ToString(), cameraItem.GetStatisticalText()), weekItemTextFont, textBrush, tempPoint);
  4062. cameraItem.ItemRectangle = new Rectangle(tempPoint.X, tempPoint.Y, weekRec.Width - 12, 18);
  4063. }
  4064. }
  4065. //this.Invoke(new MethodInvoker(delegate
  4066. //{
  4067. //}));
  4068. }
  4069. /// <summary>
  4070. /// 画公休图钉
  4071. /// </summary>
  4072. /// <param name="g"></param>
  4073. /// <param name="cellWeek"></param>
  4074. void DrawPublicHoliday(Graphics g, CellWeekContent cellWeek)
  4075. {
  4076. Rectangle srcRect = new Rectangle(0, 0, LYFZ.Software.Properties.Resources.TuDing4_0.Width, LYFZ.Software.Properties.Resources.TuDing4_0.Height);
  4077. g.DrawImage(LYFZ.Software.Properties.Resources.TuDing4_0, cellWeek.PublicHoliday.ThumbtackRectangle, srcRect, GraphicsUnit.Pixel);
  4078. //画公休标记
  4079. Pen tempPen = new Pen(new SolidBrush(Color.FromArgb(179, 123, 255)), 2); // new Pen(new SolidBrush(Color.FromArgb(165, 239, 173)), 2);
  4080. g.DrawRectangle(tempPen, new Rectangle(cellWeek.BorderRectangle.X + 1, cellWeek.BorderRectangle.Y + 1, cellWeek.BorderRectangle.Width - 3, cellWeek.BorderRectangle.Height - 3));
  4081. }
  4082. #endregion
  4083. #region 日历表事件处理
  4084. private void PlCalendarTable_MouseDoubleClick(object sender, MouseEventArgs e)
  4085. {
  4086. this.tpsInfo.Hide(this.plCalendarTable);
  4087. CellWeekContent cellWeek = CellWeekContentList.Find(w => w.ContentRectangle.Contains(e.Location));
  4088. if (cellWeek != null)
  4089. {
  4090. CameraTypeItem CameraItem = cellWeek.CameraTypeItemList.Find(w => w.ItemRectangle.Contains(e.Location));
  4091. if (CameraItem != null)
  4092. {
  4093. if (e.Location.X < CameraItem.ItemRectangle.X + 120)
  4094. {
  4095. //MessageBoxCustom.Show(CameraItem.CurrCameraType.ToString());
  4096. this.GoToCameraRecord(this.cbxStoreList.SelectedIndex, CameraItem.CurrCameraType,cellWeek.DayTime);
  4097. }
  4098. }
  4099. if (!String.IsNullOrWhiteSpace(cellWeek.Thumbtack.ThumbtackText))
  4100. {
  4101. if (cellWeek.Thumbtack.ThumbtackRectangle.Contains(e.Location))
  4102. {
  4103. if (cellWeek.Thumbtack.Tag != null)
  4104. {
  4105. LYFZ.Model.ThumbtackRecord thumbtackRecord = (LYFZ.Model.ThumbtackRecord)cellWeek.Thumbtack.Tag;
  4106. if (this.EditThumbtackRecord(thumbtackRecord, cellWeek.DayTime, ThumbtackType.摄控本日历图钉))
  4107. {
  4108. cellWeek.Thumbtack.ThumbtackText = thumbtackRecord.ThumbtackInfo.Trim();
  4109. this.plCalendarTable.Refresh();
  4110. }
  4111. else
  4112. {
  4113. MessageBoxCustom.Show("图钉修改失败");
  4114. }
  4115. }
  4116. }
  4117. }
  4118. if (!cellWeek.PublicHoliday.IsNullThumbtackText)
  4119. {
  4120. if (cellWeek.PublicHoliday.ThumbtackRectangle.Contains(e.Location))
  4121. {
  4122. if (cellWeek.PublicHoliday.Tag != null)
  4123. {
  4124. LYFZ.Model.ThumbtackRecord thumbtackRecord = (LYFZ.Model.ThumbtackRecord)cellWeek.PublicHoliday.Tag;
  4125. if (this.EditThumbtackRecord(thumbtackRecord, cellWeek.DayTime, ThumbtackType.公休图钉))
  4126. {
  4127. cellWeek.PublicHoliday.ThumbtackText = thumbtackRecord.ThumbtackInfo.Trim();
  4128. this.plCalendarTable.Refresh();
  4129. }
  4130. else
  4131. {
  4132. MessageBoxCustom.Show("图钉修改失败");
  4133. }
  4134. }
  4135. }
  4136. }
  4137. }
  4138. }
  4139. bool EditThumbtackRecord(LYFZ.Model.ThumbtackRecord thumbtackRecord, DateTime dayTime, ThumbtackType thumType)
  4140. {
  4141. LYFZ.Software.MainBusiness.NewCameraControlBook.frmThumbtackText frmThumbtack = new frmThumbtackText();
  4142. frmThumbtack.TType = thumType;
  4143. frmThumbtack.txtInfo.Text = thumbtackRecord.ThumbtackInfo;
  4144. if (frmThumbtack.ShowDialog() == DialogResult.OK)
  4145. {
  4146. bool isOldRemark = false;
  4147. int OldRemarkID = 0;
  4148. if (thumbtackRecord.ID <= 0)
  4149. {
  4150. isOldRemark = true;
  4151. if (!String.IsNullOrWhiteSpace(thumbtackRecord.ThumbtackMark))
  4152. {
  4153. OldRemarkID = Convert.ToInt32(thumbtackRecord.ThumbtackMark);
  4154. }
  4155. thumbtackRecord.ThumbtackMark = LYFZ.WinAPI.CustomPublicMethod.GenerateUniqueID();
  4156. thumbtackRecord.DateTimeMark = dayTime.ToJavaScriptTimeStamp();
  4157. thumbtackRecord.CreateDateTime = SDateTime.Now.ToJavaScriptTimeStamp();
  4158. thumbtackRecord.CreatePeople = LYFZ.BLL.BLL_ErpUser.UsersModel.User_EmployeeID;
  4159. thumbtackRecord.ShopID = GetShopID(this.CurrentQueryStoreList);
  4160. }
  4161. thumbtackRecord.ThumbtackTitle = thumType.ToString();
  4162. thumbtackRecord.ThumbtackType = (int)thumType;
  4163. thumbtackRecord.UpdateDateTime = SDateTime.Now.ToJavaScriptTimeStamp();
  4164. thumbtackRecord.UpdatePeople = LYFZ.BLL.BLL_ErpUser.UsersModel.User_EmployeeID;
  4165. thumbtackRecord.ThumbtackInfo = frmThumbtack.txtInfo.Text.Trim();
  4166. bool isUpdateOK = false;
  4167. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate (object obj, BackgroundWorker backgroundWorker)
  4168. {
  4169. if (String.IsNullOrWhiteSpace(thumbtackRecord.ThumbtackInfo))
  4170. {
  4171. if (isOldRemark)
  4172. {
  4173. isUpdateOK = thumbtackBll.DeleteOrderRemarkRecord(OldRemarkID);
  4174. }
  4175. else
  4176. {
  4177. isUpdateOK = thumbtackBll.Delete(thumbtackRecord);
  4178. }
  4179. }
  4180. else
  4181. {
  4182. if (isOldRemark)
  4183. {
  4184. isUpdateOK = thumbtackBll.Add(thumbtackRecord);
  4185. if (isUpdateOK)
  4186. {
  4187. thumbtackBll.DeleteOrderRemarkRecord(OldRemarkID);
  4188. }
  4189. }
  4190. else
  4191. {
  4192. isUpdateOK = thumbtackBll.Update(thumbtackRecord);
  4193. }
  4194. }
  4195. });
  4196. return isUpdateOK;
  4197. }
  4198. else {
  4199. return true;
  4200. }
  4201. }
  4202. /// <summary>
  4203. /// 单击图钉右键菜单时
  4204. /// </summary>
  4205. /// <param name="sender"></param>
  4206. /// <param name="e"></param>
  4207. private void CmenuCameraBook_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
  4208. {
  4209. if ((!this.IsOneShopID(this.CurrentQueryStoreList)&&this.tabControlEx1.SelectedIndex==0)
  4210. || (!this.IsOneShopID(this.CurrentQueryStoreList2) && this.tabControlEx1.SelectedIndex == 1))
  4211. {
  4212. MessageBoxCustom.Show("未了防止误操作,在选择查询全部门店时不可使用此功能");
  4213. return;
  4214. }
  4215. if (this.cmenuCameraBook.Tag != null)
  4216. {
  4217. if (this.tabControlEx1.SelectedIndex == 0)
  4218. {
  4219. this.isUpdateOrderDataTableQuery = true;
  4220. }
  4221. if (this.cmenuCameraBook.Tag.GetType() == typeof(CellWeekContent))
  4222. {
  4223. CellWeekContent cellWeek = (CellWeekContent)this.cmenuCameraBook.Tag;
  4224. DataEventArgs eventArgs = null;
  4225. if (cellWeek.Tag != null)
  4226. {
  4227. if (cellWeek.Tag.GetType() == typeof(DataEventArgs))
  4228. {
  4229. eventArgs = (DataEventArgs)cellWeek.Tag;
  4230. }
  4231. }
  4232. switch (e.ClickedItem.Text)
  4233. {
  4234. case "添加图钉":
  4235. if (String.IsNullOrWhiteSpace(cellWeek.Thumbtack.ThumbtackText))
  4236. {
  4237. LYFZ.Software.MainBusiness.NewCameraControlBook.frmThumbtackText frmThumbtack = new frmThumbtackText();
  4238. frmThumbtack.TType = ThumbtackType.摄控本日历图钉;
  4239. if (frmThumbtack.ShowDialog() == DialogResult.OK)
  4240. {
  4241. LYFZ.Model.ThumbtackRecord thumbtackRecord = new Model.ThumbtackRecord();
  4242. thumbtackRecord.ID = LYFZ.WinAPI.CustomPublicMethod.GenerateId();
  4243. thumbtackRecord.CreateDateTime = SDateTime.Now.ToJavaScriptTimeStamp();
  4244. thumbtackRecord.CreatePeople = LYFZ.BLL.BLL_ErpUser.UsersModel.User_EmployeeID;
  4245. thumbtackRecord.UpdateDateTime = SDateTime.Now.ToJavaScriptTimeStamp();
  4246. thumbtackRecord.UpdatePeople= LYFZ.BLL.BLL_ErpUser.UsersModel.User_EmployeeID;
  4247. thumbtackRecord.ShopID = GetShopID(this.CurrentQueryStoreList);
  4248. thumbtackRecord.ThumbtackTitle = ThumbtackType.摄控本日历图钉.ToString();
  4249. thumbtackRecord.ThumbtackType = (int)ThumbtackType.摄控本日历图钉;
  4250. thumbtackRecord.ThumbtackMark= LYFZ.WinAPI.CustomPublicMethod.GenerateUniqueID();
  4251. thumbtackRecord.ThumbtackInfo = frmThumbtack.txtInfo.Text.Trim();
  4252. thumbtackRecord.DateTimeMark = cellWeek.DayTime.ToJavaScriptTimeStamp();
  4253. bool isAddOK = false;
  4254. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate (object obj, BackgroundWorker backgroundWorker)
  4255. {
  4256. isAddOK = thumbtackBll.Add(thumbtackRecord);
  4257. });
  4258. if (isAddOK)
  4259. {
  4260. cellWeek.Thumbtack.Tag = thumbtackRecord;
  4261. cellWeek.Thumbtack.ThumbtackText = thumbtackRecord.ThumbtackInfo.Trim();
  4262. if (eventArgs != null)
  4263. {
  4264. eventArgs.CurrentCell.ThumbtackList.Add(cellWeek.Thumbtack);
  4265. this.PanelDataView.RefreshCell(eventArgs.CrrrentRow, eventArgs.CurrentCell);
  4266. this.isUpdateQuery = true;
  4267. }
  4268. else
  4269. {
  4270. this.plCalendarTable.Refresh();
  4271. }
  4272. }
  4273. else {
  4274. MessageBoxCustom.Show(String.Format("图钉添加失败"));
  4275. }
  4276. }
  4277. }
  4278. else
  4279. {
  4280. MessageBoxCustom.Show(String.Format("每一个日期上只能添加一个图钉"));
  4281. }
  4282. break;
  4283. case "删除图钉":
  4284. if (!String.IsNullOrWhiteSpace(cellWeek.Thumbtack.ThumbtackText))
  4285. {
  4286. if (cellWeek.Thumbtack.Tag != null)
  4287. {
  4288. LYFZ.Model.ThumbtackRecord thumbtackRecord = (LYFZ.Model.ThumbtackRecord)cellWeek.Thumbtack.Tag;
  4289. bool isAddOK = false;
  4290. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate (object obj, BackgroundWorker backgroundWorker)
  4291. {
  4292. if (thumbtackRecord.ID > 0)
  4293. {
  4294. isAddOK = thumbtackBll.Delete(thumbtackRecord);
  4295. }
  4296. else
  4297. {
  4298. if (!String.IsNullOrWhiteSpace(thumbtackRecord.ThumbtackMark))
  4299. {
  4300. int OldRemarkID = Convert.ToInt32(thumbtackRecord.ThumbtackMark);
  4301. isAddOK = thumbtackBll.DeleteOrderRemarkRecord(OldRemarkID);
  4302. }
  4303. }
  4304. });
  4305. if (isAddOK)
  4306. {
  4307. cellWeek.Thumbtack.ThumbtackText = "";
  4308. cellWeek.Thumbtack.Tag = null;
  4309. if (eventArgs != null)
  4310. {
  4311. eventArgs.CurrentCell.ThumbtackList.Remove(eventArgs.CurrentCell.ThumbtackList.Find(t=>t.ThumbtackType==2));
  4312. this.PanelDataView.RefreshCell(eventArgs.CrrrentRow, eventArgs.CurrentCell);
  4313. this.isUpdateQuery = true;
  4314. }
  4315. else
  4316. {
  4317. this.plCalendarTable.Refresh();
  4318. }
  4319. }
  4320. else
  4321. {
  4322. MessageBoxCustom.Show("图钉删除失败");
  4323. }
  4324. }
  4325. else {
  4326. cellWeek.Thumbtack.ThumbtackText = "";
  4327. this.plCalendarTable.Refresh();
  4328. }
  4329. }
  4330. break;
  4331. case "设为公休日":
  4332. if (cellWeek.PublicHoliday.IsNullThumbtackText)
  4333. {
  4334. LYFZ.Software.MainBusiness.NewCameraControlBook.frmThumbtackText frmThumbtack = new frmThumbtackText();
  4335. frmThumbtack.TType = ThumbtackType.公休图钉;
  4336. frmThumbtack.txtInfo.Text = "全员公休日";
  4337. if (frmThumbtack.ShowDialog() == DialogResult.OK)
  4338. {
  4339. LYFZ.Model.ThumbtackRecord thumbtackRecord = new Model.ThumbtackRecord();
  4340. thumbtackRecord.ID = LYFZ.WinAPI.CustomPublicMethod.GenerateId();
  4341. thumbtackRecord.CreateDateTime = SDateTime.Now.ToJavaScriptTimeStamp();
  4342. thumbtackRecord.CreatePeople = LYFZ.BLL.BLL_ErpUser.UsersModel.User_EmployeeID;
  4343. thumbtackRecord.UpdateDateTime = SDateTime.Now.ToJavaScriptTimeStamp();
  4344. thumbtackRecord.UpdatePeople = LYFZ.BLL.BLL_ErpUser.UsersModel.User_EmployeeID;
  4345. thumbtackRecord.ShopID = GetShopID(this.CurrentQueryStoreList);
  4346. thumbtackRecord.ThumbtackTitle = ThumbtackType.公休图钉.ToString();
  4347. thumbtackRecord.ThumbtackType = (int)ThumbtackType.公休图钉;
  4348. thumbtackRecord.ThumbtackMark = LYFZ.WinAPI.CustomPublicMethod.GenerateUniqueID();
  4349. thumbtackRecord.ThumbtackInfo = frmThumbtack.txtInfo.Text.Trim();
  4350. thumbtackRecord.DateTimeMark = cellWeek.DayTime.ToJavaScriptTimeStamp();
  4351. bool isAddOK = false;
  4352. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate (object obj, BackgroundWorker backgroundWorker)
  4353. {
  4354. isAddOK = thumbtackBll.Add(thumbtackRecord);
  4355. });
  4356. if (isAddOK)
  4357. {
  4358. cellWeek.PublicHoliday.Tag = thumbtackRecord;
  4359. cellWeek.PublicHoliday.ThumbtackText = thumbtackRecord.ThumbtackInfo.Trim();
  4360. if (eventArgs != null)
  4361. {
  4362. eventArgs.CurrentCell.ThumbtackList.Add(cellWeek.PublicHoliday);
  4363. // this.PanelDataView.RefreshCell(eventArgs.CrrrentRow, eventArgs.CurrentCell);
  4364. this.thumbtackRecordList.Add(thumbtackRecord);
  4365. CameraType cameraType = SetCameraTemplate.GetCameraType(this.flowLayoutPanel3.Controls);
  4366. this.BindPanelDataView(cameraType);
  4367. this.isUpdateQuery = true;
  4368. }
  4369. else
  4370. {
  4371. this.plCalendarTable.Refresh();
  4372. }
  4373. }
  4374. else
  4375. {
  4376. MessageBoxCustom.Show(String.Format("设为公休日失败"));
  4377. }
  4378. }
  4379. }
  4380. else
  4381. {
  4382. MessageBoxCustom.Show(String.Format("当前日期已经是公休日,不需要重复设置"));
  4383. }
  4384. break;
  4385. case "取消公休日":
  4386. if (!cellWeek.PublicHoliday.IsNullThumbtackText)
  4387. {
  4388. if (cellWeek.PublicHoliday.Tag != null)
  4389. {
  4390. LYFZ.Model.ThumbtackRecord thumbtackRecord = (LYFZ.Model.ThumbtackRecord)cellWeek.PublicHoliday.Tag;
  4391. bool isAddOK = false;
  4392. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate (object obj, BackgroundWorker backgroundWorker)
  4393. {
  4394. isAddOK = thumbtackBll.Delete(thumbtackRecord);
  4395. });
  4396. if (isAddOK)
  4397. {
  4398. cellWeek.PublicHoliday.ThumbtackText = "";
  4399. cellWeek.PublicHoliday.Tag = null;
  4400. if (eventArgs != null)
  4401. {
  4402. eventArgs.CurrentCell.ThumbtackList.Remove(eventArgs.CurrentCell.ThumbtackList.Find(t => t.ThumbtackType == 1));
  4403. // this.PanelDataView.RefreshCell(eventArgs.CrrrentRow, eventArgs.CurrentCell);
  4404. this.thumbtackRecordList.Remove(this.thumbtackRecordList.Find(r=>r.ID== thumbtackRecord.ID));
  4405. CameraType cameraType = SetCameraTemplate.GetCameraType(this.flowLayoutPanel3.Controls);
  4406. this.BindPanelDataView(cameraType);
  4407. this.isUpdateQuery = true;
  4408. }
  4409. else
  4410. {
  4411. this.plCalendarTable.Refresh();
  4412. }
  4413. }
  4414. else
  4415. {
  4416. MessageBoxCustom.Show("取消公休日失败");
  4417. }
  4418. }
  4419. else
  4420. {
  4421. cellWeek.PublicHoliday.ThumbtackText = "";
  4422. this.plCalendarTable.Refresh();
  4423. }
  4424. }
  4425. break;
  4426. }
  4427. }
  4428. }
  4429. }
  4430. /// <summary>
  4431. /// 当前鼠标点击时的位置
  4432. /// </summary>
  4433. Point MouseClickLocation = new Point(0, 0);
  4434. /// <summary>
  4435. /// 在日历上单击鼠标时
  4436. /// </summary>
  4437. /// <param name="sender"></param>
  4438. /// <param name="e"></param>
  4439. private void PlCalendarTable_MouseUp(object sender, MouseEventArgs e)
  4440. {
  4441. this.tpsInfo.Hide(this.plCalendarTable);
  4442. CellWeekContent cellWeek = CellWeekContentList.Find(w => w.ContentRectangle.Contains(e.Location));
  4443. if (cellWeek != null)
  4444. {
  4445. if (!cellWeek.IsCurrent)
  4446. {
  4447. this.MouseClickLocation = e.Location;
  4448. this.plCalendarTable.Refresh();
  4449. }
  4450. if (e.Button == MouseButtons.Right)
  4451. {
  4452. this.cmenuCameraBook.Tag = cellWeek;
  4453. this.cmenuCameraBook.Show(this.plCalendarTable, e.Location);
  4454. }
  4455. }
  4456. }
  4457. Rectangle currentMoveRectangle = new Rectangle(0, 0, 1, 1);
  4458. /// <summary>
  4459. /// 在日历上移动鼠标时
  4460. /// </summary>
  4461. /// <param name="sender"></param>
  4462. /// <param name="e"></param>
  4463. private void PlCalendarTable_MouseMove(object sender, MouseEventArgs e)
  4464. {
  4465. CellWeekContent cellWeek = CellWeekContentList.Find(w => w.ContentRectangle.Contains(e.Location));
  4466. if (cellWeek != null)
  4467. {
  4468. this.plCalendarTable.Cursor = Cursors.Hand;
  4469. int duration = 5000;//提示标签显示时间
  4470. CameraTypeItem CameraItem = cellWeek.CameraTypeItemList.Find(w => w.ItemRectangle.Contains(e.Location));
  4471. if (CameraItem != null)
  4472. {
  4473. if (CameraItem.OrderCameraDataList.Count > 0)
  4474. {
  4475. if (!currentMoveRectangle.Contains(e.Location) && e.Location.X > CameraItem.ItemRectangle.X + 65 && e.Location.X < CameraItem.ItemRectangle.X + 120)
  4476. {
  4477. currentMoveRectangle = new Rectangle(e.Location.X - 5, e.Location.Y - 5, 10, 10);
  4478. this.tpsInfo.ToolTipTitle = CameraItem.CurrCameraType.ToString();
  4479. this.tpsInfo.Show(String.Format("{0}", CameraItem.GetToolTipText()), this.plCalendarTable, new Point(e.Location.X + 10, e.Location.Y));
  4480. }
  4481. }
  4482. }
  4483. if (!String.IsNullOrWhiteSpace(cellWeek.Thumbtack.ThumbtackText))
  4484. {
  4485. if (cellWeek.Thumbtack.ThumbtackRectangle.Contains(e.Location))
  4486. {
  4487. if (!currentMoveRectangle.Contains(e.Location))
  4488. {
  4489. currentMoveRectangle = new Rectangle(e.Location.X - 5, e.Location.Y - 5, 10, 10);
  4490. this.tpsInfo.ToolTipTitle = "图钉内容预览";
  4491. this.tpsInfo.Show(String.Format("{0}", this.GetToolTipText(cellWeek.Thumbtack.ThumbtackText)), this.plCalendarTable, new Point(e.Location.X + 10, e.Location.Y), duration);
  4492. }
  4493. }
  4494. }
  4495. if (!cellWeek.PublicHoliday.IsNullThumbtackText)
  4496. {
  4497. if (cellWeek.PublicHoliday.ThumbtackRectangle.Contains(e.Location))
  4498. {
  4499. if (!currentMoveRectangle.Contains(e.Location))
  4500. {
  4501. currentMoveRectangle = new Rectangle(e.Location.X - 5, e.Location.Y - 5, 10, 10);
  4502. this.tpsInfo.ToolTipTitle = "公休日说明内容预览";
  4503. this.tpsInfo.Show(String.Format("{0}", this.GetToolTipText(cellWeek.PublicHoliday.ThumbtackText)), this.plCalendarTable, new Point(e.Location.X + 10, e.Location.Y), duration);
  4504. }
  4505. }
  4506. }
  4507. }
  4508. else
  4509. {
  4510. this.plCalendarTable.Cursor = Cursors.Default;
  4511. }
  4512. }
  4513. string GetToolTipText(string text)
  4514. {
  4515. string tempText = text;
  4516. if (tempText.Length > 50)
  4517. {
  4518. tempText = String.Format("{0}......", tempText.Substring(0, 50));
  4519. }
  4520. return tempText;
  4521. }
  4522. #endregion
  4523. #region 门店列表处理
  4524. private void CbxStoreList2_SelectedIndexChanged(object sender, EventArgs e)
  4525. {
  4526. GetCurrentQueryStoreList(ref CurrentQueryStoreList2, this.cbxStoreList2);
  4527. if (!this.isShownLoad)
  4528. {
  4529. if (this.tabControlEx1.SelectedIndex == 1)
  4530. {
  4531. this.SetOrderTypeChBoxShow();
  4532. this.LoadTemplateData();
  4533. }
  4534. }
  4535. }
  4536. private void CbxStoreList_SelectedIndexChanged(object sender, EventArgs e)
  4537. {
  4538. GetCurrentQueryStoreList(ref CurrentQueryStoreList, this.cbxStoreList);
  4539. if (!this.isShownLoad)
  4540. {
  4541. this.InitializeCalendar();
  4542. }
  4543. }
  4544. /// <summary>
  4545. /// 根是是否集团版显示隐藏门店列表
  4546. /// </summary>
  4547. /// <param name="isGroupEdition"></param>
  4548. void HideORShowStoresList(bool isGroupEdition)
  4549. {
  4550. if (isGroupEdition)
  4551. {
  4552. this.cbxStoreList.Show();
  4553. this.lbStore.Show();
  4554. this.cbxStoreList2.Show();
  4555. this.lbStore2.Show();
  4556. }
  4557. else
  4558. {
  4559. this.cbxStoreList.Hide();
  4560. this.lbStore.Hide();
  4561. this.cbxStoreList2.Hide();
  4562. this.lbStore2.Hide();
  4563. }
  4564. }
  4565. /// <summary>
  4566. /// 当前要查询的门店信息集合
  4567. /// </summary>
  4568. QueryStoreList CurrentQueryStoreList = null;
  4569. /// <summary>
  4570. /// 当前要查询的门店信息集合2
  4571. /// </summary>
  4572. QueryStoreList CurrentQueryStoreList2 = null;
  4573. public EnumPermissions.BusinessType GetCurrentStoreBusinessType(QueryStoreList storeList)
  4574. {
  4575. if (storeList != null)
  4576. {
  4577. return GetStoreBusinessType(storeList);
  4578. }
  4579. else
  4580. {
  4581. return LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetBusinessType();
  4582. }
  4583. }
  4584. public static EnumPermissions.BusinessType GetStoreBusinessType(QueryStoreList storeList)
  4585. {
  4586. if (storeList.QueryStoreInfoList.Count > 0)
  4587. {
  4588. List<EnumPermissions.BusinessType> tempBuTypeList = new List<EnumPermissions.BusinessType>();
  4589. foreach (QueryStoreInfo storeInfo in storeList.QueryStoreInfoList)
  4590. {
  4591. EnumPermissions.BusinessType buType = GetStoreBusinessType(storeInfo);
  4592. if (buType == EnumPermissions.BusinessType.旗舰版)
  4593. {
  4594. return EnumPermissions.BusinessType.旗舰版;
  4595. }
  4596. else {
  4597. if (!tempBuTypeList.Any(b => b == buType))
  4598. {
  4599. tempBuTypeList.Add(buType);
  4600. }
  4601. }
  4602. }
  4603. if (tempBuTypeList.Count > 1)
  4604. {
  4605. return EnumPermissions.BusinessType.旗舰版;
  4606. }
  4607. else if (tempBuTypeList.Count == 1)
  4608. {
  4609. return tempBuTypeList[0];
  4610. }
  4611. }
  4612. return LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetBusinessType();
  4613. }
  4614. public static EnumPermissions.BusinessType GetStoreBusinessType(QueryStoreInfo storeInfo)
  4615. {
  4616. EnumPermissions.BusinessType buType = (EnumPermissions.BusinessType)storeInfo.ShopStoreFeature.BusinessType;
  4617. return buType;
  4618. }
  4619. /// <summary>
  4620. /// 获取当前要查询的门店信息集合
  4621. /// </summary>
  4622. public static void GetCurrentQueryStoreList(ref QueryStoreList cQueryStoreList, System.Windows.Forms.ComboBox cStoreList)
  4623. {
  4624. if (cQueryStoreList == null)
  4625. {
  4626. cQueryStoreList = new QueryStoreList();
  4627. }
  4628. else
  4629. {
  4630. cQueryStoreList.QueryStoreInfoList.Clear();
  4631. }
  4632. ItemValue cItem = (ItemValue)cStoreList.SelectedItem;
  4633. if (cItem.Value.ToString() == "0"|| cItem.Value.ToString() == "1")
  4634. {
  4635. cQueryStoreList.QueryType = 1;
  4636. if (cItem.Value.ToString() == "0")
  4637. {
  4638. cQueryStoreList.QueryType = 0;
  4639. }
  4640. foreach (ItemValue item in cStoreList.Items)
  4641. {
  4642. if (item.Tag != null)
  4643. {
  4644. QueryStoreInfo qStoreInfo = GetQueryStoreInfo(item);
  4645. if (qStoreInfo != null)
  4646. {
  4647. cQueryStoreList.QueryStoreInfoList.Add(qStoreInfo);
  4648. }
  4649. }
  4650. }
  4651. }
  4652. else
  4653. {
  4654. cQueryStoreList.QueryType = 1;
  4655. QueryStoreInfo qStoreInfo = GetQueryStoreInfo(cItem);
  4656. if (qStoreInfo != null)
  4657. {
  4658. cQueryStoreList.QueryStoreInfoList.Add(qStoreInfo);
  4659. }
  4660. }
  4661. }
  4662. static QueryStoreInfo GetQueryStoreInfo(ItemValue item)
  4663. {
  4664. if (item.Tag != null)
  4665. {
  4666. DataRow dataRow = ((DataRow)item.Tag);
  4667. QueryStoreInfo qStoreInfo = new QueryStoreInfo();
  4668. qStoreInfo.DividedShop = item.Value.ToString();
  4669. qStoreInfo.DividedShop_Name = item.Text.Trim();
  4670. qStoreInfo.JMGDomain = dataRow["Company_JMGDomain"].ToString();
  4671. qStoreInfo.ShopStoreFeature = LYFZ.Model.Model_ErpCompanyInfo.GetStoreFeature(dataRow["Company_ServerAddress"].ToString());
  4672. return qStoreInfo;
  4673. }
  4674. return null;
  4675. }
  4676. /// <summary>
  4677. /// 邦定门店
  4678. /// </summary>
  4679. public static void BindStoreList(System.Windows.Forms.ComboBox cbxStoreList, bool isGroupEdition,bool isGroupEditionShowAll=true)
  4680. {
  4681. DataRowCollection rows = null;
  4682. int allValue = 0;
  4683. int allStoreCount = 1;
  4684. if (isGroupEdition)
  4685. {
  4686. string groupKeyCode = LYFZ.Model.Model_UserRights.GetQuickToolsPet();
  4687. List<string> mlist = LYFZ.BLL.BLL_ErpUser.GetGroupRights(groupKeyCode, "qt001");
  4688. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate (object obj, BackgroundWorker backgroundWorker)
  4689. {
  4690. rows = LYFZ.DAL.DAL_ErpCompanyInfo.GetCompanyBasicInfoList(mlist.ToArray());
  4691. allStoreCount = LYFZ.DAL.DAL_ErpCompanyInfo.GetCompanyBasicInfoListCount();
  4692. });
  4693. if (rows == null)
  4694. {
  4695. MessageBoxCustom.Show("获取门店信息失败!");
  4696. return;
  4697. }
  4698. else
  4699. {
  4700. if (allStoreCount > 1 && allStoreCount == rows.Count)
  4701. {
  4702. allValue = 0;
  4703. }
  4704. else
  4705. {
  4706. allValue = 1;
  4707. }
  4708. if (isGroupEditionShowAll)
  4709. {
  4710. if (rows.Count > 1)
  4711. {
  4712. ItemValue itemAll = new ItemValue(allValue, "全部");
  4713. cbxStoreList.Items.Add(itemAll);
  4714. cbxStoreList.SelectedIndex = 0;
  4715. }
  4716. }
  4717. //是否找到当前店
  4718. bool isCurrentStore = false;
  4719. foreach (DataRow row in rows)
  4720. {
  4721. ItemValue itemStore = new ItemValue(row["Company_DividedShop"].ToString(), row["Company_Name"].ToString());
  4722. itemStore.Tag = row;
  4723. cbxStoreList.Items.Add(itemStore);
  4724. if (row["Company_JMGDomain"].ToString().Trim().ToLower() == LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.SoftwareInfo.SDomainName.Trim().ToLower())
  4725. {
  4726. isCurrentStore = true;
  4727. // if (allValue == 1)
  4728. {
  4729. cbxStoreList.SelectedItem = itemStore;
  4730. }
  4731. }
  4732. }
  4733. if (!isCurrentStore)
  4734. {
  4735. MessageBoxCustom.Show("没有找到当前门店信息");
  4736. cbxStoreList.Items.Clear();
  4737. return;
  4738. }
  4739. }
  4740. }
  4741. else
  4742. {
  4743. ItemValue itemAll = new ItemValue(allValue, "全部");
  4744. cbxStoreList.Items.Add(itemAll);
  4745. cbxStoreList.SelectedIndex = 0;
  4746. }
  4747. }
  4748. #endregion
  4749. }
  4750. /// <summary>
  4751. /// 日历内容单元格
  4752. /// </summary>
  4753. public class CellWeekContent
  4754. {
  4755. public CellWeekContent(int selectYear, int selectMonth, int currentDayCount)
  4756. {
  4757. this.selectYear = selectYear;
  4758. this.selectMonth = selectMonth;
  4759. this.currentDayCount = currentDayCount;
  4760. this.SetDayTime();
  4761. }
  4762. /// <summary>
  4763. /// 设置当前天的时间
  4764. /// </summary>
  4765. void SetDayTime()
  4766. {
  4767. this.dayTime = GetDayDateTime(this.SelectYear, this.SelectMonth, this.currentDayCount);
  4768. this._LunarCalendarDayTime = Command.Command_CalendarTurnLunar.GetChineseDateTimeToNoYear(this.dayTime);
  4769. }
  4770. /// <summary>
  4771. /// 设置当前天的时间
  4772. /// </summary>
  4773. public void SetDayTime(DateTime dateTime)
  4774. {
  4775. this.dayTime = dateTime;
  4776. this._LunarCalendarDayTime = Command.Command_CalendarTurnLunar.GetChineseDateTimeToNoYear(this.dayTime);
  4777. }
  4778. public static DateTime GetDayDateTime(int selectYear, int selectMonth, int currentDayCount)
  4779. {
  4780. DateTime tempDate = Convert.ToDateTime(String.Format("{0}-{1}-{2}", selectYear, selectMonth, 1));
  4781. int afterDay = ((int)tempDate.DayOfWeek) - 1;
  4782. if (afterDay < 0)
  4783. {
  4784. afterDay = 6;
  4785. }
  4786. return tempDate.AddDays(-afterDay + (currentDayCount - 1));
  4787. }
  4788. Rectangle _BorderRectangle = new Rectangle();
  4789. Rectangle _ContentRectangle = new Rectangle();
  4790. //bool isValid = true;
  4791. int rowIndex = 0;
  4792. int cellIndex = 0;
  4793. int currentDayCount = 0;
  4794. string weekDayName = "";
  4795. int weekDayNumber = 0;
  4796. DateTime dayTime;
  4797. string _LunarCalendarDayTime = "";
  4798. int selectYear = SDateTime.Now.Year;
  4799. int selectMonth = SDateTime.Now.Month;
  4800. bool _IsCurrent = false;
  4801. object tag;
  4802. List<CameraTypeItem> _CameraTypeItemList = new List<CameraTypeItem>();
  4803. ThumbtackData _Thumbtack = new ThumbtackData();
  4804. ThumbtackData _PublicHoliday = new ThumbtackData();
  4805. /// <summary>
  4806. /// 边框区域
  4807. /// </summary>
  4808. public Rectangle BorderRectangle { get => _BorderRectangle; set => _BorderRectangle = value; }
  4809. /// <summary>
  4810. /// 内容区域
  4811. /// </summary>
  4812. public Rectangle ContentRectangle { get => _ContentRectangle; set => _ContentRectangle = value; }
  4813. /// <summary>
  4814. /// 是否有效
  4815. /// </summary>
  4816. public bool IsValid {
  4817. get {
  4818. if (this.dayTime.Month == this.SelectMonth)
  4819. {
  4820. return true;
  4821. }
  4822. else {
  4823. return false;
  4824. }
  4825. }
  4826. }
  4827. /// <summary>
  4828. /// 行索引
  4829. /// </summary>
  4830. public int RowIndex { get => rowIndex; set => rowIndex = value; }
  4831. /// <summary>
  4832. /// 列索引
  4833. /// </summary>
  4834. public int CellIndex { get => cellIndex; set => cellIndex = value; }
  4835. /// <summary>
  4836. /// 当前天时间 哪年哪月哪日
  4837. /// </summary>
  4838. public DateTime DayTime { get => dayTime; }
  4839. /// <summary>
  4840. /// 农历
  4841. /// </summary>
  4842. public string LunarCalendarDayTime
  4843. {
  4844. get {
  4845. return _LunarCalendarDayTime;
  4846. }
  4847. }
  4848. /// <summary>
  4849. /// 当前单元格索引计数 1-42
  4850. /// </summary>
  4851. public int CurrentDayCount { get => currentDayCount; set => currentDayCount = value; }
  4852. /// <summary>
  4853. /// 星期几 (一、二、三、四、五、六、日)
  4854. /// </summary>
  4855. public string WeekDayName { get => weekDayName; set => weekDayName = value; }
  4856. /// <summary>
  4857. /// 星期几 (1、2、3、4、5、6、0)
  4858. /// </summary>
  4859. public int WeekDayNumber
  4860. {
  4861. get { return weekDayNumber; }
  4862. set {
  4863. if (value == 7)
  4864. {
  4865. weekDayNumber = 0;
  4866. }
  4867. else {
  4868. weekDayNumber = value;
  4869. }
  4870. }
  4871. }
  4872. /// <summary>
  4873. /// 当前选择年
  4874. /// </summary>
  4875. public int SelectYear { get => selectYear; set => selectYear = value; }
  4876. /// <summary>
  4877. /// 当前选择月
  4878. /// </summary>
  4879. public int SelectMonth { get => selectMonth; set => selectMonth = value; }
  4880. /// <summary>
  4881. /// 是否为当前选择项
  4882. /// </summary>
  4883. public bool IsCurrent { get => _IsCurrent; set => _IsCurrent = value; }
  4884. public object Tag { get => tag; set => tag = value; }
  4885. /// <summary>
  4886. /// 摄控数据集合
  4887. /// </summary>
  4888. public List<CameraTypeItem> CameraTypeItemList { get => _CameraTypeItemList; set => _CameraTypeItemList = value; }
  4889. /// <summary>
  4890. /// 图钉
  4891. /// </summary>
  4892. public ThumbtackData Thumbtack { get => _Thumbtack; set => _Thumbtack = value; }
  4893. /// <summary>
  4894. /// 公休图钉
  4895. /// </summary>
  4896. public ThumbtackData PublicHoliday { get => _PublicHoliday; set => _PublicHoliday = value; }
  4897. }
  4898. }