MainFrameFormMain.cs 240 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291
  1. using LYFZ.ComponentLibrary;
  2. using LYFZ.Software.MainBusiness.DoorCityProcess;
  3. using System;
  4. using System.Collections;
  5. using System.Collections.Generic;
  6. using System.ComponentModel;
  7. using System.Data;
  8. using System.Drawing;
  9. using System.Linq;
  10. using System.Text;
  11. using System.Threading;
  12. using System.Windows.Forms;
  13. using LYFZ.Model.CameraBook;
  14. using Newtonsoft.Json;
  15. namespace LYFZ.Software.MainBusiness.CameraControlBook
  16. {
  17. public partial class MainFrameFormMain : LYFZ.Software.UI.CameraControlBook.MainFrameFormMain
  18. {
  19. /*预约时间名称*/
  20. string strReservationTimeName = "拍摄时间";
  21. LYFZ.BLL.BLL_ErpOrder orbll = new BLL.BLL_ErpOrder();
  22. LYFZ.BLL.BLL_ErpOrderDigital odbll = new BLL.BLL_ErpOrderDigital();
  23. LYFZ.BLL.BLL_ErpWeddingService wsbll = new LYFZ.BLL.BLL_ErpWeddingService();
  24. LYFZ.BLL.BLL_ErpOrderProductList libll = new LYFZ.BLL.BLL_ErpOrderProductList();
  25. LYFZ.BLL.BLL_ErpOrderWorkAnPaiRecord ordwr = new BLL.BLL_ErpOrderWorkAnPaiRecord();
  26. LYFZ.BLL.BLL_ErpOrdersPhotography phbll = new LYFZ.BLL.BLL_ErpOrdersPhotography();
  27. public MainFrameFormMain()
  28. {
  29. #region 窗体事件
  30. this.Shown += MainFrameFormMain_Shown;
  31. this.Load += MainFrameFormMain_Load;
  32. //this.nudDate.KeyDown += nudDate_KeyDown;
  33. this.Resize += MainFrameFormMain_Resize;
  34. #endregion
  35. #region 头
  36. this.nudYears.ValueChanged += nudYears_ValueChanged;
  37. this.nudMonth.ValueChanged += nudMonth_ValueChanged;
  38. this.nudDate.ValueChanged += nudDate_ValueChanged;
  39. #endregion
  40. #region 左边
  41. this.rdoPhotographed.Click += rdoPhotographed_Click;
  42. this.rdoFilmSelection.Click += rdoFilmSelection_Click;
  43. this.rdoLookDesign.Click += rdoLookDesign_Click;
  44. this.rdoTotakePiece.Click += rdoTotakePiece_Click;
  45. this.rdoService.Click += rdoService_Click;
  46. this.rdoSelectDress.Click += rdoSelectDress_Click;
  47. this.rdoHospitalClient.Click += rdoHospitalClient_Click;
  48. this.rdoRecentBirthday.Click += rdoRecentBirthday_Click;
  49. this.chkNearlyOneWeek.Click += chkNearlyOneWeek_Click;
  50. this.chkNearlyHalfMonth.Click += chkNearlyHalfMonth_Click;
  51. this.chkDressVersion.Click += chkDressVersion_Click;
  52. this.chkKidsVersion.Click += chkKidsVersion_Click;
  53. this.chkPortraitVersion.Click += chkPortraitVersion_Click;
  54. #endregion
  55. #region 右边
  56. this.btnCharts.Click += btnCharts_Click;
  57. this.btnPrint.Click += btnPrint_Click;
  58. this.btnStatistic.Click += btnStatistic_Click;
  59. this.btnGuestsReservation.Click += btnGuestsReservation_Click;
  60. this.btnReschedule.Click += btnReschedule_Click;
  61. this.btnSMS.Click += btnSMS_Click;
  62. this.btnClose.Click += btnClose_Click;
  63. this.btnSelectedClothes.Click += btnSelectedClothes_Click;
  64. this.btnOverview.Click += btnOverview_Click;
  65. this.btnClientServiceAnPai.Click += btnClientServiceAnPai_Click;
  66. this.btnPersonSchedule.Click += btnPersonSchedule_Click;
  67. #endregion
  68. //this.GetDayData();
  69. this.cmbtreevStoreName.ComboBoxTree_NodeMouseClick += cmbtreevStoreName_ComboBoxTree_NodeMouseClick;
  70. this.dgvData.CellMouseDown += dgvData_CellMouseDown;
  71. this.dgvData.CellClick += dgvData_CellClick;
  72. this.dgvData.MouseDoubleClick += dgvData_MouseDoubleClick;
  73. this.chkWeddingCelebration.Click += chkWeddingCelebration_Click;
  74. this.btnExport.Click += btnExport_Click;
  75. this.btnAddRecord.Click += btnAddRecord_Click;
  76. this.btnCommunicateDetails.Click += btnCommunicateDetails_Click;
  77. this.FormClosed += MainFrameFormMain_FormClosed;
  78. this.dgvData.ColumnHeaderMouseClick += DgvData_ColumnHeaderMouseClick;
  79. //this.btnClientServiceAnPai.Visible = false;
  80. this.btn_Report.Click += Btn_Report_Click;
  81. this.btn_AnPai.Click += Btn_AnPai_Click;
  82. }
  83. private void Btn_AnPai_Click(object sender, EventArgs e)
  84. {
  85. frmPerturbedController perturbedController = new frmPerturbedController();
  86. perturbedController.ShowDialog();
  87. }
  88. private void Btn_Report_Click(object sender, EventArgs e)
  89. {
  90. LYFZ.Software.MainBusiness.CameraControlBook.SuperSmallForm.WorkAnPaiRecordSuperSmallForm frm = new SuperSmallForm.WorkAnPaiRecordSuperSmallForm();
  91. frm.ShowDialog();
  92. }
  93. /// <summary>
  94. /// 排序顺序
  95. /// </summary>
  96. string StrSortOrder = "DESC";
  97. /// <summary>
  98. /// 当前点击的字段
  99. /// </summary>
  100. string StrCurrentClickField = "";
  101. /// <summary>
  102. /// 排序字段
  103. /// </summary>
  104. string StrSortField = "Ordpg_ReservationPhotographyTime,Ord_Number,Ordv_DigitalNumber DESC";
  105. private void DgvData_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
  106. {
  107. if (e.Button == MouseButtons.Left)
  108. {
  109. string StrColumnName = this.dgvData.Columns[e.ColumnIndex].Name.Trim();
  110. if (StrColumnName == this.StrCurrentClickField || this.dgvData.StrValueNullColumn.Trim().IndexOf(StrColumnName) != -1 || string.IsNullOrEmpty(this.StrCurrentClickField))
  111. {
  112. if (this.StrSortOrder == "ASC")
  113. this.StrSortOrder = "DESC";
  114. else
  115. this.StrSortOrder = "ASC";
  116. }
  117. else
  118. {
  119. this.StrSortOrder = "DESC";
  120. }
  121. this.StrSortField = StrColumnName + " " + this.StrSortOrder;
  122. this.StrCurrentClickField = StrColumnName;
  123. this.PublicFunctionRows();
  124. }
  125. }
  126. void GetDayData()
  127. {
  128. DateTime NowTime = SDateTime.Now;
  129. if (IsFirstLoad)
  130. { NowTime = Convert.ToDateTime(LYFZ.Command.Command_Validate.DateTimeToString(SDateTime.Now, "yyyy-MM-01")); }
  131. else
  132. { NowTime = Convert.ToDateTime(nudYears.Value + "-" + nudMonth.Value + "-01"); }
  133. System.Threading.Thread t = new System.Threading.Thread(new System.Threading.ThreadStart(delegate ()
  134. {
  135. string ExecuteSql = "select Ord_Type,Ordpg_Number,Ordpg_ReservationPhotographyTime from dbo.tb_ErpOrdersPhotography Left Join dbo.tb_ErpOrder on Ord_Number = Ordpg_Number where 1=1 And (Ordpg_ReservationPhotographyDividedShop is null or Ordpg_ReservationPhotographyDividedShop = '" + this.LocalCompanyInfoID + "') and Ordpg_ReservationPhotographyTime between '" + LYFZ.Command.Command_Validate.DateTimeToString(NowTime, "yyyy-MM-dd HH:mm:ss") + "' and '" + LYFZ.Command.Command_Validate.DateTimeToString(NowTime.AddMonths(1).AddSeconds(-1), "yyyy-MM-dd HH:mm:ss") + "';";
  136. ExecuteSql += "select Ord_Type,Ordv_Number,Ordv_ReservationFilmSelectionTime from dbo.tb_ErpOrderDigital Left Join dbo.tb_ErpOrder on Ord_Number = Ordv_Number where 1=1 And (Ordv_ReservationFilmSelectionDividedShop is null or Ordv_ReservationFilmSelectionDividedShop = '" + this.LocalCompanyInfoID + "') and Ordv_ReservationFilmSelectionTime between '" + LYFZ.Command.Command_Validate.DateTimeToString(NowTime, "yyyy-MM-dd HH:mm:ss") + "' and '" + LYFZ.Command.Command_Validate.DateTimeToString(NowTime.AddMonths(1).AddSeconds(-1), "yyyy-MM-dd HH:mm:ss") + "';";
  137. ExecuteSql += "select Ord_Type,Ordv_Number,Ordv_ReservationLookDesignTime from dbo.tb_ErpOrderDigital Left Join dbo.tb_ErpOrder on Ord_Number = Ordv_Number where 1=1 And (Ordv_ReservationLookDesignDividedShop is null or Ordv_ReservationLookDesignDividedShop = '" + this.LocalCompanyInfoID + "') and Ordv_ReservationLookDesignTime between '" + LYFZ.Command.Command_Validate.DateTimeToString(NowTime, "yyyy-MM-dd HH:mm:ss") + "' and '" + LYFZ.Command.Command_Validate.DateTimeToString(NowTime.AddMonths(1).AddSeconds(-1), "yyyy-MM-dd HH:mm:ss") + "';";
  138. ExecuteSql += "select Ord_Type,OPlist_OrderNumber,OPlist_ReservationTakeTime from dbo.tb_ErpOrderProductList Left Join dbo.tb_ErpOrder on Ord_Number = OPlist_OrderNumber where 1=1 And (OPlist_ReservationTakeDividedShop is null or OPlist_ReservationTakeDividedShop = '" + this.LocalCompanyInfoID + "') and OPlist_ReservationTakeTime between '" + LYFZ.Command.Command_Validate.DateTimeToString(NowTime, "yyyy-MM-dd HH:mm:ss") + "' and '" + LYFZ.Command.Command_Validate.DateTimeToString(NowTime.AddMonths(1).AddSeconds(-1), "yyyy-MM-dd HH:mm:ss") + "' and OPlist_Type = '2';";
  139. ExecuteSql += "select Ord_Type,Ws_Number,Ws_WeddingDate from dbo.tb_ErpWeddingService Left Join dbo.tb_ErpOrder on Ord_Number = Ws_Number where 1=1 And (Ws_ReservationServiceDividedShop is null or Ws_ReservationServiceDividedShop = '" + this.LocalCompanyInfoID + "') and Ws_WeddingDate between '" + LYFZ.Command.Command_Validate.DateTimeToString(NowTime, "yyyy-MM-dd HH:mm:ss") + "' and '" + LYFZ.Command.Command_Validate.DateTimeToString(NowTime.AddMonths(1).AddSeconds(-1), "yyyy-MM-dd HH:mm:ss") + "';";
  140. ExecuteSql += "select Ord_Type,Ordv_Number,Ordv_ReservationClothingTime from dbo.tb_ErpOrderDigital Left Join dbo.tb_ErpOrder on Ord_Number = Ordv_Number where 1=1 And (Ordv_ReservationClothingDividedShop is null or Ordv_ReservationClothingDividedShop = '" + this.LocalCompanyInfoID + "') and Ordv_ReservationClothingTime between '" + LYFZ.Command.Command_Validate.DateTimeToString(NowTime, "yyyy-MM-dd HH:mm:ss") + "' and '" + LYFZ.Command.Command_Validate.DateTimeToString(NowTime.AddMonths(1).AddSeconds(-1), "yyyy-MM-dd HH:mm:ss") + "';";
  141. ExecuteSql += "select Hdr_DoorTime from dbo.tb_ErpHospitalDispatchDoor where (Hdr_DividedShop is null or Hdr_DividedShop = '" + this.LocalCompanyInfoID + "') And Hdr_DoorTime between '" + LYFZ.Command.Command_Validate.DateTimeToString(NowTime, "yyyy-MM-dd HH:mm:ss") + "' and '" + LYFZ.Command.Command_Validate.DateTimeToString(NowTime.AddMonths(1).AddSeconds(-1), "yyyy-MM-dd HH:mm:ss") + "';";
  142. DataSet dsData = orbll.GetView_Custom(ExecuteSql);
  143. }));
  144. t.Start();
  145. }
  146. /// <summary>
  147. /// 安排任务的任务类型
  148. /// </summary>
  149. public string StrClientServiceType = "";
  150. /// <summary>
  151. /// 是否首次加载
  152. /// </summary>
  153. bool IsFirstLoad = true;
  154. /// <summary>
  155. /// 员工编号
  156. /// </summary>
  157. string StrUserID = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;
  158. /// <summary>
  159. /// 当前登录的影楼
  160. /// </summary>
  161. string LocalCompanyInfoID = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID();
  162. #region 窗体事件
  163. /// <summary>
  164. /// 窗体加载事件
  165. /// </summary>
  166. /// <param name="sender"></param>
  167. /// <param name="e"></param>
  168. void MainFrameFormMain_Shown(object sender, EventArgs e)
  169. {
  170. this.panelEx9.BackColor = Color.Red;
  171. this.panelEx10.BackColor = Color.Coral;
  172. if (this.StrClientServiceType.Trim().Length > 0)
  173. {
  174. this.IsFirstLoad = false;
  175. switch (this.StrClientServiceType.Trim())
  176. {
  177. case "选衣服客人":
  178. this.rdoSelectDress.Checked = true;
  179. this.rdoSelectDress_Click(this, null);
  180. break;
  181. case "拍照客人":
  182. this.rdoPhotographed.Checked = true;
  183. this.rdoPhotographed_Click(this, null);
  184. break;
  185. case "选片客人":
  186. this.rdoFilmSelection.Checked = true;
  187. this.rdoFilmSelection_Click(this, null);
  188. break;
  189. case "看版客人":
  190. this.rdoLookDesign.Checked = true;
  191. this.rdoLookDesign_Click(this, null);
  192. break;
  193. case "取件客人":
  194. this.rdoTotakePiece.Checked = true;
  195. this.rdoTotakePiece_Click(this, null);
  196. break;
  197. case "服务客人":
  198. this.rdoService.Checked = true;
  199. this.rdoService_Click(this, null);
  200. break;
  201. case "摄控医院客人":
  202. this.rdoHospitalClient.Checked = true;
  203. this.rdoHospitalClient_Click(this, null);
  204. break;
  205. }
  206. }
  207. else
  208. {
  209. this.PaintingWeekly();
  210. this.IsFirstLoad = false;
  211. }
  212. }
  213. /// <summary>
  214. /// 窗体加载事件
  215. /// </summary>
  216. /// <param name="sender"></param>
  217. /// <param name="e"></param>
  218. void MainFrameFormMain_Load(object sender, EventArgs e)
  219. {
  220. List<Control> hideControl = new List<Control>();
  221. //LYFZSS.SystemSpecterPossessed.ISystemSpecterPossessed.GetMySystemSpecter = LYFZSS.SystemSpecterType.SST_D;
  222. hideControl.Add(this.panelSelectDressGuests);
  223. LYFZ.Software.MainBusiness.VersionControl.StaticVersion.BindVersionShowHideControl(
  224. VersionControl.VersionFunctionEnum.礼服管理, hideControl, null, null);
  225. hideControl = new List<Control>();
  226. //LYFZSS.SystemSpecterPossessed.ISystemSpecterPossessed.GetMySystemSpecter = LYFZSS.SystemSpecterType.SST_D;
  227. hideControl.Add(this.panelHospitalClient);
  228. LYFZ.Software.MainBusiness.VersionControl.StaticVersion.BindVersionShowHideControl(
  229. VersionControl.VersionFunctionEnum.医院跟踪系统意向单查询, hideControl, null, null);
  230. hideControl = new List<Control>();
  231. //LYFZSS.SystemSpecterPossessed.ISystemSpecterPossessed.GetMySystemSpecter = LYFZSS.SystemSpecterType.SST_D;
  232. hideControl.Add(this.panelRecentBirthday);
  233. hideControl.Add(this.btnCommunicateDetails);
  234. hideControl.Add(this.btnAddRecord);
  235. LYFZ.Software.MainBusiness.VersionControl.StaticVersion.BindVersionShowHideControl(
  236. VersionControl.VersionFunctionEnum.沟通助手, hideControl, null, null);
  237. hideControl = new List<Control>();
  238. //LYFZSS.SystemSpecterPossessed.ISystemSpecterPossessed.GetMySystemSpecter = LYFZSS.SystemSpecterType.SST_D;
  239. hideControl.Add(this.btnClientServiceAnPai);
  240. LYFZ.Software.MainBusiness.VersionControl.StaticVersion.BindVersionShowHideControl(
  241. VersionControl.VersionFunctionEnum.客服中心客服安排, hideControl, null, null);
  242. hideControl = new List<Control>();
  243. //LYFZSS.SystemSpecterPossessed.ISystemSpecterPossessed.GetMySystemSpecter = LYFZSS.SystemSpecterType.SST_D;
  244. hideControl.Add(this.btnPersonSchedule);
  245. LYFZ.Software.MainBusiness.VersionControl.StaticVersion.BindVersionShowHideControl(
  246. VersionControl.VersionFunctionEnum.员工考勤员工档期, hideControl, null, null);
  247. hideControl = new List<Control>();
  248. //LYFZSS.SystemSpecterPossessed.ISystemSpecterPossessed.GetMySystemSpecter = LYFZSS.SystemSpecterType.SST_D;
  249. hideControl.Add(this.panelEx9);
  250. hideControl.Add(this.labelEx3);
  251. hideControl.Add(this.panelEx10);
  252. hideControl.Add(this.labelEx2);
  253. LYFZ.Software.MainBusiness.VersionControl.StaticVersion.BindVersionShowHideControl(
  254. VersionControl.VersionFunctionEnum.订单拍照重拍标注, hideControl, null, null);
  255. try
  256. {
  257. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindGroupStoreName(this.cmbtreevStoreName, StrKeyCode: "qt001");
  258. this.PublicFunctionRights();
  259. this.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y);
  260. this.Size = new Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height);
  261. #region
  262. this.chkKidsVersion.Visible = false;
  263. this.chkDressVersion.Visible = false;
  264. this.chkPortraitVersion.Visible = false;
  265. this.chkNearlyHalfMonth.Visible = false;
  266. this.chkNearlyOneWeek.Visible = false;
  267. #endregion
  268. #region 图表
  269. this.btnCharts.Text = " 详 情";
  270. this.tblPanel.Controls.Clear();
  271. string[] RelationEnum = System.Enum.GetNames(typeof(LYFZ.EnumPublic.TotalWeeks));
  272. int panelCount = 0;
  273. this.nudYears.Value = SDateTime.Now.Year;
  274. this.nudMonth.Value = SDateTime.Now.Month;
  275. this.nudDate.Value = SDateTime.Now.Day;
  276. this.nudDate.Maximum = DateTime.DaysInMonth(Convert.ToInt32(nudYears.Value), Convert.ToInt32(nudMonth.Value));
  277. if (this.StrClientServiceType.Trim().Length > 0)
  278. { this.tblPanel.Visible = false; }
  279. else
  280. { this.tblPanel.Visible = true; }
  281. this.SetnudDate();
  282. #region 填充每天的Panel
  283. Panel panel = new Panel();
  284. Label lable = new Label();
  285. for (int i = 0; i < 7; i++)
  286. {
  287. for (int j = 0; j < 7; j++)
  288. {
  289. if (i == 0)
  290. {
  291. panel = new Panel();
  292. panel.BackColor = UIBlueThemeResources.SightsSelectTableBorderColor;
  293. panel.Margin = new System.Windows.Forms.Padding(1, 1, 1, 1);
  294. panel.Size = new Size((this.Width / 7) - 4, 40);
  295. panel.Dock = DockStyle.Fill;
  296. panel.Name = "AAAA" + i + j;
  297. lable = new Label();
  298. lable.Text = RelationEnum[j].Trim();
  299. lable.Size = new System.Drawing.Size((this.Width / 7) - 4, 30);
  300. lable.TextAlign = ContentAlignment.MiddleCenter;
  301. lable.Dock = DockStyle.Fill;
  302. lable.ForeColor = UIBlueThemeResources.DefaultReverseTextColor;
  303. lable.Font = new System.Drawing.Font("微软雅黑", 12F, FontStyle.Bold, System.Drawing.GraphicsUnit.Pixel);
  304. panel.Controls.Add(lable);
  305. tblPanel.Controls.Add(panel);
  306. }
  307. else
  308. {
  309. CameraBookDayControl cbcPanel = new CameraBookDayControl();
  310. cbcPanel.BackColor = Color.Gainsboro;
  311. cbcPanel.Margin = new System.Windows.Forms.Padding(1, 1, 1, 1);
  312. cbcPanel.Size = new Size((this.Width / 7) - 4, (this.Height / 6));
  313. panelCount++;
  314. cbcPanel.Name = "panel" + panelCount;
  315. cbcPanel.Dock = DockStyle.Fill;
  316. //cbcPanel.DoubleClick += new EventHandler(panel_DoubleClick);
  317. cbcPanel.Click += new EventHandler(panel_Click);
  318. cbcPanel.ClickRemarkEvent += new CameraBookDayControl.ClickRemarkHandler(CameraBookDayControl_Click);
  319. cbcPanel.DoubleClickItemEvent += new CameraBookDayControl.DoubleClickItemHandler(CameraBookDayControl_DoubleClick);
  320. tblPanel.Controls.Add(cbcPanel);
  321. }
  322. }
  323. }
  324. #endregion
  325. this.nudDate.Focus();
  326. #endregion
  327. }
  328. catch (Exception ex)
  329. { MessageBoxCustom.Show(ex.ToString()); }
  330. btn_ColorSetting.Click += Btn_ColorSetting_Click;
  331. }
  332. private void Btn_ColorSetting_Click(object sender, EventArgs e)
  333. {
  334. SmallForm.frmColorManager frmColor = new SmallForm.frmColorManager();
  335. if(frmColor.ShowDialog()== DialogResult.OK)
  336. {
  337. }
  338. }
  339. private void CameraBookDayControl_DoubleClick(CameraBookDayControl pan, string dayNum, DayDataItemModel dayDataItem)
  340. {
  341. this.nudDate.Value = Convert.ToDecimal(dayNum);
  342. if (dayDataItem.Name.Contains("拍照"))
  343. {
  344. lbl_A_DoubleClick(null, null);
  345. }
  346. else if (dayDataItem.Name.Contains("选片"))
  347. {
  348. lbl_B_DoubleClick(null, null);
  349. }
  350. else if (dayDataItem.Name.Contains("看样"))
  351. {
  352. lbl_C_DoubleClick(null, null);
  353. }
  354. else if (dayDataItem.Name.Contains("取件"))
  355. {
  356. lbl_D_DoubleClick(null, null);
  357. }
  358. else if (dayDataItem.Name.Contains("服务"))
  359. {
  360. lbl_E_DoubleClick(null, null);
  361. }
  362. else if (dayDataItem.Name.Contains("选衣"))
  363. {
  364. lbl_F_DoubleClick(null, null);
  365. }
  366. else if (dayDataItem.Name.Contains("上门派单"))
  367. {
  368. lbl_G_DoubleClick(null, null);
  369. }
  370. else
  371. {
  372. panel_DoubleClick(null, null);
  373. }
  374. }
  375. private void CameraBookDayControl_Click(CameraBookDayControl pan, string day)
  376. {
  377. if (!this.cmbtreevStoreName.Text.Trim().Equals("全部") && this.cmbtreevStoreName.Text.Trim().Length > 0)
  378. {
  379. LYFZ.Software.MainBusiness.CameraControlBook.SuperSmallForm.CameraControlNotesSuperSmallForm frm = new SuperSmallForm.CameraControlNotesSuperSmallForm();
  380. frm.StrStoreName = this.cmbtreevStoreName.Tag.ToString().Trim();
  381. frm.StrDateValue = Convert.ToDateTime(this.nudYears.Value + "-" + this.nudMonth.Value + "-" + day).ToString("yyyy-MM-dd");
  382. frm.ShowDialog();
  383. if (frm.IsSaveed)
  384. {
  385. if (frm.intCurrentLength > 0)
  386. {
  387. pan.dayModel.remark = "保存备注";
  388. }
  389. else
  390. {
  391. pan.dayModel.remark = "";
  392. }
  393. pan.Refresh();
  394. }
  395. }
  396. }
  397. /// <summary>
  398. /// 分店选择查询数据
  399. /// </summary>
  400. /// <param name="sender"></param>
  401. /// <param name="e"></param>
  402. void cmbtreevStoreName_ComboBoxTree_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
  403. {
  404. this.PublicFunctionRights();
  405. if (this.btnCharts.Text.Trim() == "图 表")
  406. { this.PublicFunctionRows(); }
  407. else if (this.btnCharts.Text.Trim() == "详 情")
  408. { this.PaintingWeekly(); }
  409. }
  410. /// <summary>
  411. /// 选择分店获取权限
  412. /// </summary>
  413. void PublicFunctionRights()
  414. {
  415. this.btnSMS.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights(this.cmbtreevStoreName, "CameraControlBook", LYFZ.CustomAttributes.OperatingAuthority.SMSSend);
  416. this.btnPrint.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights(this.cmbtreevStoreName, "CameraControlBook", LYFZ.CustomAttributes.OperatingAuthority.Print);
  417. this.btnSelectedClothes.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights(this.cmbtreevStoreName, "CameraControlBook", LYFZ.CustomAttributes.OperatingAuthority.CameraControlBook_SelectDress);
  418. this.btnExport.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights(this.cmbtreevStoreName, "CameraControlBook", LYFZ.CustomAttributes.OperatingAuthority.DataExport);
  419. #region 权限
  420. switch (LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetBusinessType())
  421. {
  422. case LYFZ.Software.MainBusiness.EnumPermissions.BusinessType.婚纱版:
  423. this.panelHospitalClient.Visible = false;
  424. break;
  425. }
  426. #endregion
  427. }
  428. /// <summary>
  429. ///
  430. /// </summary>
  431. /// <param name="IsVisible"></param>
  432. void SetnudDate(bool IsVisible = false)
  433. {
  434. if (!IsVisible)
  435. {
  436. this.nudDate.Visible = false;
  437. this.panelEx5.Width = 205;
  438. }
  439. else
  440. {
  441. this.nudDate.Visible = true;
  442. this.panelEx5.Width = 275;
  443. }
  444. }
  445. /// <summary>
  446. /// 绘出每日
  447. /// </summary>
  448. /// <param name="todays"></param>
  449. void PaintingCharts(int todays)
  450. {
  451. DateTime NowTime = Convert.ToDateTime(this.nudYears.Value + "-" + this.nudMonth.Value + "-01");
  452. string StrStoreNameWhere = PublicCodeClasses.GetGroupQueryWhere(this.cmbtreevStoreName, "StrStoreName", ConnectWord: "or");
  453. DataTable tbl_Photogr = null;
  454. DataTable tbl_FilmSelection = null;
  455. DataTable tbl_LookDesign = null;
  456. DataTable tbl_PickupDate = null;
  457. DataTable tbl_WeddingService = null;
  458. DataTable tbl_SelectDress = null;
  459. DataTable tbl_SendSingle = null;
  460. DataTable tbl_Notes = null;
  461. string Strwhere = "";
  462. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate (object obj, BackgroundWorker backgroundWorker)
  463. {
  464. Strwhere = "between '" + LYFZ.Command.Command_Validate.DateTimeToString(NowTime, "yyyy-MM-dd HH:mm:ss") + "' and '" + LYFZ.Command.Command_Validate.DateTimeToString(NowTime.AddMonths(1).AddSeconds(-1), "yyyy-MM-dd HH:mm:ss") + "'";
  465. string ExecuteSql = "select Ord_Type,Ordpg_Number,Ordpg_ReservationPhotographyTime from dbo.tb_ErpOrdersPhotography Left Join dbo.tb_ErpOrder on Ord_Number = Ordpg_Number where 1=1 And (Ordpg_ReservationPhotographyDividedShop is null " + StrStoreNameWhere.Replace("StrStoreName", "Ordpg_ReservationPhotographyDividedShop") + ") and Ordpg_ReservationPhotographyTime " + Strwhere + ";";
  466. ExecuteSql += "select Ord_Type,Ordv_Number,Ordv_ReservationFilmSelectionTime from dbo.tb_ErpOrderDigital Left Join dbo.tb_ErpOrder on Ord_Number = Ordv_Number where 1=1 And (Ordv_ReservationFilmSelectionDividedShop is null " + StrStoreNameWhere.Replace("StrStoreName", "Ordv_ReservationFilmSelectionDividedShop") + ") and Ordv_ReservationFilmSelectionTime " + Strwhere + ";";
  467. ExecuteSql += "select Ord_Type,Ordv_Number,Ordv_ReservationLookDesignTime from dbo.tb_ErpOrderDigital Left Join dbo.tb_ErpOrder on Ord_Number = Ordv_Number where 1=1 And (Ordv_ReservationLookDesignDividedShop is null " + StrStoreNameWhere.Replace("StrStoreName", "Ordv_ReservationLookDesignDividedShop") + ") and Ordv_ReservationLookDesignTime " + Strwhere + ";";
  468. ExecuteSql += "select Ord_Type,OPlist_OrderNumber,OPlist_ReservationTakeTime from dbo.tb_ErpOrderProductList Left Join dbo.tb_ErpOrder on Ord_Number = OPlist_OrderNumber where 1=1 And (OPlist_ReservationTakeDividedShop is null " + StrStoreNameWhere.Replace("StrStoreName", "OPlist_ReservationTakeDividedShop") + ") and OPlist_ReservationTakeTime " + Strwhere + " and OPlist_Type = '2';";
  469. ExecuteSql += "select Ord_Type,Ws_Number,Ws_WeddingDate from dbo.tb_ErpWeddingService Left Join dbo.tb_ErpOrder on Ord_Number = Ws_Number where 1=1 And (Ws_ReservationServiceDividedShop is null " + StrStoreNameWhere.Replace("StrStoreName", "Ws_ReservationServiceDividedShop") + ") and Ws_WeddingDate " + Strwhere + ";";
  470. ExecuteSql += "select Ord_Type,Ordv_Number,Ordv_ReservationClothingTime from dbo.tb_ErpOrderDigital Left Join dbo.tb_ErpOrder on Ord_Number = Ordv_Number where 1=1 And (Ordv_ReservationClothingDividedShop is null " + StrStoreNameWhere.Replace("StrStoreName", "Ordv_ReservationClothingDividedShop") + ") and Ordv_ReservationClothingTime " + Strwhere + ";";
  471. ExecuteSql += "select Hdr_DoorTime from dbo.tb_ErpHospitalDispatchDoor where (Hdr_DividedShop is null " + StrStoreNameWhere.Replace("StrStoreName", "Hdr_DividedShop") + ") And Hdr_DoorTime " + Strwhere + ";";
  472. DataSet dsData = orbll.GetView_Custom(ExecuteSql);
  473. tbl_Photogr = dsData.Tables["ds"];
  474. tbl_FilmSelection = dsData.Tables["ds1"];
  475. tbl_LookDesign = dsData.Tables["ds2"];
  476. tbl_PickupDate = dsData.Tables["ds3"];
  477. tbl_WeddingService = dsData.Tables["ds4"];
  478. tbl_SelectDress = dsData.Tables["ds5"];
  479. tbl_SendSingle = dsData.Tables["ds6"];
  480. tbl_Notes = null;
  481. if (tbl_Notes == null)
  482. {
  483. string StrTableName = "select Ordrr_Remark,Ordrr_CreateDatetime from dbo.tb_ErpOrderRemarkRecord where Ordrr_ModuleName = '每日便签' And Ordrr_OrdNumber = '" + this.cmbtreevStoreName.Tag.ToString().Trim() + "' And Ordrr_CreateDatetime " + Strwhere + " and Ordrr_Remark !='' ;";
  484. tbl_Notes = orbll.GetView_Custom(StrTableName).Tables[0];
  485. tbl_Notes.PrimaryKey = new DataColumn[] { tbl_Notes.Columns["Ordrr_CreateDatetime"] };
  486. }
  487. try
  488. {
  489. List<Model.CameraBook.DayDataModel> dayModel = BinMouthData(todays, Strwhere, tbl_Photogr, tbl_FilmSelection, tbl_LookDesign, tbl_PickupDate, tbl_WeddingService, tbl_SelectDress, tbl_SendSingle, tbl_Notes);
  490. BindMouthControl3(todays, dayModel);
  491. }
  492. catch (Exception e) { }
  493. });
  494. }
  495. #region (旧)摄控本图表统计
  496. void BindMouthControl(int todays, string Strwhere, DataTable tbl_Photogr, DataTable tbl_FilmSelection, DataTable tbl_LookDesign, DataTable tbl_PickupDate, DataTable tbl_WeddingService, DataTable tbl_SelectDress, DataTable tbl_SendSingle, DataTable tbl_Notes)
  497. {
  498. this.Invoke(new LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.UpdateControl(delegate ()
  499. {
  500. int days = DateTime.DaysInMonth(Convert.ToInt32(this.nudYears.Value), Convert.ToInt32(this.nudMonth.Value));//这个月的天数
  501. int panellenght = 0;
  502. Size lblsize = new System.Drawing.Size(120, 17);
  503. Font lblfont = new System.Drawing.Font("微软雅黑", 14, FontStyle.Regular, GraphicsUnit.Pixel);
  504. int LineSpacing = (lblfont.Height / 2) + 2;
  505. int Location_X = 5;
  506. Label lbl_A = null;
  507. Label lbl_B = null;
  508. Label lbl_C = null;
  509. Label lbl_D = null;
  510. Label lbl_E = null;
  511. Label lbl_F = null;
  512. Label lbl_G = null;
  513. int lbl1_Width = 0;
  514. for (int i = 0; i < days; i++)
  515. {
  516. if (i == 0)
  517. { lblStart = todays; this.nudDataValue = todays; }
  518. panellenght++;
  519. Panel panel = (Panel)tblPanel.Controls["panel" + todays];
  520. DateTime Starttime = Convert.ToDateTime(this.nudYears.Value + "-" + this.nudMonth.Value + "-" + (i + 1));
  521. #region 日期
  522. Label lbl1 = new Label();
  523. lbl1.Text = (i + 1).ToString();
  524. lbl1.Name = "lbl" + i;
  525. lbl1.Location = new Point(Location_X, 2);
  526. lbl1.Size = new System.Drawing.Size(40, 20);
  527. lbl1.TextAlign = ContentAlignment.TopLeft;
  528. lbl1.DoubleClick += new EventHandler(lbl1_DoubleClick);
  529. lbl1.Click += new EventHandler(lbl1_Click);
  530. lbl1.Font = new System.Drawing.Font("宋体", 15, FontStyle.Bold);
  531. if (!this.cmbtreevStoreName.Text.Trim().Equals("全部") && this.cmbtreevStoreName.Text.Trim().Length > 0)
  532. {
  533. DataRow dtRow = tbl_Notes.Rows.Find(Starttime.ToString("yyyy-MM-dd HH:mm:ss"));
  534. if (dtRow != null && dtRow["Ordrr_Remark"].ToString().Trim().Length > 0)
  535. { lbl1.ForeColor = Color.Blue; }
  536. else
  537. { lbl1.ForeColor = Color.Red; }
  538. lbl1.Cursor = Cursors.Hand;
  539. lbl1.Tag = new LYFZ.ComponentLibrary.ExToolTipText("随笔便签");
  540. exToolTip1.SetToolTip(lbl1, "随笔便签");
  541. }
  542. else
  543. { lbl1.ForeColor = Color.Red; }
  544. panel.Controls.Add(lbl1);
  545. lbl1_Width = lbl1.Size.Width;
  546. #endregion
  547. #region 农历
  548. string StrText = LYFZ.Command.Command_CalendarTurnLunar.GetLunarNewYearMonthDay(nudYears.Value.ToString().Trim() + "-" + nudMonth.Value.ToString().Trim() + "-" + (i + 1));
  549. lbl1 = new Label();
  550. lbl1.Text = StrText;
  551. lbl1.Location = new Point(lbl1_Width + Location_X, 7);
  552. lbl1.AutoSize = false;
  553. lbl1.Size = new System.Drawing.Size(50, 17);
  554. lbl1.DoubleClick += new EventHandler(lbl1_DoubleClick);
  555. lbl1.Click += new EventHandler(lbl1_Click);
  556. lbl1.Font = new System.Drawing.Font("宋体", 8, FontStyle.Regular);
  557. panel.Controls.Add(lbl1);
  558. #endregion
  559. int Location_Y = 15;
  560. #region 拍照客人
  561. lbl_A = new Label();
  562. lbl_A.Cursor = Cursors.Hand;
  563. string P_StrMagess = "";
  564. int P_WCount = 0;
  565. int P_CCount = 0;
  566. int P_PCount = 0;
  567. int fordrcount = 0;
  568. //int intHoliday = 0;
  569. //if (this.cmbtreevStoreName.Tag != null && !string.IsNullOrEmpty(this.cmbtreevStoreName.Tag.ToString().Trim()))
  570. //{ dtHoliday.Select("StrStoreName = '" + this.cmbtreevStoreName.Tag.ToString().Trim() + "'"); }
  571. //else
  572. //{ dtHoliday.Select("StrStoreName = '" + LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID() + "' And ");
  573. //}
  574. if (tbl_Photogr.Rows.Count > 0)
  575. {
  576. List<DataRow> dr = tbl_Photogr.AsEnumerable().Where(
  577. p => p.Field<DateTime>("Ordpg_ReservationPhotographyTime") >= Starttime
  578. &&
  579. p.Field<DateTime>("Ordpg_ReservationPhotographyTime") <= Starttime.AddDays(1)).ToList<DataRow>();
  580. //for (int j = 0; j < dr.Count; j++)
  581. //{
  582. // if (j > 0)
  583. // {
  584. // if (dr[j]["Ordpg_Number"].ToString().Trim() != dr[j - 1]["Ordpg_Number"].ToString().Trim())
  585. // {
  586. // switch (dr[j]["Ord_Type"].ToString().Trim())
  587. // {
  588. // case "0": P_WCount++; break;
  589. // case "1": P_CCount++; break;
  590. // case "2": P_PCount++; break;
  591. // }
  592. // fordrcount++;
  593. // }
  594. // }
  595. // else
  596. // {
  597. // switch (dr[j]["Ord_Type"].ToString().Trim())
  598. // {
  599. // case "0": P_WCount++; break;
  600. // case "1": P_CCount++; break;
  601. // case "2": P_PCount++; break;
  602. // }
  603. // fordrcount++;
  604. // }
  605. //}
  606. //List<string> tempCount = dr.Where(p => p.Field<string>("Ord_Type") == "0").Select(p => p.Field<string>("Ordpg_Number")).ToList<string>().GroupBy(t => t).Select(t => t.First()).ToList();
  607. P_WCount = dr.Where(p => p.Field<string>("Ord_Type") == "0").Select(p => p.Field<string>("Ordpg_Number")).ToList<string>().GroupBy(t => t).Select(t => t.First()).ToList().Count();
  608. P_CCount = dr.Where(p => p.Field<string>("Ord_Type") == "1").Select(p => p.Field<string>("Ordpg_Number")).ToList<string>().GroupBy(t => t).Select(t => t.First()).ToList().Count();
  609. P_PCount = dr.Where(p => p.Field<string>("Ord_Type") == "2").Select(p => p.Field<string>("Ordpg_Number")).ToList<string>().GroupBy(t => t).Select(t => t.First()).ToList().Count();
  610. ;
  611. }
  612. if (P_WCount > 0)
  613. { P_StrMagess = "婚纱订单:" + P_WCount + " "; }
  614. if (P_CCount > 0)
  615. {
  616. if (P_StrMagess == "")
  617. { P_StrMagess += "儿童订单:" + P_CCount + " "; }
  618. else { P_StrMagess += "\r\n儿童订单:" + P_CCount + " "; }
  619. }
  620. if (P_PCount > 0)
  621. {
  622. if (P_StrMagess == "")
  623. { P_StrMagess += "写真订单:" + P_PCount + " "; }
  624. else { P_StrMagess += "\r\n写真订单:" + P_PCount + " "; }
  625. }
  626. if (P_StrMagess != "")
  627. { P_StrMagess = "拍照客人\r\n" + P_StrMagess; }
  628. lbl_A.Tag = new LYFZ.ComponentLibrary.ExToolTipText(P_StrMagess);
  629. exToolTip1.SetToolTip(lbl_A, P_StrMagess);
  630. lbl_A.Text = "拍照客人: " + (P_WCount + P_CCount + P_PCount);
  631. lbl_A.Location = new Point(Location_X, Location_Y + LineSpacing * 1);
  632. lbl_A.Size = lblsize;
  633. lbl_A.TextAlign = ContentAlignment.BottomLeft;
  634. lbl_A.DoubleClick += lbl_A_DoubleClick;
  635. lbl_A.Click += new EventHandler(lbl1_Click);
  636. lbl_A.Font = lblfont;
  637. panel.Controls.Add(lbl_A);
  638. Location_Y += LineSpacing;
  639. #endregion
  640. #region 选片客人
  641. lbl_B = new Label();
  642. lbl_B.Cursor = Cursors.Hand;
  643. string X_StrMagess = "";
  644. int X_WCount = 0;
  645. int X_CCount = 0;
  646. int X_PCount = 0;
  647. fordrcount = 0;
  648. if (tbl_FilmSelection.Rows.Count > 0)
  649. {
  650. //DataRow[] dr = tbl_FilmSelection.Select("Ordv_ReservationFilmSelectionTime >= '" + LYFZ.Command.Command_Validate.DateTimeToString(Starttime, "yyyy-MM-dd HH:mm:ss") + "' and Ordv_ReservationFilmSelectionTime < '" + LYFZ.Command.Command_Validate.DateTimeToString(Starttime.AddDays(1), "yyyy-MM-dd HH:mm:ss") + "'", "Ordv_Number");
  651. List<DataRow> dr = tbl_FilmSelection.AsEnumerable().Where(
  652. p => p.Field<DateTime>("Ordv_ReservationFilmSelectionTime") >= Starttime
  653. &&
  654. p.Field<DateTime>("Ordv_ReservationFilmSelectionTime") <= Starttime.AddDays(1)).ToList<DataRow>();
  655. /*for (int j = 0; j < dr.Count; j++)
  656. {
  657. if (j > 0)
  658. {
  659. if (dr[j]["Ordv_Number"].ToString().Trim() != dr[j - 1]["Ordv_Number"].ToString().Trim())
  660. {
  661. switch (dr[j]["Ord_Type"].ToString().Trim())
  662. {
  663. case "0": X_WCount++; break;
  664. case "1": X_CCount++; break;
  665. case "2": X_PCount++; break;
  666. }
  667. fordrcount++;
  668. }
  669. }
  670. else
  671. {
  672. switch (dr[j]["Ord_Type"].ToString().Trim())
  673. {
  674. case "0": X_WCount++; break;
  675. case "1": X_CCount++; break;
  676. case "2": X_PCount++; break;
  677. }
  678. fordrcount++;
  679. }
  680. }*/
  681. X_WCount = dr.Where(p => p.Field<string>("Ord_Type") == "0").Select(p => p.Field<string>("Ordv_Number")).ToList<string>().GroupBy(t => t).Select(t => t.First()).ToList().Count();
  682. X_CCount = dr.Where(p => p.Field<string>("Ord_Type") == "1").Select(p => p.Field<string>("Ordv_Number")).ToList<string>().GroupBy(t => t).Select(t => t.First()).ToList().Count();
  683. X_PCount = dr.Where(p => p.Field<string>("Ord_Type") == "2").Select(p => p.Field<string>("Ordv_Number")).ToList<string>().GroupBy(t => t).Select(t => t.First()).ToList().Count();
  684. fordrcount = X_WCount + X_CCount + X_PCount;
  685. }
  686. if (X_WCount > 0)
  687. {
  688. if (X_StrMagess == "")
  689. { X_StrMagess = "婚纱订单:" + X_WCount; }
  690. else
  691. { X_StrMagess = "\r\n婚纱订单:" + X_WCount; }
  692. }
  693. if (X_CCount > 0)
  694. {
  695. if (X_StrMagess == "")
  696. { X_StrMagess += "儿童订单:" + X_CCount; }
  697. else { X_StrMagess += "\r\n儿童订单:" + X_CCount; }
  698. }
  699. if (X_PCount > 0)
  700. {
  701. if (X_StrMagess == "")
  702. { X_StrMagess += "写真订单:" + X_PCount; }
  703. else
  704. { X_StrMagess += "\r\n写真订单:" + X_PCount; }
  705. }
  706. if (X_StrMagess != "")
  707. { X_StrMagess = "选片客人\r\n" + X_StrMagess; }
  708. lbl_B.Tag = new LYFZ.ComponentLibrary.ExToolTipText(X_StrMagess);
  709. exToolTip1.SetToolTip(lbl_B, X_StrMagess);
  710. lbl_B.Text = "选片客人: " + fordrcount;
  711. lbl_B.Location = new Point(Location_X, Location_Y + LineSpacing * 2);
  712. lbl_B.Size = lblsize;
  713. lbl_B.TextAlign = ContentAlignment.BottomLeft;
  714. lbl_B.DoubleClick += lbl_B_DoubleClick;
  715. lbl_B.Click += new EventHandler(lbl1_Click);
  716. lbl_B.Font = lblfont;
  717. panel.Controls.Add(lbl_B);
  718. Location_Y += LineSpacing;
  719. #endregion
  720. #region 看样客人
  721. lbl_C = new Label();
  722. lbl_C.Cursor = Cursors.Hand;
  723. string K_StrMagess = "";
  724. int K_WCount = 0;
  725. int K_CCount = 0;
  726. int K_PCount = 0;
  727. fordrcount = 0;
  728. if (tbl_LookDesign.Rows.Count > 0)
  729. {
  730. //DataRow[] dr = tbl_LookDesign.Select("Ordv_ReservationLookDesignTime >= '" + LYFZ.Command.Command_Validate.DateTimeToString(Starttime, "yyyy-MM-dd HH:mm:ss") + "' and Ordv_ReservationLookDesignTime < '" + LYFZ.Command.Command_Validate.DateTimeToString(Starttime.AddDays(1), "yyyy-MM-dd HH:mm:ss") + "'", "Ordv_Number");
  731. List<DataRow> dr = tbl_LookDesign.AsEnumerable().Where(
  732. p => p.Field<DateTime>("Ordv_ReservationLookDesignTime") >= Starttime
  733. &&
  734. p.Field<DateTime>("Ordv_ReservationLookDesignTime") <= Starttime.AddDays(1)).ToList<DataRow>();
  735. /*for (int j = 0; j < dr.Count; j++)
  736. {
  737. if (j > 0)
  738. {
  739. if (dr[j]["Ordv_Number"].ToString().Trim() != dr[j - 1]["Ordv_Number"].ToString().Trim())
  740. {
  741. switch (dr[j]["Ord_Type"].ToString().Trim())
  742. {
  743. case "0": K_WCount++; break;
  744. case "1": K_CCount++; break;
  745. case "2": K_PCount++; break;
  746. }
  747. fordrcount++;
  748. }
  749. }
  750. else
  751. {
  752. switch (dr[j]["Ord_Type"].ToString().Trim())
  753. {
  754. case "0": K_WCount++; break;
  755. case "1": K_CCount++; break;
  756. case "2": K_PCount++; break;
  757. }
  758. fordrcount++;
  759. }
  760. }*/
  761. K_WCount = dr.Where(p => p.Field<string>("Ord_Type") == "0").Select(p => p.Field<string>("Ordv_Number")).ToList<string>().GroupBy(t => t).Select(t => t.First()).ToList().Count();
  762. K_CCount = dr.Where(p => p.Field<string>("Ord_Type") == "1").Select(p => p.Field<string>("Ordv_Number")).ToList<string>().GroupBy(t => t).Select(t => t.First()).ToList().Count();
  763. K_PCount = dr.Where(p => p.Field<string>("Ord_Type") == "2").Select(p => p.Field<string>("Ordv_Number")).ToList<string>().GroupBy(t => t).Select(t => t.First()).ToList().Count();
  764. fordrcount = K_WCount + K_CCount + K_PCount;
  765. }
  766. if (K_WCount > 0)
  767. {
  768. if (K_StrMagess == "")
  769. { K_StrMagess = "婚纱订单:" + K_WCount; }
  770. else
  771. { K_StrMagess = "\r\n婚纱订单:" + K_WCount; }
  772. }
  773. if (K_CCount > 0)
  774. {
  775. if (K_StrMagess == "")
  776. { K_StrMagess += "儿童订单:" + K_CCount; }
  777. else
  778. { K_StrMagess += "\r\n儿童订单:" + K_CCount; }
  779. }
  780. if (K_PCount > 0)
  781. {
  782. if (K_StrMagess == "")
  783. { K_StrMagess += "写真订单:" + K_PCount; }
  784. else
  785. { K_StrMagess += "\r\n写真订单:" + K_PCount; }
  786. }
  787. if (K_StrMagess != "")
  788. { K_StrMagess = "看样客人\r\n" + K_StrMagess; }
  789. lbl_C.Tag = new LYFZ.ComponentLibrary.ExToolTipText(K_StrMagess);
  790. exToolTip1.SetToolTip(lbl_C, K_StrMagess);
  791. lbl_C.Text = "看样客人: " + fordrcount;
  792. lbl_C.Location = new Point(Location_X, Location_Y + LineSpacing * 3);
  793. lbl_C.Size = lblsize;
  794. lbl_C.TextAlign = ContentAlignment.BottomLeft;
  795. lbl_C.DoubleClick += lbl_C_DoubleClick;
  796. lbl_C.Click += new EventHandler(lbl1_Click);
  797. lbl_C.Font = lblfont;
  798. panel.Controls.Add(lbl_C);
  799. Location_Y += LineSpacing;
  800. #endregion
  801. #region 取件客人
  802. lbl_D = new Label();
  803. lbl_D.Cursor = Cursors.Hand;
  804. string Q_StrMagess = "";
  805. int Q_WCount = 0;
  806. int Q_CCount = 0;
  807. int Q_PCount = 0;
  808. fordrcount = 0;
  809. if (tbl_PickupDate.Rows.Count > 0)
  810. {
  811. //DataRow[] dr = tbl_PickupDate.Select("OPlist_ReservationTakeTime >= '" + LYFZ.Command.Command_Validate.DateTimeToString(Starttime, "yyyy-MM-dd HH:mm:ss") + "' and OPlist_ReservationTakeTime < '" + LYFZ.Command.Command_Validate.DateTimeToString(Starttime.AddDays(1), "yyyy-MM-dd HH:mm:ss") + "'", "OPlist_OrderNumber");
  812. List<DataRow> dr = tbl_PickupDate.AsEnumerable().Where(
  813. p => p.Field<DateTime>("OPlist_ReservationTakeTime") >= Starttime
  814. &&
  815. p.Field<DateTime>("OPlist_ReservationTakeTime") <= Starttime.AddDays(1)).ToList<DataRow>();
  816. /*for (int j = 0; j < dr.Count; j++)
  817. {
  818. if (j > 0)
  819. {
  820. if (dr[j]["OPlist_OrderNumber"].ToString().Trim() != dr[j - 1]["OPlist_OrderNumber"].ToString().Trim())
  821. {
  822. switch (dr[j]["Ord_Type"].ToString().Trim())
  823. {
  824. case "0": Q_WCount++; break;
  825. case "1": Q_CCount++; break;
  826. case "2": Q_PCount++; break;
  827. }
  828. fordrcount++;
  829. }
  830. }
  831. else
  832. {
  833. switch (dr[j]["Ord_Type"].ToString().Trim())
  834. {
  835. case "0": Q_WCount++; break;
  836. case "1": Q_CCount++; break;
  837. case "2": Q_PCount++; break;
  838. }
  839. fordrcount++;
  840. }
  841. }*/
  842. Q_WCount = dr.Where(p => p.Field<string>("Ord_Type") == "0").Select(p => p.Field<string>("OPlist_OrderNumber")).ToList<string>().GroupBy(t => t).Select(t => t.First()).ToList().Count();
  843. Q_CCount = dr.Where(p => p.Field<string>("Ord_Type") == "1").Select(p => p.Field<string>("OPlist_OrderNumber")).ToList<string>().GroupBy(t => t).Select(t => t.First()).ToList().Count();
  844. Q_PCount = dr.Where(p => p.Field<string>("Ord_Type") == "2").Select(p => p.Field<string>("OPlist_OrderNumber")).ToList<string>().GroupBy(t => t).Select(t => t.First()).ToList().Count();
  845. fordrcount = Q_WCount + Q_CCount + Q_PCount;
  846. }
  847. if (Q_WCount > 0)
  848. {
  849. if (Q_StrMagess == "")
  850. { Q_StrMagess = "婚纱订单:" + Q_WCount; }
  851. else
  852. { Q_StrMagess = "\r\n婚纱订单:" + Q_WCount; }
  853. }
  854. if (Q_CCount > 0)
  855. {
  856. if (Q_StrMagess == "")
  857. { Q_StrMagess += "儿童订单:" + Q_CCount; }
  858. else
  859. { Q_StrMagess += "\r\n儿童订单:" + Q_CCount; }
  860. }
  861. if (Q_PCount > 0)
  862. {
  863. if (Q_StrMagess == "")
  864. { Q_StrMagess += "写真订单:" + Q_PCount; }
  865. else
  866. { Q_StrMagess += "\r\n写真订单:" + Q_PCount; }
  867. }
  868. if (Q_StrMagess != "")
  869. { Q_StrMagess = "取件客人\r\n" + Q_StrMagess; }
  870. lbl_D.Tag = new LYFZ.ComponentLibrary.ExToolTipText(Q_StrMagess);
  871. exToolTip1.SetToolTip(lbl_D, Q_StrMagess);
  872. lbl_D.Cursor = Cursors.Hand;
  873. lbl_D.Text = "取件客人: " + fordrcount;
  874. lbl_D.Location = new Point(Location_X, Location_Y + LineSpacing * 4);
  875. lbl_D.Size = lblsize;
  876. lbl_D.TextAlign = ContentAlignment.BottomLeft;
  877. lbl_D.DoubleClick += lbl_D_DoubleClick;
  878. lbl_D.Click += new EventHandler(lbl1_Click);
  879. lbl_D.Font = lblfont;
  880. panel.Controls.Add(lbl_D);
  881. Location_Y += LineSpacing;
  882. #endregion
  883. #region 服务客人
  884. lbl_E = new Label();
  885. lbl_E.Cursor = Cursors.Hand;
  886. string F_StrMagess = "";
  887. int F_WCount = 0;
  888. int F_CCount = 0;
  889. int F_PCount = 0;
  890. int F_FCount = 0;
  891. fordrcount = 0;
  892. if (tbl_WeddingService.Rows.Count > 0)
  893. {
  894. //DataRow[] dr = tbl_WeddingService.Select("Ws_WeddingDate >= '" + LYFZ.Command.Command_Validate.DateTimeToString(Starttime, "yyyy-MM-dd HH:mm:ss") + "' and Ws_WeddingDate < '" + LYFZ.Command.Command_Validate.DateTimeToString(Starttime.AddDays(1), "yyyy-MM-dd HH:mm:ss") + "'", "Ws_Number");
  895. List<DataRow> dr = tbl_WeddingService.AsEnumerable().Where(
  896. p => p.Field<DateTime>("Ws_WeddingDate") >= Starttime
  897. &&
  898. p.Field<DateTime>("Ws_WeddingDate") <= Starttime.AddDays(1)).ToList<DataRow>();
  899. /*for (int j = 0; j < dr.Count; j++)
  900. {
  901. if (j > 0)
  902. {
  903. if (dr[j]["Ws_Number"].ToString().Trim() != dr[j - 1]["Ws_Number"].ToString().Trim())
  904. {
  905. switch (dr[j]["Ord_Type"].ToString().Trim())
  906. {
  907. case "0": F_WCount++; break;
  908. case "1": F_CCount++; break;
  909. case "2": F_PCount++; break;
  910. case "3": F_FCount++; break;
  911. }
  912. fordrcount++;
  913. }
  914. }
  915. else
  916. {
  917. switch (dr[j]["Ord_Type"].ToString().Trim())
  918. {
  919. case "0": F_WCount++; break;
  920. case "1": F_CCount++; break;
  921. case "2": F_PCount++; break;
  922. case "3": F_FCount++; break;
  923. }
  924. fordrcount++;
  925. }
  926. }*/
  927. F_WCount = dr.Where(p => p.Field<string>("Ord_Type") == "0").Select(p => p.Field<string>("Ws_Number")).ToList<string>().GroupBy(t => t).Select(t => t.First()).ToList().Count();
  928. F_CCount = dr.Where(p => p.Field<string>("Ord_Type") == "1").Select(p => p.Field<string>("Ws_Number")).ToList<string>().GroupBy(t => t).Select(t => t.First()).ToList().Count();
  929. F_PCount = dr.Where(p => p.Field<string>("Ord_Type") == "2").Select(p => p.Field<string>("Ws_Number")).ToList<string>().GroupBy(t => t).Select(t => t.First()).ToList().Count();
  930. F_FCount = dr.Where(p => p.Field<string>("Ord_Type") == "3").Select(p => p.Field<string>("Ws_Number")).ToList<string>().GroupBy(t => t).Select(t => t.First()).ToList().Count();
  931. fordrcount = F_WCount + F_CCount + F_PCount + F_FCount;
  932. }
  933. if (F_WCount > 0)
  934. {
  935. if (F_StrMagess == "")
  936. { F_StrMagess = "婚纱订单:" + F_WCount; }
  937. else { F_StrMagess = "\r\n婚纱订单:" + F_WCount; }
  938. }
  939. if (F_CCount > 0)
  940. {
  941. if (F_StrMagess == "")
  942. { F_StrMagess += "儿童订单:" + F_CCount; }
  943. else { F_StrMagess += "\r\n儿童订单:" + F_CCount; }
  944. }
  945. if (F_PCount > 0)
  946. {
  947. if (F_StrMagess == "")
  948. { F_StrMagess += "写真订单:" + F_PCount; }
  949. else { F_StrMagess += "\r\n写真订单:" + F_PCount; }
  950. }
  951. if (F_FCount > 0)
  952. {
  953. if (F_StrMagess == "")
  954. { F_StrMagess += "服务订单:" + F_FCount; }
  955. else { F_StrMagess += "\r\n服务订单:" + F_FCount; }
  956. }
  957. if (F_StrMagess != "")
  958. { F_StrMagess = "服务客人\r\n" + F_StrMagess; }
  959. lbl_E.Tag = new LYFZ.ComponentLibrary.ExToolTipText(F_StrMagess);
  960. exToolTip1.SetToolTip(lbl_E, F_StrMagess);
  961. lbl_E.Cursor = Cursors.Hand;
  962. lbl_E.Text = "服务客人: " + fordrcount;
  963. lbl_E.Location = new Point(Location_X, Location_Y + LineSpacing * 5);
  964. lbl_E.Size = lblsize;
  965. lbl_E.TextAlign = ContentAlignment.BottomLeft;
  966. lbl_E.DoubleClick += lbl_E_DoubleClick;
  967. lbl_E.Click += new EventHandler(lbl1_Click);
  968. lbl_E.Font = lblfont;
  969. panel.Controls.Add(lbl_E);
  970. Location_Y += LineSpacing;
  971. #endregion
  972. #region 选衣客人
  973. lbl_F = new Label();
  974. lbl_F.Cursor = Cursors.Hand;
  975. string S_StrMagess = "";
  976. int S_WCount = 0;
  977. int S_CCount = 0;
  978. int S_PCount = 0;
  979. int S_FCount = 0;
  980. fordrcount = 0;
  981. if (tbl_SelectDress.Rows.Count > 0)
  982. {
  983. //DataRow[] dr = tbl_SelectDress.Select("Ordv_ReservationClothingTime >= '" + LYFZ.Command.Command_Validate.DateTimeToString(Starttime, "yyyy-MM-dd HH:mm:ss") + "' and Ordv_ReservationClothingTime < '" + LYFZ.Command.Command_Validate.DateTimeToString(Starttime.AddDays(1), "yyyy-MM-dd HH:mm:ss") + "'", "Ordv_Number");
  984. List<DataRow> dr = tbl_SelectDress.AsEnumerable().Where(
  985. p => p.Field<DateTime>("Ordv_ReservationClothingTime") >= Starttime
  986. &&
  987. p.Field<DateTime>("Ordv_ReservationClothingTime") <= Starttime.AddDays(1)).ToList<DataRow>();
  988. /* for (int j = 0; j < dr.Count; j++)
  989. {
  990. if (j > 0)
  991. {
  992. if (dr[j]["Ordv_Number"].ToString().Trim() != dr[j - 1]["Ordv_Number"].ToString().Trim())
  993. {
  994. switch (dr[j]["Ord_Type"].ToString().Trim())
  995. {
  996. case "0": S_WCount++; break;
  997. case "1": S_CCount++; break;
  998. case "2": S_PCount++; break;
  999. case "3": S_FCount++; break;
  1000. }
  1001. fordrcount++;
  1002. }
  1003. }
  1004. else
  1005. {
  1006. switch (dr[j]["Ord_Type"].ToString().Trim())
  1007. {
  1008. case "0": S_WCount++; break;
  1009. case "1": S_CCount++; break;
  1010. case "2": S_PCount++; break;
  1011. case "3": S_FCount++; break;
  1012. }
  1013. fordrcount++;
  1014. }
  1015. }*/
  1016. S_WCount = dr.Where(p => p.Field<string>("Ord_Type") == "0").Select(p => p.Field<string>("Ordv_Number")).ToList<string>().GroupBy(t => t).Select(t => t.First()).ToList().Count();
  1017. S_CCount = dr.Where(p => p.Field<string>("Ord_Type") == "1").Select(p => p.Field<string>("Ordv_Number")).ToList<string>().GroupBy(t => t).Select(t => t.First()).ToList().Count();
  1018. S_PCount = dr.Where(p => p.Field<string>("Ord_Type") == "2").Select(p => p.Field<string>("Ordv_Number")).ToList<string>().GroupBy(t => t).Select(t => t.First()).ToList().Count();
  1019. S_FCount = dr.Where(p => p.Field<string>("Ord_Type") == "3").Select(p => p.Field<string>("Ordv_Number")).ToList<string>().GroupBy(t => t).Select(t => t.First()).ToList().Count();
  1020. fordrcount = S_WCount + S_CCount + S_PCount + S_FCount;
  1021. }
  1022. if (S_WCount > 0)
  1023. {
  1024. if (S_StrMagess == "")
  1025. { S_StrMagess = "婚纱订单:" + S_WCount; }
  1026. else { S_StrMagess = "\r\n婚纱订单:" + S_WCount; }
  1027. }
  1028. if (S_CCount > 0)
  1029. {
  1030. if (S_StrMagess == "")
  1031. { S_StrMagess += "儿童订单:" + S_CCount; }
  1032. else { S_StrMagess += "\r\n儿童订单:" + S_CCount; }
  1033. }
  1034. if (S_PCount > 0)
  1035. {
  1036. if (S_StrMagess == "")
  1037. { S_StrMagess += "写真订单:" + S_PCount; }
  1038. else { S_StrMagess += "\r\n写真订单:" + S_PCount; }
  1039. }
  1040. if (S_StrMagess != "")
  1041. { S_StrMagess = "选衣客人\r\n" + S_StrMagess; }
  1042. lbl_F.Tag = new LYFZ.ComponentLibrary.ExToolTipText(S_StrMagess);
  1043. exToolTip1.SetToolTip(lbl_F, S_StrMagess);
  1044. lbl_F.Cursor = Cursors.Hand;
  1045. lbl_F.Text = "选衣客人: " + fordrcount;
  1046. lbl_F.Location = new Point(Location_X, Location_Y + LineSpacing * 6);
  1047. lbl_F.Size = lblsize;
  1048. lbl_F.TextAlign = ContentAlignment.BottomLeft;
  1049. lbl_F.DoubleClick += lbl_F_DoubleClick;
  1050. lbl_F.Click += new EventHandler(lbl1_Click);
  1051. lbl_F.Font = lblfont;
  1052. panel.Controls.Add(lbl_F);
  1053. Location_Y += LineSpacing;
  1054. #endregion
  1055. #region 上门派单
  1056. lbl_G = new Label();
  1057. lbl_G.Cursor = Cursors.Hand;
  1058. string SH_StrMagess = "";
  1059. int SH_WCount = 0;
  1060. if (tbl_SendSingle.Rows.Count > 0)
  1061. {
  1062. //DataRow[] dr = tbl_SendSingle.Select("Hdr_DoorTime >= '" + LYFZ.Command.Command_Validate.DateTimeToString(Starttime, "yyyy-MM-dd HH:mm:ss") + "' and Hdr_DoorTime < '" + LYFZ.Command.Command_Validate.DateTimeToString(Starttime.AddDays(1), "yyyy-MM-dd HH:mm:ss") + "'");
  1063. List<DataRow> dr = tbl_SendSingle.AsEnumerable().Where(
  1064. p => p.Field<DateTime>("Hdr_DoorTime") >= Starttime
  1065. &&
  1066. p.Field<DateTime>("Hdr_DoorTime") <= Starttime.AddDays(1)).ToList<DataRow>();
  1067. SH_WCount = dr.Count;
  1068. if (dr.Count > 0)
  1069. { SH_StrMagess = "上门派单:" + SH_WCount; }
  1070. }
  1071. lbl_G.Tag = new LYFZ.ComponentLibrary.ExToolTipText(SH_StrMagess);
  1072. exToolTip1.SetToolTip(lbl_G, SH_StrMagess);
  1073. lbl_G.Cursor = Cursors.Hand;
  1074. lbl_G.Text = "上门派单: " + SH_WCount;
  1075. lbl_G.Location = new Point(Location_X, Location_Y + LineSpacing * 7);
  1076. lbl_G.Size = lblsize;
  1077. lbl_G.TextAlign = ContentAlignment.BottomLeft;
  1078. lbl_G.DoubleClick += lbl_G_DoubleClick;
  1079. lbl_G.Click += new EventHandler(lbl1_Click);
  1080. lbl_G.Font = lblfont;
  1081. panel.Controls.Add(lbl_G);
  1082. #endregion
  1083. string H_StrMagess = "";
  1084. if (P_StrMagess != "")
  1085. {
  1086. H_StrMagess += P_StrMagess;
  1087. }
  1088. if (X_StrMagess != "")
  1089. {
  1090. if (H_StrMagess == "")
  1091. { H_StrMagess += X_StrMagess; }
  1092. else
  1093. { H_StrMagess += "\r\n\r\n" + X_StrMagess; }
  1094. }
  1095. if (K_StrMagess != "")
  1096. {
  1097. if (H_StrMagess == "")
  1098. { H_StrMagess += K_StrMagess; }
  1099. else
  1100. { H_StrMagess += "\r\n\r\n" + K_StrMagess; }
  1101. }
  1102. if (Q_StrMagess != "")
  1103. {
  1104. if (H_StrMagess == "")
  1105. { H_StrMagess += Q_StrMagess; }
  1106. else
  1107. { H_StrMagess += "\r\n\r\n" + Q_StrMagess; }
  1108. }
  1109. if (F_StrMagess != "")
  1110. {
  1111. if (H_StrMagess == "")
  1112. { H_StrMagess += F_StrMagess; }
  1113. else
  1114. { H_StrMagess += "\r\n\r\n" + F_StrMagess; }
  1115. }
  1116. if (S_StrMagess != "")
  1117. {
  1118. if (H_StrMagess == "")
  1119. { H_StrMagess += S_StrMagess; }
  1120. else
  1121. { H_StrMagess += "\r\n\r\n" + S_StrMagess; }
  1122. }
  1123. if (SH_StrMagess != "")
  1124. {
  1125. if (H_StrMagess == "")
  1126. { H_StrMagess += SH_StrMagess; }
  1127. else
  1128. { H_StrMagess += "\r\n\r\n" + SH_StrMagess; }
  1129. }
  1130. //if (H_StrMagess != "")
  1131. //{ H_StrMagess += "\r\n"; }
  1132. panel.Tag = new LYFZ.ComponentLibrary.ExToolTipText(H_StrMagess);
  1133. exToolTip1.SetToolTip(panel, H_StrMagess);
  1134. Location_Y += LineSpacing;
  1135. todays++;
  1136. }
  1137. Panel newpanel = (Panel)tblPanel.Controls["panel" + (Convert.ToInt32(this.nudDataValue + nudDate.Value - 1))];
  1138. newpanel.BackColor = Color.SkyBlue;
  1139. this.nudDataValue = Convert.ToInt32(newpanel.Name.Substring(5, newpanel.Name.Length - 5)) - lblStart;
  1140. }));
  1141. }
  1142. #endregion
  1143. #region 新摄控本图表统计
  1144. List<Model.CameraBook.DayDataModel> BinMouthData(int todays, string Strwhere, DataTable tbl_Photogr, DataTable tbl_FilmSelection, DataTable tbl_LookDesign, DataTable tbl_PickupDate, DataTable tbl_WeddingService, DataTable tbl_SelectDress, DataTable tbl_SendSingle, DataTable tbl_Notes)
  1145. {
  1146. int days = DateTime.DaysInMonth(Convert.ToInt32(this.nudYears.Value), Convert.ToInt32(this.nudMonth.Value));//这个月的天数
  1147. List<Model.CameraBook.DayDataModel> dayDataList = new List<Model.CameraBook.DayDataModel>();
  1148. for (int i = 0; i < days; i++)
  1149. {
  1150. Model.CameraBook.DayDataModel dayModel = new Model.CameraBook.DayDataModel();
  1151. if (i == 0)
  1152. { lblStart = todays; this.nudDataValue = todays; }
  1153. DateTime Starttime = Convert.ToDateTime(this.nudYears.Value + "-" + this.nudMonth.Value + "-" + (i + 1));
  1154. #region 日期
  1155. dayModel.dayNum = (i + 1).ToString();
  1156. if (!this.cmbtreevStoreName.Text.Trim().Equals("全部") && this.cmbtreevStoreName.Text.Trim().Length > 0)
  1157. {
  1158. DataRow dtRow = tbl_Notes.Rows.Find(Starttime.ToString("yyyy-MM-dd HH:mm:ss"));
  1159. if (dtRow != null && dtRow["Ordrr_Remark"].ToString().Trim().Length > 0)
  1160. { dayModel.remark = dtRow["Ordrr_Remark"].ToString(); }
  1161. }
  1162. #endregion
  1163. #region 农历
  1164. string StrText = LYFZ.Command.Command_CalendarTurnLunar.GetLunarNewYearMonthDay(nudYears.Value.ToString().Trim() + "-" + nudMonth.Value.ToString().Trim() + "-" + (i + 1));
  1165. dayModel.strLunar = StrText;
  1166. #endregion
  1167. string P_StrMagess = "";
  1168. int P_WCount = 0;
  1169. int P_CCount = 0;
  1170. int P_PCount = 0;
  1171. int fordrcount = 0;
  1172. //int intHoliday = 0;
  1173. //if (this.cmbtreevStoreName.Tag != null && !string.IsNullOrEmpty(this.cmbtreevStoreName.Tag.ToString().Trim()))
  1174. //{ dtHoliday.Select("StrStoreName = '" + this.cmbtreevStoreName.Tag.ToString().Trim() + "'"); }
  1175. //else
  1176. //{ dtHoliday.Select("StrStoreName = '" + LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID() + "' And ");
  1177. //}
  1178. if (tbl_Photogr.Rows.Count > 0)
  1179. {
  1180. List<DataRow> dr = tbl_Photogr.AsEnumerable().Where(
  1181. p => p.Field<DateTime>("Ordpg_ReservationPhotographyTime") >= Starttime
  1182. &&
  1183. p.Field<DateTime>("Ordpg_ReservationPhotographyTime") < Starttime.AddDays(1)).ToList<DataRow>();
  1184. P_WCount = dr.Where(p => p.Field<string>("Ord_Type") == "0").Select(p => p.Field<string>("Ordpg_Number")).ToList<string>().GroupBy(t => t).Select(t => t.First()).ToList().Count();
  1185. P_CCount = dr.Where(p => p.Field<string>("Ord_Type") == "1").Select(p => p.Field<string>("Ordpg_Number")).ToList<string>().GroupBy(t => t).Select(t => t.First()).ToList().Count();
  1186. P_PCount = dr.Where(p => p.Field<string>("Ord_Type") == "2").Select(p => p.Field<string>("Ordpg_Number")).ToList<string>().GroupBy(t => t).Select(t => t.First()).ToList().Count();
  1187. fordrcount = P_WCount + P_CCount + P_PCount;
  1188. }
  1189. if (P_WCount > 0)
  1190. { P_StrMagess = "婚纱订单:" + P_WCount + " "; }
  1191. if (P_CCount > 0)
  1192. {
  1193. if (P_StrMagess == "")
  1194. { P_StrMagess += "儿童订单:" + P_CCount + " "; }
  1195. else { P_StrMagess += "\r\n儿童订单:" + P_CCount + " "; }
  1196. }
  1197. if (P_PCount > 0)
  1198. {
  1199. if (P_StrMagess == "")
  1200. { P_StrMagess += "写真订单:" + P_PCount + " "; }
  1201. else { P_StrMagess += "\r\n写真订单:" + P_PCount + " "; }
  1202. }
  1203. dayModel.list.Add(new Model.CameraBook.DayDataItemModel()
  1204. {
  1205. Name = "拍照客人: ",
  1206. Number = fordrcount.ToString(),
  1207. TipText = P_StrMagess
  1208. });
  1209. if (P_StrMagess != "")
  1210. { P_StrMagess = "拍照客人\r\n" + P_StrMagess; }
  1211. dayModel.TipText = P_StrMagess;
  1212. #region 选片客人
  1213. string X_StrMagess = "";
  1214. int X_WCount = 0;
  1215. int X_CCount = 0;
  1216. int X_PCount = 0;
  1217. fordrcount = 0;
  1218. if (tbl_FilmSelection.Rows.Count > 0)
  1219. {
  1220. //DataRow[] dr = tbl_FilmSelection.Select("Ordv_ReservationFilmSelectionTime >= '" + LYFZ.Command.Command_Validate.DateTimeToString(Starttime, "yyyy-MM-dd HH:mm:ss") + "' and Ordv_ReservationFilmSelectionTime < '" + LYFZ.Command.Command_Validate.DateTimeToString(Starttime.AddDays(1), "yyyy-MM-dd HH:mm:ss") + "'", "Ordv_Number");
  1221. List<DataRow> dr = tbl_FilmSelection.AsEnumerable().Where(
  1222. p => p.Field<DateTime>("Ordv_ReservationFilmSelectionTime") >= Starttime
  1223. &&
  1224. p.Field<DateTime>("Ordv_ReservationFilmSelectionTime") < Starttime.AddDays(1)).ToList<DataRow>();
  1225. X_WCount = dr.Where(p => p.Field<string>("Ord_Type") == "0").Select(p => p.Field<string>("Ordv_Number")).ToList<string>().GroupBy(t => t).Select(t => t.First()).ToList().Count();
  1226. X_CCount = dr.Where(p => p.Field<string>("Ord_Type") == "1").Select(p => p.Field<string>("Ordv_Number")).ToList<string>().GroupBy(t => t).Select(t => t.First()).ToList().Count();
  1227. X_PCount = dr.Where(p => p.Field<string>("Ord_Type") == "2").Select(p => p.Field<string>("Ordv_Number")).ToList<string>().GroupBy(t => t).Select(t => t.First()).ToList().Count();
  1228. fordrcount = X_WCount + X_CCount + X_PCount;
  1229. }
  1230. if (X_WCount > 0)
  1231. {
  1232. if (X_StrMagess == "")
  1233. { X_StrMagess = "婚纱订单:" + X_WCount; }
  1234. else
  1235. { X_StrMagess = "\r\n婚纱订单:" + X_WCount; }
  1236. }
  1237. if (X_CCount > 0)
  1238. {
  1239. if (X_StrMagess == "")
  1240. { X_StrMagess += "儿童订单:" + X_CCount; }
  1241. else { X_StrMagess += "\r\n儿童订单:" + X_CCount; }
  1242. }
  1243. if (X_PCount > 0)
  1244. {
  1245. if (X_StrMagess == "")
  1246. { X_StrMagess += "写真订单:" + X_PCount; }
  1247. else
  1248. { X_StrMagess += "\r\n写真订单:" + X_PCount; }
  1249. }
  1250. dayModel.list.Add(new Model.CameraBook.DayDataItemModel()
  1251. {
  1252. Name = "选片客人: ",
  1253. Number = fordrcount.ToString(),
  1254. TipText = X_StrMagess
  1255. });
  1256. if (X_StrMagess != "")
  1257. { X_StrMagess = "选片客人\r\n" + X_StrMagess; }
  1258. dayModel.TipText = X_StrMagess;
  1259. #endregion
  1260. #region 看样客人
  1261. string K_StrMagess = "";
  1262. int K_WCount = 0;
  1263. int K_CCount = 0;
  1264. int K_PCount = 0;
  1265. fordrcount = 0;
  1266. if (tbl_LookDesign.Rows.Count > 0)
  1267. {
  1268. //DataRow[] dr = tbl_LookDesign.Select("Ordv_ReservationLookDesignTime >= '" + LYFZ.Command.Command_Validate.DateTimeToString(Starttime, "yyyy-MM-dd HH:mm:ss") + "' and Ordv_ReservationLookDesignTime < '" + LYFZ.Command.Command_Validate.DateTimeToString(Starttime.AddDays(1), "yyyy-MM-dd HH:mm:ss") + "'", "Ordv_Number");
  1269. List<DataRow> dr = tbl_LookDesign.AsEnumerable().Where(
  1270. p => p.Field<DateTime>("Ordv_ReservationLookDesignTime") >= Starttime
  1271. &&
  1272. p.Field<DateTime>("Ordv_ReservationLookDesignTime") < Starttime.AddDays(1)).ToList<DataRow>();
  1273. K_WCount = dr.Where(p => p.Field<string>("Ord_Type") == "0").Select(p => p.Field<string>("Ordv_Number")).ToList<string>().GroupBy(t => t).Select(t => t.First()).ToList().Count();
  1274. K_CCount = dr.Where(p => p.Field<string>("Ord_Type") == "1").Select(p => p.Field<string>("Ordv_Number")).ToList<string>().GroupBy(t => t).Select(t => t.First()).ToList().Count();
  1275. K_PCount = dr.Where(p => p.Field<string>("Ord_Type") == "2").Select(p => p.Field<string>("Ordv_Number")).ToList<string>().GroupBy(t => t).Select(t => t.First()).ToList().Count();
  1276. fordrcount = K_WCount + K_CCount + K_PCount;
  1277. }
  1278. if (K_WCount > 0)
  1279. {
  1280. if (K_StrMagess == "")
  1281. { K_StrMagess = "婚纱订单:" + K_WCount; }
  1282. else
  1283. { K_StrMagess = "\r\n婚纱订单:" + K_WCount; }
  1284. }
  1285. if (K_CCount > 0)
  1286. {
  1287. if (K_StrMagess == "")
  1288. { K_StrMagess += "儿童订单:" + K_CCount; }
  1289. else
  1290. { K_StrMagess += "\r\n儿童订单:" + K_CCount; }
  1291. }
  1292. if (K_PCount > 0)
  1293. {
  1294. if (K_StrMagess == "")
  1295. { K_StrMagess += "写真订单:" + K_PCount; }
  1296. else
  1297. { K_StrMagess += "\r\n写真订单:" + K_PCount; }
  1298. }
  1299. dayModel.list.Add(new Model.CameraBook.DayDataItemModel()
  1300. {
  1301. Name = "看样客人: ",
  1302. Number = fordrcount.ToString(),
  1303. TipText = K_StrMagess
  1304. });
  1305. if (K_StrMagess != "")
  1306. { K_StrMagess = "看样客人\r\n" + K_StrMagess; }
  1307. dayModel.TipText = K_StrMagess;
  1308. #endregion
  1309. #region 取件客人
  1310. string Q_StrMagess = "";
  1311. int Q_WCount = 0;
  1312. int Q_CCount = 0;
  1313. int Q_PCount = 0;
  1314. fordrcount = 0;
  1315. if (tbl_PickupDate.Rows.Count > 0)
  1316. {
  1317. //DataRow[] dr = tbl_PickupDate.Select("OPlist_ReservationTakeTime >= '" + LYFZ.Command.Command_Validate.DateTimeToString(Starttime, "yyyy-MM-dd HH:mm:ss") + "' and OPlist_ReservationTakeTime < '" + LYFZ.Command.Command_Validate.DateTimeToString(Starttime.AddDays(1), "yyyy-MM-dd HH:mm:ss") + "'", "OPlist_OrderNumber");
  1318. List<DataRow> dr = tbl_PickupDate.AsEnumerable().Where(
  1319. p => p.Field<DateTime>("OPlist_ReservationTakeTime") >= Starttime
  1320. &&
  1321. p.Field<DateTime>("OPlist_ReservationTakeTime") < Starttime.AddDays(1)).ToList<DataRow>();
  1322. Q_WCount = dr.Where(p => p.Field<string>("Ord_Type") == "0").Select(p => p.Field<string>("OPlist_OrderNumber")).ToList<string>().GroupBy(t => t).Select(t => t.First()).ToList().Count();
  1323. Q_CCount = dr.Where(p => p.Field<string>("Ord_Type") == "1").Select(p => p.Field<string>("OPlist_OrderNumber")).ToList<string>().GroupBy(t => t).Select(t => t.First()).ToList().Count();
  1324. Q_PCount = dr.Where(p => p.Field<string>("Ord_Type") == "2").Select(p => p.Field<string>("OPlist_OrderNumber")).ToList<string>().GroupBy(t => t).Select(t => t.First()).ToList().Count();
  1325. fordrcount = Q_WCount + Q_CCount + Q_PCount;
  1326. }
  1327. if (Q_WCount > 0)
  1328. {
  1329. if (Q_StrMagess == "")
  1330. { Q_StrMagess = "婚纱订单:" + Q_WCount; }
  1331. else
  1332. { Q_StrMagess = "\r\n婚纱订单:" + Q_WCount; }
  1333. }
  1334. if (Q_CCount > 0)
  1335. {
  1336. if (Q_StrMagess == "")
  1337. { Q_StrMagess += "儿童订单:" + Q_CCount; }
  1338. else
  1339. { Q_StrMagess += "\r\n儿童订单:" + Q_CCount; }
  1340. }
  1341. if (Q_PCount > 0)
  1342. {
  1343. if (Q_StrMagess == "")
  1344. { Q_StrMagess += "写真订单:" + Q_PCount; }
  1345. else
  1346. { Q_StrMagess += "\r\n写真订单:" + Q_PCount; }
  1347. }
  1348. dayModel.list.Add(new Model.CameraBook.DayDataItemModel()
  1349. {
  1350. Name = "取件客人: ",
  1351. Number = fordrcount.ToString(),
  1352. TipText = Q_StrMagess
  1353. });
  1354. if (Q_StrMagess != "")
  1355. { Q_StrMagess = "取件客人\r\n" + Q_StrMagess; }
  1356. dayModel.TipText = X_StrMagess;
  1357. #endregion
  1358. #region 服务客人
  1359. string F_StrMagess = "";
  1360. int F_WCount = 0;
  1361. int F_CCount = 0;
  1362. int F_PCount = 0;
  1363. int F_FCount = 0;
  1364. int F_HCount = 0;
  1365. fordrcount = 0;
  1366. if (tbl_WeddingService.Rows.Count > 0)
  1367. {
  1368. //DataRow[] dr = tbl_WeddingService.Select("Ws_WeddingDate >= '" + LYFZ.Command.Command_Validate.DateTimeToString(Starttime, "yyyy-MM-dd HH:mm:ss") + "' and Ws_WeddingDate < '" + LYFZ.Command.Command_Validate.DateTimeToString(Starttime.AddDays(1), "yyyy-MM-dd HH:mm:ss") + "'", "Ws_Number");
  1369. List<DataRow> dr = tbl_WeddingService.AsEnumerable().Where(
  1370. p => p.Field<DateTime>("Ws_WeddingDate") >= Starttime
  1371. &&
  1372. p.Field<DateTime>("Ws_WeddingDate") < Starttime.AddDays(1)).ToList<DataRow>();
  1373. F_WCount = dr.Where(p => p.Field<string>("Ord_Type") == "0").Select(p => p.Field<string>("Ws_Number")).ToList<string>().GroupBy(t => t).Select(t => t.First()).ToList().Count();
  1374. F_CCount = dr.Where(p => p.Field<string>("Ord_Type") == "1").Select(p => p.Field<string>("Ws_Number")).ToList<string>().GroupBy(t => t).Select(t => t.First()).ToList().Count();
  1375. F_PCount = dr.Where(p => p.Field<string>("Ord_Type") == "2").Select(p => p.Field<string>("Ws_Number")).ToList<string>().GroupBy(t => t).Select(t => t.First()).ToList().Count();
  1376. F_FCount = dr.Where(p => p.Field<string>("Ord_Type") == "3").Select(p => p.Field<string>("Ws_Number")).ToList<string>().GroupBy(t => t).Select(t => t.First()).ToList().Count();
  1377. F_HCount = dr.Where(p => p.Field<string>("Ord_Type") == "4").Select(p => p.Field<string>("Ws_Number")).ToList<string>().GroupBy(t => t).Select(t => t.First()).ToList().Count();
  1378. fordrcount = F_WCount + F_CCount + F_PCount + F_FCount+ F_HCount;
  1379. }
  1380. if (F_WCount > 0)
  1381. {
  1382. if (F_StrMagess == "")
  1383. { F_StrMagess = "婚纱订单:" + F_WCount; }
  1384. else { F_StrMagess = "\r\n婚纱订单:" + F_WCount; }
  1385. }
  1386. if (F_CCount > 0)
  1387. {
  1388. if (F_StrMagess == "")
  1389. { F_StrMagess += "儿童订单:" + F_CCount; }
  1390. else { F_StrMagess += "\r\n儿童订单:" + F_CCount; }
  1391. }
  1392. if (F_PCount > 0)
  1393. {
  1394. if (F_StrMagess == "")
  1395. { F_StrMagess += "写真订单:" + F_PCount; }
  1396. else { F_StrMagess += "\r\n写真订单:" + F_PCount; }
  1397. }
  1398. if (F_FCount > 0)
  1399. {
  1400. if (F_StrMagess == "")
  1401. { F_StrMagess += "服务订单:" + F_FCount; }
  1402. else { F_StrMagess += "\r\n服务订单:" + F_FCount; }
  1403. }
  1404. if (F_HCount > 0)
  1405. {
  1406. if (F_StrMagess == "")
  1407. { F_StrMagess += "婚庆订单:" + F_HCount; }
  1408. else { F_StrMagess += "\r\n服务订单:" + F_HCount; }
  1409. }
  1410. dayModel.list.Add(new Model.CameraBook.DayDataItemModel()
  1411. {
  1412. Name = "服务客人: ",
  1413. Number = fordrcount.ToString(),
  1414. TipText = F_StrMagess
  1415. });
  1416. if (F_StrMagess != "")
  1417. { F_StrMagess = "服务客人\r\n" + F_StrMagess; }
  1418. dayModel.TipText = F_StrMagess;
  1419. #endregion
  1420. #region 选衣客人
  1421. string S_StrMagess = "";
  1422. int S_WCount = 0;
  1423. int S_CCount = 0;
  1424. int S_PCount = 0;
  1425. int S_FCount = 0;
  1426. fordrcount = 0;
  1427. if (tbl_SelectDress.Rows.Count > 0)
  1428. {
  1429. //DataRow[] dr = tbl_SelectDress.Select("Ordv_ReservationClothingTime >= '" + LYFZ.Command.Command_Validate.DateTimeToString(Starttime, "yyyy-MM-dd HH:mm:ss") + "' and Ordv_ReservationClothingTime < '" + LYFZ.Command.Command_Validate.DateTimeToString(Starttime.AddDays(1), "yyyy-MM-dd HH:mm:ss") + "'", "Ordv_Number");
  1430. List<DataRow> dr = tbl_SelectDress.AsEnumerable().Where(
  1431. p => p.Field<DateTime>("Ordv_ReservationClothingTime") >= Starttime
  1432. &&
  1433. p.Field<DateTime>("Ordv_ReservationClothingTime") < Starttime.AddDays(1)).ToList<DataRow>();
  1434. S_WCount = dr.Where(p => p.Field<string>("Ord_Type") == "0").Select(p => p.Field<string>("Ordv_Number")).ToList<string>().GroupBy(t => t).Select(t => t.First()).ToList().Count();
  1435. S_CCount = dr.Where(p => p.Field<string>("Ord_Type") == "1").Select(p => p.Field<string>("Ordv_Number")).ToList<string>().GroupBy(t => t).Select(t => t.First()).ToList().Count();
  1436. S_PCount = dr.Where(p => p.Field<string>("Ord_Type") == "2").Select(p => p.Field<string>("Ordv_Number")).ToList<string>().GroupBy(t => t).Select(t => t.First()).ToList().Count();
  1437. S_FCount = dr.Where(p => p.Field<string>("Ord_Type") == "3").Select(p => p.Field<string>("Ordv_Number")).ToList<string>().GroupBy(t => t).Select(t => t.First()).ToList().Count();
  1438. fordrcount = S_WCount + S_CCount + S_PCount + S_FCount;
  1439. }
  1440. if (S_WCount > 0)
  1441. {
  1442. if (S_StrMagess == "")
  1443. { S_StrMagess = "婚纱订单:" + S_WCount; }
  1444. else { S_StrMagess = "\r\n婚纱订单:" + S_WCount; }
  1445. }
  1446. if (S_CCount > 0)
  1447. {
  1448. if (S_StrMagess == "")
  1449. { S_StrMagess += "儿童订单:" + S_CCount; }
  1450. else { S_StrMagess += "\r\n儿童订单:" + S_CCount; }
  1451. }
  1452. if (S_PCount > 0)
  1453. {
  1454. if (S_StrMagess == "")
  1455. { S_StrMagess += "写真订单:" + S_PCount; }
  1456. else { S_StrMagess += "\r\n写真订单:" + S_PCount; }
  1457. }
  1458. dayModel.list.Add(new Model.CameraBook.DayDataItemModel()
  1459. {
  1460. Name = "选衣客人: ",
  1461. Number = fordrcount.ToString(),
  1462. TipText = S_StrMagess
  1463. });
  1464. if (S_StrMagess != "")
  1465. { S_StrMagess = "选衣客人\r\n" + S_StrMagess; }
  1466. dayModel.TipText = S_StrMagess;
  1467. #endregion
  1468. #region 上门派单
  1469. string SH_StrMagess = "";
  1470. int SH_WCount = 0;
  1471. if (tbl_SendSingle.Rows.Count > 0)
  1472. {
  1473. //DataRow[] dr = tbl_SendSingle.Select("Hdr_DoorTime >= '" + LYFZ.Command.Command_Validate.DateTimeToString(Starttime, "yyyy-MM-dd HH:mm:ss") + "' and Hdr_DoorTime < '" + LYFZ.Command.Command_Validate.DateTimeToString(Starttime.AddDays(1), "yyyy-MM-dd HH:mm:ss") + "'");
  1474. List<DataRow> dr = tbl_SendSingle.AsEnumerable().Where(
  1475. p => p.Field<DateTime>("Hdr_DoorTime") >= Starttime
  1476. &&
  1477. p.Field<DateTime>("Hdr_DoorTime") < Starttime.AddDays(1)).ToList<DataRow>();
  1478. SH_WCount = dr.Count;
  1479. if (dr.Count > 0)
  1480. {
  1481. dayModel.list.Add(new Model.CameraBook.DayDataItemModel()
  1482. {
  1483. Name = "上门派单: ",
  1484. Number = SH_WCount.ToString(),
  1485. TipText = SH_StrMagess
  1486. });
  1487. if (SH_StrMagess != "")
  1488. { SH_StrMagess = "上门派单\r\n" + SH_StrMagess; }
  1489. dayModel.TipText = SH_StrMagess;
  1490. }
  1491. }
  1492. else
  1493. {
  1494. dayModel.list.Add(new Model.CameraBook.DayDataItemModel()
  1495. {
  1496. Name = "上门派单: ",
  1497. Number = "0",
  1498. TipText = ""
  1499. });
  1500. if (SH_StrMagess != "")
  1501. { SH_StrMagess = "上门派单\r\n" + SH_StrMagess; }
  1502. dayModel.TipText = SH_StrMagess;
  1503. }
  1504. #endregion
  1505. string H_StrMagess = "";
  1506. if (P_StrMagess != "")
  1507. {
  1508. H_StrMagess += P_StrMagess;
  1509. }
  1510. if (X_StrMagess != "")
  1511. {
  1512. if (H_StrMagess == "")
  1513. { H_StrMagess += X_StrMagess; }
  1514. else
  1515. { H_StrMagess += "\r\n\r\n" + X_StrMagess; }
  1516. }
  1517. if (K_StrMagess != "")
  1518. {
  1519. if (H_StrMagess == "")
  1520. { H_StrMagess += K_StrMagess; }
  1521. else
  1522. { H_StrMagess += "\r\n\r\n" + K_StrMagess; }
  1523. }
  1524. if (Q_StrMagess != "")
  1525. {
  1526. if (H_StrMagess == "")
  1527. { H_StrMagess += Q_StrMagess; }
  1528. else
  1529. { H_StrMagess += "\r\n\r\n" + Q_StrMagess; }
  1530. }
  1531. if (F_StrMagess != "")
  1532. {
  1533. if (H_StrMagess == "")
  1534. { H_StrMagess += F_StrMagess; }
  1535. else
  1536. { H_StrMagess += "\r\n\r\n" + F_StrMagess; }
  1537. }
  1538. if (S_StrMagess != "")
  1539. {
  1540. if (H_StrMagess == "")
  1541. { H_StrMagess += S_StrMagess; }
  1542. else
  1543. { H_StrMagess += "\r\n\r\n" + S_StrMagess; }
  1544. }
  1545. if (SH_StrMagess != "")
  1546. {
  1547. if (H_StrMagess == "")
  1548. { H_StrMagess += SH_StrMagess; }
  1549. else
  1550. { H_StrMagess += "\r\n\r\n" + SH_StrMagess; }
  1551. }
  1552. //if (H_StrMagess != "")
  1553. //{ H_StrMagess += "\r\n"; }
  1554. dayModel.TipText = H_StrMagess;
  1555. dayDataList.Add(dayModel);
  1556. todays++;
  1557. }
  1558. return dayDataList;
  1559. }
  1560. void BindMouthControl3(int todays, List<Model.CameraBook.DayDataModel> dayModelList)
  1561. {
  1562. this.Invoke(new LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.UpdateControl(delegate ()
  1563. {
  1564. int days = DateTime.DaysInMonth(Convert.ToInt32(this.nudYears.Value), Convert.ToInt32(this.nudMonth.Value));//这个月的天数
  1565. int panellenght = 0;
  1566. Size lblsize = new System.Drawing.Size(120, 17);
  1567. Font lblfont = new System.Drawing.Font("微软雅黑", 14, FontStyle.Regular, GraphicsUnit.Pixel);
  1568. int LineSpacing = (lblfont.Height / 2) + 2;
  1569. int Location_X = 5;
  1570. Label lbl_A = null;
  1571. int lbl1_Width = 0;
  1572. for (int i = 0; i < days; i++)
  1573. {
  1574. Model.CameraBook.DayDataModel model = dayModelList[i];
  1575. panellenght++;
  1576. CameraBookDayControl panel = (CameraBookDayControl)tblPanel.Controls["panel" + (i + todays)];
  1577. panel.SetDayDataModel(model);
  1578. panel.Tag = model.TipText;
  1579. if (DateTime.Now.ToString("yyyy-MM-dd") == (this.nudYears.Value.ToString("0000") + "-" + this.nudMonth.Value.ToString("00") + "-" + (i + 1).ToString("00")))
  1580. {
  1581. panel.BackColor = Color.SkyBlue;
  1582. }
  1583. }
  1584. }));
  1585. }
  1586. #endregion
  1587. //void BindMouthControl2(int todays, List<Model.CameraBook.DayDataModel> dayModelList)
  1588. //{
  1589. // this.Invoke(new LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.UpdateControl(delegate ()
  1590. // {
  1591. // int days = DateTime.DaysInMonth(Convert.ToInt32(this.nudYears.Value), Convert.ToInt32(this.nudMonth.Value));//这个月的天数
  1592. // int panellenght = 0;
  1593. // Size lblsize = new System.Drawing.Size(120, 17);
  1594. // Font lblfont = new System.Drawing.Font("微软雅黑", 14, FontStyle.Regular, GraphicsUnit.Pixel);
  1595. // int LineSpacing = (lblfont.Height / 2) + 2;
  1596. // int Location_X = 5;
  1597. // Label lbl_A = null;
  1598. // int lbl1_Width = 0;
  1599. // for (int i = 0; i < days; i++)
  1600. // {
  1601. // Model.CameraBook.DayDataModel model = dayModelList[i];
  1602. // panellenght++;
  1603. // Panel panel = (Panel)tblPanel.Controls["panel" + (i+ todays)];
  1604. // Label lbl1 = new Label();
  1605. // lbl1.Text = (i + 1).ToString();
  1606. // lbl1.Name = "lbl" + i;
  1607. // lbl1.Location = new Point(Location_X, 2);
  1608. // lbl1.Size = new System.Drawing.Size(40, 20);
  1609. // lbl1.TextAlign = ContentAlignment.TopLeft;
  1610. // lbl1.DoubleClick += new EventHandler(lbl1_DoubleClick);
  1611. // lbl1.Click += new EventHandler(lbl1_Click);
  1612. // lbl1.Font = new System.Drawing.Font("宋体", 15, FontStyle.Bold);
  1613. // if (!this.cmbtreevStoreName.Text.Trim().Equals("全部") && this.cmbtreevStoreName.Text.Trim().Length > 0)
  1614. // {
  1615. // //DataRow dtRow = tbl_Notes.Rows.Find(Starttime.ToString("yyyy-MM-dd HH:mm:ss"));
  1616. // if (model.remark.Trim().Length > 0)
  1617. // { lbl1.ForeColor = Color.Blue; }
  1618. // else
  1619. // { lbl1.ForeColor = Color.Red; }
  1620. // lbl1.Cursor = Cursors.Hand;
  1621. // lbl1.Tag = new LYFZ.ComponentLibrary.ExToolTipText("随笔便签");
  1622. // exToolTip1.SetToolTip(lbl1, "随笔便签");
  1623. // }
  1624. // else
  1625. // { lbl1.ForeColor = Color.Red; }
  1626. // panel.Controls.Add(lbl1);
  1627. // lbl1_Width = lbl1.Size.Width;
  1628. // lbl1 = new Label();
  1629. // lbl1.Text = model.strLunar;
  1630. // lbl1.Location = new Point(lbl1_Width + Location_X, 7);
  1631. // lbl1.AutoSize = false;
  1632. // lbl1.Size = new System.Drawing.Size(50, 17);
  1633. // lbl1.DoubleClick += new EventHandler(lbl1_DoubleClick);
  1634. // lbl1.Click += new EventHandler(lbl1_Click);
  1635. // lbl1.Font = new System.Drawing.Font("宋体", 8, FontStyle.Regular);
  1636. // panel.Controls.Add(lbl1);
  1637. // int Location_Y = 15;
  1638. // int indx = 0;
  1639. // foreach (var item in model.list)
  1640. // {
  1641. // indx++;
  1642. // lbl_A = new Label();
  1643. // lbl_A.Cursor = Cursors.Hand;
  1644. // lbl_A.Tag = new LYFZ.ComponentLibrary.ExToolTipText(item.TipText);
  1645. // exToolTip1.SetToolTip(lbl_A, item.TipText);
  1646. // lbl_A.Text = item.Name + "" + item.Number;
  1647. // lbl_A.Location = new Point(Location_X, Location_Y + LineSpacing * indx);
  1648. // lbl_A.Size = lblsize;
  1649. // lbl_A.TextAlign = ContentAlignment.BottomLeft;
  1650. // if(item.Name.Contains("拍照"))
  1651. // {
  1652. // lbl_A.DoubleClick += lbl_A_DoubleClick;
  1653. // }
  1654. // else if (item.Name.Contains("选片"))
  1655. // {
  1656. // lbl_A.DoubleClick += lbl_B_DoubleClick;
  1657. // }
  1658. // else if (item.Name.Contains("看样"))
  1659. // {
  1660. // lbl_A.DoubleClick += lbl_C_DoubleClick;
  1661. // }
  1662. // else if (item.Name.Contains("取件"))
  1663. // {
  1664. // lbl_A.DoubleClick += lbl_D_DoubleClick;
  1665. // }
  1666. // else if (item.Name.Contains("服务"))
  1667. // {
  1668. // lbl_A.DoubleClick += lbl_E_DoubleClick;
  1669. // }
  1670. // else if (item.Name.Contains("选衣"))
  1671. // {
  1672. // lbl_A.DoubleClick += lbl_F_DoubleClick;
  1673. // }
  1674. // else if (item.Name.Contains("上门派单"))
  1675. // {
  1676. // lbl_A.DoubleClick += lbl_G_DoubleClick;
  1677. // }
  1678. // lbl_A.Click += new EventHandler(lbl1_Click);
  1679. // lbl_A.Font = lblfont;
  1680. // panel.Controls.Add(lbl_A);
  1681. // Location_Y += LineSpacing;
  1682. // }
  1683. // panel.Tag = new LYFZ.ComponentLibrary.ExToolTipText(model.TipText);
  1684. // exToolTip1.SetToolTip(panel, model.TipText);
  1685. // }
  1686. // Panel newpanel = (Panel)tblPanel.Controls["panel" + (Convert.ToInt32(this.nudDataValue + nudDate.Value - 1))];
  1687. // newpanel.BackColor = Color.SkyBlue;
  1688. // }));
  1689. //}
  1690. #endregion
  1691. /// <summary>
  1692. /// 拍照客人双击事件
  1693. /// </summary>
  1694. /// <param name="sender"></param>
  1695. /// <param name="e"></param>
  1696. void lbl_A_DoubleClick(object sender, EventArgs e)
  1697. {
  1698. this.rdoPhotographed.Checked = true;
  1699. this.rdoPhotographed_Click(this, null);
  1700. }
  1701. /// <summary>
  1702. /// 选片客人双击事件
  1703. /// </summary>
  1704. /// <param name="sender"></param>
  1705. /// <param name="e"></param>
  1706. void lbl_B_DoubleClick(object sender, EventArgs e)
  1707. {
  1708. this.rdoFilmSelection.Checked = true;
  1709. this.rdoFilmSelection_Click(this, null);
  1710. }
  1711. /// <summary>
  1712. /// 看样客人双击事件
  1713. /// </summary>
  1714. /// <param name="sender"></param>
  1715. /// <param name="e"></param>
  1716. void lbl_C_DoubleClick(object sender, EventArgs e)
  1717. {
  1718. this.rdoLookDesign.Checked = true;
  1719. this.rdoLookDesign_Click(this, null);
  1720. }
  1721. /// <summary>
  1722. /// 取件客人双击事件
  1723. /// </summary>
  1724. /// <param name="sender"></param>
  1725. /// <param name="e"></param>
  1726. void lbl_D_DoubleClick(object sender, EventArgs e)
  1727. {
  1728. this.rdoTotakePiece.Checked = true;
  1729. this.rdoTotakePiece_Click(this, null);
  1730. }
  1731. /// <summary>
  1732. /// 服务客人双击事件
  1733. /// </summary>
  1734. /// <param name="sender"></param>
  1735. /// <param name="e"></param>
  1736. void lbl_E_DoubleClick(object sender, EventArgs e)
  1737. {
  1738. this.rdoService.Checked = true;
  1739. this.rdoService_Click(this, null);
  1740. }
  1741. /// <summary>
  1742. /// 选衣客人双击事件
  1743. /// </summary>
  1744. /// <param name="sender"></param>
  1745. /// <param name="e"></param>
  1746. void lbl_F_DoubleClick(object sender, EventArgs e)
  1747. {
  1748. this.rdoSelectDress.Checked = true;
  1749. this.rdoSelectDress_Click(this, null);
  1750. }
  1751. /// <summary>
  1752. /// 上门派单双击事件
  1753. /// </summary>
  1754. /// <param name="sender"></param>
  1755. /// <param name="e"></param>
  1756. void lbl_G_DoubleClick(object sender, EventArgs e)
  1757. {
  1758. this.rdoHospitalClient.Checked = true;
  1759. this.rdoHospitalClient_Click(this, null);
  1760. }
  1761. /// <summary>
  1762. /// 绘出每周
  1763. /// </summary>
  1764. void PaintingWeekly()
  1765. {
  1766. //绑定数据
  1767. for (int i = 1; i < 50; i++)
  1768. {
  1769. CameraBookDayControl newpanel = (CameraBookDayControl)tblPanel.Controls["panel" + i];
  1770. if (newpanel == null)
  1771. { continue; }
  1772. newpanel.SetDayDataModel(null);
  1773. for (int j = 0; j < newpanel.Controls.Count; j++)
  1774. { newpanel.Controls.Clear(); }
  1775. }
  1776. DateTime dttime = Convert.ToDateTime(this.nudYears.Value.ToString().Trim() + "-" + this.nudMonth.Value.ToString().Trim() + "-" + 1);
  1777. switch (dttime.DayOfWeek.ToString())
  1778. {
  1779. //星期日
  1780. case "Sunday":
  1781. this.PaintingCharts(1);
  1782. break;
  1783. //星期一
  1784. case "Monday":
  1785. this.PaintingCharts(2);
  1786. break;
  1787. //星期二
  1788. case "Tuesday":
  1789. this.PaintingCharts(3);
  1790. break;
  1791. //星期三
  1792. case "Wednesday":
  1793. this.PaintingCharts(4);
  1794. break;
  1795. //星期四
  1796. case "Thursday":
  1797. this.PaintingCharts(5);
  1798. break;
  1799. //星期五
  1800. case "Friday":
  1801. this.PaintingCharts(6);
  1802. break;
  1803. //星期六
  1804. case "Saturday":
  1805. this.PaintingCharts(7);
  1806. break;
  1807. }
  1808. }
  1809. /// <summary>
  1810. /// 当月的第一天是从本星期的第几天开始绘画
  1811. /// </summary>
  1812. int lblStart = 0;
  1813. /// <summary>
  1814. /// 单击选中当天,调用panel_Click();
  1815. /// </summary>
  1816. /// <param name="sender"></param>
  1817. /// <param name="e"></param>
  1818. void lbl1_Click(object sender, EventArgs e)
  1819. {
  1820. this.nudDate.Focus();
  1821. Label lbl = (Label)sender;
  1822. Panel panel = (Panel)lbl.Parent;
  1823. this.panel_Click(panel, e);
  1824. if (!this.cmbtreevStoreName.Text.Trim().Equals("全部") && this.cmbtreevStoreName.Text.Trim().Length > 0 && lbl.Name.Trim().IndexOf("lbl") != -1)
  1825. {
  1826. LYFZ.Software.MainBusiness.CameraControlBook.SuperSmallForm.CameraControlNotesSuperSmallForm frm = new SuperSmallForm.CameraControlNotesSuperSmallForm();
  1827. frm.StrStoreName = this.cmbtreevStoreName.Tag.ToString().Trim();
  1828. frm.StrDateValue = Convert.ToDateTime(this.nudYears.Value + "-" + this.nudMonth.Value + "-" + lbl.Text.Trim()).ToString("yyyy-MM-dd");
  1829. frm.ShowDialog();
  1830. if (frm.IsSaveed)
  1831. {
  1832. if (frm.intCurrentLength > 0)
  1833. { lbl.ForeColor = Color.Blue; }
  1834. else
  1835. { lbl.ForeColor = Color.Red; }
  1836. }
  1837. }
  1838. }
  1839. /// <summary>
  1840. /// 双击Label时间调用panel_DoubleClick();
  1841. /// </summary>
  1842. /// <param name="sender"></param>
  1843. /// <param name="e"></param>
  1844. void lbl1_DoubleClick(object sender, EventArgs e)
  1845. {
  1846. if (!this.cmbtreevStoreName.Text.Trim().Equals("全部") && this.cmbtreevStoreName.Text.Trim().Length > 0)
  1847. { this.lbl1_Click(sender, e); }
  1848. else
  1849. {
  1850. this.nudDate.Focus();
  1851. Label lbl = (Label)sender;
  1852. Panel panel = (Panel)lbl.Parent;
  1853. this.panel_DoubleClick(panel, e);
  1854. }
  1855. }
  1856. /// <summary>
  1857. /// 选中当天,改变背景颜色
  1858. /// </summary>
  1859. /// <param name="sender"></param>
  1860. /// <param name="e"></param>
  1861. void panel_Click(object sender, EventArgs e)
  1862. {
  1863. this.nudDate.Focus();
  1864. Panel panel = sender as Panel;
  1865. string panelName = panel.Name.Substring(0, 5);
  1866. if (panel.Tag == null)
  1867. { return; }
  1868. for (int i = 1; i < 50; i++)
  1869. {
  1870. Panel newpanel = (Panel)tblPanel.Controls[panelName + i];
  1871. if (newpanel != null)
  1872. {
  1873. newpanel.BackColor = Color.Gainsboro;
  1874. }
  1875. }
  1876. /*
  1877. * 摄控本旧统计图表 新功能暂时不用
  1878. * int panelSub = Convert.ToInt32(panel.Name.Substring(5, panel.Name.Length - 5));
  1879. Label lbl = (Label)panel.Controls["lbl" + (panelSub - lblStart)];
  1880. if (lbl == null)
  1881. { return; }
  1882. this.nudDataValue = Convert.ToDecimal(lbl.Text);
  1883. this.nudDate.Value = Convert.ToDecimal(lbl.Text);*/
  1884. panel.BackColor = Color.SkyBlue;
  1885. }
  1886. /// <summary>
  1887. /// 双击选中当天,去详情浏览
  1888. /// </summary>
  1889. /// <param name="sender"></param>
  1890. /// <param name="e"></param>
  1891. void panel_DoubleClick(object sender, EventArgs e)
  1892. {
  1893. this.nudDate.Focus();
  1894. Panel panel = sender as Panel;
  1895. int panelSub = Convert.ToInt32(panel.Name.Substring(5, panel.Name.Length - 5));
  1896. Label lbl = (Label)panel.Controls["lbl" + (panelSub - lblStart)];
  1897. if (lbl != null)
  1898. {
  1899. nudDataValue = Convert.ToDecimal(lbl.Text);
  1900. nudDate.Value = Convert.ToDecimal(lbl.Text);
  1901. }
  1902. this.SetnudDate(true);
  1903. this.tblPanel.Visible = false;
  1904. this.dgvData.Visible = true;
  1905. this.chkPortraitVersion.Visible = true;
  1906. this.chkDressVersion.Visible = true;
  1907. this.chkKidsVersion.Visible = true;
  1908. this.chkNearlyHalfMonth.Visible = true;
  1909. this.chkNearlyOneWeek.Visible = true;
  1910. this.btnAddRecord.Visible = true;
  1911. this.btnCommunicateDetails.Visible = true;
  1912. this.btnCharts.Text = " 图 表";
  1913. this.PublicFunctionRows();
  1914. this.MainFrameFormMain_Resize(null, null);
  1915. }
  1916. /// <summary>
  1917. /// 按下某键时发生
  1918. /// </summary>
  1919. /// <param name="sender"></param>
  1920. /// <param name="e"></param>
  1921. void nudDate_KeyDown(object sender, KeyEventArgs e)
  1922. {
  1923. if (e.KeyCode == Keys.Left)
  1924. {
  1925. if (this.nudDate.Value > 1)
  1926. { this.nudDate.Value -= 1; }
  1927. }
  1928. else if (e.KeyCode == Keys.Right)
  1929. {
  1930. int days = DateTime.DaysInMonth(Convert.ToInt32(this.nudYears.Value), Convert.ToInt32(this.nudMonth.Value));//这个月的天数
  1931. if (this.nudDate.Value < days)
  1932. { this.nudDate.Value += 1; }
  1933. }
  1934. else if (e.KeyCode == Keys.Enter)
  1935. {
  1936. //this.ucPagerEx1.Visible = true;
  1937. this.tblPanel.Visible = false;
  1938. this.dgvData.Visible = true;
  1939. this.btnCharts.Text = " 图 表";
  1940. this.PublicFunctionRows();
  1941. this.MainFrameFormMain_Resize(null, null);
  1942. }
  1943. this.nudDate.Focus();
  1944. }
  1945. /// <summary>
  1946. /// 窗体大小变化
  1947. /// </summary>
  1948. /// <param name="sender"></param>
  1949. /// <param name="e"></param>
  1950. void MainFrameFormMain_Resize(object sender, EventArgs e)
  1951. {
  1952. if (!this.dgvData.Visible)
  1953. {
  1954. this.IsCustomScrollBar = false;
  1955. int panelWhith = 950;
  1956. int panelHeight = 1300;
  1957. if (this.Width > panelWhith)
  1958. { this.tblPanel.Size = new Size(this.panelEx3.Width - 25, panelHeight - 100); }
  1959. else
  1960. { this.tblPanel.Size = new Size(this.panelEx3.Width, panelHeight - 100); }
  1961. this.tblPanel.Location = this.dgvData.Location;
  1962. this.nudDate.Focus();
  1963. }
  1964. }
  1965. /// <summary>
  1966. /// 窗体关闭后发生事件
  1967. /// </summary>
  1968. /// <param name="sender"></param>
  1969. /// <param name="e"></param>
  1970. void MainFrameFormMain_FormClosed(object sender, FormClosedEventArgs e)
  1971. {
  1972. if (this.IsShowAssistant)
  1973. {
  1974. LYFZ.Software.MainBusiness.CameraControlBook.A_EventAideFormMain frm = new A_EventAideFormMain();
  1975. frm.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  1976. frm.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y);
  1977. frm.Size = new Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height);
  1978. frm.Show();
  1979. }
  1980. }
  1981. /// <summary>
  1982. /// 是否要跳转到沟通助手动去
  1983. /// </summary>
  1984. bool IsShowAssistant = false;
  1985. #region 头
  1986. /// <summary>
  1987. /// 年
  1988. /// </summary>
  1989. /// <param name="sender"></param>
  1990. /// <param name="e"></param>
  1991. void nudYears_ValueChanged(object sender, EventArgs e)
  1992. {
  1993. this.YearMonthValueChanged();
  1994. }
  1995. /// <summary>
  1996. /// 月
  1997. /// </summary>
  1998. /// <param name="sender"></param>
  1999. /// <param name="e"></param>
  2000. void nudMonth_ValueChanged(object sender, EventArgs e)
  2001. {
  2002. this.YearMonthValueChanged();
  2003. }
  2004. void YearMonthValueChanged()
  2005. {
  2006. if (this.nudYears.Value.ToString().Trim() != "" && this.nudMonth.Value.ToString().Trim() != "")
  2007. {
  2008. this.nudDate.Maximum = DateTime.DaysInMonth(Convert.ToInt32(this.nudYears.Value), Convert.ToInt32(this.nudMonth.Value));
  2009. for (int i = 1; i < 50; i++)
  2010. {
  2011. Panel newpanel = (Panel)this.tblPanel.Controls["panel" + i];
  2012. if (newpanel == null)
  2013. { continue; }
  2014. for (int j = 0; j < newpanel.Controls.Count; j++)
  2015. {
  2016. newpanel.BackColor = Color.Gainsboro;
  2017. }
  2018. }
  2019. if (this.tblPanel.Controls.Count > 0) { this.PaintingWeekly(); }
  2020. if (this.dgvData.Visible) { this.PublicFunctionRows(); }
  2021. }
  2022. }
  2023. decimal nudDataValue = 0;
  2024. /// <summary>
  2025. /// 日
  2026. /// </summary>
  2027. /// <param name="sender"></param>
  2028. /// <param name="e"></param>
  2029. void nudDate_ValueChanged(object sender, EventArgs e)
  2030. {
  2031. if (this.nudDate.Value.ToString().Trim() != "")
  2032. {
  2033. for (int i = 1; i < 50; i++)
  2034. {
  2035. Panel newpanel = (Panel)this.tblPanel.Controls["panel" + i];
  2036. if (newpanel == null)
  2037. { continue; }
  2038. for (int j = 0; j < newpanel.Controls.Count; j++)
  2039. {
  2040. newpanel.BackColor = Color.Gainsboro;
  2041. }
  2042. }
  2043. if (this.tblPanel.Controls.Count > 0)
  2044. {
  2045. Panel panel = (Panel)this.tblPanel.Controls["panel" + (Convert.ToInt32(this.nudDate.Value) + lblStart - 1)];
  2046. panel.BackColor = Color.SkyBlue;
  2047. this.nudDataValue = this.nudDate.Value;
  2048. }
  2049. if (this.dgvData.Visible) { this.PublicFunctionRows(); }
  2050. }
  2051. }
  2052. #endregion
  2053. #region 左边
  2054. /// <summary>
  2055. /// 拍照客人
  2056. /// </summary>
  2057. /// <param name="sender"></param>
  2058. /// <param name="e"></param>
  2059. void rdoPhotographed_Click(object sender, EventArgs e)
  2060. {
  2061. strReservationTimeName = "拍摄时间";
  2062. StrSortOrder = "DESC";
  2063. StrCurrentClickField = "";
  2064. this.StrSortField = "Ordpg_ReservationPhotographyTime,Ord_Number,Ordv_DigitalNumber";
  2065. if (this.rdoPhotographed.Checked && !this.IsFirstLoad)
  2066. {
  2067. this.rdoHospitalClient.Checked = false;
  2068. this.rdoLookDesign.Checked = false;
  2069. this.rdoRecentBirthday.Checked = false;
  2070. this.rdoSelectDress.Checked = false;
  2071. this.rdoFilmSelection.Checked = false;
  2072. this.rdoPhotographed.Checked = true;
  2073. this.rdoTotakePiece.Checked = false;
  2074. this.rdoService.Checked = false;
  2075. this.SetnudDate(true);
  2076. this.chkWeddingCelebration.Visible = false;
  2077. this.btnOverview.Visible = true;
  2078. this.btnSelectedClothes.Visible = false;
  2079. this.btnCharts.Visible = true;
  2080. this.btnPrint.Visible = true;
  2081. this.btnStatistic.Visible = true;
  2082. this.btnGuestsReservation.Visible = true;
  2083. this.btnReschedule.Visible = true;
  2084. this.btnSMS.Visible = true;
  2085. this.btnAddRecord.Visible = true;
  2086. this.btnCommunicateDetails.Visible = true;
  2087. this.btnStatistic.Text = " 统计未拍";
  2088. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetSystemVersion(this.chkPortraitVersion, this.chkDressVersion, this.chkKidsVersion);
  2089. this.chkNearlyHalfMonth.Visible = true;
  2090. this.chkNearlyOneWeek.Visible = true;
  2091. this.btnCharts.Text = " 图 表";
  2092. List<Control> hideControl = new List<Control>();
  2093. //LYFZSS.SystemSpecterPossessed.ISystemSpecterPossessed.GetMySystemSpecter = LYFZSS.SystemSpecterType.SST_D;
  2094. hideControl.Add(this.panelRecentBirthday);
  2095. hideControl.Add(this.btnCommunicateDetails);
  2096. hideControl.Add(this.btnAddRecord);
  2097. LYFZ.Software.MainBusiness.VersionControl.StaticVersion.BindVersionShowHideControl(
  2098. VersionControl.VersionFunctionEnum.沟通助手, hideControl, null, null);
  2099. this.PublicFunctionRows();
  2100. this.MainFrameFormMain_Resize(null, null);
  2101. }
  2102. }
  2103. /// <summary>
  2104. /// 选片客人
  2105. /// </summary>
  2106. /// <param name="sender"></param>
  2107. /// <param name="e"></param>
  2108. void rdoFilmSelection_Click(object sender, EventArgs e)
  2109. {
  2110. strReservationTimeName = "选片时间";
  2111. StrSortOrder = "DESC";
  2112. StrCurrentClickField = "";
  2113. this.StrSortField = "Ordv_ReservationFilmSelectionTime,Ord_Number,Ordv_DigitalNumber";
  2114. if (this.rdoFilmSelection.Checked)
  2115. {
  2116. this.rdoHospitalClient.Checked = false;
  2117. this.rdoLookDesign.Checked = false;
  2118. this.rdoRecentBirthday.Checked = false;
  2119. this.rdoSelectDress.Checked = false;
  2120. this.rdoFilmSelection.Checked = true;
  2121. this.rdoPhotographed.Checked = false;
  2122. this.rdoTotakePiece.Checked = false;
  2123. this.rdoService.Checked = false;
  2124. this.SetnudDate(true);
  2125. this.chkWeddingCelebration.Visible = false;
  2126. this.btnOverview.Visible = true;
  2127. this.btnSelectedClothes.Visible = false;
  2128. this.btnCharts.Visible = true;
  2129. this.btnPrint.Visible = true;
  2130. this.btnStatistic.Visible = true;
  2131. this.btnGuestsReservation.Visible = true;
  2132. this.btnReschedule.Visible = true;
  2133. this.btnSMS.Visible = true;
  2134. this.btnAddRecord.Visible = true;
  2135. this.btnCommunicateDetails.Visible = true;
  2136. this.btnStatistic.Text = " 统计未选";
  2137. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetSystemVersion(this.chkPortraitVersion, this.chkDressVersion, this.chkKidsVersion);
  2138. this.chkNearlyHalfMonth.Visible = true;
  2139. this.chkNearlyOneWeek.Visible = true;
  2140. this.btnCharts.Text = " 图 表";
  2141. List<Control> hideControl = new List<Control>();
  2142. //LYFZSS.SystemSpecterPossessed.ISystemSpecterPossessed.GetMySystemSpecter = LYFZSS.SystemSpecterType.SST_D;
  2143. hideControl.Add(this.panelRecentBirthday);
  2144. hideControl.Add(this.btnCommunicateDetails);
  2145. hideControl.Add(this.btnAddRecord);
  2146. LYFZ.Software.MainBusiness.VersionControl.StaticVersion.BindVersionShowHideControl(
  2147. VersionControl.VersionFunctionEnum.沟通助手, hideControl, null, null);
  2148. this.PublicFunctionRows();
  2149. this.MainFrameFormMain_Resize(this, null);
  2150. }
  2151. }
  2152. /// <summary>
  2153. /// 看版客人
  2154. /// </summary>
  2155. /// <param name="sender"></param>
  2156. /// <param name="e"></param>
  2157. void rdoLookDesign_Click(object sender, EventArgs e)
  2158. {
  2159. strReservationTimeName = "看版时间";
  2160. StrSortOrder = "DESC";
  2161. StrCurrentClickField = "";
  2162. this.StrSortField = "Ordv_ReservationLookDesignTime,Ord_Number,Ordv_DigitalNumber";
  2163. if (this.rdoLookDesign.Checked)
  2164. {
  2165. this.rdoHospitalClient.Checked = false;
  2166. this.rdoLookDesign.Checked = true;
  2167. this.rdoRecentBirthday.Checked = false;
  2168. this.rdoSelectDress.Checked = false;
  2169. this.rdoFilmSelection.Checked = false;
  2170. this.rdoPhotographed.Checked = false;
  2171. this.rdoTotakePiece.Checked = false;
  2172. this.rdoService.Checked = false;
  2173. this.SetnudDate(true);
  2174. this.chkWeddingCelebration.Visible = false;
  2175. this.btnOverview.Visible = true;
  2176. this.btnSelectedClothes.Visible = false;
  2177. this.btnCharts.Visible = true;
  2178. this.btnPrint.Visible = true;
  2179. this.btnStatistic.Visible = true;
  2180. this.btnGuestsReservation.Visible = true;
  2181. this.btnReschedule.Visible = true;
  2182. this.btnSMS.Visible = true;
  2183. this.btnAddRecord.Visible = true;
  2184. this.btnCommunicateDetails.Visible = true;
  2185. this.btnStatistic.Text = " 统计未看";
  2186. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetSystemVersion(this.chkPortraitVersion, this.chkDressVersion, this.chkKidsVersion);
  2187. this.chkNearlyHalfMonth.Visible = true;
  2188. this.chkNearlyOneWeek.Visible = true;
  2189. this.btnCharts.Text = " 图 表";
  2190. List<Control> hideControl = new List<Control>();
  2191. //LYFZSS.SystemSpecterPossessed.ISystemSpecterPossessed.GetMySystemSpecter = LYFZSS.SystemSpecterType.SST_D;
  2192. hideControl.Add(this.panelRecentBirthday);
  2193. hideControl.Add(this.btnCommunicateDetails);
  2194. hideControl.Add(this.btnAddRecord);
  2195. LYFZ.Software.MainBusiness.VersionControl.StaticVersion.BindVersionShowHideControl(
  2196. VersionControl.VersionFunctionEnum.沟通助手, hideControl, null, null);
  2197. this.PublicFunctionRows();
  2198. this.MainFrameFormMain_Resize(this, null);
  2199. }
  2200. }
  2201. /// <summary>
  2202. /// 取件客人
  2203. /// </summary>
  2204. /// <param name="sender"></param>
  2205. /// <param name="e"></param>
  2206. void rdoTotakePiece_Click(object sender, EventArgs e)
  2207. {
  2208. strReservationTimeName = "取件时间";
  2209. StrSortOrder = "DESC";
  2210. StrCurrentClickField = "";
  2211. this.StrSortField = "OPlist_ReservationTakeTime,Ord_Number,Ordv_DigitalNumber";
  2212. if (rdoTotakePiece.Checked)
  2213. {
  2214. this.rdoHospitalClient.Checked = false;
  2215. this.rdoLookDesign.Checked = false;
  2216. this.rdoRecentBirthday.Checked = false;
  2217. this.rdoSelectDress.Checked = false;
  2218. this.rdoFilmSelection.Checked = false;
  2219. this.rdoPhotographed.Checked = false;
  2220. this.rdoTotakePiece.Checked = true;
  2221. this.rdoService.Checked = false;
  2222. this.SetnudDate(true);
  2223. this.chkWeddingCelebration.Visible = true;
  2224. this.btnOverview.Visible = true;
  2225. this.btnSelectedClothes.Visible = false;
  2226. this.btnCharts.Visible = true;
  2227. this.btnPrint.Visible = true;
  2228. this.btnStatistic.Visible = true;
  2229. this.btnGuestsReservation.Visible = true;
  2230. this.btnReschedule.Visible = true;
  2231. this.btnSMS.Visible = true;
  2232. this.btnAddRecord.Visible = true;
  2233. this.btnCommunicateDetails.Visible = true;
  2234. this.btnStatistic.Text = " 统计未取";
  2235. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetSystemVersion(this.chkPortraitVersion, this.chkDressVersion, this.chkKidsVersion);
  2236. this.chkNearlyHalfMonth.Visible = true;
  2237. this.chkNearlyOneWeek.Visible = true;
  2238. this.btnCharts.Text = " 图 表";
  2239. List<Control> hideControl = new List<Control>();
  2240. //LYFZSS.SystemSpecterPossessed.ISystemSpecterPossessed.GetMySystemSpecter = LYFZSS.SystemSpecterType.SST_D;
  2241. hideControl.Add(this.panelRecentBirthday);
  2242. hideControl.Add(this.btnCommunicateDetails);
  2243. hideControl.Add(this.btnAddRecord);
  2244. LYFZ.Software.MainBusiness.VersionControl.StaticVersion.BindVersionShowHideControl(
  2245. VersionControl.VersionFunctionEnum.沟通助手, hideControl, null, null);
  2246. this.PublicFunctionRows();
  2247. this.MainFrameFormMain_Resize(this, null);
  2248. }
  2249. }
  2250. /// <summary>
  2251. /// 服务客人
  2252. /// </summary>
  2253. /// <param name="sender"></param>
  2254. /// <param name="e"></param>
  2255. void rdoService_Click(object sender, EventArgs e)
  2256. {
  2257. strReservationTimeName = "服务时间";
  2258. StrSortOrder = "DESC";
  2259. StrCurrentClickField = "";
  2260. this.StrSortField = "Ws_WeddingDate,Ord_Number";
  2261. if (this.rdoService.Checked)
  2262. {
  2263. this.rdoHospitalClient.Checked = false;
  2264. this.rdoLookDesign.Checked = false;
  2265. this.rdoRecentBirthday.Checked = false;
  2266. this.rdoSelectDress.Checked = false;
  2267. this.rdoFilmSelection.Checked = false;
  2268. this.rdoPhotographed.Checked = false;
  2269. this.rdoTotakePiece.Checked = false;
  2270. this.rdoService.Checked = true;
  2271. this.SetnudDate(true);
  2272. this.btnOverview.Visible = true;
  2273. this.btnSelectedClothes.Visible = false;
  2274. this.btnCharts.Visible = true;
  2275. this.btnPrint.Visible = true;
  2276. this.btnStatistic.Visible = true;
  2277. this.btnGuestsReservation.Visible = true;
  2278. this.btnReschedule.Visible = true;
  2279. this.btnSMS.Visible = true;
  2280. this.btnAddRecord.Visible = true;
  2281. this.btnCommunicateDetails.Visible = true;
  2282. this.btnStatistic.Text = " 统计服务";
  2283. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetSystemVersion(this.chkPortraitVersion, this.chkDressVersion, this.chkKidsVersion);
  2284. this.chkNearlyHalfMonth.Visible = false;
  2285. this.chkNearlyOneWeek.Visible = false;
  2286. this.chkWeddingCelebration.Visible = true;
  2287. this.chkNearlyHalfMonth.Visible = true;
  2288. this.chkNearlyOneWeek.Visible = true;
  2289. this.btnCharts.Text = " 图 表";
  2290. List<Control> hideControl = new List<Control>();
  2291. //LYFZSS.SystemSpecterPossessed.ISystemSpecterPossessed.GetMySystemSpecter = LYFZSS.SystemSpecterType.SST_D;
  2292. hideControl.Add(this.panelRecentBirthday);
  2293. hideControl.Add(this.btnCommunicateDetails);
  2294. hideControl.Add(this.btnAddRecord);
  2295. LYFZ.Software.MainBusiness.VersionControl.StaticVersion.BindVersionShowHideControl(
  2296. VersionControl.VersionFunctionEnum.沟通助手, hideControl, null, null);
  2297. this.PublicFunctionRows();
  2298. this.MainFrameFormMain_Resize(this, null);
  2299. }
  2300. }
  2301. /// <summary>
  2302. /// 选礼服客人
  2303. /// </summary>
  2304. /// <param name="sender"></param>
  2305. /// <param name="e"></param>
  2306. void rdoSelectDress_Click(object sender, EventArgs e)
  2307. {
  2308. strReservationTimeName = "选礼服时间";
  2309. StrSortOrder = "DESC";
  2310. StrCurrentClickField = "";
  2311. this.StrSortField = "Ordv_ReservationClothingTime,Ord_Number";
  2312. if (this.rdoSelectDress.Checked)
  2313. {
  2314. this.rdoHospitalClient.Checked = false;
  2315. this.rdoLookDesign.Checked = false;
  2316. this.rdoRecentBirthday.Checked = false;
  2317. this.rdoSelectDress.Checked = true;
  2318. this.rdoFilmSelection.Checked = false;
  2319. this.rdoPhotographed.Checked = false;
  2320. this.rdoTotakePiece.Checked = false;
  2321. this.rdoService.Checked = false;
  2322. this.SetnudDate(true);
  2323. this.chkWeddingCelebration.Visible = false;
  2324. this.btnOverview.Visible = true;
  2325. this.btnSelectedClothes.Visible = true;
  2326. this.btnCharts.Visible = true;
  2327. this.btnPrint.Visible = true;
  2328. this.btnStatistic.Visible = true;
  2329. this.btnGuestsReservation.Visible = true;
  2330. this.btnReschedule.Visible = true;
  2331. this.btnSMS.Visible = true;
  2332. this.btnAddRecord.Visible = true;
  2333. this.btnCommunicateDetails.Visible = true;
  2334. this.btnStatistic.Text = " 统计未选";
  2335. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetSystemVersion(this.chkPortraitVersion, this.chkDressVersion, this.chkKidsVersion);
  2336. this.chkNearlyHalfMonth.Visible = true;
  2337. this.chkNearlyOneWeek.Visible = true;
  2338. this.btnCharts.Text = " 图 表";
  2339. List<Control> hideControl = new List<Control>();
  2340. //LYFZSS.SystemSpecterPossessed.ISystemSpecterPossessed.GetMySystemSpecter = LYFZSS.SystemSpecterType.SST_D;
  2341. hideControl.Add(this.panelRecentBirthday);
  2342. hideControl.Add(this.btnCommunicateDetails);
  2343. hideControl.Add(this.btnAddRecord);
  2344. LYFZ.Software.MainBusiness.VersionControl.StaticVersion.BindVersionShowHideControl(
  2345. VersionControl.VersionFunctionEnum.沟通助手, hideControl, null, null);
  2346. this.PublicFunctionRows();
  2347. this.MainFrameFormMain_Resize(this, null);
  2348. }
  2349. }
  2350. /// <summary>
  2351. /// 纪念日
  2352. /// </summary>
  2353. /// <param name="sender"></param>
  2354. /// <param name="e"></param>
  2355. void rdoRecentBirthday_Click(object sender, EventArgs e)
  2356. {
  2357. if (this.rdoRecentBirthday.Checked)
  2358. {
  2359. this.IsShowAssistant = true;
  2360. this.Close();
  2361. }
  2362. }
  2363. /// <summary>
  2364. /// 医院客户
  2365. /// </summary>
  2366. /// <param name="sender"></param>
  2367. /// <param name="e"></param>
  2368. void rdoHospitalClient_Click(object sender, EventArgs e)
  2369. {
  2370. StrSortOrder = "DESC";
  2371. StrCurrentClickField = "";
  2372. this.StrSortField = "Hdr_DoorTime,Ord_Number";
  2373. if (this.rdoHospitalClient.Checked)
  2374. {
  2375. this.rdoHospitalClient.Checked = true;
  2376. this.rdoLookDesign.Checked = false;
  2377. this.rdoRecentBirthday.Checked = false;
  2378. this.rdoSelectDress.Checked = false;
  2379. this.rdoFilmSelection.Checked = false;
  2380. this.rdoPhotographed.Checked = false;
  2381. this.rdoTotakePiece.Checked = false;
  2382. this.rdoService.Checked = false;
  2383. this.SetnudDate(true);
  2384. this.chkWeddingCelebration.Visible = false;
  2385. this.btnOverview.Visible = false;
  2386. this.btnSelectedClothes.Visible = false;
  2387. this.btnCharts.Visible = true;
  2388. this.btnPrint.Visible = false;
  2389. this.btnStatistic.Visible = false;
  2390. this.btnGuestsReservation.Visible = false;
  2391. this.btnReschedule.Visible = true;
  2392. this.btnSMS.Visible = true;
  2393. this.btnAddRecord.Visible = true;
  2394. this.btnCommunicateDetails.Visible = true;
  2395. this.btnStatistic.Text = " ";
  2396. this.chkPortraitVersion.Visible = false;
  2397. this.chkDressVersion.Visible = false;
  2398. this.chkKidsVersion.Visible = false;
  2399. this.chkNearlyHalfMonth.Visible = true;
  2400. this.chkNearlyOneWeek.Visible = true;
  2401. this.btnCharts.Text = " 图 表";
  2402. List<Control> hideControl = new List<Control>();
  2403. //LYFZSS.SystemSpecterPossessed.ISystemSpecterPossessed.GetMySystemSpecter = LYFZSS.SystemSpecterType.SST_D;
  2404. hideControl.Add(this.panelRecentBirthday);
  2405. hideControl.Add(this.btnCommunicateDetails);
  2406. hideControl.Add(this.btnAddRecord);
  2407. LYFZ.Software.MainBusiness.VersionControl.StaticVersion.BindVersionShowHideControl(
  2408. VersionControl.VersionFunctionEnum.沟通助手, hideControl, null, null);
  2409. this.PublicFunctionRows();
  2410. this.MainFrameFormMain_Resize(this, null);
  2411. }
  2412. }
  2413. /// <summary>
  2414. /// 近一个星期
  2415. /// </summary>
  2416. /// <param name="sender"></param>
  2417. /// <param name="e"></param>
  2418. void chkNearlyOneWeek_Click(object sender, EventArgs e)
  2419. {
  2420. if (this.chkNearlyOneWeek.Checked)
  2421. { this.chkNearlyOneWeek.Checked = true; this.chkNearlyHalfMonth.Checked = false; }
  2422. else
  2423. { this.chkNearlyOneWeek.Checked = false; this.chkNearlyHalfMonth.Checked = false; }
  2424. this.PublicFunctionRows();
  2425. }
  2426. /// <summary>
  2427. /// 近半个月
  2428. /// </summary>
  2429. /// <param name="sender"></param>
  2430. /// <param name="e"></param>
  2431. void chkNearlyHalfMonth_Click(object sender, EventArgs e)
  2432. {
  2433. if (this.chkNearlyHalfMonth.Checked)
  2434. { this.chkNearlyOneWeek.Checked = false; this.chkNearlyHalfMonth.Checked = true; }
  2435. else
  2436. { this.chkNearlyOneWeek.Checked = false; this.chkNearlyHalfMonth.Checked = false; }
  2437. this.PublicFunctionRows();
  2438. }
  2439. /// <summary>
  2440. /// 婚纱版
  2441. /// </summary>
  2442. /// <param name="sender"></param>
  2443. /// <param name="e"></param>
  2444. void chkDressVersion_Click(object sender, EventArgs e)
  2445. {
  2446. if (this.chkDressVersion.Checked)
  2447. {
  2448. this.chkPortraitVersion.Checked = false;
  2449. this.chkWeddingCelebration.Checked = false;//婚庆版
  2450. this.chkKidsVersion.Checked = false;
  2451. this.chkNearlyHalfMonth.Visible = true;
  2452. this.chkNearlyOneWeek.Visible = true;
  2453. }
  2454. this.PublicFunctionRows();
  2455. this.MainFrameFormMain_Resize(this, null);
  2456. }
  2457. /// <summary>
  2458. /// 儿童版
  2459. /// </summary>
  2460. /// <param name="sender"></param>
  2461. /// <param name="e"></param>
  2462. void chkKidsVersion_Click(object sender, EventArgs e)
  2463. {
  2464. if (this.chkKidsVersion.Checked)
  2465. {
  2466. this.chkPortraitVersion.Checked = false;
  2467. this.chkWeddingCelebration.Checked = false;//婚庆版
  2468. this.chkDressVersion.Checked = false;
  2469. this.chkNearlyHalfMonth.Visible = true;
  2470. this.chkNearlyOneWeek.Visible = true;
  2471. }
  2472. this.PublicFunctionRows();
  2473. this.MainFrameFormMain_Resize(this, null);
  2474. }
  2475. /// <summary>
  2476. /// 写真版
  2477. /// </summary>
  2478. /// <param name="sender"></param>
  2479. /// <param name="e"></param>
  2480. void chkPortraitVersion_Click(object sender, EventArgs e)
  2481. {
  2482. if (this.chkPortraitVersion.Checked)
  2483. {
  2484. this.chkWeddingCelebration.Checked = false;//婚庆版
  2485. this.chkDressVersion.Checked = false;//婚纱版
  2486. this.chkKidsVersion.Checked = false;//儿童版
  2487. this.chkNearlyHalfMonth.Visible = true;
  2488. this.chkNearlyOneWeek.Visible = true;
  2489. }
  2490. this.PublicFunctionRows();
  2491. this.MainFrameFormMain_Resize(this, null);
  2492. }
  2493. /// <summary>
  2494. /// 婚庆版
  2495. /// </summary>
  2496. /// <param name="sender"></param>
  2497. /// <param name="e"></param>
  2498. void chkWeddingCelebration_Click(object sender, EventArgs e)
  2499. {
  2500. if (this.chkPortraitVersion.Checked)
  2501. {
  2502. this.chkPortraitVersion.Checked = false;//写真版
  2503. this.chkDressVersion.Checked = false;//婚纱版
  2504. this.chkKidsVersion.Checked = false;//儿童版
  2505. this.chkNearlyHalfMonth.Visible = true;
  2506. this.chkNearlyOneWeek.Visible = true;
  2507. }
  2508. this.PublicFunctionRows();
  2509. this.MainFrameFormMain_Resize(this, null);
  2510. }
  2511. #endregion
  2512. #region 右边
  2513. /// <summary>
  2514. /// 详情
  2515. /// </summary>
  2516. /// <param name="sender"></param>
  2517. /// <param name="e"></param>
  2518. void btnCharts_Click(object sender, EventArgs e)
  2519. {
  2520. if (this.btnCharts.Text.Trim() == "详 情" || !this.dgvData.Visible)
  2521. {
  2522. this.SetnudDate(true);
  2523. this.PublicFunctionRows();
  2524. this.btnCharts.Text = " 图 表";
  2525. this.dgvData.Visible = true;
  2526. this.tblPanel.Visible = false;
  2527. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetSystemVersion(this.chkPortraitVersion, this.chkDressVersion, this.chkKidsVersion);
  2528. this.chkNearlyHalfMonth.Visible = true;
  2529. this.chkNearlyOneWeek.Visible = true;
  2530. this.btnAddRecord.Visible = true;
  2531. this.btnCommunicateDetails.Visible = true;
  2532. }
  2533. else
  2534. {
  2535. this.SetnudDate();
  2536. this.btnCharts.Text = " 详 情";
  2537. this.chkWeddingCelebration.Visible = false;
  2538. this.panelEx1.Visible = false;
  2539. this.dgvData.Visible = false;
  2540. this.tblPanel.Visible = true;
  2541. this.chkPortraitVersion.Visible = false;
  2542. this.chkDressVersion.Visible = false;
  2543. this.chkKidsVersion.Visible = false;
  2544. this.chkNearlyHalfMonth.Visible = false;
  2545. this.chkNearlyOneWeek.Visible = false;
  2546. this.btnAddRecord.Visible = false;
  2547. this.btnCommunicateDetails.Visible = false;
  2548. this.PaintingWeekly();
  2549. }
  2550. this.MainFrameFormMain_Resize(this, null);
  2551. }
  2552. /// <summary>
  2553. /// 打印
  2554. /// </summary>
  2555. /// <param name="sender"></param>
  2556. /// <param name="e"></param>
  2557. void btnPrint_Click(object sender, EventArgs e)
  2558. {
  2559. if (this.dgvData.SelectedRows.Count > 0)
  2560. {
  2561. Hashtable htData = new Hashtable();
  2562. if (this.chkPortraitVersion.Checked || LYFZ.Software.MainBusiness.EnumPermissions.BusinessType.写真版 == LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetBusinessType())
  2563. { htData["Ver"] = "2"; }
  2564. else if (this.chkDressVersion.Checked || LYFZ.Software.MainBusiness.EnumPermissions.BusinessType.婚纱版 == LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetBusinessType())
  2565. { htData["Ver"] = "0"; }
  2566. else if (this.chkKidsVersion.Checked || LYFZ.Software.MainBusiness.EnumPermissions.BusinessType.儿童版 == LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetBusinessType())
  2567. { htData["Ver"] = "1"; }
  2568. else if ((!this.chkKidsVersion.Checked && !this.chkDressVersion.Checked && !this.chkPortraitVersion.Checked) || LYFZ.Software.MainBusiness.EnumPermissions.BusinessType.旗舰版 == LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetBusinessType())
  2569. { htData["Ver"] = "-1"; }
  2570. ArrayList Alist = new ArrayList();
  2571. if (this.rdoService.Checked)//服务客人预约
  2572. {
  2573. for (int i = 0; i < this.dgvData.SelectedRows.Count; i++)
  2574. {
  2575. if (this.dgvData.SelectedRows[i].Visible)
  2576. {
  2577. if (Alist.Count > 0)
  2578. {
  2579. bool isTrue = true;
  2580. for (int j = 0; j < Alist.Count; j++)
  2581. {
  2582. if (this.dgvData.SelectedRows[i].Cells["Ordv_ViceNumber"].Value.ToString().Trim() == Alist[j].ToString().Trim())
  2583. { isTrue = false; break; }
  2584. }
  2585. if (isTrue)
  2586. { Alist.Add(this.dgvData.SelectedRows[i].Cells["Ordv_ViceNumber"].Value.ToString().Trim()); }
  2587. }
  2588. else { Alist.Add(this.dgvData.SelectedRows[i].Cells["Ordv_ViceNumber"].Value.ToString().Trim()); }
  2589. }
  2590. }
  2591. if (Alist.Count == 0)
  2592. { return; }
  2593. htData["Alist"] = Alist;
  2594. LYFZ.Software.MainBusiness.ReportPrint.ReportFixedFormat.PrintFixedFormat(LYFZ.EnumPublic.PrintTypeEnum.服务明细, ObjValue: htData);
  2595. }
  2596. else
  2597. {
  2598. if (this.rdoPhotographed.Checked)//拍照客人预约
  2599. {
  2600. for (int i = 0; i < this.dgvData.SelectedRows.Count; i++)
  2601. {
  2602. if (this.dgvData.SelectedRows[i].Visible)
  2603. {
  2604. string StrItem = this.dgvData.SelectedRows[i].Cells["Ordv_ViceNumber"].Value.ToString().Trim() + "|" + this.dgvData.SelectedRows[i].Cells["拍摄名称"].Value.ToString().Trim();
  2605. bool isTrue = true;
  2606. if (Alist.Count > 0)
  2607. {
  2608. for (int j = 0; j < Alist.Count; j++)
  2609. {
  2610. if (StrItem == Alist[j].ToString().Trim())
  2611. { isTrue = false; break; }
  2612. }
  2613. }
  2614. if (isTrue)
  2615. { Alist.Add(StrItem); }
  2616. }
  2617. }
  2618. }
  2619. else
  2620. {
  2621. for (int i = 0; i < this.dgvData.SelectedRows.Count; i++)
  2622. {
  2623. if (this.dgvData.SelectedRows[i].Visible)
  2624. {
  2625. if (Alist.Count > 0)
  2626. {
  2627. bool isTrue = true;
  2628. for (int j = 0; j < Alist.Count; j++)
  2629. {
  2630. if (this.dgvData.SelectedRows[i].Cells["Ordv_ViceNumber"].Value.ToString().Trim() == Alist[j].ToString().Trim())
  2631. { isTrue = false; break; }
  2632. }
  2633. if (isTrue)
  2634. { Alist.Add(this.dgvData.SelectedRows[i].Cells["Ordv_ViceNumber"].Value.ToString().Trim()); }
  2635. }
  2636. else
  2637. { Alist.Add(this.dgvData.SelectedRows[i].Cells["Ordv_ViceNumber"].Value.ToString().Trim()); }
  2638. }
  2639. }
  2640. }
  2641. if (Alist.Count == 0)
  2642. { return; }
  2643. htData["Alist"] = Alist;
  2644. if (this.rdoPhotographed.Checked)//拍照客人预约
  2645. {
  2646. htData["StrDate"] = this.nudYears.Value + "-" + this.nudMonth.Value + "-" + this.nudDate.Value;
  2647. LYFZ.Software.MainBusiness.CameraControlBook.SuperSmallForm.SelectPrintTypeSuperSmallForm frm = new SuperSmallForm.SelectPrintTypeSuperSmallForm();
  2648. frm.ShowDialog();
  2649. if (frm.IsOk)
  2650. {
  2651. if (frm.StrEnumType == EnumPublic.PrintTypeEnum.订单预约单)
  2652. {
  2653. if (this.dgvData.SelectedRows.Count == 1)
  2654. {
  2655. string orderNumber = this.dgvData.SelectedRows[0].Cells["Ord_Number"].Value.ToString();
  2656. BtnPrint_Click(orderNumber);
  2657. }
  2658. else {
  2659. MessageBoxCustom.Show("打印“订单预约单”时间只能选择一个订单");
  2660. }
  2661. }
  2662. else
  2663. {
  2664. LYFZ.Software.MainBusiness.ReportPrint.ReportFixedFormat.PrintFixedFormat(frm.StrEnumType, ObjValue: htData);
  2665. }
  2666. }
  2667. }
  2668. else if (this.rdoFilmSelection.Checked)//选片客人
  2669. { LYFZ.Software.MainBusiness.ReportPrint.ReportFixedFormat.PrintFixedFormat(LYFZ.EnumPublic.PrintTypeEnum.选片明细表, ObjValue: htData); }
  2670. else if (this.rdoLookDesign.Checked)//看版客人
  2671. { LYFZ.Software.MainBusiness.ReportPrint.ReportFixedFormat.PrintFixedFormat(LYFZ.EnumPublic.PrintTypeEnum.看设计明细表, ObjValue: htData); }
  2672. else if (rdoTotakePiece.Checked)//取件客人
  2673. {
  2674. htData["TakePieceDate"] = this.nudYears.Value + "-" + this.nudMonth.Value + "-" + this.nudDate.Value;
  2675. LYFZ.Software.MainBusiness.ReportPrint.ReportFixedFormat.PrintFixedFormat(LYFZ.EnumPublic.PrintTypeEnum.取件明细表, ObjValue: htData);
  2676. }
  2677. else
  2678. { MessageBoxCustom.Show("此功能暂未开放"); }
  2679. }
  2680. }
  2681. }
  2682. LYFZ.BLL.BLL_ErpOrder orderBll = new BLL.BLL_ErpOrder();
  2683. /// <summary>
  2684. /// 打印订单(打印预约单)
  2685. /// </summary>
  2686. /// <param name="sender"></param>
  2687. /// <param name="e"></param>
  2688. private void BtnPrint_Click(string OrderNumber)
  2689. {
  2690. if (!String.IsNullOrEmpty(OrderNumber))
  2691. {
  2692. LYFZ.Model.Model_ErpOrder currentOrderModel = orderBll.GetModel(OrderNumber);
  2693. if (currentOrderModel.ID > 0)
  2694. {
  2695. EnumPublic.OrderType OrderType = (EnumPublic.OrderType)Convert.ToInt32(currentOrderModel.Ord_Type);
  2696. Hashtable htData = new Hashtable();
  2697. htData["strNumber"] = OrderNumber.Trim();
  2698. htData["strOrdType"] = OrderType.ToString().Trim();
  2699. // 获取全部景点;
  2700. List<ReportPrint.SetSmallForm.PrintPreviewSmallForm.ScenicSpot2> listScenicSpot = null;
  2701. if (OrderType == EnumPublic.OrderType.儿童订单)
  2702. {
  2703. listScenicSpot = new List<ReportPrint.SetSmallForm.PrintPreviewSmallForm.ScenicSpot2>();
  2704. DataTable tb_Data = DAL.DAL_ErpOrder.GetOrdersPhotographyData(OrderNumber);
  2705. for (int i = 0; i < tb_Data.Rows.Count; i++)
  2706. {
  2707. ReportPrint.SetSmallForm.PrintPreviewSmallForm.ScenicSpot2 scenic = new ReportPrint.SetSmallForm.PrintPreviewSmallForm.ScenicSpot2();
  2708. scenic.strScenicName = tb_Data.Rows[i]["景点名"].ToString();
  2709. scenic.strViceNumber = tb_Data.Rows[i]["子单号"].ToString();
  2710. listScenicSpot.Add(scenic);
  2711. }
  2712. }
  2713. LYFZ.Software.MainBusiness.ReportPrint.ReportFixedFormat.PrintFixedFormat(LYFZ.EnumPublic.PrintTypeEnum.订单预约单, htData, listScenicSpot);
  2714. }
  2715. else {
  2716. MessageBoxCustom.Show("找不到要打印的订单号“"+OrderNumber+"”的订单");
  2717. }
  2718. }
  2719. else {
  2720. MessageBoxCustom.Show("订单号不能为空");
  2721. }
  2722. }
  2723. /// <summary>
  2724. /// 统计
  2725. /// </summary>
  2726. /// <param name="sender"></param>
  2727. /// <param name="e"></param>
  2728. void btnStatistic_Click(object sender, EventArgs e)
  2729. {
  2730. bool IsSaveed = false;
  2731. //拍照客人预约
  2732. if (this.rdoPhotographed.Checked)
  2733. {
  2734. LYFZ.Software.MainBusiness.CameraControlBook.SmallForm.CameraControlQuerySmallForm frm = new SmallForm.CameraControlQuerySmallForm();
  2735. frm.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  2736. frm.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y);
  2737. frm.Size = new Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height);
  2738. frm.ShowDialog();
  2739. IsSaveed = frm.IsSaveed;
  2740. }
  2741. //选片客人
  2742. else if (this.rdoFilmSelection.Checked)
  2743. {
  2744. LYFZ.Software.MainBusiness.CameraControlBook.SmallForm.FilmsSelectionReservationQuerySmallForm frm = new SmallForm.FilmsSelectionReservationQuerySmallForm();
  2745. frm.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  2746. frm.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y);
  2747. frm.Size = new Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height);
  2748. frm.ShowDialog();
  2749. IsSaveed = frm.IsSaveed;
  2750. }
  2751. //看版客人
  2752. else if (this.rdoLookDesign.Checked)
  2753. {
  2754. LYFZ.Software.MainBusiness.CameraControlBook.SmallForm.LookSampleReservationQuerySmallForm frm = new SmallForm.LookSampleReservationQuerySmallForm();
  2755. frm.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  2756. frm.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y);
  2757. frm.Size = new Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height);
  2758. frm.ShowDialog();
  2759. IsSaveed = frm.IsSave;
  2760. }
  2761. //取件客人
  2762. else if (rdoTotakePiece.Checked)
  2763. {
  2764. LYFZ.Software.MainBusiness.CameraControlBook.SmallForm.TakePiecesReservationQuerySmallForm frm = new SmallForm.TakePiecesReservationQuerySmallForm();
  2765. frm.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  2766. frm.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y);
  2767. frm.Size = new Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height);
  2768. frm.ShowDialog();
  2769. IsSaveed = frm.IsSaveed;
  2770. }
  2771. //服务客人预约
  2772. else if (this.rdoService.Checked)
  2773. {
  2774. LYFZ.Software.MainBusiness.CameraControlBook.SmallForm.WeddingReservationQuerySmallForm frm = new SmallForm.WeddingReservationQuerySmallForm();
  2775. frm.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  2776. frm.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y);
  2777. frm.Size = new Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height);
  2778. frm.ShowDialog();
  2779. IsSaveed = frm.IsSaveed;
  2780. }
  2781. //选礼服客人
  2782. else if (this.rdoSelectDress.Checked)
  2783. {
  2784. LYFZ.Software.MainBusiness.CameraControlBook.SmallForm.SelectDressReservationQuerySmallForm frm = new SmallForm.SelectDressReservationQuerySmallForm();
  2785. frm.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  2786. frm.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y);
  2787. frm.Size = new Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height);
  2788. frm.ShowDialog();
  2789. IsSaveed = frm.IsSaveed;
  2790. }
  2791. if (IsSaveed)
  2792. {
  2793. if (this.dgvData.Visible)
  2794. { this.PublicFunctionRows(); }
  2795. else
  2796. { this.PaintingWeekly(); }
  2797. }
  2798. }
  2799. /// <summary>
  2800. /// 客人预约
  2801. /// </summary>
  2802. /// <param name="sender"></param>
  2803. /// <param name="e"></param>
  2804. void btnGuestsReservation_Click(object sender, EventArgs e)
  2805. {
  2806. bool IsSaveed = false;
  2807. //拍照客人预约
  2808. if (this.rdoPhotographed.Checked)
  2809. {
  2810. LYFZ.Software.MainBusiness.CameraControlBook.SmallForm.PhotographedReservationSmallForm frm = new SmallForm.PhotographedReservationSmallForm();
  2811. frm.ShowDialog();
  2812. IsSaveed = frm.IsSave;
  2813. }
  2814. //选片客人
  2815. else if (this.rdoFilmSelection.Checked)
  2816. {
  2817. LYFZ.Software.MainBusiness.CameraControlBook.SmallForm.FilmsSelectionReservationSmallForm frm = new SmallForm.FilmsSelectionReservationSmallForm();
  2818. frm.ShowDialog();
  2819. IsSaveed = frm.IsSave;
  2820. }
  2821. //看版客人
  2822. else if (this.rdoLookDesign.Checked)
  2823. {
  2824. LYFZ.Software.MainBusiness.CameraControlBook.SmallForm.LookDesignReservationSmallForm frm = new SmallForm.LookDesignReservationSmallForm();
  2825. frm.ShowDialog();
  2826. IsSaveed = frm.IsSave;
  2827. }
  2828. //取件客人
  2829. else if (rdoTotakePiece.Checked)
  2830. {
  2831. LYFZ.Software.MainBusiness.CameraControlBook.SmallForm.TakePiecesReservationSmallForm frm = new SmallForm.TakePiecesReservationSmallForm();
  2832. frm.ShowDialog();
  2833. IsSaveed = frm.IsSave;
  2834. }
  2835. //服务客人预约
  2836. else if (this.rdoService.Checked)
  2837. {
  2838. LYFZ.Software.MainBusiness.CameraControlBook.SmallForm.WeddingReservationSmallForm frm = new SmallForm.WeddingReservationSmallForm();
  2839. frm.ShowDialog();
  2840. IsSaveed = frm.IsSaveed;
  2841. }
  2842. //选礼服客人
  2843. else if (this.rdoSelectDress.Checked)
  2844. {
  2845. LYFZ.Software.MainBusiness.CameraControlBook.SmallForm.SelectDressReservationSmallForm frm = new SmallForm.SelectDressReservationSmallForm();
  2846. frm.ShowDialog();
  2847. IsSaveed = frm.IsSave;
  2848. }
  2849. if (IsSaveed)
  2850. {
  2851. if (this.dgvData.Visible)
  2852. { this.PublicFunctionRows(); }
  2853. else
  2854. { this.PaintingWeekly(); }
  2855. }
  2856. }
  2857. /// <summary>
  2858. /// 重新安排
  2859. /// </summary>
  2860. /// <param name="sender"></param>
  2861. /// <param name="e"></param>
  2862. void btnReschedule_Click(object sender, EventArgs e)
  2863. {
  2864. if (this.dgvData.Visible == true)
  2865. {
  2866. if (this.dgvData.Rows.Count > 0)
  2867. {
  2868. if (this.dgvData.SelectedRows.Count > 0)
  2869. {
  2870. bool IsSaveed = false;
  2871. //拍照客人预约
  2872. if (this.rdoPhotographed.Checked)
  2873. {
  2874. LYFZ.Software.MainBusiness.CameraControlBook.SmallForm.PhotographedReservationSmallForm frm = new SmallForm.PhotographedReservationSmallForm();
  2875. frm.OrdNumber = this.dgvData.CurrentRow.Cells["Ord_Number"].Value.ToString().Trim();
  2876. frm.ShowDialog();
  2877. IsSaveed = frm.IsSave;
  2878. }
  2879. //选片客人
  2880. else if (this.rdoFilmSelection.Checked)
  2881. {
  2882. LYFZ.Software.MainBusiness.CameraControlBook.SmallForm.FilmsSelectionReservationSmallForm frm = new SmallForm.FilmsSelectionReservationSmallForm();
  2883. frm.OrdViceNumber = this.dgvData.CurrentRow.Cells["Ordv_ViceNumber"].Value.ToString().Trim();
  2884. frm.ShowDialog();
  2885. IsSaveed = frm.IsSave;
  2886. }
  2887. //看版客人
  2888. else if (this.rdoLookDesign.Checked)
  2889. {
  2890. LYFZ.Software.MainBusiness.CameraControlBook.SmallForm.LookDesignReservationSmallForm frm = new SmallForm.LookDesignReservationSmallForm();
  2891. frm.OrdViceNumber = this.dgvData.CurrentRow.Cells["Ordv_ViceNumber"].Value.ToString().Trim();
  2892. frm.ShowDialog();
  2893. IsSaveed = frm.IsSave;
  2894. }
  2895. //取件客人
  2896. else if (rdoTotakePiece.Checked)
  2897. {
  2898. LYFZ.Software.MainBusiness.CameraControlBook.SmallForm.TakePiecesReservationSmallForm frm = new SmallForm.TakePiecesReservationSmallForm();
  2899. frm.OrdNumber = this.dgvData.CurrentRow.Cells["Ord_Number"].Value.ToString().Trim();
  2900. frm.ShowDialog();
  2901. IsSaveed = frm.IsSave;
  2902. }
  2903. //服务客人预约
  2904. else if (this.rdoService.Checked)
  2905. {
  2906. LYFZ.Software.MainBusiness.CameraControlBook.SmallForm.WeddingReservationSmallForm frm = new SmallForm.WeddingReservationSmallForm();
  2907. frm.OrdNumber = this.dgvData.CurrentRow.Cells["Ord_Number"].Value.ToString().Trim();
  2908. frm.ShowDialog();
  2909. IsSaveed = frm.IsSaveed;
  2910. }
  2911. //选礼服客人
  2912. else if (this.rdoSelectDress.Checked)
  2913. {
  2914. LYFZ.Software.MainBusiness.CameraControlBook.SmallForm.SelectDressReservationSmallForm frm = new SmallForm.SelectDressReservationSmallForm();
  2915. frm.OrdViceNumber = this.dgvData.CurrentRow.Cells["Ordv_ViceNumber"].Value.ToString().Trim();
  2916. frm.ShowDialog();
  2917. IsSaveed = frm.IsSave;
  2918. }
  2919. else if (this.rdoHospitalClient.Checked)
  2920. {
  2921. LYFZ.Software.MainBusiness.HospitalTrackingSystem.DispatchDoor frm = new HospitalTrackingSystem.DispatchDoor();
  2922. frm.StrOrderNumber = this.dgvData.CurrentRow.Cells["Ord_Number"].Value.ToString().Trim();
  2923. frm.ShowDialog();
  2924. IsSaveed = frm.IsSaveed;
  2925. }
  2926. if (IsSaveed)
  2927. {
  2928. if (this.dgvData.Visible)
  2929. { this.PublicFunctionRows(); }
  2930. else
  2931. { this.PaintingWeekly(); }
  2932. }
  2933. return;
  2934. }
  2935. }
  2936. }
  2937. MessageBoxCustom.Show("请选择您要安排的客人");
  2938. }
  2939. /// <summary>
  2940. /// 短信
  2941. /// </summary>
  2942. /// <param name="sender"></param>
  2943. /// <param name="e"></param>
  2944. void btnSMS_Click(object sender, EventArgs e)
  2945. {
  2946. if (this.dgvData.Rows.Count > 0)
  2947. {
  2948. if (this.dgvData.SelectedRows.Count > 0)
  2949. {
  2950. if (this.dgvData.Columns.Contains("客户电话"))
  2951. {
  2952. String StrTelephone = "";
  2953. for (int i = 0; i < this.dgvData.SelectedRows.Count; i++)
  2954. { StrTelephone += this.dgvData.SelectedRows[i].Cells["客户电话"].Value.ToString().Trim() + ","; }
  2955. LYFZ.Software.MainBusiness.SMSManagement.SmsSend.FrmSendSms SendSMS = new SMSManagement.SmsSend.FrmSendSms();
  2956. SendSMS.Phone = StrTelephone.TrimEnd(',');
  2957. SendSMS.ShowDialog();
  2958. return;
  2959. }
  2960. else
  2961. { MessageBoxCustom.Show("找不到电话列,或已被您隐藏了!"); }
  2962. }
  2963. }
  2964. MessageBoxCustom.Show("请选中您要发送短信的客人");
  2965. }
  2966. /// <summary>
  2967. /// 关闭
  2968. /// </summary>
  2969. /// <param name="sender"></param>
  2970. /// <param name="e"></param>
  2971. void btnClose_Click(object sender, EventArgs e)
  2972. { this.Close(); }
  2973. /// <summary>
  2974. /// 总览
  2975. /// </summary>
  2976. /// <param name="sender"></param>
  2977. /// <param name="e"></param>
  2978. void btnOverview_Click(object sender, EventArgs e)
  2979. {
  2980. LYFZ.Software.MainBusiness.CameraControlBook.SmallForm.CameraControlBookOverviewSmallForm frm = new SmallForm.CameraControlBookOverviewSmallForm();
  2981. frm.StrDate = this.nudYears.Value + "-" + this.nudMonth.Value + "-" + this.nudDate.Value;
  2982. frm.ShowDialog();
  2983. }
  2984. /// <summary>
  2985. /// 确认选衣状态
  2986. /// </summary>
  2987. /// <param name="sender"></param>
  2988. /// <param name="e"></param>
  2989. void btnSelectedClothes_Click(object sender, EventArgs e)
  2990. {
  2991. if (this.dgvData.Rows.Count > 0)
  2992. {
  2993. if (this.dgvData.CurrentCell.ColumnIndex >= 0 && this.dgvData.CurrentRow.Index >= 0)
  2994. {
  2995. if (this.dgvData.SelectedRows.Count > 0)
  2996. {
  2997. LYFZ.Software.MainBusiness.CameraControlBook.SmallForm.SelectDressConfirmSmallForm frm = new SmallForm.SelectDressConfirmSmallForm();
  2998. frm.strViceNumber = this.dgvData.CurrentRow.Cells["Ordv_ViceNumber"].Value.ToString();
  2999. frm.ShowDialog();
  3000. if (frm.IsSave)
  3001. { this.PublicFunctionRows(); }
  3002. }
  3003. }
  3004. }
  3005. }
  3006. /// <summary>
  3007. /// 导出
  3008. /// </summary>
  3009. /// <param name="sender"></param>
  3010. /// <param name="e"></param>
  3011. void btnExport_Click(object sender, EventArgs e)
  3012. {
  3013. if (this.dgvData.Visible)
  3014. { this.dgvData.ExportDataTable(); }
  3015. }
  3016. /// <summary>
  3017. /// 添加记录
  3018. /// </summary>
  3019. /// <param name="sender"></param>
  3020. /// <param name="e"></param>
  3021. void btnAddRecord_Click(object sender, EventArgs e)
  3022. {
  3023. BLL.BLL_ErpCompanyInfo companyBll = new BLL.BLL_ErpCompanyInfo();
  3024. if (this.dgvData.Visible == true)
  3025. {
  3026. if (this.dgvData.Rows.Count > 0)
  3027. {
  3028. if (this.dgvData.SelectedRows.Count > 0)
  3029. {
  3030. string StrOrdNumber = this.dgvData.CurrentRow.Cells["Ord_Number"].Value.ToString().Trim();
  3031. if (!this.rdoHospitalClient.Checked)
  3032. {
  3033. LYFZ.EnumPublic.ClientServiceTaskItem inputType = EnumPublic.ClientServiceTaskItem.拍照客人;
  3034. //拍照客人预约
  3035. if (this.rdoPhotographed.Checked)
  3036. { inputType = EnumPublic.ClientServiceTaskItem.拍照客人; }
  3037. //选片客人
  3038. else if (this.rdoFilmSelection.Checked)
  3039. { inputType = EnumPublic.ClientServiceTaskItem.选片客人; }
  3040. //看版客人
  3041. else if (this.rdoLookDesign.Checked)
  3042. { inputType = EnumPublic.ClientServiceTaskItem.看版客人; }
  3043. //取件客人
  3044. else if (rdoTotakePiece.Checked)
  3045. { inputType = EnumPublic.ClientServiceTaskItem.取件客人; }
  3046. //服务客人预约
  3047. else if (this.rdoService.Checked)
  3048. { inputType = EnumPublic.ClientServiceTaskItem.服务客人; }
  3049. //选礼服客人
  3050. else if (this.rdoSelectDress.Checked)
  3051. { inputType = EnumPublic.ClientServiceTaskItem.选衣服客人; }
  3052. if (StrOrdNumber != "")
  3053. {
  3054. DataTable tbl = orbll.GetView_Custom("tb_ErpCustomerGroup", StrWhere: "GP_OrderNumber = '" + StrOrdNumber + "'", ShowColumnName: "GP_CustomerGroupID").Tables[0];
  3055. if (tbl.Rows.Count > 0)
  3056. {
  3057. LYFZ.Software.MainBusiness.CameraControlBook.SuperSmallForm.A_AddCommunicateRecords frm = new SuperSmallForm.A_AddCommunicateRecords();
  3058. frm.StrClientNumber = tbl.Rows[0]["GP_CustomerGroupID"].ToString().Trim();
  3059. frm.EnumClientServiceTaskType = EnumPublic.ClientServiceTaskType.摄控确认;
  3060. frm.EnumClientServiceTaskItem = inputType;
  3061. frm.Areminderdate = true;
  3062. frm.ShowDialog();
  3063. if (frm.IsSaveed)
  3064. {
  3065. #region 将预约安排时间改为下次提醒时间
  3066. if (frm.StrNextTime.Trim().Length > 0)
  3067. {
  3068. string StrCurrentDateTime = Convert.ToDateTime(this.nudYears.Value + "-" + this.nudMonth.Value + "-" + this.nudDate.Value).ToYYYY_MM_dd();
  3069. List<Helper.CommandInfo> clist = new List<Helper.CommandInfo>();
  3070. string StrViceNumber = this.dgvData.CurrentRow.Cells["Ordv_ViceNumber"].Value.ToString().Trim();
  3071. string storaRecord = "";
  3072. //拍照客人预约
  3073. if (this.rdoPhotographed.Checked)
  3074. {
  3075. DataTable dtData = orbll.GetView_Custom("tb_ErpOrdersPhotography", StrWhere: "Ordpg_ViceNumber = '" + StrViceNumber + "'", ShowColumnName: "*").Tables[0];
  3076. foreach (DataRow dtRow in dtData.Rows)
  3077. {
  3078. if (dtRow["Ordpg_ReservationPhotographyTime"].ToString().Trim().Length > 0 && dtRow["Ordpg_PhotographyStatus"].ToString().Trim() != "1")
  3079. {
  3080. if (StrCurrentDateTime == Convert.ToDateTime(dtRow["Ordpg_ReservationPhotographyTime"]).ToYYYY_MM_dd())
  3081. {
  3082. LYFZ.Model.Model_ErpOrdersPhotography model = phbll.DataRowToModel(dtRow);
  3083. model.Ordpg_ReservationPhotographyTime = Convert.ToDateTime(frm.StrNextTime.Trim() + " " + model.Ordpg_ReservationPhotographyTime.ToString("HH:mm:ss"));
  3084. model.Ordpg_UpdateDateTime = SDateTime.Now;
  3085. model.Ordpg_UpdateName = this.StrUserID;
  3086. if (model.Ordpg_Remark.Trim().Length > 0)
  3087. { model.Ordpg_Remark += ";"; }
  3088. model.Ordpg_Remark += "安排日期由'" + LYFZ.BLL.OtherCommonModel.DateTimeToString(dtRow["Ordpg_ReservationPhotographyTime"]) + "'改为'" + LYFZ.BLL.OtherCommonModel.DateTimeToString(model.Ordpg_ReservationPhotographyTime) + "'";
  3089. clist.Add(phbll.GetUpdateCommandInfo(model));
  3090. if (!string.IsNullOrEmpty(model.Ordpg_ReservationPhotographyDividedShop))
  3091. {
  3092. storaRecord = "门店:" + companyBll.GetModel("Company_DividedShop", model.Ordpg_ReservationPhotographyDividedShop).Company_Name;
  3093. }
  3094. Model.Model_ErpOrderWorkAnPaiRecord modelRecord = new Model.Model_ErpOrderWorkAnPaiRecord();
  3095. modelRecord.Ordwr_Number = "OWPR_" + LYFZ.BLL.BLL_ErpCustomer.GetClientNumber();
  3096. modelRecord.Ordwr_WorkNumber = model.Ordpg_IDNumber;
  3097. modelRecord.Ordwr_OrdNumber = model.Ordpg_Number;
  3098. modelRecord.Ordwr_ViceNumber = model.Ordpg_ViceNumber;
  3099. modelRecord.Ordwr_ModuleName = LYFZ.EnumPublic.WorkAnPaiChangeLogEnum.摄控安排拍照客人.ToString();
  3100. modelRecord.Ordwr_UpdateOrderName = model.Ordpg_Sights;
  3101. modelRecord.Ordwr_UpdateAgoPerson = model.Ordpg_Dispatcher;
  3102. modelRecord.Ordwr_UpdateAgoTime = model.Ordpg_DispatchTime;
  3103. modelRecord.Ordwr_UpdateAgoData = storaRecord +" " + model.Ordpg_Remark;
  3104. modelRecord.Ordwr_CreateDatetime = SDateTime.Now;
  3105. modelRecord.Ordwr_CreateName = StrUserID;
  3106. clist.Add(ordwr.GetAddCommandInfo(modelRecord));
  3107. }
  3108. }
  3109. }
  3110. }
  3111. //取件客人
  3112. else if (rdoTotakePiece.Checked)
  3113. {
  3114. DataTable dtData = orbll.GetView_Custom("tb_ErpOrderProductList", StrWhere: "OPlist_ViceNumber = '" + StrViceNumber + "' And OPlist_Type = '2'", ShowColumnName: "*").Tables[0];
  3115. foreach (DataRow dtRow in dtData.Rows)
  3116. {
  3117. if (dtRow["OPlist_ReservationTakeTime"].ToString().Trim().Length > 0 && dtRow["OPlist_PickupStatus"].ToString().Trim() != "1")
  3118. {
  3119. if (StrCurrentDateTime == Convert.ToDateTime(dtRow["OPlist_ReservationTakeTime"]).ToYYYY_MM_dd())
  3120. {
  3121. LYFZ.Model.Model_ErpOrderProductList model = libll.DataRowToModel(dtRow);
  3122. model.OPlist_ReservationTakeTime = Convert.ToDateTime(frm.StrNextTime.Trim() + " " + model.OPlist_ReservationTakeTime.ToString("HH:mm:ss"));
  3123. model.OPlist_UpdateDateTime = SDateTime.Now;
  3124. model.OPlist_UpdateName = this.StrUserID;
  3125. if (model.OPlist_ArrangeRemark.Trim().Length > 0)
  3126. { model.OPlist_ArrangeRemark += ";"; }
  3127. model.OPlist_ArrangeRemark += "安排日期由'" + LYFZ.BLL.OtherCommonModel.DateTimeToString(dtRow["OPlist_ReservationTakeTime"]) + "'转移到'" + LYFZ.BLL.OtherCommonModel.DateTimeToString(model.OPlist_ReservationTakeTime) + "'";
  3128. clist.Add(libll.GetUpdateCommandInfo(model));
  3129. if (!string.IsNullOrEmpty(model.OPlist_ReservationTakeDividedShop))
  3130. {
  3131. storaRecord = "门店:" + companyBll.GetModel("Company_DividedShop", model.OPlist_ReservationTakeDividedShop).Company_Name;
  3132. }
  3133. LYFZ.Model.Model_ErpOrderWorkAnPaiRecord modelRecord = new Model.Model_ErpOrderWorkAnPaiRecord();
  3134. modelRecord.Ordwr_Number = "OWPR_" + LYFZ.BLL.BLL_ErpCustomer.GetClientNumber();
  3135. modelRecord.Ordwr_WorkNumber = model.ID.ToString().Trim();
  3136. modelRecord.Ordwr_OrdNumber = model.OPlist_OrderNumber;
  3137. modelRecord.Ordwr_ViceNumber = model.OPlist_ViceNumber;
  3138. modelRecord.Ordwr_ModuleName = LYFZ.EnumPublic.WorkAnPaiChangeLogEnum.摄控安排取件客人.ToString();
  3139. modelRecord.Ordwr_UpdateOrderName = model.OPlist_PickupName;
  3140. modelRecord.Ordwr_UpdateAgoPerson = dtRow["OPlist_UpdateName"].ToString_s();
  3141. modelRecord.Ordwr_UpdateAgoTime = (dtRow["OPlist_UpdateDateTime"].ToString_s()==""?new DateTime(): Convert.ToDateTime(dtRow["OPlist_UpdateDateTime"].ToString_s()));
  3142. modelRecord.Ordwr_UpdateAgoData = storaRecord + " " + model.OPlist_ArrangeRemark;
  3143. modelRecord.Ordwr_CreateDatetime = SDateTime.Now;
  3144. modelRecord.Ordwr_CreateName = StrUserID;
  3145. clist.Add(ordwr.GetAddCommandInfo(modelRecord));
  3146. }
  3147. }
  3148. }
  3149. }
  3150. //服务客人预约
  3151. else if (this.rdoService.Checked)
  3152. {
  3153. DataTable dtData = orbll.GetView_Custom("tb_ErpWeddingService", StrWhere: "Ws_ViceNumber = '" + StrViceNumber + "' And Ws_Status = '0'", ShowColumnName: "*").Tables[0];
  3154. foreach (DataRow dtRow in dtData.Rows)
  3155. {
  3156. if (dtRow["Ws_WeddingDate"].ToString().Trim().Length > 0 && dtRow["Ws_Status"].ToString().Trim() != "1")
  3157. {
  3158. if (StrCurrentDateTime == Convert.ToDateTime(dtRow["Ws_WeddingDate"]).ToYYYY_MM_dd())
  3159. {
  3160. LYFZ.Model.Model_ErpWeddingService model = wsbll.DataRowToModel(dtRow);
  3161. model.Ws_WeddingDate = Convert.ToDateTime(frm.StrNextTime.Trim() + " " + Convert.ToDateTime(model.Ws_WeddingDate).ToString("HH:mm:ss"));
  3162. model.Ws_UpdateDateTime = SDateTime.Now;
  3163. model.Ws_UpdateName = this.StrUserID;
  3164. if (model.Ws_Remark.Trim().Length > 0)
  3165. { model.Ws_Remark += ";"; }
  3166. model.Ws_Remark += "安排日期由'" + LYFZ.BLL.OtherCommonModel.DateTimeToString(dtRow["Ws_WeddingDate"]) + "'转移到'" + LYFZ.BLL.OtherCommonModel.DateTimeToString(model.Ws_WeddingDate) + "'";
  3167. clist.Add(wsbll.GetUpdateCommandInfo(model));
  3168. if(!string.IsNullOrEmpty(model.Ws_ReservationServiceDividedShop))
  3169. {
  3170. storaRecord = "门店:" + companyBll.GetModel("Company_DividedShop", model.Ws_ReservationServiceDividedShop).Company_Name;
  3171. }
  3172. LYFZ.Model.Model_ErpOrderWorkAnPaiRecord modelRecord = new Model.Model_ErpOrderWorkAnPaiRecord();
  3173. modelRecord.Ordwr_Number = "OWPR_" + LYFZ.BLL.BLL_ErpCustomer.GetClientNumber();
  3174. modelRecord.Ordwr_WorkNumber = model.ID.ToString().Trim();
  3175. modelRecord.Ordwr_OrdNumber = model.Ws_Number;
  3176. modelRecord.Ordwr_ViceNumber = model.Ws_ViceNumber;
  3177. modelRecord.Ordwr_ModuleName = LYFZ.EnumPublic.WorkAnPaiChangeLogEnum.摄控安排服务客人.ToString();
  3178. modelRecord.Ordwr_UpdateOrderName = model.Ws_ProdName;
  3179. modelRecord.Ordwr_UpdateAgoPerson = model.Ws_WeddingDispatcher;
  3180. modelRecord.Ordwr_UpdateAgoTime = model.Ws_WeddingDispatchDate;
  3181. modelRecord.Ordwr_UpdateAgoData = storaRecord + " " + model.Ws_Remark;
  3182. modelRecord.Ordwr_CreateDatetime = SDateTime.Now;
  3183. modelRecord.Ordwr_CreateName = StrUserID;
  3184. clist.Add(ordwr.GetAddCommandInfo(modelRecord));
  3185. }
  3186. }
  3187. }
  3188. }
  3189. else
  3190. {
  3191. DataTable dtData = orbll.GetView_Custom("tb_ErpOrderDigital", StrWhere: "Ordv_ViceNumber = '" + StrViceNumber + "'", ShowColumnName: "*").Tables[0];
  3192. //选片客人
  3193. if (this.rdoFilmSelection.Checked)
  3194. {
  3195. foreach (DataRow dtRow in dtData.Rows)
  3196. {
  3197. if (dtRow["Ordv_ReservationFilmSelectionTime"].ToString().Trim().Length > 0 && dtRow["Ordv_FilmSelectionStatus"].ToString().Trim() != "1")
  3198. {
  3199. if (StrCurrentDateTime == Convert.ToDateTime(dtRow["Ordv_ReservationFilmSelectionTime"]).ToYYYY_MM_dd())
  3200. {
  3201. LYFZ.Model.Model_ErpOrderDigital model = odbll.DataRowToModel(dtRow);
  3202. model.Ordv_ReservationFilmSelectionTime = Convert.ToDateTime(frm.StrNextTime.Trim() + " " + Convert.ToDateTime(model.Ordv_ReservationFilmSelectionTime).ToString("HH:mm:ss"));
  3203. model.Ordv_UpdateDateTime = SDateTime.Now;
  3204. model.Ordv_UpdateName = this.StrUserID;
  3205. clist.Add(odbll.GetUpdateCommandInfo(model));
  3206. if (!string.IsNullOrEmpty(model.Ordv_ReservationFilmSelectionDividedShop))
  3207. {
  3208. storaRecord = "门店:" + companyBll.GetModel("Company_DividedShop", model.Ordv_ReservationFilmSelectionDividedShop).Company_Name;
  3209. }
  3210. LYFZ.Model.Model_ErpOrderWorkAnPaiRecord modelRecord = new Model.Model_ErpOrderWorkAnPaiRecord();
  3211. modelRecord.Ordwr_Number = "OWPR_" + LYFZ.BLL.BLL_ErpCustomer.GetClientNumber();
  3212. modelRecord.Ordwr_WorkNumber = model.Ordv_ViceNumber;
  3213. modelRecord.Ordwr_OrdNumber = model.Ordv_Number;
  3214. modelRecord.Ordwr_ViceNumber = model.Ordv_ViceNumber;
  3215. modelRecord.Ordwr_ModuleName = LYFZ.EnumPublic.WorkAnPaiChangeLogEnum.摄控安排选片客人.ToString();
  3216. DataTable dtName = orbll.GetView_Custom("tb_ErpOrderDigitalStatus", StrWhere: "Ords_ViceNumber = '" + model.Ordv_ViceNumber + "'", ShowColumnName: "Ords_SightsName").Tables[0];
  3217. if (dtName.Rows.Count > 0)
  3218. {
  3219. modelRecord.Ordwr_UpdateOrderName = dtName.Rows[0]["Ords_SightsName"].ToString().Trim();
  3220. }
  3221. else
  3222. {
  3223. modelRecord.Ordwr_UpdateOrderName = "";
  3224. }
  3225. modelRecord.Ordwr_UpdateAgoPerson = model.Ordv_FilmSelectionDispatcher;
  3226. modelRecord.Ordwr_UpdateAgoTime = model.Ordv_FilmSelectionDispatchTime;
  3227. modelRecord.Ordwr_UpdateAgoData = storaRecord + " " + "安排日期由'" + LYFZ.BLL.OtherCommonModel.DateTimeToString(dtRow["Ordv_ReservationFilmSelectionTime"]) + "'转移到'" + model.Ordv_ReservationFilmSelectionTime + "'";
  3228. modelRecord.Ordwr_CreateDatetime = SDateTime.Now;
  3229. modelRecord.Ordwr_CreateName = StrUserID;
  3230. clist.Add(ordwr.GetAddCommandInfo(modelRecord));
  3231. }
  3232. }
  3233. }
  3234. }
  3235. //看版客人
  3236. else if (this.rdoLookDesign.Checked)
  3237. {
  3238. foreach (DataRow dtRow in dtData.Rows)
  3239. {
  3240. if (dtRow["Ordv_ReservationLookDesignTime"].ToString().Trim().Length > 0 && dtRow["Ordv_LookDesignStatus"].ToString().Trim() != "1")
  3241. {
  3242. if (StrCurrentDateTime == Convert.ToDateTime(dtRow["Ordv_ReservationLookDesignTime"]).ToYYYY_MM_dd())
  3243. {
  3244. LYFZ.Model.Model_ErpOrderDigital model = odbll.DataRowToModel(dtRow);
  3245. model.Ordv_ReservationLookDesignTime = Convert.ToDateTime(frm.StrNextTime.Trim() + " " + Convert.ToDateTime(model.Ordv_ReservationLookDesignTime).ToString("HH:mm:ss"));
  3246. model.Ordv_UpdateDateTime = SDateTime.Now;
  3247. model.Ordv_UpdateName = this.StrUserID;
  3248. clist.Add(odbll.GetUpdateCommandInfo(model));
  3249. if (!string.IsNullOrEmpty(model.Ordv_ReservationLookDesignDividedShop))
  3250. {
  3251. storaRecord = "门店:" + companyBll.GetModel("Company_DividedShop", model.Ordv_ReservationLookDesignDividedShop).Company_Name;
  3252. }
  3253. LYFZ.Model.Model_ErpOrderWorkAnPaiRecord modelRecord = new Model.Model_ErpOrderWorkAnPaiRecord();
  3254. modelRecord.Ordwr_Number = "OWPR_" + LYFZ.BLL.BLL_ErpCustomer.GetClientNumber();
  3255. modelRecord.Ordwr_WorkNumber = model.Ordv_ViceNumber;
  3256. modelRecord.Ordwr_OrdNumber = model.Ordv_Number;
  3257. modelRecord.Ordwr_ViceNumber = model.Ordv_ViceNumber;
  3258. modelRecord.Ordwr_ModuleName = LYFZ.EnumPublic.WorkAnPaiChangeLogEnum.摄控安排看版客人.ToString();
  3259. DataTable dtName = orbll.GetView_Custom("tb_ErpOrderDigitalStatus", StrWhere: "Ords_ViceNumber = '" + model.Ordv_ViceNumber + "'", ShowColumnName: "Ords_SightsName").Tables[0];
  3260. if (dtName.Rows.Count > 0)
  3261. {
  3262. modelRecord.Ordwr_UpdateOrderName = dtName.Rows[0]["Ords_SightsName"].ToString().Trim();
  3263. }
  3264. else
  3265. {
  3266. modelRecord.Ordwr_UpdateOrderName = "";
  3267. }
  3268. modelRecord.Ordwr_UpdateAgoPerson = model.Ordv_LookDesignDispatcher;
  3269. modelRecord.Ordwr_UpdateAgoTime = model.Ordv_LookDesignDispatchTime;
  3270. modelRecord.Ordwr_UpdateAgoData = storaRecord + " " + "安排日期由'" + LYFZ.BLL.OtherCommonModel.DateTimeToString(dtRow["Ordv_ReservationLookDesignTime"]) + "'转移到'" + model.Ordv_ReservationLookDesignTime + "'";
  3271. modelRecord.Ordwr_CreateDatetime = SDateTime.Now;
  3272. modelRecord.Ordwr_CreateName = StrUserID;
  3273. clist.Add(ordwr.GetAddCommandInfo(modelRecord));
  3274. }
  3275. }
  3276. }
  3277. }
  3278. //选礼服客人
  3279. else if (this.rdoSelectDress.Checked)
  3280. {
  3281. foreach (DataRow dtRow in dtData.Rows)
  3282. {
  3283. if (dtRow["Ordv_ReservationClothingTime"].ToString().Trim().Length > 0 && dtRow["Ordv_ClothingStatus"].ToString().Trim() != "1")
  3284. {
  3285. if (StrCurrentDateTime == Convert.ToDateTime(dtRow["Ordv_ReservationClothingTime"]).ToYYYY_MM_dd())
  3286. {
  3287. LYFZ.Model.Model_ErpOrderDigital model = odbll.DataRowToModel(dtRow);
  3288. model.Ordv_ReservationClothingTime = Convert.ToDateTime(frm.StrNextTime.Trim() + " " + Convert.ToDateTime(model.Ordv_ReservationClothingTime).ToString("HH:mm:ss"));
  3289. model.Ordv_UpdateDateTime = SDateTime.Now;
  3290. model.Ordv_UpdateName = this.StrUserID;
  3291. clist.Add(odbll.GetUpdateCommandInfo(model));
  3292. if (!string.IsNullOrEmpty(model.Ordv_ReservationClothingDividedShop))
  3293. {
  3294. storaRecord = "门店:" + companyBll.GetModel("Company_DividedShop", model.Ordv_ReservationClothingDividedShop).Company_Name;
  3295. }
  3296. LYFZ.Model.Model_ErpOrderWorkAnPaiRecord modelRecord = new Model.Model_ErpOrderWorkAnPaiRecord();
  3297. modelRecord.Ordwr_Number = "OWPR_" + LYFZ.BLL.BLL_ErpCustomer.GetClientNumber();
  3298. modelRecord.Ordwr_WorkNumber = model.Ordv_ViceNumber;
  3299. modelRecord.Ordwr_OrdNumber = model.Ordv_Number;
  3300. modelRecord.Ordwr_ViceNumber = model.Ordv_ViceNumber;
  3301. modelRecord.Ordwr_ModuleName = LYFZ.EnumPublic.WorkAnPaiChangeLogEnum.摄控安排选礼服客人.ToString();
  3302. DataTable dtName = orbll.GetView_Custom("tb_ErpOrderDigitalStatus", StrWhere: "Ords_ViceNumber = '" + model.Ordv_ViceNumber + "'", ShowColumnName: "Ords_SightsName").Tables[0];
  3303. if (dtName.Rows.Count > 0)
  3304. {
  3305. modelRecord.Ordwr_UpdateOrderName = dtName.Rows[0]["Ords_SightsName"].ToString().Trim();
  3306. }
  3307. else
  3308. {
  3309. modelRecord.Ordwr_UpdateOrderName = "";
  3310. }
  3311. modelRecord.Ordwr_UpdateAgoPerson = model.Ordv_ClothingDispatcher;
  3312. modelRecord.Ordwr_UpdateAgoTime = model.Ordv_ClothingDispatchTime;
  3313. modelRecord.Ordwr_UpdateAgoData = storaRecord + " " + "安排日期由'" + LYFZ.BLL.OtherCommonModel.DateTimeToString(dtRow["Ordv_ReservationClothingTime"]) + "'转移到'" + model.Ordv_ReservationClothingTime + "'";
  3314. modelRecord.Ordwr_CreateDatetime = SDateTime.Now;
  3315. modelRecord.Ordwr_CreateName = StrUserID;
  3316. clist.Add(ordwr.GetAddCommandInfo(modelRecord));
  3317. }
  3318. }
  3319. }
  3320. }
  3321. }
  3322. if (clist.Count > 0)
  3323. {
  3324. if (LYFZ.BLL.BaseBllOperate.ExecuteSqlTran(clist) > 0)
  3325. { MessageBoxCustom.Show("已将您沟通的客户‘" + this.dgvData.CurrentRow.Cells["客户姓名"].Value.ToString().Trim() + "’的摄控预约日期改为‘" + frm.StrNextTime + "’"); }
  3326. }
  3327. }
  3328. #endregion
  3329. this.PublicFunctionRows();
  3330. }
  3331. }
  3332. }
  3333. }
  3334. else if (this.rdoHospitalClient.Checked)
  3335. {
  3336. if (this.dgvData.Columns["ID"] != null)
  3337. {
  3338. string StrOrderID = this.dgvData.CurrentRow.Cells["ID"].Value.ToString().Trim();
  3339. LYFZ.Software.MainBusiness.HospitalTrackingSystem.AddingTrackRecord frm = new HospitalTrackingSystem.AddingTrackRecord();
  3340. frm.IsShowDatimeRemind = false;
  3341. frm.StrOrderNumber = StrOrdNumber;
  3342. frm.IsGoForm = false;
  3343. frm.intDispatchDoorID = Convert.ToInt32(StrOrderID);
  3344. frm.ShowDialog();
  3345. if (frm.IsSaveed)
  3346. { this.PublicFunctionRows(); }
  3347. }
  3348. else
  3349. { MessageBoxCustom.Show("版本数据不正确,请重置列表标!"); }
  3350. }
  3351. }
  3352. }
  3353. }
  3354. }
  3355. /// <summary>
  3356. /// 沟通详情
  3357. /// </summary>
  3358. /// <param name="sender"></param>
  3359. /// <param name="e"></param>
  3360. void btnCommunicateDetails_Click(object sender, EventArgs e)
  3361. {
  3362. if (this.dgvData.Visible == true)
  3363. {
  3364. if (this.dgvData.Rows.Count > 0)
  3365. {
  3366. if (this.dgvData.SelectedRows.Count > 0)
  3367. {
  3368. string StrOrdNumber = this.dgvData.CurrentRow.Cells["Ord_Number"].Value.ToString().Trim();
  3369. if (StrOrdNumber != "")
  3370. {
  3371. if (this.rdoHospitalClient.Checked)
  3372. {
  3373. LYFZ.Software.MainBusiness.HospitalTrackingSystem.IntentionsEntered frm = new HospitalTrackingSystem.IntentionsEntered();
  3374. frm.StrOrdNumber = StrOrdNumber;
  3375. frm.ShowDialog();
  3376. if (frm.IsSaveed)
  3377. { this.PublicFunctionRows(); }
  3378. }
  3379. else
  3380. {
  3381. LYFZ.Software.MainBusiness.CameraControlBook.SuperSmallForm.A_CommunicationDetails frm = new SuperSmallForm.A_CommunicationDetails();
  3382. frm.StrNumber = StrOrdNumber;
  3383. frm.ShowDialog();
  3384. if (frm.IsSaveed)
  3385. { this.PublicFunctionRows(); }
  3386. }
  3387. }
  3388. }
  3389. }
  3390. }
  3391. }
  3392. /// <summary>
  3393. /// 安排客服
  3394. /// </summary>
  3395. /// <param name="sender"></param>
  3396. /// <param name="e"></param>
  3397. void btnClientServiceAnPai_Click(object sender, EventArgs e)
  3398. {
  3399. if (this.dgvData.SelectedRows.Count > 0)
  3400. {
  3401. LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.ClientServiceTaskAnPaiSmallForm frm = new DoorCityProcess.SetSmallForm.ClientServiceTaskAnPaiSmallForm();
  3402. frm.ShowDialog();
  3403. if (frm.IsSaveed)
  3404. {
  3405. LYFZ.EnumPublic.ClientServiceTaskItem ClientServiceAnPai = EnumPublic.ClientServiceTaskItem.拍照客人;
  3406. if (this.rdoFilmSelection.Checked)
  3407. { ClientServiceAnPai = EnumPublic.ClientServiceTaskItem.选片客人; }
  3408. else if (this.rdoLookDesign.Checked)
  3409. { ClientServiceAnPai = EnumPublic.ClientServiceTaskItem.看版客人; }
  3410. else if (this.rdoSelectDress.Checked)
  3411. { ClientServiceAnPai = EnumPublic.ClientServiceTaskItem.选衣服客人; }
  3412. else if (this.rdoService.Checked)
  3413. { ClientServiceAnPai = EnumPublic.ClientServiceTaskItem.服务客人; }
  3414. else if (this.rdoTotakePiece.Checked)
  3415. { ClientServiceAnPai = EnumPublic.ClientServiceTaskItem.取件客人; }
  3416. else if (this.rdoHospitalClient.Checked)
  3417. { ClientServiceAnPai = EnumPublic.ClientServiceTaskItem.摄控医院客人; }
  3418. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ClientServiceAnPai(this.dgvData, LYFZ.EnumPublic.ClientServiceTaskType.摄控确认, frm.model, ClientServiceAnPai);
  3419. }
  3420. }
  3421. }
  3422. /// <summary>
  3423. /// 员工档期
  3424. /// </summary>
  3425. /// <param name="sender"></param>
  3426. /// <param name="e"></param>
  3427. void btnPersonSchedule_Click(object sender, EventArgs e)
  3428. {
  3429. LYFZ.Software.MainBusiness.CameraControlBook.SmallForm.A_EmployeeScheduleSmallForm frm = new SmallForm.A_EmployeeScheduleSmallForm();
  3430. frm.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  3431. frm.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y);
  3432. frm.Size = new Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height);
  3433. frm.ShowDialog();
  3434. }
  3435. #endregion
  3436. #region 数据处理
  3437. bool GetIsWorkChange(int eRowIndex, ref string StrModuleName)
  3438. {
  3439. string StrModuleNameWhere = "";
  3440. if (this.rdoFilmSelection.Checked)
  3441. {
  3442. StrModuleNameWhere = " And Ordwr_ModuleName = '" + LYFZ.EnumPublic.WorkAnPaiChangeLogEnum.摄控安排选片客人.ToString() + "' ";
  3443. StrModuleName = LYFZ.EnumPublic.WorkAnPaiChangeLogEnum.摄控安排选片客人.ToString();
  3444. }
  3445. else if (this.rdoLookDesign.Checked)
  3446. {
  3447. StrModuleNameWhere = " And Ordwr_ModuleName = '" + LYFZ.EnumPublic.WorkAnPaiChangeLogEnum.摄控安排看版客人.ToString() + "' ";
  3448. StrModuleName = LYFZ.EnumPublic.WorkAnPaiChangeLogEnum.摄控安排看版客人.ToString();
  3449. }
  3450. else if (this.rdoPhotographed.Checked)
  3451. {
  3452. StrModuleNameWhere = " And Ordwr_ModuleName = '" + LYFZ.EnumPublic.WorkAnPaiChangeLogEnum.摄控安排拍照客人.ToString() + "' ";
  3453. StrModuleName = LYFZ.EnumPublic.WorkAnPaiChangeLogEnum.摄控安排拍照客人.ToString();
  3454. }
  3455. else if (this.rdoSelectDress.Checked)
  3456. {
  3457. StrModuleNameWhere = " And Ordwr_ModuleName = '" + LYFZ.EnumPublic.WorkAnPaiChangeLogEnum.摄控安排选礼服客人.ToString() + "' ";
  3458. StrModuleName = LYFZ.EnumPublic.WorkAnPaiChangeLogEnum.摄控安排选礼服客人.ToString();
  3459. }
  3460. else if (this.rdoService.Checked)
  3461. {
  3462. StrModuleNameWhere = " And Ordwr_ModuleName = '" + LYFZ.EnumPublic.WorkAnPaiChangeLogEnum.摄控安排服务客人.ToString() + "' ";
  3463. StrModuleName = LYFZ.EnumPublic.WorkAnPaiChangeLogEnum.摄控安排服务客人.ToString();
  3464. }
  3465. else if (this.rdoTotakePiece.Checked)
  3466. {
  3467. StrModuleNameWhere = " And Ordwr_ModuleName = '" + LYFZ.EnumPublic.WorkAnPaiChangeLogEnum.摄控安排取件客人.ToString() + "' ";
  3468. StrModuleName = LYFZ.EnumPublic.WorkAnPaiChangeLogEnum.摄控安排取件客人.ToString();
  3469. }
  3470. if (StrModuleName.Trim().Length > 0)
  3471. {
  3472. DataTable dt = orbll.GetView_Custom("tb_ErpOrderWorkAnPaiRecord", StrWhere: "Ordwr_ViceNumber = '" + this.dgvData.Rows[eRowIndex].Cells["Ordv_ViceNumber"].Value.ToString().Trim() + "'" + StrModuleNameWhere, ShowColumnName: "ID", filedOrder: "Ordwr_CreateDatetime DESC").Tables[0];
  3473. if (dt.Rows.Count > 0)
  3474. {
  3475. return true;
  3476. }
  3477. }
  3478. return false;
  3479. }
  3480. /// <summary>
  3481. /// 右键菜单
  3482. /// </summary>
  3483. /// <param name="sender"></param>
  3484. /// <param name="e"></param>
  3485. void dgvData_CellMouseDown(object sender, DataGridViewCellMouseEventArgs e)
  3486. {
  3487. if (e.Button == MouseButtons.Right)
  3488. {
  3489. if (e.RowIndex >= 0 && e.ColumnIndex >= 0)
  3490. {
  3491. if (this.dgvData.SelectedRows.Count > 0)
  3492. {
  3493. bool IsFind = false;
  3494. Hashtable htData = null;
  3495. ToolStripMenuItem item = null;
  3496. if (this.rdoPhotographed.Checked)
  3497. {
  3498. bool IsPhotographRetake = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights(this.cmbtreevStoreName, "StoresPhotograph", LYFZ.CustomAttributes.OperatingAuthority.PhotographRetake);
  3499. if (IsPhotographRetake && this.dgvData.Rows[e.RowIndex].Cells["拍摄状态"].Value.ToString().Trim() != "未拍" && this.dgvData.Rows[e.RowIndex].DefaultCellStyle.ForeColor != Color.Coral)
  3500. {
  3501. item = new ToolStripMenuItem();
  3502. htData = new Hashtable();
  3503. htData["StrNumber"] = this.dgvData.Rows[e.RowIndex].Cells["Ord_Number"].Value.ToString().Trim();
  3504. htData["StrSightsIDNumber"] = this.dgvData.Rows[e.RowIndex].Cells["VID"].Value.ToString().Trim();
  3505. item.Text = "重拍";
  3506. item.Tag = htData;
  3507. item.Name = "Remake";
  3508. this.dgvData.conMenu.Items.Add(item);
  3509. IsFind = true;
  3510. }
  3511. DataTable dt = orbll.GetView_Custom("tb_ErpOrdersPhotography", StrWhere: "ID = '" + this.dgvData.Rows[e.RowIndex].Cells["VID"].Value.ToString().Trim() + "'", ShowColumnName: "Ordpg_IDNumber").Tables[0];
  3512. if (dt.Rows.Count > 0)
  3513. {
  3514. DataTable odt = orbll.GetView_Custom("tb_ErpOrderRetakeRecord", StrWhere: "Ordrr_SightsIDNumber = '" + dt.Rows[0]["Ordpg_IDNumber"].ToString().Trim() + "'", ShowColumnName: "Count(ID) AS CountID").Tables[0];
  3515. if (odt.Rows.Count > 0)
  3516. {
  3517. if (Convert.ToInt32(odt.Rows[0]["CountID"]) > 0)
  3518. {
  3519. item = new ToolStripMenuItem();
  3520. htData = new Hashtable();
  3521. htData["StrNumber"] = this.dgvData.Rows[e.RowIndex].Cells["Ord_Number"].Value.ToString().Trim();
  3522. htData["StrViceNumber"] = this.dgvData.Rows[e.RowIndex].Cells["Ordv_ViceNumber"].Value.ToString().Trim();
  3523. htData["StrSightsIDNumber"] = dt.Rows[0]["Ordpg_IDNumber"].ToString().Trim();
  3524. htData["IsCompetence"] = IsPhotographRetake;
  3525. item.Text = "重拍记录";
  3526. item.Tag = htData;
  3527. item.Name = "RemakeRecord";
  3528. this.dgvData.conMenu.Items.Add(item);
  3529. IsFind = true;
  3530. }
  3531. }
  3532. }
  3533. }
  3534. if (this.dgvData.SelectedRows.Count == 1 && !this.rdoHospitalClient.Checked)
  3535. {
  3536. item = new ToolStripMenuItem();
  3537. htData = new Hashtable();
  3538. htData["StrNumber"] = this.dgvData.Rows[e.RowIndex].Cells["Ord_Number"].Value.ToString().Trim();
  3539. htData["StrViceNumber"] = this.dgvData.Rows[e.RowIndex].Cells["Ordv_ViceNumber"].Value.ToString().Trim();
  3540. item.Text = "订单备注";
  3541. item.Tag = htData;
  3542. item.Name = "OrderRemark";
  3543. this.dgvData.conMenu.Items.Add(item);
  3544. IsFind = true;
  3545. string StrModuleName = "";
  3546. if (this.GetIsWorkChange(e.RowIndex, ref StrModuleName))
  3547. {
  3548. item = new ToolStripMenuItem();
  3549. htData = new Hashtable();
  3550. htData["StrNumber"] = this.dgvData.Rows[e.RowIndex].Cells["Ord_Number"].Value.ToString().Trim();
  3551. htData["StrViceNumber"] = this.dgvData.Rows[e.RowIndex].Cells["Ordv_ViceNumber"].Value.ToString().Trim();
  3552. htData["StrModuleName"] = StrModuleName;
  3553. item.Text = "安排变更记录";
  3554. item.Tag = htData;
  3555. item.Name = "WorkLog";
  3556. this.dgvData.conMenu.Items.Add(item);
  3557. }
  3558. }
  3559. if (IsFind)
  3560. {
  3561. // this.dgvData.conMenu.Show(MousePosition.X, MousePosition.Y);//弹出操作菜单
  3562. this.dgvData.conMenu.ItemClicked -= dgvData_DataGridViewConMenu_ItemClicked;
  3563. this.dgvData.conMenu.ItemClicked += dgvData_DataGridViewConMenu_ItemClicked;
  3564. // this.dgvData.conMenu.Show();
  3565. if (!this.dgvData.conMenu.Visible)
  3566. {
  3567. this.dgvData.conMenu.Show(MousePosition.X, MousePosition.Y);//弹出操作菜单
  3568. }
  3569. }
  3570. }
  3571. }
  3572. else
  3573. {
  3574. this.dgvData.conMenu.Items.Clear();
  3575. ToolStripMenuItem item = new ToolStripMenuItem();
  3576. item.Text = "设置标题";
  3577. item.Tag = "SetColumnShow";
  3578. item.Name = "SetColumnShow";
  3579. this.dgvData.conMenu.Items.Add(item);
  3580. // this.dgvData.conMenu.Show(MousePosition.X, MousePosition.Y);//弹出操作菜单
  3581. this.dgvData.conMenu.ItemClicked -= dgvData_DataGridViewConMenu_ItemClicked;
  3582. this.dgvData.conMenu.ItemClicked += dgvData_DataGridViewConMenu_ItemClicked;
  3583. // this.dgvData.conMenu.Show();
  3584. if (!this.dgvData.conMenu.Visible)
  3585. {
  3586. this.dgvData.conMenu.Show(MousePosition.X, MousePosition.Y);//弹出操作菜单
  3587. }
  3588. }
  3589. ToolStripMenuItem stripItem = new ToolStripMenuItem();
  3590. stripItem.Text = "颜色";
  3591. this.dgvData.conMenu.Items.Add(stripItem);
  3592. BLL.BLL_ColorSetting bLL_Color = new BLL.BLL_ColorSetting();
  3593. System.Data.DataTable dtList = bLL_Color.GetAllList().Tables[0];
  3594. List<ToolStripItem> items = new List<ToolStripItem>();
  3595. ToolStripMenuItem stripItem0 = new ToolStripMenuItem();
  3596. stripItem0.Text = "清除";
  3597. items.Add(stripItem0);
  3598. stripItem0.Click += StripItem0_Click;
  3599. foreach (System.Data.DataRow dr in dtList.Rows)
  3600. {
  3601. ToolStripMenuItem stripItem1 = new ToolStripMenuItem();
  3602. stripItem1.Text = dr["InfoText"].ToString();
  3603. dynamic dyColor = JsonConvert.DeserializeObject(dr["ColorText"].ToString());
  3604. stripItem1.BackColor = Color.FromArgb(
  3605. Convert.ToInt32(dyColor.A),
  3606. Convert.ToInt32(dyColor.R),
  3607. Convert.ToInt32(dyColor.G),
  3608. Convert.ToInt32(dyColor.B)
  3609. );
  3610. stripItem1.Tag = dr;
  3611. stripItem1.Click += StripItem1_Click;
  3612. items.Add(stripItem1);
  3613. }
  3614. stripItem.DropDownItems.AddRange(items.ToArray());
  3615. }
  3616. }
  3617. private void StripItem0_Click(object sender, EventArgs e)
  3618. {
  3619. if (this.dgvData.SelectedRows.Count > 0)
  3620. {
  3621. BLL.BLL_ErpOrder bllErpOrder = new BLL.BLL_ErpOrder();
  3622. string OrdNumber = this.dgvData.SelectedRows[0].Cells["Ord_Number"].Value.ToString();
  3623. Model.Model_ErpOrder model_ErpOrder = bllErpOrder.GetModel(OrdNumber);
  3624. model_ErpOrder.ord_AutoColor = "";
  3625. bllErpOrder.Update(model_ErpOrder);
  3626. PublicFunctionRows();
  3627. }
  3628. }
  3629. private void StripItem1_Click(object sender, EventArgs e)
  3630. {
  3631. if (this.dgvData.SelectedRows.Count > 0)
  3632. {
  3633. BLL.BLL_ErpOrder bllErpOrder = new BLL.BLL_ErpOrder();
  3634. string OrdNumber = this.dgvData.SelectedRows[0].Cells["Ord_Number"].Value.ToString();
  3635. Model.Model_ErpOrder model_ErpOrder = bllErpOrder.GetModel(OrdNumber);
  3636. DataRow dr = (DataRow)((ToolStripItem)sender).Tag;
  3637. string colorText = dr["ColorText"].ToString();
  3638. model_ErpOrder.ord_AutoColor = colorText;
  3639. bllErpOrder.Update(model_ErpOrder);
  3640. PublicFunctionRows();
  3641. }
  3642. }
  3643. /// <summary>
  3644. /// 列表单击事件
  3645. /// </summary>
  3646. /// <param name="sender"></param>
  3647. /// <param name="e"></param>
  3648. void dgvData_CellClick(object sender, DataGridViewCellEventArgs e)
  3649. {
  3650. try
  3651. {
  3652. if (this.dgvData.Columns.Contains("订单号"))
  3653. {
  3654. string StrNumber = this.dgvData.CurrentRow.Cells["订单号"].Value.ToString().Trim();
  3655. if (string.IsNullOrEmpty(StrNumber) || StrNumber.Trim() == "(取件OK)")
  3656. {
  3657. bool IsFind = false;
  3658. int i = this.dgvData.CurrentRow.Index;
  3659. while (!IsFind)
  3660. {
  3661. i = i - 1;
  3662. if (!string.IsNullOrEmpty(this.dgvData.Rows[i].Cells["订单号"].Value.ToString().Trim()))
  3663. { StrNumber = this.dgvData.Rows[i].Cells["订单号"].Value.ToString().Trim(); IsFind = true; }
  3664. }
  3665. }
  3666. LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber = StrNumber;
  3667. }
  3668. }
  3669. catch
  3670. { }
  3671. }
  3672. /// <summary>
  3673. /// 对列表控件双击事件
  3674. /// </summary>
  3675. /// <param name="sender"></param>
  3676. /// <param name="e"></param>
  3677. void dgvData_MouseDoubleClick(object sender, MouseEventArgs e)
  3678. {
  3679. Point hit = this.dgvData.PointToClient(Cursor.Position);
  3680. DataGridView.HitTestInfo hitTest = this.dgvData.HitTest(hit.X, hit.Y);
  3681. if (hitTest.RowIndex < 0 && hitTest.ColumnIndex < 0)
  3682. { LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber = ""; }
  3683. }
  3684. /// <summary>
  3685. /// 右键菜单选择项事件
  3686. /// </summary>
  3687. /// <param name="sender"></param>
  3688. /// <param name="e"></param>
  3689. void dgvData_DataGridViewConMenu_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
  3690. {
  3691. ToolStripItem item = e.ClickedItem;
  3692. if (item.Name.Trim() == "SetColumnShow")
  3693. {
  3694. string strEnabled = "";
  3695. if (this.dgvData.Columns.Contains("拍摄状态"))
  3696. {
  3697. strEnabled = "拍摄状态";
  3698. }
  3699. if (LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ShowDataGridViewSetColumn(this.dgvData, StrEnabled: strEnabled))
  3700. {
  3701. this.PublicFunctionRows();
  3702. }
  3703. }
  3704. else if (item.Name.Trim() == "Remake")
  3705. {
  3706. Hashtable htData = (Hashtable)item.Tag;
  3707. LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.OrderSightsRetakeSmallForm frm = new DoorCityProcess.SetSmallForm.OrderSightsRetakeSmallForm();
  3708. frm.StrOrdNumber = htData["StrNumber"].ToString().Trim();
  3709. frm.StrSightsID = htData["StrSightsIDNumber"].ToString().Trim();
  3710. frm.StrRetakeType = EnumPublic.EnumRetakeType.拍照重拍;
  3711. frm.ShowDialog();
  3712. if (frm.IsSaveed)
  3713. {
  3714. this.PublicFunctionRows();
  3715. }
  3716. }
  3717. else if (item.Name.Trim() == "RemakeRecord")
  3718. {
  3719. Hashtable htData = (Hashtable)item.Tag;
  3720. LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.OrderSightsRemakeRecordSmallForm frm = new DoorCityProcess.SetSmallForm.OrderSightsRemakeRecordSmallForm();
  3721. frm.StrRemakeRecordType = EnumPublic.EnumRetakeType.拍照重拍;
  3722. frm.StrOrdNumber = htData["StrNumber"].ToString().Trim();
  3723. frm.StrSightsID = htData["StrSightsIDNumber"].ToString().Trim();
  3724. frm.IsCompetence = Convert.ToBoolean(htData["IsCompetence"]);
  3725. frm.ShowDialog();
  3726. if (frm.IsSaveed)
  3727. {
  3728. this.PublicFunctionRows();
  3729. }
  3730. }
  3731. else if (item.Name.Trim() == "OrderRemark")
  3732. {
  3733. Hashtable htData = (Hashtable)item.Tag;
  3734. LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.OrderRemarkRecordAddSuperSmallForm frm = new DoorCityProcess.SuperSmallForm.OrderRemarkRecordAddSuperSmallForm();
  3735. frm.StrOrderNumber = htData["StrNumber"].ToString().Trim();
  3736. frm.StrOrdViceNumber = htData["StrViceNumber"].ToString().Trim();
  3737. if (this.rdoPhotographed.Checked)
  3738. {
  3739. frm.StrOrdModuleName = LYFZ.EnumPublic.EnumOrderRemarkModule.预约拍照.ToString().Trim();
  3740. }
  3741. else if (this.rdoFilmSelection.Checked)
  3742. {
  3743. frm.StrOrdModuleName = LYFZ.EnumPublic.EnumOrderRemarkModule.预约选片.ToString().Trim();
  3744. }
  3745. else if (this.rdoLookDesign.Checked)
  3746. {
  3747. frm.StrOrdModuleName = LYFZ.EnumPublic.EnumOrderRemarkModule.预约看版.ToString().Trim();
  3748. }
  3749. else if (this.rdoSelectDress.Checked)
  3750. {
  3751. frm.StrOrdModuleName = LYFZ.EnumPublic.EnumOrderRemarkModule.预约选衣.ToString().Trim();
  3752. }
  3753. else if (this.rdoTotakePiece.Checked)
  3754. {
  3755. frm.StrOrdModuleName = LYFZ.EnumPublic.EnumOrderRemarkModule.预约取件.ToString().Trim();
  3756. }
  3757. else if (this.rdoService.Checked)
  3758. {
  3759. frm.StrOrdModuleName = LYFZ.EnumPublic.EnumOrderRemarkModule.预约服务.ToString().Trim();
  3760. }
  3761. frm.ShowDialog();
  3762. }
  3763. else if (item.Name.Trim() == "WorkLog")
  3764. {
  3765. Hashtable htData = (Hashtable)item.Tag;
  3766. LYFZ.Software.MainBusiness.CameraControlBook.SuperSmallForm.WorkAnPaiRecordSuperSmallForm frm = new SuperSmallForm.WorkAnPaiRecordSuperSmallForm();
  3767. frm.StrOrdNumber = htData["StrNumber"].ToString().Trim();
  3768. frm.StrViceNumber = htData["StrViceNumber"].ToString().Trim();
  3769. frm.StrModuleName = htData["StrModuleName"].ToString().Trim();
  3770. frm.ShowDialog();
  3771. }
  3772. }
  3773. /// <summary>
  3774. /// 创建行
  3775. /// </summary>
  3776. void PublicFunctionRows()
  3777. {
  3778. string StrFixedHideColumn = "";
  3779. string StrVersion = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetVersion(this.chkPortraitVersion, this.chkDressVersion, this.chkKidsVersion);//获取版本
  3780. if (StrVersion == "1")
  3781. { StrFixedHideColumn = ",婚期"; }
  3782. if (this.chkWeddingCelebration.Checked)
  3783. { StrFixedHideColumn += ",拍摄名称"; }
  3784. if (this.rdoPhotographed.Checked)
  3785. {
  3786. this.panelEx8.Visible = true;
  3787. this.dgvData.dgvCurrentColumnOriginalSet = "Ord_Class,Ord_Type,VID,Ord_Number,Ordv_ViceNumber,ord_AutoColor,订单号,客户姓名,客户性别,客户电话,年龄,订单类型,接单人,套系名称,套系价格,婚期,欠款,拍摄名称,服装套数,拍摄状态,摄影时间,摄影师,摄影师满意度,摄影助理,摄影助理满意度,化妆师,化妆师满意度,化妆助理,化妆助理满意度,引导师,引导师满意度,引导助理,引导助理满意度,录入备注,安排人,安排时间,客服人员,沟通时间,沟通状态,沟通备注";
  3788. string StrGuidName = LYFZ.EnumPublic.dgvGuidName.E_FormAll_A0011.ToString().Trim();
  3789. this.dgvData.dgvFixedHideColumn = "Ord_Class,Ord_Type,VID,Ord_Number,ord_AutoColor,Ordv_ViceNumber" + StrFixedHideColumn;
  3790. this.dgvData.dgvGuidName = StrGuidName;
  3791. this.dgvData.dgvUserEmployeeID = this.StrUserID;
  3792. this.dgvData.StrValueNullColumn = "订单号,客户姓名,客户性别,客户电话,年龄,订单类型,接单人,套系名称,套系价格,婚期,欠款";
  3793. Dictionary<string, string> dictColumns = LYFZ.DAL.DAL_GridViewDisplayIndex.GetGridViewShowColumns(this.StrUserID, StrGuidName, this.dgvData.dgvCurrentColumnOriginalSet);
  3794. this.dgvData.dictShowColumName = dictColumns;
  3795. LYFZ.ComponentLibrary.DataGridOrderView.GetData_CameraControlBookPhotographed(this.dgvData, dictColumns, this.GetWhereStr(), this.StrSortField);//"Ordpg_ReservationPhotographyTime,Ord_Number,Ordv_DigitalNumber");
  3796. }
  3797. else
  3798. {
  3799. this.panelEx8.Visible = false;
  3800. if (this.rdoFilmSelection.Checked)
  3801. {
  3802. this.dgvData.dgvCurrentColumnOriginalSet = "Ord_Type,Ord_Number,Ordv_ViceNumber,ord_AutoColor,订单号,客户姓名,客户性别,客户电话,订单类型,接单人,套系名称,套系价格,婚期,欠款,拍摄名称,拍照状态,摄影师,化妆师,初修状态,选片状态,选片师,选片师满意度,选片时间,安排人,安排时间,客服人员,沟通时间,沟通状态,沟通备注";
  3803. string StrGuidName = LYFZ.EnumPublic.dgvGuidName.E_FormAll_A0012.ToString().Trim();
  3804. this.dgvData.dgvFixedHideColumn = "Ord_Type,Ord_Number,ord_AutoColor,Ordv_ViceNumber" + StrFixedHideColumn;
  3805. this.dgvData.dgvGuidName = StrGuidName;
  3806. this.dgvData.dgvUserEmployeeID = this.StrUserID;
  3807. this.dgvData.StrValueNullColumn = "订单号,客户姓名,客户性别,客户电话,订单类型,接单人,套系名称,套系价格,婚期,欠款";
  3808. Dictionary<string, string> dictColumns = LYFZ.DAL.DAL_GridViewDisplayIndex.GetGridViewShowColumns(this.StrUserID, StrGuidName, this.dgvData.dgvCurrentColumnOriginalSet);
  3809. this.dgvData.dictShowColumName = dictColumns;
  3810. LYFZ.ComponentLibrary.DataGridOrderView.GetData_CameraControlBookFilmSelection(this.dgvData, dictColumns, this.GetWhereStr(), this.StrSortField);//"Ordv_ReservationFilmSelectionTime,Ord_Number,Ordv_DigitalNumber");
  3811. }
  3812. else if (this.rdoLookDesign.Checked)
  3813. {
  3814. this.dgvData.dgvCurrentColumnOriginalSet = "Ord_Type,Ord_Number,Ordv_ViceNumber,ord_AutoColor,订单号,客户姓名,客户性别,客户电话,订单类型,接单人,套系名称,套系价格,婚期,欠款,拍摄名称,设计状态,看版状态,看版师,看版师满意度,看版时间,安排人,安排时间,客服人员,沟通时间,沟通状态,沟通备注";
  3815. string StrGuidName = LYFZ.EnumPublic.dgvGuidName.E_FormAll_A0013.ToString().Trim();
  3816. this.dgvData.dgvFixedHideColumn = "Ord_Type,Ord_Number,ord_AutoColor,Ordv_ViceNumber" + StrFixedHideColumn;
  3817. this.dgvData.dgvGuidName = StrGuidName;
  3818. this.dgvData.dgvUserEmployeeID = this.StrUserID;
  3819. this.dgvData.StrValueNullColumn = "订单号,客户姓名,客户性别,客户电话,订单类型,接单人,套系名称,套系价格,婚期,欠款";
  3820. Dictionary<string, string> dictColumns = LYFZ.DAL.DAL_GridViewDisplayIndex.GetGridViewShowColumns(this.StrUserID, StrGuidName, this.dgvData.dgvCurrentColumnOriginalSet);
  3821. this.dgvData.dictShowColumName = dictColumns;
  3822. LYFZ.ComponentLibrary.DataGridOrderView.GetData_CameraControlBookLookDesign(this.dgvData, dictColumns, this.GetWhereStr(), this.StrSortField);//"Ordv_ReservationLookDesignTime,Ord_Number,Ordv_DigitalNumber");
  3823. }
  3824. else if (this.rdoTotakePiece.Checked)
  3825. {
  3826. this.dgvData.dgvCurrentColumnOriginalSet = "Ord_Type,Ord_Number,Ordv_ViceNumber,ord_AutoColor,订单号,客户姓名,客户性别,客户电话,订单类型,接单人,套系名称,套系价格,婚期,欠款,拍摄名称,商品名称,取件时间,取件人,取件状态,完成状态,安排人,安排时间,客服人员,沟通时间,沟通状态,沟通备注";
  3827. string StrGuidName = LYFZ.EnumPublic.dgvGuidName.E_FormAll_A0014.ToString().Trim();
  3828. this.dgvData.dgvFixedHideColumn = "Ord_Type,Ord_Number,ord_AutoColor,Ordv_ViceNumber" + StrFixedHideColumn;
  3829. this.dgvData.dgvGuidName = StrGuidName;
  3830. this.dgvData.dgvUserEmployeeID = this.StrUserID;
  3831. this.dgvData.StrValueNullColumn = "订单号,客户姓名,客户性别,客户电话,订单类型,接单人,套系名称,套系价格,婚期,欠款";
  3832. this.dgvData.StrSecondStageNull = "拍摄名称";
  3833. Dictionary<string, string> dictColumns = LYFZ.DAL.DAL_GridViewDisplayIndex.GetGridViewShowColumns(this.StrUserID, StrGuidName, this.dgvData.dgvCurrentColumnOriginalSet);
  3834. this.dgvData.dictShowColumName = dictColumns;
  3835. LYFZ.ComponentLibrary.DataGridOrderView.GetData_CameraControlBookTotakePiece(this.dgvData, dictColumns, this.GetWhereStr(), this.StrSortField);//"OPlist_ReservationTakeTime,Ord_Number,Ordv_DigitalNumber");
  3836. }
  3837. else if (this.rdoService.Checked)
  3838. {
  3839. this.dgvData.dgvCurrentColumnOriginalSet = "Ord_Type,Ord_Number,Ordv_ViceNumber,ord_AutoColor,订单号,客户姓名,客户性别,客户电话,订单类型,接单人,套系名称,套系价格,婚期,欠款,拍摄名称,服务内容,服务状态,服务日期,服务人员1,服务人员1满意度,服务人员2,服务人员2满意度,安排人,安排时间,服务备注,客服人员,沟通时间,沟通状态,沟通备注";
  3840. string StrGuidName = LYFZ.EnumPublic.dgvGuidName.E_FormAll_A0015.ToString().Trim();
  3841. this.dgvData.dgvFixedHideColumn = "Ord_Type,Ord_Number,ord_AutoColor,Ordv_ViceNumber" + StrFixedHideColumn;
  3842. this.dgvData.dgvGuidName = StrGuidName;
  3843. this.dgvData.dgvUserEmployeeID = this.StrUserID;
  3844. this.dgvData.StrValueNullColumn = "订单号,客户姓名,客户性别,客户电话,订单类型,接单人,套系名称,套系价格,婚期,欠款";
  3845. this.dgvData.StrSecondStageNull = "拍摄名称";
  3846. Dictionary<string, string> dictColumns = LYFZ.DAL.DAL_GridViewDisplayIndex.GetGridViewShowColumns(this.StrUserID, StrGuidName, this.dgvData.dgvCurrentColumnOriginalSet);
  3847. this.dgvData.dictShowColumName = dictColumns;
  3848. LYFZ.ComponentLibrary.DataGridOrderView.GetData_CameraControlBookService(this.dgvData, dictColumns, this.GetWhereStr(), this.StrSortField);//"Ws_WeddingDate,Ord_Number,Ords_DigitalNumber");
  3849. }
  3850. else if (this.rdoSelectDress.Checked)
  3851. {
  3852. this.dgvData.dgvCurrentColumnOriginalSet = "Ord_Type,Ord_Number,Ordv_ViceNumber,ord_AutoColor,订单号,客户姓名,客户性别,客户电话,订单类型,接单人,套系名称,套系价格,婚期,拍摄名称,服装套数,选礼服状态,预约选礼服师,预约选礼服时间,确认选礼服师,确认选礼服时间,礼服师满意度,安排人,安排时间,客服人员,沟通时间,沟通状态,沟通备注";
  3853. string StrGuidName = LYFZ.EnumPublic.dgvGuidName.E_FormAll_A0016.ToString().Trim();
  3854. this.dgvData.dgvFixedHideColumn = "Ord_Type,Ord_Number,ord_AutoColor,Ordv_ViceNumber" + StrFixedHideColumn;
  3855. this.dgvData.dgvGuidName = StrGuidName;
  3856. this.dgvData.dgvUserEmployeeID = this.StrUserID;
  3857. this.dgvData.StrValueNullColumn = "订单号,客户姓名,客户性别,客户电话,订单类型,接单人,套系名称,套系价格,婚期";
  3858. this.dgvData.StrSecondStageNull = "拍摄名称";
  3859. Dictionary<string, string> dictColumns = LYFZ.DAL.DAL_GridViewDisplayIndex.GetGridViewShowColumns(this.StrUserID, StrGuidName, this.dgvData.dgvCurrentColumnOriginalSet);
  3860. this.dgvData.dictShowColumName = dictColumns;
  3861. LYFZ.ComponentLibrary.DataGridOrderView.GetData_CameraControlBookSelectDress(this.dgvData, dictColumns, this.GetWhereStr(), this.StrSortField);//"Ordv_ReservationClothingTime,Ord_Number,Ords_DigitalNumber");
  3862. }
  3863. else if (this.rdoHospitalClient.Checked)
  3864. {
  3865. this.dgvData.dgvCurrentColumnOriginalSet = "ID,Ord_Number,ord_AutoColor,订单号,客户姓名,客户电话,宝贝名称,上门时间,上门状态,车辆,上门人员1,上门人员2,上门人员3,上门人员4,派单备注,客服人员,录入时间,沟通备注";
  3866. string StrGuidName = LYFZ.EnumPublic.dgvGuidName.E_FormAll_A0043.ToString().Trim();
  3867. this.dgvData.dgvFixedHideColumn = "ID,ord_AutoColor,Ord_Number";
  3868. this.dgvData.dgvGuidName = StrGuidName;
  3869. this.dgvData.dgvUserEmployeeID = this.StrUserID;
  3870. this.dgvData.StrValueNullColumn = "订单号,客户姓名,客户电话,宝贝名称";
  3871. Dictionary<string, string> dictColumns = LYFZ.DAL.DAL_GridViewDisplayIndex.GetGridViewShowColumns(this.StrUserID, StrGuidName, this.dgvData.dgvCurrentColumnOriginalSet);
  3872. this.dgvData.dictShowColumName = dictColumns;
  3873. LYFZ.ComponentLibrary.DataGridOrderView.GetData_CameraControlBookUpDoorSendSingle(this.dgvData, dictColumns, this.GetWhereStr(), this.StrSortField);//"Hdr_DoorTime,Ord_Number");
  3874. }
  3875. }
  3876. this.StatisticQuantity();
  3877. this.dgvData.ClearSelection();
  3878. if (!this.dgvData.Visible)
  3879. {
  3880. this.tblPanel.Visible = false;
  3881. this.dgvData.Visible = true;
  3882. }
  3883. this.panelEx1.Visible = true;
  3884. Dictionary<string, int> dicList = GetDataRowByChangeTime(dgvData);
  3885. foreach (DataGridViewRow row in dgvData.Rows)
  3886. {
  3887. if (!this.rdoHospitalClient.Checked)
  3888. {
  3889. if (row.Cells["ord_AutoColor"].Value!=null&&!string.IsNullOrEmpty(row.Cells["ord_AutoColor"].Value.ToString()))
  3890. {
  3891. dynamic dyColor = JsonConvert.DeserializeObject(row.Cells["ord_AutoColor"].Value.ToString());
  3892. row.DefaultCellStyle.BackColor = Color.FromArgb(Convert.ToInt32(dyColor.A), Convert.ToInt32(dyColor.R), Convert.ToInt32(dyColor.G), Convert.ToInt32(dyColor.B));
  3893. row.Tag = dyColor;
  3894. }
  3895. else
  3896. {
  3897. string viceNumber = row.Cells["Ordv_ViceNumber"].Value.ToString();
  3898. if (dicList.ContainsKey(viceNumber))
  3899. {
  3900. if (dicList[viceNumber] > 2)
  3901. {
  3902. row.DefaultCellStyle.BackColor = Color.YellowGreen;
  3903. }
  3904. }
  3905. }
  3906. }
  3907. }
  3908. this.Refresh();
  3909. this.dgvData.Refresh();
  3910. }
  3911. Dictionary<string, int> GetDataRowByChangeTime(DataGridViewEc dgvData)
  3912. {
  3913. LYFZ.BLL.BLL_ErpOrderWorkAnPaiRecord recordBll = new BLL.BLL_ErpOrderWorkAnPaiRecord();
  3914. List<string> dgvNumberList = new List<string>();
  3915. Dictionary<string, int> dicList = new Dictionary<string, int>();
  3916. if (!this.rdoHospitalClient.Checked)
  3917. {
  3918. foreach (DataGridViewRow item in dgvData.Rows)
  3919. {
  3920. string viceNumber = item.Cells["Ordv_ViceNumber"].Value.ToString();
  3921. if (dgvNumberList.IndexOf(viceNumber) == -1)
  3922. {
  3923. dgvNumberList.Add(viceNumber);
  3924. }
  3925. }
  3926. dicList = recordBll.GetCustomerChangeTimeControl(dgvNumberList, strReservationTimeName);
  3927. }
  3928. return dicList;
  3929. }
  3930. /// <summary>
  3931. /// 统计订单分类数量
  3932. /// </summary>
  3933. void StatisticQuantity()
  3934. {
  3935. Hashtable htDataA = new Hashtable();
  3936. Hashtable htDataB = new Hashtable();
  3937. Hashtable htDataC = new Hashtable();
  3938. Hashtable htDataD = new Hashtable();
  3939. Hashtable htDataE = new Hashtable();
  3940. Hashtable htDataO = new Hashtable();
  3941. for (int i = 0; i < this.dgvData.Rows.Count; i++)
  3942. {
  3943. if (this.rdoHospitalClient.Checked)
  3944. { htDataO[this.dgvData.Rows[i].Cells["Ord_Number"].Value.ToString().Trim()] = this.dgvData.Rows[i].Cells["Ord_Number"].Value.ToString().Trim(); }
  3945. else
  3946. {
  3947. switch ((LYFZ.EnumPublic.OrderType)Enum.Parse(typeof(LYFZ.EnumPublic.OrderType), this.dgvData.Rows[i].Cells["Ord_Type"].Value.ToString()))
  3948. {
  3949. case EnumPublic.OrderType.婚纱订单:
  3950. htDataA[this.dgvData.Rows[i].Cells["Ord_Number"].Value.ToString().Trim()] = this.dgvData.Rows[i].Cells["Ord_Number"].Value.ToString().Trim();
  3951. break;
  3952. case EnumPublic.OrderType.儿童订单:
  3953. htDataB[this.dgvData.Rows[i].Cells["Ord_Number"].Value.ToString().Trim()] = this.dgvData.Rows[i].Cells["Ord_Number"].Value.ToString().Trim();
  3954. break;
  3955. case EnumPublic.OrderType.写真订单:
  3956. htDataC[this.dgvData.Rows[i].Cells["Ord_Number"].Value.ToString().Trim()] = this.dgvData.Rows[i].Cells["Ord_Number"].Value.ToString().Trim();
  3957. break;
  3958. case EnumPublic.OrderType.婚庆订单:
  3959. htDataD[this.dgvData.Rows[i].Cells["Ord_Number"].Value.ToString().Trim()] = this.dgvData.Rows[i].Cells["Ord_Number"].Value.ToString().Trim();
  3960. break;
  3961. case EnumPublic.OrderType.服务订单:
  3962. htDataE[this.dgvData.Rows[i].Cells["Ord_Number"].Value.ToString().Trim()] = this.dgvData.Rows[i].Cells["Ord_Number"].Value.ToString().Trim();
  3963. break;
  3964. }
  3965. }
  3966. }
  3967. if (this.rdoHospitalClient.Checked)
  3968. { this.txtOrderQuantity.Text = " 订单统计(订单数:" + htDataO.Count + ")"; }
  3969. else
  3970. { this.txtOrderQuantity.Text = " 订单统计(婚纱单:" + htDataA.Count + " 儿童单:" + htDataB.Count + " 写真单:" + htDataC.Count + " 婚庆单:" + htDataD.Count + " 服务单:" + htDataE.Count + " 共" + (htDataA.Count + htDataB.Count + htDataC.Count + htDataD.Count + htDataE.Count) + "个订单)"; }
  3971. }
  3972. /// <summary>
  3973. /// 返回要操作的条件
  3974. /// </summary>
  3975. /// <returns></returns>
  3976. string GetWhereStr()
  3977. {
  3978. DateTime dttime = Convert.ToDateTime(this.nudYears.Value.ToString().Trim() + "-" + this.nudMonth.Value.ToString().Trim() + "-" + this.nudDate.Value.ToString().Trim());
  3979. string StrWhere = PublicCodeClasses.GetGroupQueryWhere(this.cmbtreevStoreName, "OrdDividedShop");
  3980. int IntAddDay = 1;
  3981. if (this.chkNearlyOneWeek.Checked)
  3982. { IntAddDay = 8; }
  3983. else if (this.chkNearlyHalfMonth.Checked)
  3984. { IntAddDay = 16; }
  3985. //拍照客人
  3986. if (this.rdoPhotographed.Checked)
  3987. {
  3988. StrWhere = StrWhere.Replace("OrdDividedShop", "Ordpg_ReservationPhotographyDividedShop");
  3989. StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("Ordpg_ReservationPhotographyTime", dttime.ToString(), dttime.ToString(), DateAddDays: IntAddDay);
  3990. }
  3991. //选片客人
  3992. else if (this.rdoFilmSelection.Checked)
  3993. {
  3994. StrWhere = StrWhere.Replace("OrdDividedShop", "Ordv_ReservationFilmSelectionDividedShop");
  3995. StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("Ordv_ReservationFilmSelectionTime", dttime.ToString(), dttime.ToString(), DateAddDays: IntAddDay);
  3996. }
  3997. //看版客人
  3998. else if (this.rdoLookDesign.Checked)
  3999. {
  4000. StrWhere = StrWhere.Replace("OrdDividedShop", "Ordv_ReservationLookDesignDividedShop");
  4001. StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("Ordv_ReservationLookDesignTime", dttime.ToString(), dttime.ToString(), DateAddDays: IntAddDay);
  4002. }
  4003. //取件客人
  4004. else if (this.rdoTotakePiece.Checked)
  4005. {
  4006. StrWhere = StrWhere.Replace("OrdDividedShop", "OPlist_ReservationTakeDividedShop");
  4007. StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("OPlist_ReservationTakeTime", dttime.ToString(), dttime.ToString(), DateAddDays: IntAddDay);
  4008. }
  4009. //服务客人
  4010. else if (this.rdoService.Checked)
  4011. {
  4012. StrWhere = StrWhere.Replace("OrdDividedShop", "Ws_ReservationServiceDividedShop");
  4013. StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("Ws_WeddingDate", dttime.ToString(), dttime.ToString(), DateAddDays: IntAddDay);
  4014. }
  4015. //选礼服客人
  4016. else if (this.rdoSelectDress.Checked)
  4017. {
  4018. StrWhere = StrWhere.Replace("OrdDividedShop", "Ordv_ReservationClothingDividedShop");
  4019. StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("Ordv_ReservationClothingTime", dttime.ToString(), dttime.ToString(), DateAddDays: IntAddDay);
  4020. }
  4021. else if (this.rdoHospitalClient.Checked)
  4022. {
  4023. StrWhere = StrWhere.Replace("OrdDividedShop", "Hdr_DividedShop");
  4024. StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("Hdr_DoorTime", dttime.ToString(), dttime.ToString(), DateAddDays: IntAddDay);
  4025. }
  4026. if (!this.rdoHospitalClient.Checked)
  4027. { StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetVersionQuerySQL(this.chkPortraitVersion, this.chkDressVersion, this.chkKidsVersion, chkWeddingCelebration: this.chkWeddingCelebration); }
  4028. return StrWhere;
  4029. }
  4030. #endregion
  4031. //private void InitializeComponent()
  4032. //{
  4033. // System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainFrameFormMain));
  4034. // this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem();
  4035. // this.toolStripMenuItem3 = new System.Windows.Forms.ToolStripMenuItem();
  4036. // this.panelEx3.SuspendLayout();
  4037. // ((System.ComponentModel.ISupportInitialize)(this.nudDate)).BeginInit();
  4038. // ((System.ComponentModel.ISupportInitialize)(this.nudYears)).BeginInit();
  4039. // ((System.ComponentModel.ISupportInitialize)(this.nudMonth)).BeginInit();
  4040. // this.panelEx8.SuspendLayout();
  4041. // this.panelEx1.SuspendLayout();
  4042. // this.plExMainContainer.SuspendLayout();
  4043. // this.plFormMainContent.SuspendLayout();
  4044. // this.SuspendLayout();
  4045. // //
  4046. // // txtOrderQuantity
  4047. // //
  4048. // this.txtOrderQuantity.Lines = new string[0];
  4049. // this.txtOrderQuantity.Size = new System.Drawing.Size(1286, 25);
  4050. // //
  4051. // // panelEx8
  4052. // //
  4053. // this.panelEx8.Location = new System.Drawing.Point(1286, 1);
  4054. // //
  4055. // // panelEx1
  4056. // //
  4057. // this.panelEx1.Size = new System.Drawing.Size(1469, 27);
  4058. // //
  4059. // // btn_ColorSetting
  4060. // //
  4061. // this.btn_ColorSetting.BackImg = ((System.Drawing.Bitmap)(resources.GetObject("btn_ColorSetting.BackImg")));
  4062. // //
  4063. // // btnAppFormExit
  4064. // //
  4065. // this.btnAppFormExit.BackImg = ((System.Drawing.Bitmap)(resources.GetObject("btnAppFormExit.BackImg")));
  4066. // //
  4067. // // btnAppFormMinimize
  4068. // //
  4069. // this.btnAppFormMinimize.BackImg = ((System.Drawing.Bitmap)(resources.GetObject("btnAppFormMinimize.BackImg")));
  4070. // //
  4071. // // toolStripMenuItem2
  4072. // //
  4073. // this.toolStripMenuItem2.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
  4074. // this.toolStripMenuItem3});
  4075. // this.toolStripMenuItem2.Name = "toolStripMenuItem2";
  4076. // this.toolStripMenuItem2.Size = new System.Drawing.Size(152, 22);
  4077. // this.toolStripMenuItem2.Text = "1";
  4078. // //
  4079. // // toolStripMenuItem3
  4080. // //
  4081. // this.toolStripMenuItem3.Name = "toolStripMenuItem3";
  4082. // this.toolStripMenuItem3.Size = new System.Drawing.Size(152, 22);
  4083. // this.toolStripMenuItem3.Text = "2";
  4084. // //
  4085. // // MainFrameFormMain
  4086. // //
  4087. // this.BottomBgImage = ((System.Drawing.Bitmap)(resources.GetObject("$this.BottomBgImage")));
  4088. // this.ClientSize = new System.Drawing.Size(1485, 610);
  4089. // this.CustomBorderStyles.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(109)))), ((int)(((byte)(139)))));
  4090. // this.Name = "MainFrameFormMain";
  4091. // this.TitleBgImage = ((System.Drawing.Bitmap)(resources.GetObject("$this.TitleBgImage")));
  4092. // this.Controls.SetChildIndex(this.btnAppFormMaximize, 0);
  4093. // this.Controls.SetChildIndex(this.btnAppFormExit, 0);
  4094. // this.Controls.SetChildIndex(this.btnAppFormMinimize, 0);
  4095. // this.Controls.SetChildIndex(this.btnAppFormMenu, 0);
  4096. // this.Controls.SetChildIndex(this.btnAppFormSkin, 0);
  4097. // this.Controls.SetChildIndex(this.plFormMainContent, 0);
  4098. // this.panelEx3.ResumeLayout(false);
  4099. // ((System.ComponentModel.ISupportInitialize)(this.nudDate)).EndInit();
  4100. // ((System.ComponentModel.ISupportInitialize)(this.nudYears)).EndInit();
  4101. // ((System.ComponentModel.ISupportInitialize)(this.nudMonth)).EndInit();
  4102. // this.panelEx8.ResumeLayout(false);
  4103. // this.panelEx8.PerformLayout();
  4104. // this.panelEx1.ResumeLayout(false);
  4105. // this.plExMainContainer.ResumeLayout(false);
  4106. // this.plFormMainContent.ResumeLayout(false);
  4107. // this.ResumeLayout(false);
  4108. //}
  4109. }
  4110. }