frmNewOrder.cs 230 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Windows.Forms;
  7. using System.Drawing;
  8. using LYFZ.ComponentLibrary;
  9. using System.Data;
  10. using LYFZ.Software.MainBusiness.DoorCityProcess.NewOrderCustomControls;
  11. using System.Collections;
  12. using LYFZ.Model.API;
  13. namespace LYFZ.Software.MainBusiness.DoorCityProcess
  14. {
  15. public class frmNewOrder : LYFZ.Software.UI.DoorCityProcess.frmNewOrder
  16. {
  17. LYFZ.BLL.BLL_ErpPackages packageBll = new BLL.BLL_ErpPackages();
  18. LYFZ.BLL.BLL_ErpStyle styleBll = new BLL.BLL_ErpStyle();
  19. LYFZ.BLL.BLL_ErpOrder orderBll = new BLL.BLL_ErpOrder();
  20. LYFZ.BLL.BLL_ErpOrdersPerson ordersPersonBll = new BLL.BLL_ErpOrdersPerson();
  21. LYFZ.BLL.BLL_ErpCustomerGroup customerGroupBll = new BLL.BLL_ErpCustomerGroup();
  22. LYFZ.BLL.BLL_ErpCustomerGroupMembers customerGroupMembersBll = new BLL.BLL_ErpCustomerGroupMembers();
  23. LYFZ.BLL.BLL_ErpCustomer customerBll = new BLL.BLL_ErpCustomer();
  24. LYFZ.BLL.BLL_ErpMemberCard memberCardBll = new BLL.BLL_ErpMemberCard();
  25. LYFZ.BLL.BLL_ErpOrderDigital orderDigitalBll = new BLL.BLL_ErpOrderDigital();
  26. LYFZ.BLL.BLL_ErpOrdersPhotography photographyBll = new BLL.BLL_ErpOrdersPhotography();
  27. LYFZ.BLL.BLL_ErpWeddingService weddingServiceBll = new BLL.BLL_ErpWeddingService();
  28. LYFZ.BLL.BLL_ErpPayment paymentbll = new BLL.BLL_ErpPayment();
  29. LYFZ.BLL.BLL_ErpSystemConfigure systemConfigurebll = new BLL.BLL_ErpSystemConfigure();
  30. LYFZ.BLL.BLL_ErpMemberCardBackCashSet memberCardBackCashSetbll = new BLL.BLL_ErpMemberCardBackCashSet();
  31. /// <summary>
  32. /// 会员返现比例设置
  33. /// </summary>
  34. LYFZ.BLL.BLL_ErpMemberCardBackCashSet cardBackCashSetBll = new BLL.BLL_ErpMemberCardBackCashSet();
  35. /// <summary>
  36. /// 会员副卡表
  37. /// </summary>
  38. LYFZ.BLL.BLL_ErpMemberCardViceCard cardViceCardBll = new BLL.BLL_ErpMemberCardViceCard();
  39. /// <summary>
  40. /// 当前订单对象
  41. /// </summary>
  42. LYFZ.Model.Model_ErpOrder currentOrderModel = new Model.Model_ErpOrder();
  43. UCustomerInfo uMainCusInfo = new UCustomerInfo( true );
  44. /// <summary>
  45. /// 订单景点
  46. /// </summary>
  47. OrderSightsControlsEx orderSightsControl = new OrderSightsControlsEx();
  48. /// <summary>
  49. /// 拍摄阶段 用于儿童订单
  50. /// </summary>
  51. OrderStagesControlsEx orderStagesControl = new OrderStagesControlsEx();
  52. /// <summary>
  53. /// 订单商品
  54. /// </summary>
  55. OrderProductControlsEx orderProductControl = new OrderProductControlsEx();
  56. /// <summary>
  57. /// 订单服务
  58. /// </summary>
  59. OrderServiceControlsEx orderServiceControl = new OrderServiceControlsEx();
  60. public frmNewOrder()
  61. {
  62. this.Load += FrmNewOrder_Load;
  63. this.Shown += FrmNewOrder_Shown;
  64. this.lblOpenType.Click += LblOpenType_Click;//测试时 打开旧版开单页
  65. this.btnOrderClose.Click += BtnOrderClose_Click;
  66. this.PictAnnotation.Click += PictAnnotation_Click;
  67. this.lbHideBiaoZhu.Click += LbHideBiaoZhu_Click;
  68. this.lkSelectOrderPerson.Click += LkSelectOrderPerson_Click;
  69. this.rdoOther.CheckedChanged += RdoOther_CheckedChanged;
  70. this.lkSetClientSource.Click += LkSetClientSource_Click;
  71. this.rdoOldClient.Click += RdoOldClient_Click;
  72. this.rdoFriends.Click += RdoFriends_Click;
  73. this.rdoHospitalClient.Click += RdoHospitalClient_Click;
  74. this.lkYiXiangClient.Click += LkYiXiangClient_Click;
  75. this.lkSelectStyle.Click += LkSelectStyle_Click;
  76. this.lkSetStyle.Click += LkSetStyle_Click;
  77. this.lbSetOrderClass.Click += LbSetOrderClass_Click;
  78. this.lbSetTaoXiName.Click += LbSetTaoXiName_Click;
  79. this.lbSetLiBao.Click += LbSetLiBao_Click;
  80. this.cmbtreevTaoXiName.ComboBoxTree_NodeMouseClick += CmbtreevTaoXiName_ComboBoxTree_NodeMouseClick;
  81. this.cmbtreevPackageName.ComboBoxTree_NodeMouseClick += CmbtreevPackageName_ComboBoxTree_NodeMouseClick;
  82. this.plDingDanZhiNiao.Scroll += PlDingDanZhiNiao_Scroll;
  83. this.btnSave.Click += BtnSave_Click;
  84. this.rdoFriends.CheckedChanged += RdoFriends_CheckedChanged;
  85. this.txtCusName.KeyUp += TxtCusName_KeyUp;
  86. this.linkSelectSameNameBaby.Click += LinkSelectSameNameBaby_Click;
  87. this.uMainCusInfo.EventSelectIntentionOrderCustomer += UMainCusInfo_EventSelectIntentionOrderCustomer;
  88. this.PictEdit.Click += PictEdit_Click;
  89. this.PictReset.Click += PictReset_Click;
  90. this.btnNewOrder.Click += BtnNewOrder_Click;
  91. this.btnSaveIntent.Click += BtnSaveIntent_Click;
  92. this.btnPrint.Click += BtnPrint_Click;
  93. this.FormClosing += FrmNewOrder_FormClosing;
  94. this.FormClosed += FrmNewOrder_FormClosed;
  95. this.likbtnUpload.Click += LikbtnUpload_Click;
  96. this.lkAddGuoTongJiLu.Click += LkAddGuoTongJiLu_Click;
  97. this.lkGuoTongJiLuXiangQing.Click += LkGuoTongJiLuXiangQing_Click;
  98. this.lkQianQi.Click += LkQianQi_Click;
  99. this.lkHouQi.Click += LkHouQi_Click;
  100. this.lkBanLiHuiYuan.Click += LkBanLiHuiYuan_Click;
  101. this.lkHuiYuanGuanLi.Click += LkHuiYuanGuanLi_Click;
  102. this.lkHuFuShouKuan.Click += LkHuFuShouKuan_Click;
  103. this.tabControlMain.SelectedIndexChanged += TabControlMain_SelectedIndexChanged;
  104. this.lbTaoXiShenJi.Click += LbTaoXiShenJi_Click;
  105. this.maskBirthday.Leave += MaskBirthday_Leave;
  106. }
  107. List<Helper.CommandInfo> WorkAnPaiRecordlist = new List<Helper.CommandInfo>();
  108. LYFZ.BLL.BLL_ErpOrderWorkAnPaiRecord ordwr = new BLL.BLL_ErpOrderWorkAnPaiRecord();
  109. void AddOrderWorkAnPaiRecord(LYFZ.Model.Model_ErpOrdersPhotography model)
  110. {
  111. // loginUserName,
  112. // loginCompanyInfoID,
  113. // loginUserID,
  114. Model.Model_ErpOrderWorkAnPaiRecord modelRecord = new Model.Model_ErpOrderWorkAnPaiRecord();
  115. modelRecord.Ordwr_Number = "OWPR_" + LYFZ.BLL.BLL_ErpCustomer.GetClientNumber();
  116. modelRecord.Ordwr_WorkNumber = model.Ordpg_IDNumber;
  117. modelRecord.Ordwr_OrdNumber = model.Ordpg_Number;
  118. modelRecord.Ordwr_ViceNumber = model.Ordpg_ViceNumber;
  119. modelRecord.Ordwr_ModuleName = LYFZ.EnumPublic.WorkAnPaiChangeLogEnum.摄控安排拍照客人.ToString();
  120. modelRecord.Ordwr_UpdateOrderName = model.Ordpg_Sights;
  121. modelRecord.Ordwr_UpdateAgoPerson = model.Ordpg_Dispatcher;
  122. modelRecord.Ordwr_UpdateAgoTime = model.Ordpg_DispatchTime;
  123. modelRecord.Ordwr_UpdateAgoData = "修改订单时修改了拍摄时间, 修改前为 拍摄时间:" + LYFZ.BLL.OtherCommonModel.DateTimeToString(model.Ordpg_ReservationPhotographyTime) + " 摄影师:" + LYFZ.BLL.BLL_ErpOrderView.GetUserName(model.Ordpg_ReservationPhotographyName) + " 摄影助理:" + LYFZ.BLL.BLL_ErpOrderView.GetUserName(model.Ordpg_ReservationPhotographyAssistant) +
  124. " 化妆师:" + LYFZ.BLL.BLL_ErpOrderView.GetUserName(model.Ordpg_ReservationMakeupArtist) + " 化妆助理:" + LYFZ.BLL.BLL_ErpOrderView.GetUserName(model.Ordpg_ReservationMakeupAssistant) + " 引导师:" + LYFZ.BLL.BLL_ErpOrderView.GetUserName(model.Ordpg_ReservationBootDivision) + " 引导助理:" + LYFZ.BLL.BLL_ErpOrderView.GetUserName(model.Ordpg_ReservationBootDivisionAssistant);
  125. modelRecord.Ordwr_CreateDatetime = SDateTime.Now;
  126. modelRecord.Ordwr_CreateName = loginUserID;
  127. WorkAnPaiRecordlist.Add(ordwr.GetAddCommandInfo(modelRecord));
  128. }
  129. #region 订单详情页处理
  130. private void TabControlMain_SelectedIndexChanged( object sender, EventArgs e )
  131. {
  132. if ( this.tabControlMain.SelectedIndex == 2 )
  133. {
  134. this.GetPanelContactRecord();
  135. this.GetPanelPaymentDetailsControlsEx();
  136. this.GeneratingFlowchartImage();
  137. }
  138. }
  139. /// <summary>
  140. /// 生成流程图
  141. /// </summary>
  142. void GeneratingFlowchartImage()
  143. {
  144. if ( this.isGeneratingFlowchartImage || this.plFlowchartNodePanel.Controls.Count <= 0 )
  145. {
  146. this.isGeneratingFlowchartImage = false;
  147. this.plFlowchartNodePanel.Controls.Clear();
  148. FlowchartNode flowNode = new FlowchartNode( FlowchartNodeType.蓝色节点, "订单" );
  149. flowNode.PanelNode.Location = new Point( 8, 13 );
  150. this.plFlowchartNodePanel.Controls.Add( flowNode.PanelNode );
  151. VerticalLine vLine = new VerticalLine();
  152. vLine.Location = new Point( flowNode.PanelNode.Location.X + flowNode.PanelNode.Width / 2, flowNode.PanelNode.Location.Y + flowNode.PanelNode.Height / 2 );
  153. vLine.Height = 300;
  154. // vLine.SendToBack();
  155. //vLine.BringToFront();
  156. NodeDescription nodeDesc = new NodeDescription();
  157. nodeDesc.PanelGroup.Location = new Point( flowNode.PanelNode.Location.X + flowNode.PanelNode.Width + 4, flowNode.PanelNode.Location.Y - 4 );
  158. nodeDesc.LabelText.Text = this.currentOrderModel.Ord_CreateDateTime.ToYYYY_MM_dd_HH_mm_ss();
  159. nodeDesc.LabelDescription.Text = String.Format( "接单人:{0}", this.currentOrderModel.Ord_OrderPersonName );
  160. // nodeDesc.PanelGroup.BackColor = Color.Red;
  161. nodeDesc.PanelBg.Width = 270;
  162. this.plFlowchartNodePanel.Controls.Add( nodeDesc.PanelGroup );
  163. //拍照 修片 选片 精修 设计 看版 取件
  164. switch ( this.OrderType )
  165. {
  166. case EnumPublic.OrderType.婚纱订单:
  167. case EnumPublic.OrderType.写真订单:
  168. this.GeneratingFlowchartImage_WeddingOrders( flowNode, vLine );
  169. break;
  170. case EnumPublic.OrderType.儿童订单:
  171. this.GeneratingFlowchartImage_Child( flowNode, vLine );
  172. break;
  173. case EnumPublic.OrderType.婚庆订单:
  174. case EnumPublic.OrderType.服务订单:
  175. this.GeneratingFlowchartImage_Service( flowNode, vLine );
  176. break;
  177. }
  178. this.plFlowchartNodePanel.Controls.Add( vLine );
  179. this.plFlowchartNodePanel.Height = vLine.Location.Y + vLine.Height + 100;
  180. this.flowLayoutPanel2.Height = this.plFlowchartNodePanel.Location.Y + this.plFlowchartNodePanel.Height;
  181. this.flowLayoutPanel2.Refresh();
  182. this.flowLayoutPanel2.Update();
  183. }
  184. }
  185. //创建一个委托,是为访问DataGridVie控件服务的。
  186. //public delegate void UpdateControl();
  187. //void WaitThreadFunc(object b)
  188. //{
  189. // try
  190. // {
  191. // this.plFlowchartNodePanel.Invoke(new UpdateControl(delegate ()
  192. // {
  193. // this.GeneratingFlowchartImage();
  194. // }));
  195. // }
  196. // catch (Exception ex){
  197. // MessageBoxCustom.Show(ex.Message);
  198. // }
  199. //}
  200. /// <summary>
  201. /// 流程间隔
  202. /// </summary>
  203. int FlowchartInterval = 70;
  204. /// <summary>
  205. /// 拍照按钮数组
  206. /// </summary>
  207. string[] PhotographyBtnTexts = new string[] { "安排拍照", "导出原片", "查看原片", "导入原片" };
  208. /// <summary>
  209. /// 初修片
  210. /// </summary>
  211. string[] RetouchPhotoBtnTexts = new string[] { "安排修片", "查看初修片", "导入初修片" };
  212. /// <summary>
  213. /// 选片
  214. /// </summary>
  215. string[] SelectPhotoBtnTexts = new string[] { "安排选片", "开始选片" };
  216. /// <summary>
  217. /// 精修
  218. /// </summary>
  219. string[] RefinetPhotoBtnTexts = new string[] { "安排精修", "导入精修片", "导出选片" };
  220. /// <summary>
  221. /// 设计
  222. /// </summary>
  223. string[] DesignPhotoBtnTexts = new string[] { "安排设计", "导入设计", "导出精修" };
  224. /// <summary>
  225. /// 看版
  226. /// </summary>
  227. string[] LookPhotoBtnTexts = new string[] { "安排看版", "导出改设计", "看设计版" };
  228. /// <summary>
  229. /// 取件
  230. /// </summary>
  231. string[] PickupPhotoBtnTexts = new string[] { "安排取件", "安排发片", "发片取件", "安排服务" };
  232. /// <summary>
  233. /// 生成流程图 婚庆和服务订单
  234. /// </summary>
  235. void GeneratingFlowchartImage_Service( FlowchartNode rootNode, VerticalLine mainVLine )
  236. {
  237. int yIndex = 1;
  238. int interval = 140;
  239. if ( orderDigitalList.Count > 0 )
  240. {
  241. LYFZ.Model.Model_ErpOrderDigital digitaItem = orderDigitalList[0];
  242. FlowchartNode ServiceNode = AddFlowchartNode( rootNode.PanelNode.Location.X, rootNode.PanelNode.Location.Y + rootNode.PanelNode.Location.Y + rootNode.PanelNode.Height + yIndex * interval - 35
  243. , "服务", PickupPhotoBtnTexts, digitaItem, FlowchrtType.服务 );
  244. ServiceNode.DigitalItem = digitaItem;
  245. mainVLine.Height = ServiceNode.PanelNode.Location.Y + 2;
  246. }
  247. }
  248. /// <summary>
  249. /// 生成流程图 婚纱订单
  250. /// </summary>
  251. void GeneratingFlowchartImage_WeddingOrders( FlowchartNode rootNode, VerticalLine mainVLine )
  252. {
  253. FlowchartNode flowNode = new FlowchartNode( FlowchartNodeType.白色节点, "拍照" );
  254. flowNode.PanelNode.Location = new Point( rootNode.PanelNode.Location.X, rootNode.PanelNode.Location.Y + 70 );
  255. this.plFlowchartNodePanel.Controls.Add( flowNode.PanelNode );
  256. int yIndex = 0;
  257. int interval = 70;
  258. if ( orderDigitalList.Count > 0 )
  259. {
  260. LYFZ.Model.Model_ErpOrderDigital digitaItem = orderDigitalList[0];
  261. foreach ( LYFZ.Model.Model_ErpOrdersPhotography potoItem in photographyList )
  262. {
  263. NodeTitle nTitle = new NodeTitle( potoItem.Ordpg_Sights );
  264. nTitle.Location = new Point( mainVLine.Location.X + mainVLine.Width, flowNode.PanelNode.Location.Y + flowNode.PanelNode.Height + yIndex * interval );
  265. HorizontalLine hLine = new HorizontalLine();
  266. hLine.Location = new Point( mainVLine.Location.X + mainVLine.Width, nTitle.Location.Y + nTitle.Height + 1 );
  267. this.plFlowchartNodePanel.Controls.Add( nTitle );
  268. FlowchartNode potoNode = new FlowchartNode( FlowchartNodeType.白色节点, (yIndex + 1).ToString() );
  269. potoNode.PanelNode.Size = new Size( 24, 24 );
  270. potoNode.PanelNode.Location = new Point( hLine.Location.X + hLine.Width - 3, hLine.Location.Y - potoNode.PanelNode.Height / 2 );
  271. this.plFlowchartNodePanel.Controls.Add( potoNode.PanelNode );
  272. potoNode.DigitalItem = digitaItem;
  273. potoNode.PhotographyItem = potoItem;
  274. NodeDescription nodeDesc = new NodeDescription();
  275. nodeDesc.CurrentNode = potoNode;
  276. nodeDesc.PanelGroup.Location = new Point( potoNode.PanelNode.Location.X + potoNode.PanelNode.Width + 1, potoNode.PanelNode.Location.Y - 19 );
  277. this.SetPhotographyNodeDescription( nodeDesc, potoItem );
  278. nodeDesc.PanelBg.Width = 360;
  279. AddLinkLabelBtn( nodeDesc, PhotographyBtnTexts );
  280. this.plFlowchartNodePanel.Controls.Add( nodeDesc.PanelGroup );
  281. this.plFlowchartNodePanel.Controls.Add( hLine );
  282. yIndex++;
  283. }
  284. FlowchartNode RetouchPhotoNode = AddFlowchartNode( flowNode.PanelNode.Location.X, flowNode.PanelNode.Location.Y + flowNode.PanelNode.Location.Y + flowNode.PanelNode.Height + yIndex * interval - 35
  285. , "修片", RetouchPhotoBtnTexts, digitaItem, FlowchrtType.初修 );
  286. FlowchartNode SelectPhotoNode = AddFlowchartNode( RetouchPhotoNode.PanelNode.Location.X, RetouchPhotoNode.PanelNode.Location.Y + FlowchartInterval
  287. , "选片", SelectPhotoBtnTexts, digitaItem, FlowchrtType.选片 );
  288. FlowchartNode RefinetPhotoNode = AddFlowchartNode( SelectPhotoNode.PanelNode.Location.X, SelectPhotoNode.PanelNode.Location.Y + FlowchartInterval
  289. , "精修", RefinetPhotoBtnTexts, digitaItem, FlowchrtType.精修 );
  290. FlowchartNode DesignPhotoNode = AddFlowchartNode( RefinetPhotoNode.PanelNode.Location.X, RefinetPhotoNode.PanelNode.Location.Y + FlowchartInterval
  291. , "设计", DesignPhotoBtnTexts, digitaItem, FlowchrtType.设计 );
  292. FlowchartNode LookPhotoNode = AddFlowchartNode( DesignPhotoNode.PanelNode.Location.X, DesignPhotoNode.PanelNode.Location.Y + FlowchartInterval
  293. , "看版", LookPhotoBtnTexts, digitaItem, FlowchrtType.看版 );
  294. FlowchartNode PickupPhotoNode = AddFlowchartNode( LookPhotoNode.PanelNode.Location.X, LookPhotoNode.PanelNode.Location.Y + FlowchartInterval
  295. , "取件", PickupPhotoBtnTexts, digitaItem, FlowchrtType.取件 );
  296. RetouchPhotoNode.DigitalItem = digitaItem;
  297. SelectPhotoNode.DigitalItem = digitaItem;
  298. RefinetPhotoNode.DigitalItem = digitaItem;
  299. DesignPhotoNode.DigitalItem = digitaItem;
  300. LookPhotoNode.DigitalItem = digitaItem;
  301. PickupPhotoNode.DigitalItem = digitaItem;
  302. mainVLine.Height = PickupPhotoNode.PanelNode.Location.Y + 2;
  303. }
  304. }
  305. /// <summary>
  306. /// 设置婚纱订单拍照描述信息
  307. /// </summary>
  308. /// <param name="nodeDesc"></param>
  309. /// <param name="potoItem"></param>
  310. void SetPhotographyNodeDescription( NodeDescription nodeDesc, LYFZ.Model.Model_ErpOrdersPhotography potoItem )
  311. {
  312. nodeDesc.LabelText.Text = potoItem.Ordpg_PhotographyTime.ToYYYY_MM_dd_HH_mm_ss();
  313. if ( String.IsNullOrEmpty( nodeDesc.LabelText.Text ) )
  314. {
  315. nodeDesc.LabelText.Text = potoItem.Ordpg_ReservationPhotographyTime.ToYYYY_MM_dd_HH_mm_ss();
  316. }
  317. nodeDesc.LabelText2.Text = String.Format( "{0}", potoItem.GetPhotographyStatus() );
  318. nodeDesc.LabelDescription.Text = String.Format( "摄影师:{0} 化妆师:{1}\r\n摄影助理:{2} 化妆助理:{3}"
  319. , LYFZ.DAL.DAL_ErpUser.GetUserIDToUserName( potoItem.Ordpg_Photographer, ',' )
  320. , LYFZ.DAL.DAL_ErpUser.GetUserIDToUserName( potoItem.Ordpg_MakeupArtist, ',' )
  321. , LYFZ.DAL.DAL_ErpUser.GetUserIDToUserName( potoItem.Ordpg_PhotographyAssistant, ',' )
  322. , LYFZ.DAL.DAL_ErpUser.GetUserIDToUserName( potoItem.Ordpg_MakeupAssistant, ',' ) );
  323. }
  324. /// <summary>
  325. /// 设置儿童订单拍照描述信息
  326. /// </summary>
  327. /// <param name="nodeDesc"></param>
  328. /// <param name="potoItem"></param>
  329. void SetPhotographyNodeDescription_Child( NodeDescription nodeDesc, LYFZ.Model.Model_ErpOrdersPhotography potoItem )
  330. {
  331. nodeDesc.LabelText.Text = potoItem.Ordpg_PhotographyTime.ToYYYY_MM_dd_HH_mm_ss();
  332. if ( String.IsNullOrEmpty( nodeDesc.LabelText.Text ) )
  333. {
  334. nodeDesc.LabelText.Text = potoItem.Ordpg_ReservationPhotographyTime.ToYYYY_MM_dd_HH_mm_ss();
  335. }
  336. nodeDesc.LabelText2.Text = String.Format( "{0}", potoItem.GetPhotographyStatus() );
  337. nodeDesc.LabelDescription.Text = String.Format( "摄影师:{0} 化妆师:{1} 引导师:{2} \r\n摄影助理:{3} 化妆助理:{4} 引导助理:{5}"
  338. , LYFZ.DAL.DAL_ErpUser.GetUserIDToUserName( potoItem.Ordpg_Photographer, ',' )
  339. , LYFZ.DAL.DAL_ErpUser.GetUserIDToUserName( potoItem.Ordpg_MakeupArtist, ',' )
  340. , LYFZ.DAL.DAL_ErpUser.GetUserIDToUserName( potoItem.Ordpg_BootDivision, ',' )
  341. , LYFZ.DAL.DAL_ErpUser.GetUserIDToUserName( potoItem.Ordpg_PhotographyAssistant, ',' )
  342. , LYFZ.DAL.DAL_ErpUser.GetUserIDToUserName( potoItem.Ordpg_MakeupAssistant, ',' )
  343. , LYFZ.DAL.DAL_ErpUser.GetUserIDToUserName( potoItem.Ordpg_BootDivisionAssistant, ',' ) );
  344. }
  345. /// <summary>
  346. /// 生成流程图 儿童订单
  347. /// </summary>
  348. void GeneratingFlowchartImage_Child( FlowchartNode rootNode, VerticalLine mainVLine )
  349. {
  350. int yIndex = 0;
  351. int interval = 500;
  352. //最后一个节点 Y 值
  353. int endNode_Y = 0;
  354. foreach ( LYFZ.Model.Model_ErpOrderDigital digitaItem in orderDigitalList )
  355. {
  356. if ( photographyList.Any( p => p.Ordpg_ViceNumber.ToLower() == digitaItem.Ordv_ViceNumber.ToLower() ) )
  357. {
  358. LYFZ.Model.Model_ErpOrdersPhotography potoItem = photographyList.Find( p => p.Ordpg_ViceNumber.ToLower() == digitaItem.Ordv_ViceNumber.ToLower() );
  359. FlowchartNode flowNode = new FlowchartNode( FlowchartNodeType.白色节点, (yIndex + 1).ToString() );
  360. flowNode.PanelNode.Location = new Point( rootNode.PanelNode.Location.X, rootNode.PanelNode.Location.Y + 90 + interval * yIndex );
  361. this.plFlowchartNodePanel.Controls.Add( flowNode.PanelNode );
  362. endNode_Y = flowNode.PanelNode.Location.Y;
  363. HorizontalLine hLine = new HorizontalLine();
  364. hLine.Location = new Point( rootNode.PanelNode.Location.X + rootNode.PanelNode.Width - 2, flowNode.PanelNode.Location.Y + flowNode.PanelNode.Height / 2 );
  365. NodeTitle nTitle = new NodeTitle( potoItem.Ordpg_Sights );
  366. nTitle.Location = new Point( rootNode.PanelNode.Location.X + rootNode.PanelNode.Width - 2, hLine.Location.Y - hLine.Height - nTitle.Height );
  367. this.plFlowchartNodePanel.Controls.Add( nTitle );
  368. //拍照节点
  369. FlowchartNode potoNode = new FlowchartNode( FlowchartNodeType.白色节点, "拍照" );
  370. potoNode.PanelNode.Location = new Point( nTitle.Location.X + nTitle.Width - 2, flowNode.PanelNode.Location.Y );
  371. this.plFlowchartNodePanel.Controls.Add( potoNode.PanelNode );
  372. this.plFlowchartNodePanel.Controls.Add( hLine );
  373. potoNode.DigitalItem = digitaItem;
  374. potoNode.PhotographyItem = potoItem;
  375. //拍照节点描述
  376. NodeDescription nodeDesc = new NodeDescription();
  377. nodeDesc.CurrentNode = potoNode;
  378. nodeDesc.PanelGroup.Location = new Point( potoNode.PanelNode.Location.X + potoNode.PanelNode.Width + 1, potoNode.PanelNode.Location.Y - 9 );
  379. this.SetPhotographyNodeDescription_Child( nodeDesc, potoItem );
  380. // nodeDesc.PanelBg.Width = 360;
  381. AddLinkLabelBtn( nodeDesc, PhotographyBtnTexts );
  382. FlowchartNode RetouchPhotoNode = AddFlowchartNode( potoNode.PanelNode.Location.X, potoNode.PanelNode.Location.Y + FlowchartInterval
  383. , "修片", RetouchPhotoBtnTexts, digitaItem, FlowchrtType.初修 );
  384. FlowchartNode SelectPhotoNode = AddFlowchartNode( RetouchPhotoNode.PanelNode.Location.X, RetouchPhotoNode.PanelNode.Location.Y + FlowchartInterval
  385. , "选片", SelectPhotoBtnTexts, digitaItem, FlowchrtType.选片 );
  386. FlowchartNode RefinetPhotoNode = AddFlowchartNode( SelectPhotoNode.PanelNode.Location.X, SelectPhotoNode.PanelNode.Location.Y + FlowchartInterval
  387. , "精修", RefinetPhotoBtnTexts, digitaItem, FlowchrtType.精修 );
  388. FlowchartNode DesignPhotoNode = AddFlowchartNode( RefinetPhotoNode.PanelNode.Location.X, RefinetPhotoNode.PanelNode.Location.Y + FlowchartInterval
  389. , "设计", DesignPhotoBtnTexts, digitaItem, FlowchrtType.设计 );
  390. FlowchartNode LookPhotoNode = AddFlowchartNode( DesignPhotoNode.PanelNode.Location.X, DesignPhotoNode.PanelNode.Location.Y + FlowchartInterval
  391. , "看版", LookPhotoBtnTexts, digitaItem, FlowchrtType.看版 );
  392. FlowchartNode PickupPhotoNode = AddFlowchartNode( LookPhotoNode.PanelNode.Location.X, LookPhotoNode.PanelNode.Location.Y + FlowchartInterval
  393. , "取件", PickupPhotoBtnTexts, digitaItem, FlowchrtType.取件 );
  394. RetouchPhotoNode.DigitalItem = digitaItem;
  395. SelectPhotoNode.DigitalItem = digitaItem;
  396. RefinetPhotoNode.DigitalItem = digitaItem;
  397. DesignPhotoNode.DigitalItem = digitaItem;
  398. LookPhotoNode.DigitalItem = digitaItem;
  399. PickupPhotoNode.DigitalItem = digitaItem;
  400. RetouchPhotoNode.PhotographyItem = potoItem;
  401. SelectPhotoNode.PhotographyItem = potoItem;
  402. RefinetPhotoNode.PhotographyItem = potoItem;
  403. DesignPhotoNode.PhotographyItem = potoItem;
  404. LookPhotoNode.PhotographyItem = potoItem;
  405. PickupPhotoNode.PhotographyItem = potoItem;
  406. this.plFlowchartNodePanel.Controls.Add( nodeDesc.PanelGroup );
  407. //阶段流程线
  408. VerticalLine vLine = new VerticalLine();
  409. vLine.Location = new Point( potoNode.PanelNode.Location.X + potoNode.PanelNode.Width / 2, potoNode.PanelNode.Location.Y + potoNode.PanelNode.Height / 2 );
  410. vLine.Height = 400;
  411. //修片
  412. this.plFlowchartNodePanel.Controls.Add( vLine );
  413. yIndex++;
  414. }
  415. }
  416. mainVLine.Height = rootNode.PanelNode.Location.Y + 90 + interval * yIndex;
  417. //结尾节点
  418. FlowchartNode endNode = new FlowchartNode( FlowchartNodeType.白色节点, "" );
  419. // endNode.PanelNode.Size = new Size(24, 24);
  420. endNode.PanelNode.Location = new Point( rootNode.PanelNode.Location.X, mainVLine.Location.Y + mainVLine.Height - 5 );
  421. this.plFlowchartNodePanel.Controls.Add( endNode.PanelNode );
  422. }
  423. /// <summary>
  424. /// 添加流程节点
  425. /// </summary>
  426. /// <param name="x"></param>
  427. /// <param name="y"></param>
  428. /// <param name="nodeText">节点名</param>
  429. /// <param name="btnTexts">节点按钮组</param>
  430. /// <param name="status">流程状态</param>
  431. /// <param name="time">完成时间</param>
  432. /// <param name="lbDescription">相关人员</param>
  433. /// <returns></returns>
  434. FlowchartNode AddFlowchartNode( int x, int y, string nodeText, string[] btnTexts, LYFZ.Model.Model_ErpOrderDigital digitaItem, FlowchrtType fType )
  435. {
  436. //节点
  437. FlowchartNode potoNode = new FlowchartNode( FlowchartNodeType.白色节点, nodeText );
  438. potoNode.PanelNode.Location = new Point( x, y );
  439. this.plFlowchartNodePanel.Controls.Add( potoNode.PanelNode );
  440. //节点描述
  441. NodeDescription nodeDesc = new NodeDescription();
  442. nodeDesc.CurrentNode = potoNode;
  443. nodeDesc.PanelGroup.Location = new Point( potoNode.PanelNode.Location.X + potoNode.PanelNode.Width + 1, potoNode.PanelNode.Location.Y - 9 );
  444. this.SetFlowchartNodeDescription( nodeDesc, digitaItem, fType );
  445. nodeDesc.PanelBg.Width = 360;
  446. nodeDesc.LabelDescription.MouseEnter += LabelDescription_MouseEnter;
  447. nodeDesc.LabelDescription.Tag = nodeDesc;
  448. nodeDesc.BtnTexts = btnTexts;
  449. // AddLinkLabelBtn(nodeDesc, btnTexts);
  450. this.plFlowchartNodePanel.Controls.Add( nodeDesc.PanelGroup );
  451. return potoNode;
  452. }
  453. /// <summary>
  454. /// 设置流程描述
  455. /// </summary>
  456. /// <param name="nodeDesc"></param>
  457. /// <param name="status"></param>
  458. /// <param name="time"></param>
  459. /// <param name="lbDescription"></param>
  460. void SetFlowchartNodeDescription( NodeDescription nodeDesc, string status, string time, string lbDescription )
  461. {
  462. nodeDesc.LabelText.Text = time;
  463. nodeDesc.LabelText2.Text = String.Format( "{0}", status );
  464. nodeDesc.LabelDescription.Text = String.Format( lbDescription );
  465. }
  466. void SetFlowchartNodeDescription( NodeDescription nodeDesc, LYFZ.Model.Model_ErpOrderDigital digitaItem, FlowchrtType fType )
  467. {
  468. string status = "";
  469. string time = "";
  470. string lbDescription = "";
  471. if ( digitaItem != null )
  472. {
  473. switch ( fType )
  474. {
  475. case FlowchrtType.初修:
  476. status = digitaItem.GetEarlyRepairStatus();
  477. time = digitaItem.Ordv_EarlyRepairTime.ToYYYY_MM_dd_HH_mm_ss();
  478. lbDescription = String.Format( "{0}师:{1}", fType.ToString(), LYFZ.DAL.DAL_ErpUser.GetUserIDToUserName( digitaItem.Ordv_EarlyRepairName, ',' ) );
  479. break;
  480. case FlowchrtType.选片:
  481. status = digitaItem.GetFilmSelectionStatus();
  482. time = digitaItem.Ordv_FilmSelectionTime.ToYYYY_MM_dd_HH_mm_ss();
  483. lbDescription = String.Format( "{0}师:{1}", fType.ToString(), LYFZ.DAL.DAL_ErpUser.GetUserIDToUserName( digitaItem.Ordv_FilmSelectionName, ',' ) );
  484. break;
  485. case FlowchrtType.精修:
  486. status = digitaItem.GetRefinementStatus();
  487. time = digitaItem.Ordv_RefinementTime.ToYYYY_MM_dd_HH_mm_ss();
  488. lbDescription = String.Format( "{0}师:{1}", fType.ToString(), LYFZ.DAL.DAL_ErpUser.GetUserIDToUserName( digitaItem.Ordv_RefinementName, ',' ) );
  489. break;
  490. case FlowchrtType.设计:
  491. status = digitaItem.GetDesignerStatus();
  492. time = digitaItem.Ordv_DesignerTime.ToYYYY_MM_dd_HH_mm_ss();
  493. lbDescription = String.Format( "{0}师:{1}", fType.ToString(), LYFZ.DAL.DAL_ErpUser.GetUserIDToUserName( digitaItem.Ordv_DesignerName, ',' ) );
  494. break;
  495. case FlowchrtType.看版:
  496. status = digitaItem.GetLookDesignStatus();
  497. time = digitaItem.Ordv_LookDesignTime.ToYYYY_MM_dd_HH_mm_ss();
  498. lbDescription = String.Format( "{0}师:{1}", fType.ToString(), LYFZ.DAL.DAL_ErpUser.GetUserIDToUserName( digitaItem.Ordv_LookDesignName, ',' ) );
  499. break;
  500. case FlowchrtType.取件:
  501. string pickupTime = "";//最后取件时间
  502. string pickupName = "";//最后取件人
  503. GetLastPickupTime( digitaItem.Ordv_ViceNumber, ref pickupTime, ref pickupName );
  504. status = GetPickupStatus( digitaItem.Ordv_ViceNumber );
  505. time = pickupTime;
  506. lbDescription = String.Format( "{0}师:{1}", fType.ToString(), LYFZ.DAL.DAL_ErpUser.GetUserIDToUserName( pickupName, ',' ) );
  507. break;
  508. case FlowchrtType.服务:
  509. string serviceTime = "";//最后服务时间
  510. string serviceName = "";//最后服务人
  511. GetLasWeddingServiceTime( digitaItem.Ordv_ViceNumber, ref serviceTime, ref serviceName );
  512. status = GetWeddingServiceStatus( digitaItem.Ordv_ViceNumber );
  513. time = serviceTime;
  514. lbDescription = String.Format( "{0}人员:{1}", fType.ToString(), LYFZ.DAL.DAL_ErpUser.GetUserIDToUserName( serviceName, ',' ) );
  515. break;
  516. }
  517. }
  518. this.SetFlowchartNodeDescription( nodeDesc, status, time, lbDescription );
  519. }
  520. private void LabelDescription_MouseEnter( object sender, EventArgs e )
  521. {
  522. NodeDescription nodeDesc = (NodeDescription)((Control)sender).Tag;
  523. AddLinkLabelBtn( nodeDesc, nodeDesc.BtnTexts );
  524. }
  525. /// <summary>
  526. /// 添加按钮
  527. /// </summary>
  528. /// <param name="nodeDesc"></param>
  529. /// <param name="btnTexts"></param>
  530. void AddLinkLabelBtn( NodeDescription nodeDesc, string[] btnTexts )
  531. {
  532. if ( btnTexts != null && !nodeDesc.IsAddBtnText )
  533. {
  534. nodeDesc.IsAddBtnText = true;
  535. foreach ( string btnText in btnTexts )
  536. {
  537. System.Windows.Forms.LinkLabel likBtn = nodeDesc.NewLinkBtn( btnText );
  538. likBtn.Tag = nodeDesc;
  539. likBtn.Click += LikBtn_Click;
  540. nodeDesc.AddLinkBtn( likBtn );
  541. }
  542. }
  543. }
  544. private void LikBtn_Click( object sender, EventArgs e )
  545. {
  546. try
  547. {
  548. System.Windows.Forms.LinkLabel likBtn = (System.Windows.Forms.LinkLabel)sender;
  549. if ( likBtn.Tag == null )
  550. {
  551. return;
  552. }
  553. NodeDescription nodeDesc = (NodeDescription)likBtn.Tag;
  554. string StrSightsName = "";
  555. if ( nodeDesc.CurrentNode.PhotographyItem != null )
  556. {
  557. StrSightsName = nodeDesc.CurrentNode.PhotographyItem.Ordpg_Sights.Trim();
  558. }
  559. LYFZ.Model.Model_ErpOrderDigital _modelDigital = null;
  560. switch ( likBtn.Text.Trim() )
  561. {
  562. case "安排拍照":
  563. if ( !LYFZ.BLL.BLL_ErpUser.GetWebInterfaceRights( LYFZ.Model.Model_UserRights.GetQuickToolsPet(), "qt001" ) )
  564. {
  565. MessageBoxCustom.Show( "您无摄控本操作权限!" );
  566. return;
  567. }
  568. LYFZ.Software.MainBusiness.CameraControlBook.SmallForm.PhotographedReservationSmallForm frm8 = new CameraControlBook.SmallForm.PhotographedReservationSmallForm();
  569. frm8.OrdNumber = this.OrderNumber;
  570. frm8.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  571. frm8.Location = new Point( LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y );
  572. frm8.ShowDialog();
  573. if ( frm8.IsSave )
  574. {
  575. this.updateOrdersPhotography( nodeDesc.CurrentNode.PhotographyItem );
  576. if ( this.OrderType == EnumPublic.OrderType.儿童订单 )
  577. {
  578. this.SetPhotographyNodeDescription_Child( nodeDesc, nodeDesc.CurrentNode.PhotographyItem );
  579. }
  580. else
  581. {
  582. this.SetPhotographyNodeDescription( nodeDesc, nodeDesc.CurrentNode.PhotographyItem );
  583. }
  584. }
  585. break;
  586. case "导出原片":
  587. if ( !LYFZ.BLL.BLL_ErpUser.GetRights( LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresPhotograph, LYFZ.CustomAttributes.OperatingAuthority.PhotoExport ) )
  588. {
  589. MessageBoxCustom.Show( "您无导出原片权限!" );
  590. return;
  591. }
  592. if ( nodeDesc.CurrentNode.PhotographyItem != null )
  593. {
  594. if ( !LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.IsEnterPassword( nodeDesc.CurrentNode.PhotographyItem.Ordpg_ViceNumber.Trim() ) )
  595. {
  596. return;
  597. }
  598. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ExportOriginalPiece( this.OrderNumber, nodeDesc.CurrentNode.PhotographyItem.Ordpg_ViceNumber.Trim(), nodeDesc.CurrentNode.PhotographyItem.Ordpg_Sights.Trim() );
  599. }
  600. else
  601. {
  602. MessageBoxCustom.Show( "订单数据不完整,你不能导出原片" );
  603. }
  604. break;
  605. case "查看原片":
  606. if ( !LYFZ.BLL.BLL_ErpUser.GetRights( LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresPhotograph, LYFZ.CustomAttributes.OperatingAuthority.PhotoView ) )
  607. {
  608. MessageBoxCustom.Show( "您无查看原片权限!" );
  609. return;
  610. }
  611. if ( nodeDesc.CurrentNode.PhotographyItem == null )
  612. {
  613. MessageBoxCustom.Show( "订单数据不完整,你不能查看原片" );
  614. return;
  615. }
  616. string Ordpg_ViceNumber = nodeDesc.CurrentNode.PhotographyItem.Ordpg_ViceNumber.Trim();
  617. string PhotographyName = nodeDesc.CurrentNode.PhotographyItem.Ordpg_Sights.Trim();
  618. if ( !LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.IsEnterPassword( Ordpg_ViceNumber ) )
  619. {
  620. return;
  621. }
  622. int Jid = 0;//景点ID
  623. string SightsName = PhotographyName.Trim();
  624. if ( this.photographyList.FindAll( p => p.Ordpg_ViceNumber.ToLower() == Ordpg_ViceNumber.Trim().ToLower() ).Count > 1 )
  625. {
  626. DialogResult Dialogresult = MessageBoxCustom.Show( "是否查看全部景点?", "信息提示", MessageBoxButtons.YesNoCancel );
  627. if ( Dialogresult == DialogResult.Yes )
  628. {
  629. SightsName = "";
  630. }
  631. else if ( Dialogresult == DialogResult.No )
  632. {
  633. Jid = nodeDesc.CurrentNode.PhotographyItem.ID;
  634. }
  635. else if ( Dialogresult == DialogResult.Cancel )
  636. {
  637. return;
  638. }
  639. }
  640. LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.CustomerPhotosViewSmallForm frm6 = new SetSmallForm.CustomerPhotosViewSmallForm();
  641. frm6.DirType = Model.Model_ErpOrder.DirectoryType.PrimitivePicture;
  642. frm6.ViceOrderNumber = Ordpg_ViceNumber.Trim();
  643. frm6.MainOrderNumber = this.OrderNumber;
  644. frm6.StrSightsName = SightsName;
  645. frm6.LoadType = "原片";
  646. frm6.JID = Jid;
  647. frm6.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  648. frm6.Location = new Point( LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y );
  649. frm6.Size = new Size( LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height );
  650. frm6.Show();
  651. break;
  652. case "导入原片":
  653. if ( !LYFZ.BLL.BLL_ErpUser.GetRights( LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresPhotograph, LYFZ.CustomAttributes.OperatingAuthority.PhotoImport ) )
  654. {
  655. MessageBoxCustom.Show( "您无导入原片权限!" );
  656. return;
  657. }
  658. if ( nodeDesc.CurrentNode.PhotographyItem == null )
  659. {
  660. MessageBoxCustom.Show( "订单数据不完整,你不能导入原片" );
  661. return;
  662. }
  663. LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.OfficersConfirmSuperSmallForm frm5 = new SuperSmallForm.OfficersConfirmSuperSmallForm();
  664. frm5.OrdNumber = this.OrderNumber;
  665. frm5.OrdViceNumber = nodeDesc.CurrentNode.PhotographyItem.Ordpg_ViceNumber.Trim();
  666. frm5.JID = nodeDesc.CurrentNode.PhotographyItem.ID.ToString();
  667. frm5.SightsName = nodeDesc.CurrentNode.PhotographyItem.Ordpg_Sights.Trim();
  668. frm5.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  669. frm5.Location = new Point( LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y );
  670. frm5.ShowDialog();
  671. if ( frm5.IsSaveed )
  672. {
  673. this.updateOrdersPhotography( nodeDesc.CurrentNode.PhotographyItem );
  674. if ( this.OrderType == EnumPublic.OrderType.儿童订单 )
  675. {
  676. this.SetPhotographyNodeDescription_Child( nodeDesc, nodeDesc.CurrentNode.PhotographyItem );
  677. }
  678. else
  679. {
  680. this.SetPhotographyNodeDescription( nodeDesc, nodeDesc.CurrentNode.PhotographyItem );
  681. }
  682. }
  683. break;
  684. case "安排修片":
  685. if ( !LYFZ.BLL.BLL_ErpUser.GetRights( LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresDigital, LYFZ.CustomAttributes.OperatingAuthority.AnPaiWork ) )
  686. {
  687. MessageBoxCustom.Show( "您无数码安排工作权限!" );
  688. return;
  689. }
  690. if ( nodeDesc.CurrentNode.DigitalItem == null )
  691. {
  692. MessageBoxCustom.Show( "订单数据不完整,你不能安排修片" );
  693. return;
  694. }
  695. LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.AnPaiWorkSmallForm frm10 = new SetSmallForm.AnPaiWorkSmallForm();
  696. frm10.StrViceNumber = "'" + nodeDesc.CurrentNode.DigitalItem.Ordv_ViceNumber.Trim() + "'";
  697. frm10.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  698. frm10.Location = new Point( LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y );
  699. frm10.Size = new Size( LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height );
  700. frm10.ShowDialog();
  701. if ( frm10.IsSave )
  702. {
  703. this.updateOrderDigital( nodeDesc.CurrentNode.DigitalItem );
  704. this.SetFlowchartNodeDescription( nodeDesc, nodeDesc.CurrentNode.DigitalItem, FlowchrtType.初修 );
  705. }
  706. break;
  707. case "查看初修片":
  708. if ( !LYFZ.BLL.BLL_ErpUser.GetRights( LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresRepairPiece, LYFZ.CustomAttributes.OperatingAuthority.PhotoView ) )
  709. {
  710. MessageBoxCustom.Show( "您无查看初修片权限!" );
  711. return;
  712. }
  713. if ( nodeDesc.CurrentNode.DigitalItem == null )
  714. {
  715. MessageBoxCustom.Show( "订单数据不完整,你不能查看初修片" );
  716. return;
  717. }
  718. if ( !LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.IsEnterPassword( nodeDesc.CurrentNode.DigitalItem.Ordv_ViceNumber.Trim() ) )
  719. {
  720. return;
  721. }
  722. LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.CustomerPhotosViewSmallForm frm9 = new SetSmallForm.CustomerPhotosViewSmallForm();
  723. frm9.LoadType = "初修片";
  724. frm9.MainOrderNumber = this.OrderNumber;
  725. frm9.ViceOrderNumber = nodeDesc.CurrentNode.DigitalItem.Ordv_ViceNumber.Trim();
  726. frm9.DirType = Model.Model_ErpOrder.DirectoryType.EarlyRetouch;
  727. if ( nodeDesc.CurrentNode.PhotographyItem != null )
  728. {
  729. frm9.StrSightsName = nodeDesc.CurrentNode.PhotographyItem.Ordpg_Sights.Trim();
  730. }
  731. frm9.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  732. frm9.Location = new Point( LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y );
  733. frm9.Size = new Size( LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height );
  734. frm9.Show();
  735. break;
  736. case "导入初修片":
  737. if ( !LYFZ.BLL.BLL_ErpUser.GetRights( LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresRepairPiece, LYFZ.CustomAttributes.OperatingAuthority.PhotoImport ) )
  738. {
  739. MessageBoxCustom.Show( "您无导入初修片权限!" );
  740. return;
  741. }
  742. if ( nodeDesc.CurrentNode.DigitalItem == null )
  743. {
  744. MessageBoxCustom.Show( "订单数据不完整,你不能导入初修片" );
  745. return;
  746. }
  747. if ( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ImportRepairPiece( this.OrderNumber, nodeDesc.CurrentNode.DigitalItem.Ordv_ViceNumber.Trim(), StrSightsName,ref _modelDigital) )
  748. {
  749. this.updateOrderDigital( nodeDesc.CurrentNode.DigitalItem );
  750. this.SetFlowchartNodeDescription( nodeDesc, nodeDesc.CurrentNode.DigitalItem, FlowchrtType.初修 );
  751. }
  752. break;
  753. case "安排选片":
  754. if ( !LYFZ.BLL.BLL_ErpUser.GetWebInterfaceRights( LYFZ.Model.Model_UserRights.GetQuickToolsPet(), "qt001" ) )
  755. {
  756. MessageBoxCustom.Show( "您无摄控本操作权限!" );
  757. return;
  758. }
  759. if ( nodeDesc.CurrentNode.DigitalItem == null )
  760. {
  761. MessageBoxCustom.Show( "订单数据不完整,你不能安排选片" );
  762. return;
  763. }
  764. LYFZ.Software.MainBusiness.CameraControlBook.SmallForm.FilmsSelectionReservationSmallForm frm11 = new CameraControlBook.SmallForm.FilmsSelectionReservationSmallForm();
  765. frm11.OrdViceNumber = nodeDesc.CurrentNode.DigitalItem.Ordv_ViceNumber.Trim();
  766. frm11.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  767. frm11.Location = new Point( LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y );
  768. frm11.ShowDialog();
  769. if ( frm11.IsSave )
  770. {
  771. this.updateOrderDigital( nodeDesc.CurrentNode.DigitalItem );
  772. this.SetFlowchartNodeDescription( nodeDesc, nodeDesc.CurrentNode.DigitalItem, FlowchrtType.选片 );
  773. }
  774. break;
  775. case "开始选片":
  776. if ( !LYFZ.BLL.BLL_ErpUser.GetRights( LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresFilmSelection, LYFZ.CustomAttributes.OperatingAuthority.StartFilmSelection ) )
  777. {
  778. MessageBoxCustom.Show( "您无选片权限!" );
  779. return;
  780. }
  781. if ( nodeDesc.CurrentNode.DigitalItem == null )
  782. {
  783. MessageBoxCustom.Show( "订单数据不完整,你不能开始选片" );
  784. return;
  785. }
  786. if ( !LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.IsEnterPassword( nodeDesc.CurrentNode.DigitalItem.Ordv_ViceNumber.Trim() ) )
  787. {
  788. return;
  789. }
  790. if ( LYFZ.Software.MainBusiness.DoorCityProcess.FilmSelectionStart.ShowPhotoSelectSystemMainPhotoSelect( this.OrderNumber, nodeDesc.CurrentNode.DigitalItem.Ordv_ViceNumber.Trim() ) )
  791. {
  792. this.updateOrderDigital( nodeDesc.CurrentNode.DigitalItem );
  793. this.SetFlowchartNodeDescription( nodeDesc, nodeDesc.CurrentNode.DigitalItem, FlowchrtType.选片 );
  794. }
  795. break;
  796. case "安排精修":
  797. if ( !LYFZ.BLL.BLL_ErpUser.GetRights( LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresDigital, LYFZ.CustomAttributes.OperatingAuthority.AnPaiWork ) )
  798. {
  799. MessageBoxCustom.Show( "您无数码安排工作权限!" );
  800. return;
  801. }
  802. if ( nodeDesc.CurrentNode.DigitalItem == null )
  803. {
  804. MessageBoxCustom.Show( "订单数据不完整,你不能开始选片" );
  805. return;
  806. }
  807. LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.AnPaiWorkSmallForm frm13 = new SetSmallForm.AnPaiWorkSmallForm();
  808. frm13.StrViceNumber = "'" + nodeDesc.CurrentNode.DigitalItem.Ordv_ViceNumber.Trim() + "'";
  809. frm13.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  810. frm13.Location = new Point( LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y );
  811. frm13.Size = new Size( LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height );
  812. frm13.ShowDialog();
  813. if ( frm13.IsSave )
  814. {
  815. this.updateOrderDigital( nodeDesc.CurrentNode.DigitalItem );
  816. this.SetFlowchartNodeDescription( nodeDesc, nodeDesc.CurrentNode.DigitalItem, FlowchrtType.精修 );
  817. }
  818. break;
  819. case "导入精修片":
  820. if ( !LYFZ.BLL.BLL_ErpUser.GetRights( LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresRefinedRepair, LYFZ.CustomAttributes.OperatingAuthority.PhotoImport ) )
  821. {
  822. MessageBoxCustom.Show( "您无导入精修片权限!" );
  823. return;
  824. }
  825. if ( nodeDesc.CurrentNode.DigitalItem == null )
  826. {
  827. MessageBoxCustom.Show( "订单数据不完整,你不能开始选片" );
  828. return;
  829. }
  830. if ( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ImportRefinedRepairPiece( this.OrderNumber
  831. , nodeDesc.CurrentNode.DigitalItem.Ordv_ViceNumber.Trim(), StrSightsName,ref _modelDigital ) )
  832. {
  833. this.updateOrderDigital( nodeDesc.CurrentNode.DigitalItem );
  834. this.SetFlowchartNodeDescription( nodeDesc, nodeDesc.CurrentNode.DigitalItem, FlowchrtType.精修 );
  835. }
  836. break;
  837. case "导出选片":
  838. if ( !LYFZ.BLL.BLL_ErpUser.GetRights( LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresFilmSelection, LYFZ.CustomAttributes.OperatingAuthority.PhotoExport ) )
  839. {
  840. MessageBoxCustom.Show( "您无导出选好的片权限!" ); return;
  841. }
  842. if ( nodeDesc.CurrentNode.DigitalItem == null )
  843. {
  844. MessageBoxCustom.Show( "订单数据不完整,你不能开始选片" );
  845. return;
  846. }
  847. if ( !LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.IsEnterPassword( nodeDesc.CurrentNode.DigitalItem.Ordv_ViceNumber.Trim() ) )
  848. {
  849. return;
  850. }
  851. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ExportSelectionPiece( this.OrderNumber, nodeDesc.CurrentNode.DigitalItem.Ordv_ViceNumber.Trim() );
  852. break;
  853. case "安排设计":
  854. if ( !LYFZ.BLL.BLL_ErpUser.GetRights( LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresDigital, LYFZ.CustomAttributes.OperatingAuthority.AnPaiWork ) )
  855. {
  856. MessageBoxCustom.Show( "您无数码安排工作权限!" );
  857. return;
  858. }
  859. if ( nodeDesc.CurrentNode.DigitalItem == null )
  860. {
  861. MessageBoxCustom.Show( "订单数据不完整,你不能安排设计" );
  862. return;
  863. }
  864. LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.AnPaiWorkSmallForm frm14 = new SetSmallForm.AnPaiWorkSmallForm();
  865. frm14.StrViceNumber = "'" + nodeDesc.CurrentNode.DigitalItem.Ordv_ViceNumber.Trim() + "'";
  866. frm14.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  867. frm14.Location = new Point( LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y );
  868. frm14.Size = new Size( LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height );
  869. frm14.ShowDialog();
  870. if ( frm14.IsSave )
  871. {
  872. this.updateOrderDigital( nodeDesc.CurrentNode.DigitalItem );
  873. this.SetFlowchartNodeDescription( nodeDesc, nodeDesc.CurrentNode.DigitalItem, FlowchrtType.设计 );
  874. }
  875. break;
  876. case "导入设计":
  877. if ( !LYFZ.BLL.BLL_ErpUser.GetRights( LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresDesign, LYFZ.CustomAttributes.OperatingAuthority.PhotoImport ) )
  878. {
  879. MessageBoxCustom.Show( "您无导入设计片权限!" );
  880. return;
  881. }
  882. if ( nodeDesc.CurrentNode.DigitalItem == null )
  883. {
  884. MessageBoxCustom.Show( "订单数据不完整,你不能导入设计" );
  885. return;
  886. }
  887. if ( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ImportDesignPiece( this.OrderNumber
  888. , nodeDesc.CurrentNode.DigitalItem.Ordv_ViceNumber.Trim(), StrSightsName,ref _modelDigital ) )
  889. {
  890. this.updateOrderDigital( nodeDesc.CurrentNode.DigitalItem );
  891. this.SetFlowchartNodeDescription( nodeDesc, nodeDesc.CurrentNode.DigitalItem, FlowchrtType.设计 );
  892. }
  893. break;
  894. case "导出精修":
  895. if ( !LYFZ.BLL.BLL_ErpUser.GetRights( LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresRefinedRepair, LYFZ.CustomAttributes.OperatingAuthority.PhotoExport ) )
  896. {
  897. MessageBoxCustom.Show( "您无导出精修权限!" );
  898. return;
  899. }
  900. if ( nodeDesc.CurrentNode.DigitalItem == null )
  901. {
  902. MessageBoxCustom.Show( "订单数据不完整,你不能导出精修" );
  903. return;
  904. }
  905. if ( !LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.IsEnterPassword( nodeDesc.CurrentNode.DigitalItem.Ordv_ViceNumber.Trim() ) )
  906. {
  907. return;
  908. }
  909. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ExportRefinedRepairPiece( this.OrderNumber
  910. , nodeDesc.CurrentNode.DigitalItem.Ordv_ViceNumber.Trim(), StrSightsName );
  911. break;
  912. case "安排看版":
  913. if ( !LYFZ.BLL.BLL_ErpUser.GetWebInterfaceRights( LYFZ.Model.Model_UserRights.GetQuickToolsPet(), "qt001" ) )
  914. {
  915. MessageBoxCustom.Show( "您无摄控本操作权限!" );
  916. return;
  917. }
  918. if ( nodeDesc.CurrentNode.DigitalItem == null )
  919. {
  920. MessageBoxCustom.Show( "订单数据不完整,你不能安排看版" );
  921. return;
  922. }
  923. LYFZ.Software.MainBusiness.CameraControlBook.SmallForm.LookDesignReservationSmallForm frm16 = new CameraControlBook.SmallForm.LookDesignReservationSmallForm();
  924. frm16.OrdViceNumber = nodeDesc.CurrentNode.DigitalItem.Ordv_ViceNumber.Trim();
  925. frm16.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  926. frm16.Location = new Point( LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y );
  927. frm16.ShowDialog();
  928. if ( frm16.IsSave )
  929. {
  930. this.updateOrderDigital( nodeDesc.CurrentNode.DigitalItem );
  931. this.SetFlowchartNodeDescription( nodeDesc, nodeDesc.CurrentNode.DigitalItem, FlowchrtType.看版 );
  932. }
  933. break;
  934. case "导出改设计":
  935. if ( !LYFZ.BLL.BLL_ErpUser.GetRights( LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresDesign, LYFZ.CustomAttributes.OperatingAuthority.PhotoExport ) )
  936. {
  937. MessageBoxCustom.Show( "您无导出改设计片权限!" );
  938. return;
  939. }
  940. if ( nodeDesc.CurrentNode.DigitalItem == null )
  941. {
  942. MessageBoxCustom.Show( "订单数据不完整,你不能导出改设计" );
  943. return;
  944. }
  945. if ( !LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.IsEnterPassword( nodeDesc.CurrentNode.DigitalItem.Ordv_ViceNumber.Trim() ) )
  946. {
  947. return;
  948. }
  949. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ExportDesignPiece( this.OrderNumber
  950. , nodeDesc.CurrentNode.DigitalItem.Ordv_ViceNumber.Trim(), StrSightsName );
  951. break;
  952. case "看设计版":
  953. if ( !LYFZ.BLL.BLL_ErpUser.GetRights( LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresDesign, LYFZ.CustomAttributes.OperatingAuthority.LookDesign ) )
  954. {
  955. MessageBoxCustom.Show( "您无看设计版权限!" );
  956. return;
  957. }
  958. if ( nodeDesc.CurrentNode.DigitalItem == null )
  959. {
  960. MessageBoxCustom.Show( "订单数据不完整,你不能看设计版" );
  961. return;
  962. }
  963. if ( !LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.IsEnterPassword( nodeDesc.CurrentNode.DigitalItem.Ordv_ViceNumber.Trim() ) )
  964. {
  965. return;
  966. }
  967. LYFZ.PhotoSelectSystem.LookDesign frm15 = new PhotoSelectSystem.LookDesign( this.currentOrderModel, nodeDesc.CurrentNode.DigitalItem );
  968. frm15.ShowDialog();
  969. break;
  970. case "安排取件":
  971. if ( !LYFZ.BLL.BLL_ErpUser.GetWebInterfaceRights( LYFZ.Model.Model_UserRights.GetQuickToolsPet(), "qt001" ) )
  972. {
  973. MessageBoxCustom.Show( "您无摄控本操作权限!" );
  974. return;
  975. }
  976. if ( nodeDesc.CurrentNode.DigitalItem == null )
  977. {
  978. MessageBoxCustom.Show( "订单数据不完整,你不能安排取件" );
  979. return;
  980. }
  981. LYFZ.Software.MainBusiness.CameraControlBook.SmallForm.TakePiecesReservationSmallForm frm20 = new CameraControlBook.SmallForm.TakePiecesReservationSmallForm();
  982. frm20.OrdNumber = this.OrderNumber;
  983. frm20.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  984. frm20.Location = new Point( LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y );
  985. frm20.Size = new Size( LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height );
  986. frm20.ShowDialog();
  987. if ( frm20.IsSave )
  988. {
  989. this.updateOrderDigital( nodeDesc.CurrentNode.DigitalItem );
  990. this.SetFlowchartNodeDescription( nodeDesc, nodeDesc.CurrentNode.DigitalItem, FlowchrtType.取件 );
  991. }
  992. break;
  993. case "安排发片":
  994. if ( !LYFZ.BLL.BLL_ErpUser.GetRights( LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresDigital, LYFZ.CustomAttributes.OperatingAuthority.AnPaiWork ) )
  995. {
  996. MessageBoxCustom.Show( "您无数码安排工作权限!" );
  997. return;
  998. }
  999. if ( nodeDesc.CurrentNode.DigitalItem == null )
  1000. {
  1001. MessageBoxCustom.Show( "订单数据不完整,你不能安排发片" );
  1002. return;
  1003. }
  1004. LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.AnPaiWorkSmallForm frm19 = new SetSmallForm.AnPaiWorkSmallForm();
  1005. frm19.StrViceNumber = "'" + nodeDesc.CurrentNode.DigitalItem.Ordv_ViceNumber.Trim() + "'";
  1006. frm19.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  1007. frm19.Location = new Point( LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y );
  1008. frm19.Size = new Size( LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height );
  1009. frm19.ShowDialog();
  1010. if ( frm19.IsSave )
  1011. {
  1012. this.updateOrderDigital( nodeDesc.CurrentNode.DigitalItem );
  1013. }
  1014. break;
  1015. case "发片取件":
  1016. if ( !LYFZ.BLL.BLL_ErpUser.GetWebInterfaceRights( "retailProcess", "st013" ) )
  1017. {
  1018. MessageBoxCustom.Show( "您无发片取件权限!" );
  1019. return;
  1020. }
  1021. if ( nodeDesc.CurrentNode.DigitalItem == null )
  1022. {
  1023. MessageBoxCustom.Show( "订单数据不完整,你不能发片取件" );
  1024. return;
  1025. }
  1026. LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.HairPieceSingleSmallForm frm18 = new SetSmallForm.HairPieceSingleSmallForm();
  1027. frm18.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  1028. frm18.Location = new Point( LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y );
  1029. frm18.Size = new Size( LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height );
  1030. Dictionary<string, string> DictDataArray = new Dictionary<string, string>();
  1031. DictDataArray["ViceNumber"] = nodeDesc.CurrentNode.DigitalItem.Ordv_ViceNumber.Trim();
  1032. DictDataArray["OrdNumber"] = this.OrderNumber;
  1033. DictDataArray["OrdType"] = Enum.GetName( typeof( LYFZ.EnumPublic.OrderType ), Convert.ToInt32( this.OrderType ) );
  1034. frm18.DictDataArray = DictDataArray;
  1035. frm18.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  1036. frm18.Location = new Point( LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y );
  1037. frm18.Size = new Size( LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height );
  1038. frm18.ShowDialog();
  1039. if ( frm18.IsSave )
  1040. {
  1041. this.updateOrderDigital( nodeDesc.CurrentNode.DigitalItem );
  1042. this.SetFlowchartNodeDescription( nodeDesc, nodeDesc.CurrentNode.DigitalItem, FlowchrtType.取件 );
  1043. }
  1044. break;
  1045. case "安排服务":
  1046. if ( !LYFZ.BLL.BLL_ErpUser.GetWebInterfaceRights( LYFZ.Model.Model_UserRights.GetQuickToolsPet(), "qt001" ) )
  1047. {
  1048. MessageBoxCustom.Show( "您无摄控本操作权限!" );
  1049. return;
  1050. }
  1051. if ( nodeDesc.CurrentNode.DigitalItem == null )
  1052. {
  1053. MessageBoxCustom.Show( "订单数据不完整,你不能安排服务" );
  1054. return;
  1055. }
  1056. LYFZ.Software.MainBusiness.CameraControlBook.SmallForm.WeddingReservationSmallForm frm17 = new CameraControlBook.SmallForm.WeddingReservationSmallForm();
  1057. frm17.OrdNumber = this.OrderNumber;
  1058. frm17.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  1059. frm17.Location = new Point( LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y );
  1060. frm17.Size = new Size( LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height );
  1061. frm17.ShowDialog();
  1062. if ( frm17.IsSaveed )
  1063. {
  1064. this.updateOrderDigital( nodeDesc.CurrentNode.DigitalItem );
  1065. }
  1066. break;
  1067. }
  1068. }
  1069. catch ( Exception ex )
  1070. {
  1071. MessageBoxCustom.Show( "请求出错:{0}", ex.Message );
  1072. }
  1073. /*
  1074. /// 拍照按钮数组 new string[] { "安排拍照", "导出原片", "查看原片", "导入原片" };
  1075. /// 初修片 new string[] { "安排修片", "查看初修片", "导入初修片" };
  1076. /// 选片 new string[] { "安排选片", "开始选片" };
  1077. /// 精修 new string[] { "安排精修", "导入精修片","导出选片" };
  1078. /// 设计 new string[] { "安排设计", "导入设计", "导出精修" };
  1079. /// 看版 new string[] { "安排看版", "导出改设计", "看设计版" };
  1080. /// 取件 new string[] { "安排取件", "安排发片", "发片取件", "安排服务" };
  1081. */
  1082. }
  1083. /// <summary>
  1084. /// 更新摄影表对象
  1085. /// </summary>
  1086. /// <param name="nodeDesc"></param>
  1087. void updateOrdersPhotography( Model.Model_ErpOrdersPhotography oldPhotographyModel )
  1088. {
  1089. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  1090. {
  1091. backgroundWorker.ReportProgress( 0, "正在更新数据... " );
  1092. Model.Model_ErpOrdersPhotography newPhotographyModel = photographyBll.GetModel( oldPhotographyModel.ID );
  1093. this.UpdateModel<Model.Model_ErpOrdersPhotography>( oldPhotographyModel, newPhotographyModel );
  1094. } );
  1095. }
  1096. /// <summary>
  1097. /// 更新数码表对象
  1098. /// </summary>
  1099. /// <param name="nodeDesc"></param>
  1100. void updateOrderDigital( Model.Model_ErpOrderDigital oldOrderDigital )
  1101. {
  1102. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  1103. {
  1104. backgroundWorker.ReportProgress( 0, "正在更新数据... " );
  1105. Model.Model_ErpOrderDigital newOrderDigital = orderDigitalBll.GetModel( oldOrderDigital.ID );
  1106. this.UpdateModel<Model.Model_ErpOrderDigital>( oldOrderDigital, newOrderDigital );
  1107. } );
  1108. }
  1109. /// <summary>
  1110. /// 获取属性集合
  1111. /// </summary>
  1112. public System.Reflection.PropertyInfo[] GetPropertyInfos<T>()
  1113. {
  1114. return typeof( T ).GetProperties().Where( i => i.CanWrite && i.Name != "id" ).ToArray();
  1115. }
  1116. /// <summary>
  1117. /// 得到一个对象实体
  1118. /// </summary>
  1119. public void UpdateModel<T>( T oldModel, T newModel )
  1120. {
  1121. if ( newModel != null )
  1122. {
  1123. System.Reflection.PropertyInfo[] PropertyInfos = GetPropertyInfos<T>();
  1124. for ( int i = 0; i < PropertyInfos.Length; i++ )
  1125. {
  1126. try
  1127. {
  1128. System.Reflection.PropertyInfo propertyInfo = PropertyInfos[i];
  1129. string tempFieldName = propertyInfo.Name;//字段名
  1130. object tempValue = LYFZ.WinAPI.CustomPublicMethod.GetPropertyValue( newModel, tempFieldName );//对应字段值
  1131. LYFZ.WinAPI.CustomPublicMethod.SetPropertyValue( oldModel, propertyInfo, tempValue );
  1132. }
  1133. catch
  1134. {
  1135. }
  1136. }
  1137. }
  1138. }
  1139. /// <summary>
  1140. /// 获取取件状态
  1141. /// </summary>
  1142. /// <param name="_ViceNumber"></param>
  1143. /// <returns></returns>
  1144. string GetPickupStatus( string _ViceNumber )
  1145. {
  1146. string retStatus = "无商品";
  1147. if ( this.orderProductList.Count > 0 )
  1148. {
  1149. if ( this.orderProductList.Any( p => p.OPlist_ViceNumber.ToLower() == _ViceNumber.ToLower() && p.OPlist_PickupStatus == "0" )
  1150. && !this.orderProductList.Any( p => p.OPlist_ViceNumber.ToLower() == _ViceNumber.ToLower() && p.OPlist_PickupStatus == "1" ) )
  1151. {
  1152. retStatus = "未取";
  1153. }
  1154. else if ( this.orderProductList.Any( p => p.OPlist_ViceNumber.ToLower() == _ViceNumber.ToLower() && p.OPlist_PickupStatus == "0" )
  1155. && this.orderProductList.Any( p => p.OPlist_ViceNumber.ToLower() == _ViceNumber.ToLower() && p.OPlist_PickupStatus == "1" ) )
  1156. {
  1157. retStatus = "部分已取";
  1158. }
  1159. else if ( !this.orderProductList.Any( p => p.OPlist_ViceNumber.ToLower() == _ViceNumber.ToLower() && p.OPlist_PickupStatus == "0" )
  1160. && this.orderProductList.Any( p => p.OPlist_ViceNumber.ToLower() == _ViceNumber.ToLower() && p.OPlist_PickupStatus == "1" ) )
  1161. {
  1162. retStatus = "已取";
  1163. }
  1164. }
  1165. return retStatus;
  1166. }
  1167. /// <summary>
  1168. /// 获取服务状态
  1169. /// </summary>
  1170. /// <param name="_ViceNumber"></param>
  1171. /// <returns></returns>
  1172. string GetWeddingServiceStatus( string _ViceNumber )
  1173. {
  1174. string retStatus = "无服务";
  1175. if ( this.orderWeddingServiceList.Count > 0 )
  1176. {
  1177. if ( this.orderWeddingServiceList.Any( p => p.Ws_ViceNumber.ToLower() == _ViceNumber.ToLower() && p.Ws_Status == "0" )
  1178. && !this.orderWeddingServiceList.Any( p => p.Ws_ViceNumber.ToLower() == _ViceNumber.ToLower() && p.Ws_Status == "1" )
  1179. && !this.orderWeddingServiceList.Any( p => p.Ws_ViceNumber.ToLower() == _ViceNumber.ToLower() && p.Ws_Status == "2" ) )
  1180. {
  1181. retStatus = "未进行";
  1182. }
  1183. else if ( this.orderWeddingServiceList.Any( p => p.Ws_ViceNumber.ToLower() == _ViceNumber.ToLower() && p.Ws_Status == "2" )
  1184. || this.orderWeddingServiceList.Any( p => p.Ws_ViceNumber.ToLower() == _ViceNumber.ToLower() && p.Ws_Status == "1" ) )
  1185. {
  1186. retStatus = "进行中";
  1187. }
  1188. else if ( !this.orderWeddingServiceList.Any( p => p.Ws_ViceNumber.ToLower() == _ViceNumber.ToLower() && p.Ws_Status == "0" )
  1189. && !this.orderWeddingServiceList.Any( p => p.Ws_ViceNumber.ToLower() == _ViceNumber.ToLower() && p.Ws_Status == "2" )
  1190. && this.orderWeddingServiceList.Any( p => p.Ws_ViceNumber.ToLower() == _ViceNumber.ToLower() && p.Ws_Status == "1" ) )
  1191. {
  1192. retStatus = "OK";
  1193. }
  1194. }
  1195. return retStatus;
  1196. }
  1197. /// <summary>
  1198. /// 获取最后服务时间 和 服务人员
  1199. /// </summary>
  1200. /// <param name="_ViceNumber"></param>
  1201. /// <param name="serviceTime"></param>
  1202. /// <param name="serviceName"></param>
  1203. void GetLasWeddingServiceTime( string _ViceNumber, ref string serviceTime, ref string serviceName )
  1204. {
  1205. if ( this.orderWeddingServiceList.Count > 0 )
  1206. {
  1207. List<LYFZ.Model.Model_ErpWeddingService> tempWeddingServiceList = orderWeddingServiceList.FindAll( p => p.Ws_ViceNumber.ToLower() == _ViceNumber.ToLower() );
  1208. if ( tempWeddingServiceList != null )
  1209. {
  1210. if ( tempWeddingServiceList.Count > 0 )
  1211. {
  1212. LYFZ.Model.Model_ErpWeddingService tempProduct = tempWeddingServiceList.OrderByDescending( p => p.Ws_WeddingDate ).First();
  1213. if ( tempProduct.Ws_WeddingDate != null )
  1214. {
  1215. if ( tempProduct.Ws_WeddingDate > LYFZ.WinAPI.CustomPublicMethod.GetNullDateTime() )
  1216. {
  1217. serviceTime = Convert.ToDateTime( tempProduct.Ws_WeddingDate ).ToYYYY_MM_dd_HH_mm_ss();
  1218. serviceName = tempProduct.Ws_Serviceman1 + "," + tempProduct.Ws_Serviceman2;
  1219. }
  1220. }
  1221. }
  1222. }
  1223. }
  1224. }
  1225. /// <summary>
  1226. /// 获取最后取件时间 和 取件人
  1227. /// </summary>
  1228. /// <param name="_ViceNumber"></param>
  1229. /// <param name="pickupTime"></param>
  1230. /// <param name="pickupName"></param>
  1231. void GetLastPickupTime( string _ViceNumber, ref string pickupTime, ref string pickupName )
  1232. {
  1233. if ( this.orderProductList.Count > 0 )
  1234. {
  1235. List<LYFZ.Model.Model_ErpOrderProductList> tempProductList = this.orderProductList.FindAll( p => p.OPlist_ViceNumber.ToLower() == _ViceNumber.ToLower() );
  1236. if ( tempProductList != null )
  1237. {
  1238. if ( tempProductList.Count > 0 )
  1239. {
  1240. LYFZ.Model.Model_ErpOrderProductList tempProduct = tempProductList.OrderByDescending( p => p.OPlist_PickupTime ).First();
  1241. if ( tempProduct.OPlist_PickupTime != null )
  1242. {
  1243. if ( tempProduct.OPlist_PickupTime > LYFZ.WinAPI.CustomPublicMethod.GetNullDateTime() )
  1244. {
  1245. pickupTime = Convert.ToDateTime( tempProduct.OPlist_PickupTime ).ToYYYY_MM_dd_HH_mm_ss();
  1246. pickupName = tempProduct.OPlist_PickupName;
  1247. }
  1248. }
  1249. }
  1250. }
  1251. }
  1252. }
  1253. /// <summary>
  1254. /// 服务收款
  1255. /// </summary>
  1256. /// <param name="sender"></param>
  1257. /// <param name="e"></param>
  1258. private void LkHuFuShouKuan_Click( object sender, EventArgs e )
  1259. {
  1260. if ( !LYFZ.BLL.BLL_ErpUser.GetWebInterfaceRights( "st040", "st041" ) )
  1261. {
  1262. MessageBoxCustom.Show( "您无会员资料权限!" ); return;
  1263. }
  1264. LYFZ.Software.MainBusiness.MembershipManage.SuperSmallForm.MemberServiceCardArrearsSuperSmallForm frm4 = new MembershipManage.SuperSmallForm.MemberServiceCardArrearsSuperSmallForm();
  1265. if ( this.lbHuiYuanHao.Tag != null )
  1266. {
  1267. frm4.StrMemberNumber = this.lbHuiYuanHao.Tag.ToString().Trim();
  1268. }
  1269. else
  1270. {
  1271. frm4.StrMemberNumber = "";
  1272. }
  1273. frm4.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  1274. frm4.Location = new Point( LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y );
  1275. frm4.Size = new Size( LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height );
  1276. frm4.ShowDialog();
  1277. if ( frm4.IsSaveed )
  1278. {
  1279. this.GetPanelPaymentDetailsControlsEx();
  1280. }
  1281. }
  1282. /// <summary>
  1283. /// 会员管理
  1284. /// </summary>
  1285. /// <param name="sender"></param>
  1286. /// <param name="e"></param>
  1287. private void LkHuiYuanGuanLi_Click( object sender, EventArgs e )
  1288. {
  1289. if ( !LYFZ.BLL.BLL_ErpUser.GetWebInterfaceRights( "st040", "st041" ) )
  1290. {
  1291. MessageBoxCustom.Show( "您无会员资料权限!" );
  1292. return;
  1293. }
  1294. LYFZ.Software.MainBusiness.MembershipManage.SetSmallForm.GoldManagementSmallForm frm3 = new MembershipManage.SetSmallForm.GoldManagementSmallForm();
  1295. if ( this.lbHuiYuanHao.Tag != null )
  1296. {
  1297. frm3.StrNumber = this.lbHuiYuanHao.Tag.ToString().Trim();
  1298. }
  1299. else
  1300. {
  1301. frm3.StrNumber = "";
  1302. }
  1303. frm3.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  1304. frm3.Location = new Point( LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y );
  1305. frm3.ShowDialog();
  1306. if ( frm3.IsSaveed )
  1307. {
  1308. this.GetPanelPaymentDetailsControlsEx();
  1309. }
  1310. }
  1311. /// <summary>
  1312. /// 办理会员
  1313. /// </summary>
  1314. /// <param name="sender"></param>
  1315. /// <param name="e"></param>
  1316. private void LkBanLiHuiYuan_Click( object sender, EventArgs e )
  1317. {
  1318. if ( !LYFZ.BLL.BLL_ErpUser.GetRights( LYFZ.BLL.BLL_ErpUser.CurrentUserRights.MemberManage, LYFZ.CustomAttributes.OperatingAuthority.Member_OpenCard ) )
  1319. {
  1320. MessageBoxCustom.Show( "您无办理会员权限!" );
  1321. return;
  1322. }
  1323. LYFZ.Software.MainBusiness.MembershipManage.SetSmallForm.AddGoldCardMemberSmallForm frm21 = new MembershipManage.SetSmallForm.AddGoldCardMemberSmallForm();
  1324. frm21.StrClientNumber = this.M_Cus_CustomerNumber;
  1325. frm21.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  1326. frm21.Location = new Point( LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y );
  1327. frm21.ShowDialog();
  1328. if ( frm21.IsSaveed )
  1329. {
  1330. this.GetPanelPaymentDetailsControlsEx();
  1331. }
  1332. }
  1333. /// <summary>
  1334. /// 当前会员卡持卡人客户ID
  1335. /// </summary>
  1336. string M_Cus_CustomerNumber = "";
  1337. /// <summary>
  1338. /// 获取订单收款信息
  1339. /// </summary>
  1340. void GetPanelPaymentDetailsControlsEx()
  1341. {
  1342. string StrColumnName = "Ord_Number,M_Cus_CustomerNumber,Ord_SeriesPrice AS 套系金额,case when (Select sum(Plu_Amount) as Plu_Amount from tb_ErpPlusPickItems where Plu_OrdNumber = Ord_Number) is null then 0 else (Select sum(Plu_Amount) as Plu_Amount from tb_ErpPlusPickItems where Plu_OrdNumber = Ord_Number) end AS 加挑金额," +
  1343. "case when (select sum(Pay_AmountOf) from dbo.tb_ErpPayment where Pay_OrdNumber = Ord_Number And Pay_Category in ('全款','预约收款','预约补款')) is null then 0 else (select sum(Pay_AmountOf) from dbo.tb_ErpPayment where Pay_OrdNumber = Ord_Number And Pay_Category in ('全款','预约收款','预约补款')) end AS 前期收款," +
  1344. "case when (select sum(Pay_AmountOf) from dbo.tb_ErpPayment where Pay_OrdNumber = Ord_Number And Pay_Category = '后期收款') is null then 0 else (select sum(Pay_AmountOf) from dbo.tb_ErpPayment where Pay_OrdNumber = Ord_Number And Pay_Category = '后期收款') end AS 后期收款";
  1345. DataTable dt = orderBll.GetView_Custom( "tb_ErpOrder Left Join tempTB_AggregationCustomer on GP_OrderNumber = Ord_Number", StrWhere: "Ord_Number = '" + this.currentOrderModel.Ord_Number + "'", ShowColumnName: StrColumnName ).Tables[0];
  1346. #region 收款与会员信息
  1347. try
  1348. {
  1349. if ( dt.Rows.Count > 0 )
  1350. {
  1351. this.lbQianQiShiShou.Text = dt.Rows[0]["套系金额"].ToString().Trim();
  1352. this.lbQianQiYingShou.Text = dt.Rows[0]["前期收款"].ToString().Trim();
  1353. this.lbQianQiQianKuan.Text = (Convert.ToDecimal( dt.Rows[0]["套系金额"] ) - Convert.ToDecimal( dt.Rows[0]["前期收款"] )).ToString();
  1354. this.lbHouQiShiShou.Text = dt.Rows[0]["加挑金额"].ToString().Trim();
  1355. this.lbHouQiYingShou.Text = dt.Rows[0]["后期收款"].ToString().Trim();
  1356. this.lbHouQiQianKuan.Text = (Convert.ToDecimal( dt.Rows[0]["加挑金额"] ) - Convert.ToDecimal( dt.Rows[0]["后期收款"] )).ToString();
  1357. this.M_Cus_CustomerNumber = dt.Rows[0]["M_Cus_CustomerNumber"].ToString().Trim();
  1358. dt = orderBll.GetView_Custom( "BView_MemberMain_GoldMember", StrWhere: " Mc_Status='1' and 姓名编号 = '" + dt.Rows[0]["M_Cus_CustomerNumber"].ToString().Trim() + "'", ShowColumnName: "Mc_Number,姓名,会员卡号,等级,折扣,积分,金额,欠款" ).Tables[0];
  1359. if ( dt.Rows.Count > 0 )
  1360. {
  1361. if ( !string.IsNullOrEmpty( dt.Rows[0]["会员卡号"].ToString().Trim() ) )
  1362. {
  1363. this.lbHuiYuanMing.Text = ObjectToString( dt.Rows[0]["姓名"] ).Trim();
  1364. this.lbHuiYuanHao.Tag = ObjectToString( dt.Rows[0]["Mc_Number"] ).Trim();
  1365. this.lbHuiYuanHao.Text = String.Format( "会员卡号:{0}", ObjectToString( dt.Rows[0]["会员卡号"] ).Trim() );
  1366. this.lbKeYongJiE.Text = String.Format( "{0}元", ObjectToString( dt.Rows[0]["金额"] ).Trim() );
  1367. this.lbKeYongJiFen.Text = String.Format( "{0}分", ObjectToString( dt.Rows[0]["积分"] ).Trim() );
  1368. this.lbHuiYuanDengJi.Text = String.Format( "会员等级:{0}", ObjectToString( dt.Rows[0]["等级"] ).Trim() );
  1369. if ( !String.IsNullOrEmpty( ObjectToString( dt.Rows[0]["折扣"] ).Trim() ) )
  1370. {
  1371. this.lbXiaoFieZheKou.Text = String.Format( "{0}折", ObjectToString( dt.Rows[0]["折扣"] ).Trim() );
  1372. }
  1373. else
  1374. {
  1375. this.lbXiaoFieZheKou.Text = "-";
  1376. }
  1377. this.lbHuFuQianKuan.Text = String.Format( "{0}元", ObjectToString( dt.Rows[0]["欠款"] ).Trim() );
  1378. }
  1379. }
  1380. }
  1381. }
  1382. catch
  1383. {
  1384. }
  1385. #endregion
  1386. }
  1387. string ObjectToString( object obj )
  1388. {
  1389. if ( obj != null )
  1390. {
  1391. return obj.ToString().Trim();
  1392. }
  1393. else
  1394. {
  1395. return "";
  1396. }
  1397. }
  1398. /// <summary>
  1399. /// 后期收款
  1400. /// </summary>
  1401. /// <param name="sender"></param>
  1402. /// <param name="e"></param>
  1403. private void LkHouQi_Click( object sender, EventArgs e )
  1404. {
  1405. LYFZ.Software.MainBusiness.FinancialManagement.OrdersReceivables.FrmLatePayment frm2 = new FinancialManagement.OrdersReceivables.FrmLatePayment();
  1406. frm2.StrOrdType = this.OrderType.ToString();
  1407. frm2.StrOrdNumber = this.currentOrderModel.Ord_Number;
  1408. frm2.StrCope = Convert.ToDecimal( this.lbHouQiShiShou.Text );
  1409. frm2.StrPaid = Convert.ToDecimal( this.lbHouQiYingShou.Text );
  1410. frm2.StrArrears = Convert.ToDecimal( this.lbHouQiQianKuan.Text );
  1411. frm2.ShowDialog();
  1412. if ( frm2.IsSaveed )
  1413. {
  1414. this.GetPanelPaymentDetailsControlsEx();
  1415. }
  1416. }
  1417. /// <summary>
  1418. /// 前期收款
  1419. /// </summary>
  1420. /// <param name="sender"></param>
  1421. /// <param name="e"></param>
  1422. private void LkQianQi_Click( object sender, EventArgs e )
  1423. {
  1424. LYFZ.Software.MainBusiness.FinancialManagement.OrdersReceivables.FrmPrePayment frm1 = new FinancialManagement.OrdersReceivables.FrmPrePayment();
  1425. frm1.StrOrdNumber = this.currentOrderModel.Ord_Number;
  1426. frm1.IsShowButtonPayment = false;
  1427. frm1.ShowDialog();
  1428. if ( frm1.IsSaveed )
  1429. {
  1430. this.GetPanelPaymentDetailsControlsEx();
  1431. }
  1432. }
  1433. void GetPanelContactRecord()
  1434. {
  1435. List<Control> hideControl = new List<Control>();
  1436. hideControl.Add( this.panelContactRecord );
  1437. LYFZ.Software.MainBusiness.VersionControl.StaticVersion.BindVersionShowHideControl(
  1438. VersionControl.VersionFunctionEnum.沟通助手, hideControl, null, null );
  1439. DataTable dt = orderBll.GetView_Custom( LYFZ.BLL.BLL_ErpOrderView.GetData_ProcessMonitorCommunicationRecord() + "select Top 1 * from tbB Where TR_OrdNumber = '" + this.currentOrderModel.Ord_Number + "' Order By 沟通时间 DESC" ).Tables[0];
  1440. if ( dt.Rows.Count > 0 )
  1441. {
  1442. this.txtGoTongJiLu.Text = String.Format( "沟通类型:{0} 沟通人:{1} 沟通时间:{2} \r\n沟通备注:{3} "
  1443. , dt.Rows[0]["注意事项"].ToString().Trim()
  1444. , LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetUserName( dt.Rows[0]["客服人员"] )
  1445. , LYFZ.BLL.OtherCommonModel.DateTimeToString( dt.Rows[0]["沟通时间"] )
  1446. , dt.Rows[0]["沟通备注"].ToString().Trim() );
  1447. }
  1448. }
  1449. private void LkGuoTongJiLuXiangQing_Click( object sender, EventArgs e )
  1450. {
  1451. LYFZ.Software.MainBusiness.OAShopManagement.frmCallCenterList frm0 = new OAShopManagement.frmCallCenterList();
  1452. frm0.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  1453. frm0.Location = new Point( LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y );
  1454. frm0.Size = new Size( LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height );
  1455. frm0.StrOrdNumber = this.currentOrderModel.Ord_Number;
  1456. frm0.Show();
  1457. }
  1458. private void LkAddGuoTongJiLu_Click( object sender, EventArgs e )
  1459. {
  1460. if ( this.customerGroup.ID > 0 )
  1461. {
  1462. LYFZ.Software.MainBusiness.CameraControlBook.SuperSmallForm.A_AddCommunicateRecords frm = new CameraControlBook.SuperSmallForm.A_AddCommunicateRecords();
  1463. frm.StrClientNumber = this.customerGroup.GP_CustomerGroupID;
  1464. frm.EnumClientServiceTaskType = EnumPublic.ClientServiceTaskType.订单确认;
  1465. frm.EnumClientServiceTaskItem = EnumPublic.ClientServiceTaskItem.无分类;
  1466. frm.Areminderdate = false;
  1467. frm.ShowDialog();
  1468. if ( frm.IsSaveed )
  1469. {
  1470. this.GetPanelContactRecord();
  1471. }
  1472. }
  1473. }
  1474. private void LikbtnUpload_Click( object sender, EventArgs e )
  1475. {
  1476. LYFZ.Software.MainBusiness.CameraControlBook.frmContractManagement frmCManagement = new LYFZ.Software.MainBusiness.CameraControlBook.frmContractManagement();
  1477. frmCManagement.OrdNumber = this.OrderNumber;
  1478. frmCManagement.ShowDialog();
  1479. }
  1480. #endregion
  1481. private void MaskBirthday_Leave( object sender, EventArgs e )
  1482. {
  1483. int intMasse = this.maskBirthday.CheckDateValue( this.maskBirthday, chkBirthday );
  1484. if ( intMasse == 1 )
  1485. {
  1486. MessageBoxCustom.Show( "宝贝生日日期格式输入错误" );
  1487. return;
  1488. }
  1489. else if ( intMasse == 2 )
  1490. {
  1491. MessageBoxCustom.Show( "宝贝生日:" + this.maskBirthday.StrValue.Trim() + "不是公历日期,若要保存请勾上农历" );
  1492. return;
  1493. }
  1494. if ( this.maskBirthday.StrValue.Trim().Length > 0 )
  1495. {
  1496. string[] StrArrayList = this.maskBirthday.StrValue.Trim().Split( '-' );
  1497. if ( SDateTime.Now.Year < Convert.ToInt32( StrArrayList[0] ) )
  1498. {
  1499. MessageBoxCustom.Show( "您输入的宝贝生日不能大于今年!" );
  1500. return;
  1501. }
  1502. this.txtZodiac.Text = LYFZ.Command.Command_CalendarTurnLunar.GetZodiac( this.maskBirthday.StrValue.Trim(), this.chkBirthday.Checked );
  1503. }
  1504. else
  1505. {
  1506. this.txtZodiac.Text = "";
  1507. }
  1508. }
  1509. /// <summary>
  1510. /// 是否保存过数据
  1511. /// </summary>
  1512. public bool IsSaveData = false;
  1513. /// <summary>
  1514. /// 如果没有保存权限,是否已授过权
  1515. /// </summary>
  1516. bool IsSaveedHadAuthorized = false;
  1517. /// <summary>
  1518. /// 保存订单
  1519. /// </summary>
  1520. /// <param name="sender"></param>
  1521. /// <param name="e"></param>
  1522. private void BtnSave_Click( object sender, EventArgs e )
  1523. {
  1524. this.dec_OrderDiscounts = LYFZ.BLL.BLL_ErpUser.CurrentUserRights.GetOrderDiscounts( Convert.ToInt32( this.OrderType ) );
  1525. #region 检查授权
  1526. if ( String.IsNullOrEmpty( this.OrderNumber ) )
  1527. {
  1528. //如果是新订单的话,要检查新订单数据是否已被修改过
  1529. if ( !LYFZ.BLL.BLL_ErpUser.GetRights( LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.NewOrder ) )
  1530. {
  1531. if ( !this.IsSaveedHadAuthorized )
  1532. {
  1533. //检查新订单的套系内容是否被修改过
  1534. bool IsCheckDataIsUpdate = this.CheckDataIsUpdate();
  1535. string strWindowText = "开订单";
  1536. if ( IsCheckDataIsUpdate )
  1537. {
  1538. strWindowText += "、修改新订单";
  1539. }
  1540. LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.AuthorizeLoginSuperSmallForm frm = new SuperSmallForm.AuthorizeLoginSuperSmallForm( "StoresOPenSingle", LYFZ.CustomAttributes.OperatingAuthority.NewOrder );
  1541. frm.StrWindowText = strWindowText;
  1542. frm.ShowDialog();
  1543. if ( !frm.IsSaveed )
  1544. {
  1545. return;
  1546. }
  1547. else if ( !LYFZ.BLL.BLL_ErpUser.GetRights( frm.CurrentAuthorizeUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.NewOrder, frm.User_BelongRoles ) )
  1548. {
  1549. frm.SetAuthorizationResult( String.Format( "授权失败,授权人没有'开订单'权限" ) );
  1550. MessageBoxCustom.Show( "对不起!授权帐号:" + frm.StrUserAccount + "没有'开订单'权限。" ); return;
  1551. }
  1552. else
  1553. {
  1554. frm.SetAuthorizationResult();
  1555. }
  1556. this.dec_OrderDiscounts = frm.CurrentAuthorizeUserRights.GetOrderDiscounts( Convert.ToInt32( this.OrderType ) );
  1557. #region 检测套系是否被修改过
  1558. if ( IsCheckDataIsUpdate )
  1559. {
  1560. if ( !LYFZ.BLL.BLL_ErpUser.GetRights( frm.CurrentAuthorizeUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.ModifyNewOrder, frm.User_BelongRoles ) )
  1561. {
  1562. frm.SetAuthorizationResult( String.Format( "授权失败,授权人没有'修改新订单'权限" ) );
  1563. MessageBoxCustom.Show( "对不起!授权帐号:" + frm.StrUserAccount + "没有'修改新订单'权限。" );
  1564. return;
  1565. }
  1566. else
  1567. {
  1568. frm.SetAuthorizationResult();
  1569. }
  1570. }
  1571. #endregion
  1572. }
  1573. }
  1574. else
  1575. {
  1576. #region 检测套系是否被修改过
  1577. if ( !LYFZ.BLL.BLL_ErpUser.GetRights( LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.ModifyNewOrder ) )
  1578. {
  1579. if ( this.CheckDataIsUpdate() )
  1580. {
  1581. LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.AuthorizeLoginSuperSmallForm frm = new SuperSmallForm.AuthorizeLoginSuperSmallForm( "StoresOPenSingle", LYFZ.CustomAttributes.OperatingAuthority.ModifyNewOrder );
  1582. frm.StrWindowText = "修改新订单";
  1583. frm.ShowDialog();
  1584. if ( !frm.IsSaveed )
  1585. {
  1586. return;
  1587. }
  1588. else if ( !LYFZ.BLL.BLL_ErpUser.GetRights( frm.CurrentAuthorizeUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.ModifyNewOrder, frm.User_BelongRoles ) )
  1589. {
  1590. frm.SetAuthorizationResult( String.Format( "授权失败,授权人没有'修改新订单'权限" ) );
  1591. MessageBoxCustom.Show( "对不起!授权帐号:" + frm.StrUserAccount + "没有'修改新订单'权限。" );
  1592. return;
  1593. }
  1594. else
  1595. {
  1596. frm.SetAuthorizationResult();
  1597. }
  1598. }
  1599. }
  1600. #endregion
  1601. this.dec_OrderDiscounts = LYFZ.BLL.BLL_ErpUser.CurrentUserRights.GetOrderDiscounts( Convert.ToInt32( this.OrderType ) );
  1602. }
  1603. }
  1604. else
  1605. {
  1606. if ( LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.EnableOrderLockFeature )
  1607. {
  1608. //检查订单是否已被锁定
  1609. bool isCheckOrderLock = this.orderBll.CheckOrderLock( this.currentOrderModel.ID );
  1610. if ( !isCheckOrderLock )
  1611. {
  1612. if ( this.orderBll.CheckOrderDataHasBeenModified( this.currentOrderModel ) )
  1613. {
  1614. MessageBoxCustom.Show( String.Format( "当前订单在您修改订单期间已被其他人员修改,为保证订单数据正确性,您不能保存订单,请关闭后重新打开订单并修改。" ) );
  1615. return;
  1616. }
  1617. }
  1618. else
  1619. {
  1620. ExMessageBoxCustom.Show( "当前订单已被其他人员锁定,你不能修改不当前订单,如需修改,请找店长沟通并解锁订单" );
  1621. this.LockOrderClientMarkID = "";
  1622. return;
  1623. }
  1624. }
  1625. //修改订单时
  1626. if ( !LYFZ.BLL.BLL_ErpUser.GetRights( LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.ModifyOrder ) )
  1627. {
  1628. if ( !this.IsSaveedHadAuthorized )
  1629. {
  1630. LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.AuthorizeLoginSuperSmallForm frm = new SuperSmallForm.AuthorizeLoginSuperSmallForm( "StoresOPenSingle", LYFZ.CustomAttributes.OperatingAuthority.ModifyOrder );
  1631. frm.StrWindowText = "修改已订单";
  1632. frm.ShowDialog();
  1633. if ( !frm.IsSaveed )
  1634. {
  1635. return;
  1636. }
  1637. else
  1638. {
  1639. if ( !LYFZ.BLL.BLL_ErpUser.GetRights( frm.CurrentAuthorizeUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.ModifyOrder, frm.User_BelongRoles ) )
  1640. {
  1641. frm.SetAuthorizationResult( String.Format( "授权失败,授权人没有'修改已订单'权限" ) );
  1642. MessageBoxCustom.Show( "对不起!授权帐号:" + frm.StrUserAccount + "没有'修改已订单'权限。" );
  1643. return;
  1644. }
  1645. else
  1646. {
  1647. frm.SetAuthorizationResult();
  1648. }
  1649. this.dec_OrderDiscounts = frm.CurrentAuthorizeUserRights.GetOrderDiscounts( Convert.ToInt32( this.OrderType ) );
  1650. }
  1651. }
  1652. }
  1653. else
  1654. {
  1655. this.dec_OrderDiscounts = LYFZ.BLL.BLL_ErpUser.CurrentUserRights.GetOrderDiscounts( Convert.ToInt32( this.OrderType ) );
  1656. }
  1657. }
  1658. this.IsSaveedHadAuthorized = true;
  1659. #endregion
  1660. if (String.IsNullOrWhiteSpace(this.GetClientSource()))
  1661. {
  1662. MessageBoxCustom.Show("客户来源不能为空");
  1663. return;
  1664. }
  1665. SaveOrderData( OrderSaveType.交易订单 );
  1666. }
  1667. /// <summary>
  1668. /// 保存意向订单
  1669. /// </summary>
  1670. /// <param name="sender"></param>
  1671. /// <param name="e"></param>
  1672. private void BtnSaveIntent_Click( object sender, EventArgs e )
  1673. {
  1674. this.IsSaveData = true;
  1675. SaveOrderData( OrderSaveType.意向订单 );
  1676. }
  1677. /// <summary>
  1678. /// 检查新订单的套系内容是否被修改过
  1679. /// </summary>
  1680. /// <returns></returns>
  1681. bool CheckDataIsUpdate()
  1682. {
  1683. bool IsUpdateSaveed = false;
  1684. if ( this.OrderType != EnumPublic.OrderType.服务订单 )
  1685. {
  1686. if ( this.cmbtreevTaoXiName.Tag != null )
  1687. {
  1688. DataRow[] dtRow0 = null;
  1689. DataRow[] dtRow1 = null;
  1690. DataRow[] dtRow2 = null;
  1691. DataTable tbl0 = null;
  1692. DataTable tbl1 = null;
  1693. DataTable tbl2 = null;
  1694. dynamic packPage = this.cmbtreevTaoXiName.Tag;
  1695. string ExecuteSql = "select tb_ErpPackagesGiftMerchandise.ID,Sc_ClassName,Pgm_GiveType,Pgm_IntoRegisterQuantity,Pgm_IntoBottomQuantity,Pgm_Quantity " +
  1696. "from tb_ErpPackagesGiftMerchandise Left Join tb_ErpTheScenery on cast(tb_ErpTheScenery.ID as varchar(20)) = Pgm_ProductNumber " +
  1697. "Left Join tb_ErpSystemCategory on Tsc_Rating = Sc_ClassCode where Pgm_GiveType in ('2','3') And Pgm_PackagesCode = '" +
  1698. packPage.PackagesID
  1699. + "';";
  1700. ExecuteSql += "select tb_ErpPackagesGiftMerchandise.ID,Prod_Batch,Pgm_Quantity,Pgm_GiveType from tb_ErpPackagesGiftMerchandise " +
  1701. "Left Join tb_ErpProduct on Prod_Number = Pgm_ProductNumber where Pgm_GiveType in ('0','1') And Pgm_PackagesCode = '" +
  1702. packPage.PackagesID
  1703. + "';";
  1704. ExecuteSql += "select Pak_UnitPrice from tb_ErpPackages where Pak_PackagesID = '" +
  1705. packPage.PackagesID
  1706. + "';";
  1707. DataSet dsData = orderBll.GetView_Custom( ExecuteSql );
  1708. DataTable dt0 = dsData.Tables["ds"];
  1709. DataTable dt1 = dsData.Tables["ds1"];
  1710. DataTable dt2 = dsData.Tables["ds2"];
  1711. switch ( this.OrderType )
  1712. {
  1713. case EnumPublic.OrderType.儿童订单:
  1714. case EnumPublic.OrderType.婚纱订单:
  1715. case EnumPublic.OrderType.写真订单:
  1716. case EnumPublic.OrderType.婚庆订单:
  1717. #region 判断价格
  1718. if ( dt2.Rows.Count > 0 )
  1719. {
  1720. if ( Convert.ToDecimal( dt2.Rows[0]["Pak_UnitPrice"] ) != Convert.ToDecimal( this.numTaoXiJiaGe.Value ) )
  1721. {
  1722. IsUpdateSaveed = true;
  1723. }
  1724. }
  1725. #endregion
  1726. #region 判断入底入册
  1727. /* switch ( this.OrderType )
  1728. {
  1729. case EnumPublic.OrderType.写真订单:
  1730. case EnumPublic.OrderType.婚庆订单:
  1731. try
  1732. {
  1733. DataTable dt = orderBll.GetView_Custom( "tb_ErpPackages", StrWhere: "Pak_PackagesID = '" + cmbtreevTaoXiName.Tag.ToString().Trim() + "'", ShowColumnName: "Pak_IntoTheArchive,Pak_IntoTheBook" ).Tables[0];
  1734. if ( dt.Rows.Count == 0 )
  1735. {
  1736. IsUpdateSaveed = true;
  1737. }
  1738. else if ( Convert.ToInt32( dt.Rows[0]["Pak_IntoTheArchive"] ) != Convert.ToInt32( this.numIntoBottom.Value ) || Convert.ToInt32( dt.Rows[0]["Pak_IntoTheBook"] ) != Convert.ToInt32( this.numIntoRegister.Value ) )
  1739. {
  1740. IsUpdateSaveed = true;
  1741. }
  1742. }
  1743. catch
  1744. {
  1745. }
  1746. break;
  1747. }*/
  1748. #endregion
  1749. #region 商品与服务
  1750. if ( !IsUpdateSaveed )
  1751. {
  1752. dtRow0 = dt1.Select( "Pgm_GiveType = '0'" );
  1753. tbl0 = this.orderProductControl.GetListViewData();
  1754. if ( dtRow0.Length != tbl0.Rows.Count )
  1755. {
  1756. IsUpdateSaveed = true;
  1757. }
  1758. else if ( dtRow0.Length > 0 && tbl0.Rows.Count > 0 )
  1759. {
  1760. for ( int j = 0; j < tbl0.Rows.Count; j++ )
  1761. {
  1762. if ( string.IsNullOrEmpty( tbl0.Rows[j]["PgmID"].ToString().Trim() ) )
  1763. {
  1764. IsUpdateSaveed = true;
  1765. break;
  1766. }
  1767. }
  1768. if ( !IsUpdateSaveed )
  1769. {
  1770. for ( int i = 0; i < dtRow0.Length; i++ )
  1771. {
  1772. DataRow[] dtRow = tbl0.Select( "PgmID = '" + dtRow0[i]["ID"].ToString().Trim() + "'" );
  1773. if ( dtRow0.Length <= 0 )
  1774. {
  1775. IsUpdateSaveed = true;
  1776. }
  1777. else
  1778. {
  1779. if ( Convert.ToInt32( dtRow[0]["商品P数"] ) != Convert.ToInt32( dtRow0[i]["Prod_Batch"] ) || Convert.ToInt32( dtRow[0]["商品数量"] ) != Convert.ToInt32( dtRow0[i]["Pgm_Quantity"] ) )
  1780. {
  1781. IsUpdateSaveed = true;
  1782. break;
  1783. }
  1784. }
  1785. }
  1786. }
  1787. }
  1788. }
  1789. if ( !IsUpdateSaveed )
  1790. {
  1791. dtRow1 = dt1.Select( "Pgm_GiveType = '1'" );
  1792. tbl1 = this.orderServiceControl.GetListViewData();
  1793. if ( dtRow1.Length != tbl1.Rows.Count )
  1794. {
  1795. IsUpdateSaveed = true;
  1796. }
  1797. else if ( dtRow1.Length > 0 && tbl1.Rows.Count > 0 )
  1798. {
  1799. for ( int j = 0; j < tbl1.Rows.Count; j++ )
  1800. {
  1801. if ( string.IsNullOrEmpty( tbl1.Rows[j]["PgmID"].ToString().Trim() ) )
  1802. {
  1803. IsUpdateSaveed = true;
  1804. break;
  1805. }
  1806. }
  1807. if ( !IsUpdateSaveed )
  1808. {
  1809. for ( int i = 0; i < dtRow1.Length; i++ )
  1810. {
  1811. DataRow[] dtRow = tbl1.Select( "PgmID = '" + dtRow1[i]["ID"].ToString().Trim() + "'" );
  1812. if ( dtRow1.Length <= 0 )
  1813. {
  1814. IsUpdateSaveed = true;
  1815. }
  1816. else
  1817. {
  1818. if ( Convert.ToInt32( dtRow[0]["服务数量"] ) != Convert.ToInt32( dtRow1[i]["Pgm_Quantity"] ) )
  1819. {
  1820. IsUpdateSaveed = true;
  1821. break;
  1822. }
  1823. }
  1824. }
  1825. }
  1826. }
  1827. }
  1828. #endregion
  1829. #region 景点与拍摄次数
  1830. if ( !IsUpdateSaveed )
  1831. {
  1832. switch ( this.OrderType )
  1833. {
  1834. case EnumPublic.OrderType.婚纱订单:
  1835. case EnumPublic.OrderType.写真订单:
  1836. dtRow2 = dt0.Select( "Pgm_GiveType = '2'" );
  1837. tbl2 = this.orderSightsControl.GetListViewData();
  1838. break;
  1839. case EnumPublic.OrderType.儿童订单:
  1840. dtRow2 = dt0.Select( "Pgm_GiveType = '3'" );
  1841. tbl2 = this.orderStagesControl.GetListViewData();
  1842. break;
  1843. }
  1844. if (dtRow2 != null && tbl2 != null)
  1845. {
  1846. if (dtRow2.Length != tbl2.Rows.Count)
  1847. {
  1848. IsUpdateSaveed = true;
  1849. }
  1850. else if (dtRow2.Length > 0 && tbl2.Rows.Count > 0)
  1851. {
  1852. for (int j = 0; j < tbl2.Rows.Count; j++)
  1853. {
  1854. if (string.IsNullOrEmpty(tbl2.Rows[j]["PgmID"].ToString().Trim()))
  1855. {
  1856. IsUpdateSaveed = true;
  1857. break;
  1858. }
  1859. }
  1860. if (!IsUpdateSaveed)
  1861. {
  1862. for (int i = 0; i < dtRow2.Length; i++)
  1863. {
  1864. DataRow[] dtRow = tbl2.Select("PgmID = '" + dtRow2[i]["ID"].ToString().Trim() + "'");
  1865. if (dtRow2.Length <= 0)
  1866. {
  1867. IsUpdateSaveed = true;
  1868. }
  1869. else
  1870. {
  1871. if (dtRow[0]["拍摄级别"].ToString().Trim() != dtRow2[i]["Sc_ClassName"].ToString().Trim() || Convert.ToInt32(dtRow[0]["服装套数"]) != Convert.ToInt32(dtRow2[i]["Pgm_Quantity"]))
  1872. {
  1873. IsUpdateSaveed = true;
  1874. break;
  1875. }
  1876. if (!IsUpdateSaveed)
  1877. {
  1878. switch (this.OrderType)
  1879. {
  1880. case EnumPublic.OrderType.儿童订单:
  1881. if (Convert.ToInt32(dtRow[0]["入册"]) != Convert.ToInt32(dtRow2[i]["Pgm_IntoRegisterQuantity"]) || Convert.ToInt32(dtRow[0]["入底"]) != Convert.ToInt32(dtRow2[i]["Pgm_IntoBottomQuantity"]) || Convert.ToInt32(dtRow[0]["服装套数"]) != Convert.ToInt32(dtRow2[i]["Pgm_Quantity"]))
  1882. {
  1883. IsUpdateSaveed = true;
  1884. break;
  1885. }
  1886. break;
  1887. }
  1888. }
  1889. }
  1890. }
  1891. }
  1892. }
  1893. }
  1894. }
  1895. #endregion
  1896. break;
  1897. }
  1898. }
  1899. }
  1900. return IsUpdateSaveed;
  1901. }
  1902. private void FrmNewOrder_FormClosed( object sender, FormClosedEventArgs e )
  1903. {
  1904. if ( this.currentOrderModel.ID > 0 )
  1905. {
  1906. if (!IsSelectPhoto)
  1907. {
  1908. if (!String.IsNullOrEmpty(this.LockOrderClientMarkID))
  1909. {
  1910. orderBll.UnlockOrderUpdate(this.currentOrderModel.ID);
  1911. }
  1912. }
  1913. }
  1914. if ( this.IsGoForm )
  1915. {
  1916. if ( this.EnumLoadFormType == LoadFormType.开单选择 )
  1917. {
  1918. LYFZ.Software.MainBusiness.DoorCityProcess.OnSingleFirstFormMain frm = new OnSingleFirstFormMain();
  1919. frm.StartPosition = FormStartPosition.CenterScreen;
  1920. frm.Show();
  1921. frm.Activate();
  1922. }
  1923. }
  1924. }
  1925. private void FrmNewOrder_FormClosing( object sender, FormClosingEventArgs e )
  1926. {
  1927. if ( !this.IsGoForm )
  1928. {
  1929. if ( MessageBoxCustom.Show( "你确定要关闭吗?", "温馨提示", MessageBoxButtons.YesNo ) == DialogResult.No )
  1930. {
  1931. e.Cancel = true;
  1932. }
  1933. }
  1934. }
  1935. /// <summary>
  1936. /// 打印订单(打印预约单)
  1937. /// </summary>
  1938. /// <param name="sender"></param>
  1939. /// <param name="e"></param>
  1940. private void BtnPrint_Click( object sender, EventArgs e )
  1941. {
  1942. if ( !String.IsNullOrEmpty( this.OrderNumber ) )
  1943. {
  1944. Hashtable htData = new Hashtable();
  1945. htData["strNumber"] = this.OrderNumber.Trim();
  1946. htData["strOrdType"] = this.OrderType.ToString().Trim();
  1947. // 获取全部景点;
  1948. List<ReportPrint.SetSmallForm.PrintPreviewSmallForm.ScenicSpot2> listScenicSpot = null;
  1949. if ( this.OrderType == EnumPublic.OrderType.儿童订单 )
  1950. {
  1951. listScenicSpot = new List<ReportPrint.SetSmallForm.PrintPreviewSmallForm.ScenicSpot2>();
  1952. for ( int i = 0; i < this.orderStagesControl.listViewData_Stages.Items.Count; i++ )
  1953. {
  1954. ReportPrint.SetSmallForm.PrintPreviewSmallForm.ScenicSpot2 scenic = new ReportPrint.SetSmallForm.PrintPreviewSmallForm.ScenicSpot2();
  1955. scenic.strScenicName = this.orderStagesControl.listViewData_Stages.Items[i].Text;
  1956. scenic.strViceNumber = ((NewOrderCustomControls.StagesHeaderModel)this.orderStagesControl.listViewData_Stages.Items[i].Tag).StagesViceNumber;
  1957. listScenicSpot.Add( scenic );
  1958. }
  1959. }
  1960. LYFZ.Software.MainBusiness.ReportPrint.ReportFixedFormat.PrintFixedFormat( LYFZ.EnumPublic.PrintTypeEnum.订单预约单, htData, listScenicSpot );
  1961. }
  1962. }
  1963. bool IsGoForm = false;
  1964. public LoadFormType EnumLoadFormType;
  1965. public enum LoadFormType
  1966. {
  1967. 订单报表,
  1968. 开单选择
  1969. }
  1970. /// <summary>
  1971. /// 新开订单(重置)
  1972. /// </summary>
  1973. /// <param name="sender"></param>
  1974. /// <param name="e"></param>
  1975. private void BtnNewOrder_Click( object sender, EventArgs e )
  1976. {
  1977. if ( MessageBoxCustom.Show( "重置后将清空所有数据,您确定要重置订单吗?", "温馨提示", MessageBoxButtons.YesNo ) == DialogResult.Yes )
  1978. {
  1979. this.IsGoForm = true;
  1980. this.EnumLoadFormType = LoadFormType.开单选择;
  1981. this.Close();
  1982. }
  1983. }
  1984. private void PictReset_Click( object sender, EventArgs e )
  1985. {
  1986. this.ClearChildrenInfo();
  1987. }
  1988. private void PictEdit_Click( object sender, EventArgs e )
  1989. {
  1990. this.txtCusName.ReadOnly = false;
  1991. }
  1992. private void UMainCusInfo_EventSelectIntentionOrderCustomer( UCustomerInfo uCustomer, string _IntentionOrderNumber, string _IntentionCustomerGroupID, string _IntentionCustomerID )
  1993. {
  1994. this.SelectIntentClient( _IntentionOrderNumber, _IntentionCustomerGroupID );
  1995. }
  1996. private void LinkSelectSameNameBaby_Click( object sender, EventArgs e )
  1997. {
  1998. if ( this.linkSelectSameNameBaby.Tag.ToString() != "0" && !String.IsNullOrEmpty( this.txtCusName.Text.Trim() ) )
  1999. {
  2000. LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.OrderHistoryCustomerSuperSmallForm frm = new SuperSmallForm.OrderHistoryCustomerSuperSmallForm();
  2001. frm.StrWhere = String.Format( "Cus_Name Like '%{0}%' and Cus_Type = '儿童'", this.txtCusName.Text.Trim() );
  2002. frm.IsChild = true;
  2003. frm.ShowDialog();
  2004. if ( frm.IsSaveed )
  2005. {
  2006. this.SetCusChildrenInfo( frm.model );
  2007. this.TxtCusName_KeyUp( null, null );
  2008. }
  2009. }
  2010. }
  2011. //临时宝宝名
  2012. string tempBabyName = "";
  2013. private void TxtCusName_KeyUp( object sender, KeyEventArgs e )
  2014. {
  2015. if ( this.txtCusName.Text.ToLower().Trim() != tempBabyName.ToLower().Trim() )
  2016. {
  2017. this.tempBabyName = this.txtCusName.Text.Trim();
  2018. this.toolTipMsg.SetToolTip( this.linkSelectSameNameBaby, "" );
  2019. this.linkSelectSameNameBaby.Text = "";
  2020. this.linkSelectSameNameBaby.Tag = 0;
  2021. if ( !String.IsNullOrEmpty( this.txtCusName.Text.Trim() ) )
  2022. {
  2023. int RowsCounts = customerBll.GetRecordCount( "Cus_Name like '%" + this.txtCusName.Text.Trim() + "%' and Cus_Type = '儿童'" );
  2024. if ( RowsCounts > 0 )
  2025. {
  2026. this.toolTipMsg.SetToolTip( this.linkSelectSameNameBaby, String.Format( "已有{0}个相拟名字的宝宝,点击查看", RowsCounts ) );
  2027. this.linkSelectSameNameBaby.Text = String.Format( "{0}", RowsCounts.ToString().PadRight( 4, ' ' ) );
  2028. this.linkSelectSameNameBaby.Tag = RowsCounts;
  2029. }
  2030. }
  2031. }
  2032. }
  2033. private void RdoFriends_CheckedChanged( object sender, EventArgs e )
  2034. {
  2035. if ( !this.rdoFriends.Checked )
  2036. {
  2037. this.ClearFriendIntroduction();
  2038. }
  2039. }
  2040. #region 获取用户输入数据
  2041. /// <summary>
  2042. /// 医院跟踪订单的来单批号
  2043. /// </summary>
  2044. string ComeSingleLotNumber = "";
  2045. /// <summary>
  2046. /// 当前登录者、授权者的保利系数
  2047. /// </summary>
  2048. decimal dec_OrderDiscounts = 0;
  2049. /// <summary>
  2050. /// 是否显示写真版
  2051. /// </summary>
  2052. private bool IsPortrait = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsEnablePhotoEdition;
  2053. /// <summary>
  2054. /// 登录者姓名
  2055. /// </summary>
  2056. string loginUserName = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_Name;
  2057. /// <summary>
  2058. /// 登录者员工ID
  2059. /// </summary>
  2060. string loginUserID = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;
  2061. /// <summary>
  2062. /// 本地分店ID
  2063. /// </summary>
  2064. string loginCompanyInfoID = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID();
  2065. /// <summary>
  2066. /// 获取客户来源
  2067. /// </summary>
  2068. /// <returns></returns>
  2069. private string GetClientSource()
  2070. {
  2071. string StrClientSource = "";
  2072. foreach ( Control control in this.plRuMenDiaoChaMain.Controls )
  2073. {
  2074. if ( control is RadioButtonEx )
  2075. {
  2076. RadioButtonEx tmpRdo = (RadioButtonEx)control;
  2077. if ( tmpRdo.Checked )
  2078. {
  2079. if ( tmpRdo.Tag.ToString().Trim() == "其他" )
  2080. {
  2081. StrClientSource = this.cmbtreevClientSource.Text.Trim();
  2082. }
  2083. else
  2084. {
  2085. StrClientSource = tmpRdo.Tag.ToString().Trim();
  2086. }
  2087. }
  2088. }
  2089. }
  2090. return StrClientSource;
  2091. }
  2092. /// <summary>
  2093. /// 获取宝宝信息
  2094. /// </summary>
  2095. /// <param name="erpModel"></param>
  2096. public void GetClientValueData( Api_ErpOrderModel erpModel )
  2097. {
  2098. if ( erpModel.customerData == null )
  2099. {
  2100. erpModel.customerData = new List<Api_CustomerModel>();
  2101. }
  2102. Api_CustomerModel apiModel = new Api_CustomerModel();
  2103. apiModel.cusAttr = CusAttrType.Child_.ToString();
  2104. apiModel.userRelation = "本人";
  2105. apiModel.cus_Type = "儿童";
  2106. if ( this.childModel.ID <= 0 )
  2107. {
  2108. apiModel.ClientModel.ID = -1;
  2109. }
  2110. apiModel.ClientModel.Cus_Birthday = this.maskBirthday.StrValue.Trim();
  2111. apiModel.ClientModel.Cus_BirthdayLunar = "";
  2112. if ( !String.IsNullOrEmpty( apiModel.ClientModel.Cus_Birthday ) )
  2113. {
  2114. apiModel.ClientModel.Cus_BirthdayLunar = this.chkBirthday.Checked ? "1" : "0";
  2115. }
  2116. apiModel.ClientModel.Cus_Name = LYFZ.BLL.OtherCommonModel.ClearSpecialCharacter( this.txtCusName.Text.Trim() );
  2117. apiModel.ClientModel.Cus_NamePinyin = LYFZ.Command.Command_ChineseToPinyin.GetChineseSpellPinyin( this.txtCusName.Text.Trim() ).ToLower();
  2118. apiModel.ClientModel.Cus_Sex = this.rdoCusSex1.Checked ? false : true;
  2119. apiModel.ClientModel.Cus_Zodiac = this.txtZodiac.Text.Trim();
  2120. erpModel.customerData.Add( apiModel );
  2121. }
  2122. /// <summary>
  2123. /// 获取订单资料数据
  2124. /// </summary>
  2125. /// <param name="erpModel"></param>
  2126. public void GetApiData( Api_ErpOrderModel erpModel )
  2127. {
  2128. erpModel.strOrderClass = this.cmbtreevOrderClass.Text;
  2129. erpModel.bIsShowSinceOrderNumber = LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.IsCustomOrderNumber;
  2130. erpModel.SinceOrderNumber = this.GetSinceOrderNumber();
  2131. erpModel.strTaoXiCode = this.cmbtreevTaoXiName.Tag == null ? "" : (this.cmbtreevTaoXiName.Tag).ToString();
  2132. erpModel.strNumIntoBottom = this.numIntoBottom.Value.ToString();
  2133. erpModel.strBottomQuantityPackage = this.numIntoBottomPackage.Value.ToString();
  2134. erpModel.strRegisterQuantityPackage = this.numIntoRegisterPackage.Value.ToString();
  2135. erpModel.strNumIntoRegister = this.numIntoRegister.Value.ToString();
  2136. erpModel.strRemark = this.txtOrderRemarks.Text;
  2137. erpModel.strHotelInfo = this.txtHotelInfo.Text;
  2138. erpModel.strPackageName = this.cmbtreevPackageName.Text;
  2139. erpModel.strPackagePrice = this.numLiBaoJiaGe.Value.ToString( "n2" );
  2140. erpModel.strTaoXiPrice = this.numTaoXiJiaGe.Value.ToString( "n2" );
  2141. // erpModel.IsMagess = this.IsMagess;
  2142. erpModel.strAnnotation = this.txtBiaoZhu.Text.Trim();
  2143. if ( this.OrderType == EnumPublic.OrderType.儿童订单 )
  2144. {
  2145. erpModel.bIsShowIntoRegisterAndIntoBottom = false;
  2146. }
  2147. else
  2148. {
  2149. erpModel.bIsShowIntoRegisterAndIntoBottom = true;
  2150. }
  2151. if ( this.OrderType == EnumPublic.OrderType.服务订单 )
  2152. {
  2153. erpModel.strParentTaoXiName = "服务套系";
  2154. erpModel.strTaoXiName = "服务套系";
  2155. }
  2156. else
  2157. {
  2158. erpModel.strParentTaoXiName = this.cmbtreevTaoXiName.TextFindParentText( this.cmbtreevTaoXiName.Text.Trim() );
  2159. erpModel.strTaoXiName = this.cmbtreevTaoXiName.Text;
  2160. }
  2161. }
  2162. #endregion
  2163. /// <summary>
  2164. /// 用于判断是否需要重新生成流程图
  2165. /// </summary>
  2166. bool isGeneratingFlowchartImage = true;
  2167. /// <summary>
  2168. /// 保存意向订单和真实订单数据
  2169. /// </summary>
  2170. /// <param name="saveType">订单保存类型</param>
  2171. void SaveOrderData( OrderSaveType saveType )
  2172. {
  2173. Api_ErpOrderModel apiErpModel = new Api_ErpOrderModel()
  2174. {
  2175. OrderID = this.currentOrderModel.ID,
  2176. strTime = SDateTime.Now,
  2177. strUserName = loginUserName,
  2178. dividedShop = this.cmbtreevStoreName.Tag.ToString().Trim(),
  2179. strUserID = loginUserID,
  2180. User_IP = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.User_IP,
  2181. strMskMarriage = this.mskMarriage.StrValue,
  2182. bChkCheckBox = this.chkMarriage.Checked,
  2183. chkTransactmemberCard = this.chkTransactmemberCard.Checked,
  2184. StrSaveClass = Convert.ToInt32(saveType).ToString(),
  2185. strStyle = String.Join<string>("|", this.GetStyleList(true)),
  2186. StrClientSource = this.GetClientSource(),
  2187. dec_OrderDiscounts = this.dec_OrderDiscounts,
  2188. strOldTaoXiName = this.currentOrderModel.Ord_OldSeriesName,
  2189. strOldTaoXiCode = this.currentOrderModel.Ord_OldSeriesCode,
  2190. strOldTaoXiPrice = this.currentOrderModel.Ord_OldSeriesPrice,
  2191. UploadPath = this.currentOrderModel.Ord_UploadPath,
  2192. CommissionRatio = this.customCommissionData,
  2193. strOrderPerson = txtOrderPerson.Tag == null ? "" : txtOrderPerson.Tag.ToString(),
  2194. strOrderPersonName = txtOrderPerson.Tag == null ? "" : txtOrderPerson.Text.ToString(),
  2195. ComeSingleLotNumber = this.ComeSingleLotNumber,
  2196. StrNewOrderNumber = (this.currentOrderModel.ID > 0 ? this.currentOrderModel.Ord_Number : null),
  2197. OrderGroupNumber = this.customerGroup.GP_CustomerGroupID,
  2198. customerData = new List<Api_CustomerModel>(),
  2199. OrderSightData = new List<Api_StagesModel>(),
  2200. OrderServiceData = new List<Api_ServiceModel>(),
  2201. OrderProductData = new List<Api_ProductModel>(),
  2202. modelFriends = new Model.Model_ErpCustomer(),
  2203. modelViceCard = new Model.Model_ErpMemberCardViceCard(),
  2204. SetOfSystemUpgradeLog = this.SetOfSystemUpgradeLog,
  2205. IsMagess = true,
  2206. UpCreateDateTime = (this.currentOrderModel.ID > 0 ? this.currentOrderModel.Ord_CreateDateTime : new DateTime())
  2207. };
  2208. apiErpModel.orderType = this.OrderType;
  2209. ///会员副卡
  2210. apiErpModel.modelViceCard = this.modelViceCardFriends;
  2211. if ( apiErpModel.modelViceCard != null )
  2212. {
  2213. if ( apiErpModel.modelViceCard.Mvc_CreateDatetime == new DateTime() )
  2214. {
  2215. apiErpModel.modelViceCard.Mvc_CreateDatetime = LYFZ.WinAPI.CustomPublicMethod.GetNullDateTime();
  2216. }
  2217. if ( apiErpModel.modelViceCard.Mvc_UpdateDateTime == new DateTime() )
  2218. {
  2219. apiErpModel.modelViceCard.Mvc_UpdateDateTime = LYFZ.WinAPI.CustomPublicMethod.GetNullDateTime();
  2220. }
  2221. }
  2222. //朋友介绍
  2223. apiErpModel.modelFriends = this.customerFriends;
  2224. if ( this.customerFriends != null )
  2225. {
  2226. apiErpModel.friend_CustomerNumber = this.customerFriends.Cus_CustomerNumber;
  2227. }
  2228. else
  2229. {
  2230. apiErpModel.friend_CustomerNumber = "";
  2231. }
  2232. if ( apiErpModel.modelFriends != null )
  2233. {
  2234. if ( apiErpModel.modelFriends.Cus_CreateDateTime == new DateTime() )
  2235. {
  2236. apiErpModel.modelFriends.Cus_CreateDateTime = LYFZ.WinAPI.CustomPublicMethod.GetNullDateTime();
  2237. }
  2238. if ( apiErpModel.modelFriends.Cus_UpdateDateTime == new DateTime() )
  2239. {
  2240. apiErpModel.modelFriends.Cus_UpdateDateTime = LYFZ.WinAPI.CustomPublicMethod.GetNullDateTime();
  2241. }
  2242. }
  2243. if ( this.OrderType == EnumPublic.OrderType.儿童订单 )
  2244. {
  2245. this.GetClientValueData( apiErpModel );
  2246. }
  2247. foreach ( Control control in this.flKeFuZhiNiaoBlock.Controls )
  2248. {
  2249. ///成人客户信息
  2250. if ( control is UCustomerInfo )
  2251. {
  2252. UCustomerInfo tmpCus = (UCustomerInfo)control;
  2253. tmpCus.GetClientValueData( apiErpModel );
  2254. }
  2255. }
  2256. try
  2257. {
  2258. //获取订单数据
  2259. this.GetApiData(apiErpModel);
  2260. }
  2261. catch (Exception ex){
  2262. MessageBoxCustom.Show(ex.Message);
  2263. return;
  2264. }
  2265. //是否修改了预约时间
  2266. bool isModifyAppointmentTime = false;
  2267. //获取拍摄场景数据
  2268. if ( this.OrderType == EnumPublic.OrderType.婚纱订单
  2269. || this.OrderType == EnumPublic.OrderType.写真订单 )
  2270. {
  2271. this.orderSightsControl.GetOrderSightsValueData( apiErpModel );
  2272. isModifyAppointmentTime = this.orderSightsControl.isModifyAppointmentTime;
  2273. }
  2274. else if ( this.OrderType == EnumPublic.OrderType.儿童订单 )
  2275. {
  2276. this.orderStagesControl.GetOrderStagesValueData( apiErpModel );
  2277. isModifyAppointmentTime = this.orderStagesControl.isModifyAppointmentTime;
  2278. }
  2279. //服务的数据信息
  2280. if ( this.orderServiceControl.Parent != null )
  2281. {
  2282. this.orderServiceControl.GetOrderServiceValueData( apiErpModel );
  2283. }
  2284. //商品数据信息
  2285. if ( this.orderProductControl.Parent != null )
  2286. {
  2287. this.orderProductControl.GetOrderProductValueData( apiErpModel );
  2288. }
  2289. int indx = 0;
  2290. bool bSelect = false;
  2291. // string json = Json.JsonTool.ObjectToJson(apiErpModel);
  2292. 数据检查队列:
  2293. LYFZ.Command.Result result = orderBll.SaveErpOrderDataByCheck( apiErpModel, ref indx, ref bSelect );
  2294. if ( !result.Status )
  2295. {
  2296. if ( result.StatusMsg == "手机号码重复,请核实客户数据!" )
  2297. {
  2298. MessageBoxCustom.Show( result.StatusMsg );
  2299. return;
  2300. }
  2301. LYFZ.Command.Result<LYFZ.Command.EnumReturnMsg> resultMsg = ((LYFZ.Command.Result<LYFZ.Command.EnumReturnMsg>)result);
  2302. if ( resultMsg.Data == Command.EnumReturnMsg.ReturnMsg )
  2303. {
  2304. MessageBoxCustom.Show( resultMsg.StatusMsg );
  2305. return;
  2306. }
  2307. else if ( resultMsg.Data == Command.EnumReturnMsg.SelectMsg )
  2308. {
  2309. if ( MessageBoxCustom.Show( resultMsg.StatusMsg, "温馨提示",
  2310. MessageBoxButtons.OKCancel ) == System.Windows.Forms.DialogResult.Cancel )
  2311. {
  2312. return;
  2313. }
  2314. else
  2315. {
  2316. bSelect = true;
  2317. goto 数据检查队列;
  2318. }
  2319. }
  2320. else if ( resultMsg.Data == Command.EnumReturnMsg.CostAuthorization )
  2321. {
  2322. if ( MessageBoxCustom.Show( resultMsg.StatusMsg, "温馨提示",
  2323. MessageBoxButtons.OKCancel ) == System.Windows.Forms.DialogResult.OK )
  2324. {
  2325. LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.AuthorizeLoginSuperSmallForm frm = new SuperSmallForm.AuthorizeLoginSuperSmallForm( null, CustomAttributes.OperatingAuthority.ErrorPrivilegeValue, 1 );
  2326. frm.ShowDialog();
  2327. if ( !frm.IsSaveed )
  2328. {
  2329. return;
  2330. }
  2331. else
  2332. {
  2333. decimal Ord_SeriesPrice = 0;
  2334. decimal.TryParse( apiErpModel.strTaoXiPrice, out Ord_SeriesPrice );
  2335. decimal Old_PackagesAmount = apiErpModel.ProductAmount();
  2336. Old_PackagesAmount += apiErpModel.ServiceAmount();
  2337. if ( apiErpModel.orderType == EnumPublic.OrderType.儿童订单 )
  2338. {
  2339. Old_PackagesAmount += apiErpModel.SightOrStageAmount();
  2340. }
  2341. else if ( apiErpModel.orderType != EnumPublic.OrderType.婚庆订单 )
  2342. {
  2343. Old_PackagesAmount += apiErpModel.SightOrStageAmount();
  2344. }
  2345. if ( Ord_SeriesPrice < (Old_PackagesAmount * frm.CurrentAuthorizeUserRights.GetOrderDiscounts( Convert.ToInt32( this.OrderType ) )) )
  2346. {
  2347. frm.SetAuthorizationResult( String.Format( "授权失败,授权人成本管控权限不够" ) );
  2348. MessageBoxCustom.Show( "授权帐号:" + frm.StrUserAccount + ",授权后的套系价格低于订单总成本,无法保存!" ); return;
  2349. }
  2350. else
  2351. {
  2352. frm.SetAuthorizationResult();
  2353. bSelect = true;
  2354. goto 数据检查队列;
  2355. }
  2356. }
  2357. }
  2358. else
  2359. {
  2360. return;
  2361. }
  2362. }
  2363. else
  2364. {
  2365. MessageBoxCustom.Show( resultMsg.StatusMsg );
  2366. return;
  2367. }
  2368. }
  2369. else
  2370. {
  2371. if (saveType == OrderSaveType.交易订单&&!this.IsNewOrder)
  2372. {
  2373. if (isModifyAppointmentTime)
  2374. {
  2375. foreach (LYFZ.Model.Model_ErpOrdersPhotography photography in this.photographyList)
  2376. {
  2377. this.AddOrderWorkAnPaiRecord(photography);
  2378. }
  2379. }
  2380. }
  2381. bool isAddOrder = false;
  2382. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  2383. {
  2384. backgroundWorker.ReportProgress( 0, "正在提交数据... " );
  2385. result = orderBll.SaveErpOrderData( apiErpModel, ref isAddOrder );
  2386. if (result.Status)
  2387. {
  2388. if (saveType == OrderSaveType.交易订单)
  2389. {
  2390. if (isCurrentOpentIntentOrder)
  2391. {
  2392. if (this.currentOrderModel.ID > 0)
  2393. {
  2394. this.orderBll.UpdateOrderCreateDateTime(this.currentOrderModel.ID, SDateTime.Now);
  2395. }
  2396. else
  2397. {
  2398. MessageBoxCustom.Show("当前订单数据异常");
  2399. }
  2400. }
  2401. }
  2402. }
  2403. if (WorkAnPaiRecordlist.Count > 0)
  2404. {
  2405. LYFZ.BLL.BaseBllOperate.ExecuteSqlTran(WorkAnPaiRecordlist);
  2406. }
  2407. } );
  2408. this.IsSaveData = true;
  2409. if ( result.Status )
  2410. {
  2411. object obj;
  2412. try
  2413. {
  2414. obj = ((LYFZ.Command.Result<object>)result).Data;
  2415. }
  2416. catch(Exception ex)
  2417. {
  2418. MessageBoxCustom.Show(String.Format("保存失败:{0}",ex.Message), "提示" );
  2419. return;
  2420. }
  2421. MessageBoxCustom.Show( "订单保存成功" );
  2422. if ( this.OpenLoadOrderData( apiErpModel.StrNewOrderNumber ) )
  2423. {
  2424. this.isGeneratingFlowchartImage = true;
  2425. this.lkYiXiangClient.Hide();
  2426. if ( this.tbQiTaXiangQing.Parent == null )
  2427. {
  2428. this.tbQiTaXiangQing.Parent = this.tabControlMain;
  2429. }
  2430. BindOrderData();
  2431. }
  2432. else
  2433. {
  2434. MessageBoxCustom.Show( "保存成功,但重新加载时失败", "提示" );
  2435. return;
  2436. }
  2437. Model.Model_ErpOrder modelOrder = this.currentOrderModel;//(Model.Model_ErpOrder)(obj.GetType().GetProperty("modelOrder").GetValue(obj, null));
  2438. LYFZ.Model.Model_ErpCustomer modelCilentMain = this.mainCusModel;//(Model.Model_ErpCustomer)(obj.GetType().GetProperty("modelCilentMain").GetValue(obj, null));
  2439. this.LockOrderUpdate();
  2440. if ( apiErpModel.StrSaveClass == "1" )
  2441. {
  2442. #region 短信发送操作
  2443. LYFZ.BLL.BLL_SMSRecord smsRecord = new BLL.BLL_SMSRecord();
  2444. smsRecord.SMSSend( orderBll,
  2445. systemConfigurebll,
  2446. memberCardBackCashSetbll,
  2447. apiErpModel,
  2448. modelOrder,
  2449. isAddOrder,
  2450. apiErpModel.StrSaveClass == "0",
  2451. modelCilentMain.Cus_CustomerNumber );
  2452. #endregion
  2453. #region 收款 并 积分
  2454. if ( LYFZ.BLL.BLL_ErpUser.GetRights( LYFZ.BLL.BLL_ErpUser.CurrentUserRights.OrdersReceivablesCompetence, LYFZ.CustomAttributes.OperatingAuthority.OrdersReceivables ) )
  2455. {
  2456. if ( modelOrder.Ord_SeriesPrice > 0 )
  2457. {
  2458. if ( paymentbll.GetRecordCount( "Pay_OrdNumber = '" + modelOrder.Ord_Number + "'" ) <= 0 )
  2459. {
  2460. LYFZ.Software.MainBusiness.FinancialManagement.OrdersReceivables.FrmPrePayment frm = new FinancialManagement.OrdersReceivables.FrmPrePayment();
  2461. frm.StrOrdNumber = this.OrderNumber;
  2462. frm.IsShowButtonPayment = true;
  2463. frm.ShowDialog();
  2464. }
  2465. }
  2466. }
  2467. #endregion
  2468. }
  2469. else
  2470. {
  2471. LYFZ.DAL.DAL_ErpCustomer.UpdateAggregationCustomer( this.OrderNumber );
  2472. if ( modelOrder.Ord_Number.Trim().Length > 0 )
  2473. {
  2474. LYFZ.BLL.BLL_ErpOrderDigitalStatus.UpdateDigitalStatus( modelOrder.Ord_Number, LYFZ.EnumPublic.OrderDigitalStatusEnum.开单 );
  2475. }
  2476. }
  2477. }
  2478. else
  2479. {
  2480. MessageBoxCustom.Show( result.StatusMsg );
  2481. }
  2482. }
  2483. }
  2484. private void PlDingDanZhiNiao_Scroll( object sender, ScrollEventArgs e )
  2485. {
  2486. if ( e.Type == ScrollEventType.ThumbPosition )
  2487. {
  2488. this.RefreshNumericUpDownEx();
  2489. }
  2490. }
  2491. /// <summary>
  2492. /// 选择礼包时事件处理
  2493. /// </summary>
  2494. /// <param name="sender"></param>
  2495. /// <param name="e"></param>
  2496. private void CmbtreevPackageName_ComboBoxTree_NodeMouseClick( object sender, TreeNodeMouseClickEventArgs e )
  2497. {
  2498. //if (string.IsNullOrEmpty(this.cmbtreevPackageName.Text.Trim()))
  2499. //{
  2500. // return;
  2501. //}
  2502. if ( this.cmbtreevPackageName.Tag != null )
  2503. {
  2504. dynamic taoXiMingChenData = this.cmbtreevPackageName.Tag;
  2505. this.SelectTaoXiAddItems( taoXiMingChenData, EnumPublic.EnumPackagesType.AAAAACA );
  2506. }
  2507. }
  2508. /// <summary>
  2509. /// 当前订单的新套系名称(在逻辑上临时使用)
  2510. /// </summary>
  2511. string newTempOrd_SeriesName = "";
  2512. /// <summary>
  2513. /// 选择套系名称事件处理
  2514. /// </summary>
  2515. /// <param name="sender"></param>
  2516. /// <param name="e"></param>
  2517. private void CmbtreevTaoXiName_ComboBoxTree_NodeMouseClick( object sender, TreeNodeMouseClickEventArgs e )
  2518. {
  2519. if ( string.IsNullOrEmpty( this.cmbtreevTaoXiName.Text.Trim() ) )
  2520. {
  2521. return;
  2522. }
  2523. if ( this.cmbtreevTaoXiName.Text.Trim().ToLower() == newTempOrd_SeriesName.Trim().ToLower() )
  2524. {
  2525. return;
  2526. }
  2527. if ( this.cmbtreevTaoXiName.Tag != null )
  2528. {
  2529. //设置当前订单的新套系名称(在逻辑上临时使用)
  2530. this.newTempOrd_SeriesName = this.cmbtreevTaoXiName.Text.Trim();
  2531. dynamic taoXiMingChenData = this.cmbtreevTaoXiName.Tag;
  2532. this.SelectTaoXiAddItems( taoXiMingChenData, EnumPublic.EnumPackagesType.AAAAAAB );
  2533. if ( String.IsNullOrEmpty( this.currentOrderModel.Ord_OldSeriesName ) )
  2534. {
  2535. this.currentOrderModel.Ord_OldSeriesName = this.currentOrderModel.Ord_SeriesName;
  2536. this.currentOrderModel.Ord_OldSeriesPrice = this.currentOrderModel.Ord_SeriesPrice;
  2537. }
  2538. if ( this.lbTaoXiShenJi.Visible )
  2539. {
  2540. this.SetTaoXiShenJiJiLu( true );
  2541. this.SetOfSystemUpgradeLog = String.Format( "用户:{0}({1})将套系从“{2}”升级为“{3}”", this.loginUserName, this.loginUserID, this.currentOrderModel.Ord_SeriesName, this.cmbtreevTaoXiName.Text.Trim() );
  2542. }
  2543. }
  2544. }
  2545. /// <summary>
  2546. /// 移除礼包的项目
  2547. /// </summary>
  2548. public void RemovePackageItem()
  2549. {
  2550. this.cmbtreevPackageName.SetTextAndTag_ValueNull();
  2551. this.numLiBaoJiaGe.Value = 0;
  2552. this.numIntoRegisterPackage.Value = 0;
  2553. this.numIntoBottomPackage.Value = 0;
  2554. }
  2555. /// <summary>
  2556. /// 是否为活动套系
  2557. /// </summary>
  2558. bool GetIsActivity()
  2559. {
  2560. bool IsActivity = false;
  2561. if ( this.cmbtreevTaoXiName.Tag != null )
  2562. {
  2563. if ( this.cmbtreevTaoXiName.Tag.ToString().Length > 3 )
  2564. {
  2565. dynamic taoXiMingChenData = this.cmbtreevTaoXiName.Tag;
  2566. if ( this.cmbtreevTaoXiName.Tag.ToString().ToUpper().Trim() == BLL.BLL_ErpSystemCategory.GetSysTemCategoryCode( BLL.SysTemCategoryCodeType.活动套系 ).ToUpper() )
  2567. {
  2568. IsActivity = true;
  2569. }
  2570. else if ( this.cmbtreevTaoXiName.Parent != null && this.cmbtreevTaoXiName.Tag.ToString().Contains( "PackagesClass" ) )
  2571. {
  2572. try
  2573. {
  2574. if ( taoXiMingChenData.PackagesClass.ToString().ToUpper().Trim() == BLL.BLL_ErpSystemCategory.GetSysTemCategoryCode( BLL.SysTemCategoryCodeType.活动套系 ).ToUpper() )
  2575. {
  2576. IsActivity = true;
  2577. }
  2578. else
  2579. {
  2580. string TwoLevelCategoryCode = BLL.BLL_ErpSystemCategory.GetTwoLevelCategoryCode( taoXiMingChenData.PackagesClass.ToString().ToUpper().Trim(), "" );
  2581. if ( TwoLevelCategoryCode.ToUpper().Trim() == BLL.BLL_ErpSystemCategory.GetSysTemCategoryCode( BLL.SysTemCategoryCodeType.活动套系 ).ToUpper() )
  2582. {
  2583. IsActivity = true;
  2584. }
  2585. }
  2586. }
  2587. catch
  2588. {
  2589. }
  2590. }
  2591. }
  2592. }
  2593. if ( IsActivity && !LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.ChangeActiveContent )
  2594. {
  2595. this.numTaoXiJiaGe.ReadOnly = true;
  2596. this.numIntoBottom.Enabled = false;
  2597. this.numIntoRegister.Enabled = false;
  2598. }
  2599. else
  2600. {
  2601. this.numTaoXiJiaGe.ReadOnly = false;
  2602. this.numIntoBottom.Enabled = true;
  2603. this.numIntoRegister.Enabled = true;
  2604. }
  2605. return IsActivity;
  2606. }
  2607. /// <summary>
  2608. /// 设置订单资料(套系选择)
  2609. /// </summary>
  2610. /// <param name="dtRow">DataRow数据源</param>
  2611. /// <param name="IsActivity">是否为活动套系</param>
  2612. public bool SetOrderValue( LYFZ.Model.Model_ErpPackages packages )
  2613. {
  2614. bool IsActivity = GetIsActivity();
  2615. this.numTaoXiJiaGe.Value = 0;
  2616. this.numIntoRegister.Value = 0;
  2617. this.numIntoBottom.Value = 0;
  2618. if ( packages != null && packages.ID > 0 )
  2619. {
  2620. this.numTaoXiJiaGe.Value = packages.Pak_UnitPrice;
  2621. if ( this.plDingDanXiangPian.Visible )
  2622. {
  2623. this.numIntoRegister.Value = packages.Pak_IntoTheBook;
  2624. this.numIntoBottom.Value = packages.Pak_IntoTheArchive;
  2625. }
  2626. }
  2627. return IsActivity;
  2628. }
  2629. /// <summary>
  2630. /// 根据选择的套系添加容空到相应控件中
  2631. /// </summary>
  2632. /// <param name="taoXiData"></param>
  2633. /// <param name="packages"></param>
  2634. /// <param name="packType"></param>
  2635. void SelectTaoXiAddItems( dynamic taoXiData, EnumPublic.EnumPackagesType packType )
  2636. {
  2637. LYFZ.Model.Model_ErpPackages packages = null;
  2638. string packagesID = "";
  2639. if ( taoXiData != null && taoXiData.ToString().Length > 3 )
  2640. {
  2641. packagesID = taoXiData.PackagesID.ToString().Trim();
  2642. packages = packageBll.GetModel( "Pak_PackagesID", packagesID );
  2643. }
  2644. //new
  2645. //{
  2646. // PackagesClass = row["Pak_PackagesClass"].ToString(),
  2647. // PackagesID = row["Pak_PackagesID"].ToString(),
  2648. // Pak_Name = row["Pak_Name"].ToString(),
  2649. //}
  2650. bool IsActivity = false;
  2651. List<int> packagesMerchandiseList = new List<int>();
  2652. if ( packType == EnumPublic.EnumPackagesType.AAAAACA )
  2653. {
  2654. decimal StrUnitPrice = 0;
  2655. int StrIntoRegisterQuantity = 0;
  2656. int StrIntoBottomQuantity = 0;
  2657. if ( !string.IsNullOrEmpty( this.cmbtreevPackageName.Text.Trim() ) )
  2658. {
  2659. if ( packages != null && packages.ID > 0 )
  2660. {
  2661. StrUnitPrice = packages.Pak_UnitPrice;
  2662. if ( this.plLiBaoRuDiRuChe.Visible )
  2663. {
  2664. StrIntoRegisterQuantity = packages.Pak_IntoTheBook;
  2665. StrIntoBottomQuantity = packages.Pak_IntoTheArchive;
  2666. }
  2667. }
  2668. }
  2669. this.numLiBaoJiaGe.Value = StrUnitPrice;
  2670. this.numIntoRegisterPackage.Value = StrIntoRegisterQuantity;
  2671. this.numIntoBottomPackage.Value = StrIntoBottomQuantity;
  2672. if ( packages != null && packages.ID > 0 && packages.Pak_OptionalSeveral.ToString().Trim().Length > 0 && packages.Pak_OptionalSeveral >= 0 )
  2673. {
  2674. LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.ToolboxPackageListViewSamllForm frm = new SetSmallForm.ToolboxPackageListViewSamllForm();
  2675. frm.intOptionalSeveral = packages.Pak_OptionalSeveral;
  2676. frm.StrPackageCode = packagesID;
  2677. frm.StrOrderType = this.OrderType;
  2678. frm.ShowDialog();
  2679. if ( frm.IsSaveed )
  2680. {
  2681. packagesMerchandiseList = frm.listID;
  2682. }
  2683. else
  2684. {
  2685. RemovePackageItem();
  2686. packagesID = "";
  2687. }
  2688. }
  2689. }
  2690. else
  2691. {
  2692. IsActivity = SetOrderValue( packages );
  2693. }
  2694. string strMagess = "";
  2695. if ( !string.IsNullOrEmpty( packagesID ) )
  2696. {
  2697. DataTable dtSights = null;
  2698. DataTable dtProduct = null;
  2699. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  2700. {
  2701. DataSet dsData = DAL.DAL_ErpPackagesGiftMerchandise.GetPackagesSights( packagesID, packType, packagesMerchandiseList );
  2702. dtSights = dsData.Tables["ds"];
  2703. dtProduct = dsData.Tables["ds1"];
  2704. } );
  2705. try
  2706. {
  2707. if ( dtSights != null && dtProduct != null )
  2708. {
  2709. if ( this.orderSightsControl.Parent != null )
  2710. {
  2711. DataRow[] dtRow = dtSights.Select( "Pgm_GiveType = '2'" );
  2712. strMagess += this.orderSightsControl.SetOrderSightsValue( dtRow, IsActivity, packType );
  2713. }
  2714. if ( this.orderStagesControl.Parent != null )
  2715. {
  2716. DataRow[] dtRow = dtSights.Select( "Pgm_GiveType = '3'" );
  2717. strMagess += this.orderStagesControl.SetOrderStagesValue( dtRow, IsActivity, packType );
  2718. }
  2719. if ( this.orderServiceControl.Parent != null )
  2720. {
  2721. DataRow[] dtRow = dtProduct.Select( "Pgm_GiveType = '1'" );
  2722. strMagess += this.orderServiceControl.SetOrderServiceValue( dtRow, IsActivity, packType );
  2723. }
  2724. if ( this.orderProductControl.Parent != null )
  2725. {
  2726. DataRow[] dtRow = dtProduct.Select( "Pgm_GiveType = '0'" );
  2727. strMagess += this.orderProductControl.SetOrderProductValue( dtRow, IsActivity, packType );
  2728. }
  2729. }
  2730. }
  2731. catch { }
  2732. }
  2733. else if ( packType == EnumPublic.EnumPackagesType.AAAAACA )
  2734. {
  2735. if ( this.orderSightsControl.Parent != null )
  2736. {
  2737. try
  2738. {
  2739. this.orderSightsControl.RemovePackageItem();
  2740. }
  2741. catch { }
  2742. }
  2743. if ( this.orderStagesControl.Parent != null )
  2744. {
  2745. try
  2746. {
  2747. this.orderStagesControl.RemovePackageItem();
  2748. }
  2749. catch { }
  2750. }
  2751. if ( this.orderServiceControl.Parent != null )
  2752. {
  2753. try
  2754. {
  2755. this.orderServiceControl.RemovePackageItem();
  2756. }
  2757. catch { }
  2758. }
  2759. if ( this.orderProductControl.Parent != null )
  2760. {
  2761. try
  2762. {
  2763. this.orderProductControl.RemovePackageItem();
  2764. }
  2765. catch { }
  2766. }
  2767. }
  2768. if ( !String.IsNullOrEmpty( strMagess ) )
  2769. {
  2770. MessageBoxCustom.Show( strMagess );
  2771. }
  2772. }
  2773. /// <summary>
  2774. /// 获取前缀
  2775. /// </summary>
  2776. /// <returns></returns>
  2777. private string GetOrderCustomPrefix( EnumPublic.OrderType oType )
  2778. {
  2779. string StrCustomPrefix = "";
  2780. switch ( oType )
  2781. {
  2782. case EnumPublic.OrderType.婚纱订单:
  2783. StrCustomPrefix = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetPrefix( LYFZ.EnumPublic.OrderNumberPrefixType.婚纱订单 ).Trim();
  2784. break;
  2785. case EnumPublic.OrderType.儿童订单:
  2786. StrCustomPrefix = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetPrefix( LYFZ.EnumPublic.OrderNumberPrefixType.儿童订单 ).Trim();
  2787. break;
  2788. case EnumPublic.OrderType.写真订单:
  2789. StrCustomPrefix = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetPrefix( LYFZ.EnumPublic.OrderNumberPrefixType.写真订单 ).Trim();
  2790. break;
  2791. case EnumPublic.OrderType.服务订单:
  2792. StrCustomPrefix = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetPrefix( LYFZ.EnumPublic.OrderNumberPrefixType.服务订单 ).Trim();
  2793. break;
  2794. case EnumPublic.OrderType.婚庆订单:
  2795. StrCustomPrefix = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetPrefix( LYFZ.EnumPublic.OrderNumberPrefixType.婚庆订单 ).Trim();
  2796. break;
  2797. }
  2798. return StrCustomPrefix;
  2799. }
  2800. /// <summary>
  2801. /// 设置显示隐藏订单前缀
  2802. /// </summary>
  2803. /// <param name="qz"></param>
  2804. /// <param name="isShow"></param>
  2805. void SetDingDanQianZhuiShow( string qz, bool isShow )
  2806. {
  2807. if ( isShow && !String.IsNullOrEmpty( qz ) )
  2808. {
  2809. this.txtDingDanQianZhui.Text = qz.Trim();
  2810. this.txtDingDanQianZhui.Show();
  2811. this.txtDingDanQianZhui.Width = 9 * qz.Length;
  2812. this.txtSinceOrderNumber.Padding = new Padding( 9 * qz.Length + 4, 5, 5, 5 );
  2813. //this.txtSinceOrderNumber.ReadOnly = false;
  2814. }
  2815. else
  2816. {
  2817. this.txtDingDanQianZhui.Hide();
  2818. this.txtDingDanQianZhui.Text = "";
  2819. this.txtSinceOrderNumber.Padding = new Padding( 5 );
  2820. }
  2821. if ( IsNewOrder )
  2822. {
  2823. this.txtSinceOrderNumber.ReadOnly = false;
  2824. }
  2825. else
  2826. {
  2827. this.txtSinceOrderNumber.ReadOnly = true;
  2828. }
  2829. }
  2830. /// <summary>
  2831. /// 获取自定义单号
  2832. /// </summary>
  2833. /// <returns></returns>
  2834. string GetSinceOrderNumber()
  2835. {
  2836. if ( this.txtSinceOrderNumber.ReadOnly )
  2837. {
  2838. return this.txtSinceOrderNumber.Text.Trim();
  2839. }
  2840. else
  2841. {
  2842. if ( LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.IsCustomOrderNumber )
  2843. {
  2844. if (this.txtSinceOrderNumber.Text.Trim().Length <= 0)
  2845. {
  2846. throw new Exception("自定义单号不能为空!");
  2847. }
  2848. return String.Format( "{0}{1}", this.txtDingDanQianZhui.Text.Trim(), this.txtSinceOrderNumber.Text.Trim() );
  2849. }
  2850. else
  2851. {
  2852. return "";
  2853. }
  2854. }
  2855. }
  2856. /// <summary>
  2857. /// 订单礼包设置
  2858. /// </summary>
  2859. /// <param name="sender"></param>
  2860. /// <param name="e"></param>
  2861. private void LbSetLiBao_Click( object sender, EventArgs e )
  2862. {
  2863. LYFZ.Software.MainBusiness.InitialSet.PackagesGoodsSetFormMain frm = new InitialSet.PackagesGoodsSetFormMain( "1" );
  2864. frm.ShowDialog();
  2865. if ( frm.IsSaveed )
  2866. {
  2867. LoadAllSystemCategory();
  2868. LoadAllPackagesName();
  2869. this.BindLiBao();
  2870. }
  2871. }
  2872. /// <summary>
  2873. /// 订单套系名称设置
  2874. /// </summary>
  2875. /// <param name="sender"></param>
  2876. /// <param name="e"></param>
  2877. private void LbSetTaoXiName_Click( object sender, EventArgs e )
  2878. {
  2879. LYFZ.Software.MainBusiness.InitialSet.PackagesGoodsSetFormMain frm = new InitialSet.PackagesGoodsSetFormMain( "0" );
  2880. frm.ShowDialog();
  2881. if ( frm.IsSaveed )
  2882. {
  2883. LoadAllSystemCategory();
  2884. LoadAllPackagesName();
  2885. this.BindTaoXiMing();
  2886. }
  2887. }
  2888. /// <summary>
  2889. /// 订单类别设置
  2890. /// </summary>
  2891. /// <param name="sender"></param>
  2892. /// <param name="e"></param>
  2893. private void LbSetOrderClass_Click( object sender, EventArgs e )
  2894. {
  2895. LYFZ.Software.MainBusiness.InitialSet.FrmSystemSet frm = new InitialSet.FrmSystemSet();
  2896. frm.TypeName = BLL.BLL_ErpSystemCategory.GetSysTemCategoryCode( BLL.SysTemCategoryCodeType.订单类别 ).ToUpper();
  2897. frm.IsLoadAllCategory = false;
  2898. if ( frm.ShowDialog() == DialogResult.OK )
  2899. {
  2900. LoadAllSystemCategory();
  2901. this.BindOrderClass();
  2902. }
  2903. }
  2904. /// <summary>
  2905. /// 设置风格
  2906. /// </summary>
  2907. /// <param name="sender"></param>
  2908. /// <param name="e"></param>
  2909. private void LkSetStyle_Click( object sender, EventArgs e )
  2910. {
  2911. LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.StyleSetSmallForm frm = new SetSmallForm.StyleSetSmallForm();
  2912. frm.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  2913. frm.Location = new Point( LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y );
  2914. frm.Size = new Size( LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height );
  2915. frm.ShowDialog();
  2916. if ( frm.IsSaveed )
  2917. {
  2918. List<LYFZ.Model.Model_ErpStyle> tbStyleList = new List<Model.Model_ErpStyle>();
  2919. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  2920. {
  2921. tbStyleList = styleBll.GetModelList( "1=1" );
  2922. } );
  2923. BindStyleList( tbStyleList );
  2924. }
  2925. }
  2926. /// <summary>
  2927. /// 选择喜爱风格
  2928. /// </summary>
  2929. /// <param name="sender"></param>
  2930. /// <param name="e"></param>
  2931. private void LkSelectStyle_Click( object sender, EventArgs e )
  2932. {
  2933. LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.StyleViewSmallForm frm = new SetSmallForm.StyleViewSmallForm();
  2934. frm.frmStyleViewVersion = SetSmallForm.StyleViewSmallForm.StyleViewVersion.风格浏览;
  2935. frm.OldSelectStyleList = GetStyleList();
  2936. frm.WindowState = FormWindowState.Maximized;
  2937. frm.ShowDialog();
  2938. if ( frm.IsSaveed )
  2939. {
  2940. SetCheckedSelectStyle( frm.SelectStyleList, false );
  2941. }
  2942. }
  2943. /// <summary>
  2944. /// 根据已选风格值勾选风格控件
  2945. /// </summary>
  2946. /// <param name="styleValueList">值集合</param>
  2947. /// <param name="isIDValue">为 true 时为风格ID 集合 为 false 时为风格的名称集合</param>
  2948. void SetCheckedSelectStyle( List<string> styleValueList, bool isIDValue )
  2949. {
  2950. foreach ( Control control in this.plStyleMain.Controls )
  2951. {
  2952. if ( control is CheckBoxEx )
  2953. {
  2954. if ( (isIDValue && (styleValueList.Contains( control.Tag.ToString().Trim() ) || styleValueList.Contains( String.Format( "chk_{0}", control.Tag.ToString().Trim() ) )))
  2955. || (!isIDValue && styleValueList.Contains( control.Text.Trim().ToString() )) )
  2956. {
  2957. CheckBoxEx tmp = (CheckBoxEx)control;
  2958. tmp.Checked = true;
  2959. }
  2960. }
  2961. }
  2962. }
  2963. /// <summary>
  2964. /// 清除风格控件
  2965. /// </summary>
  2966. void ClearStyleList()
  2967. {
  2968. List<Control> removeChklist = new List<Control>();
  2969. foreach ( Control control in this.plStyleMain.Controls )
  2970. {
  2971. if ( control is CheckBoxEx )
  2972. {
  2973. removeChklist.Add( control );
  2974. }
  2975. }
  2976. foreach ( Control control in removeChklist )
  2977. {
  2978. this.plStyleMain.Controls.Remove( control );
  2979. }
  2980. }
  2981. /// <summary>
  2982. /// 绑定喜爱风格
  2983. /// </summary>
  2984. void BindStyleList( List<LYFZ.Model.Model_ErpStyle> styleList )
  2985. {
  2986. ClearStyleList();
  2987. int chboxStarTablIndex = 10;
  2988. int locationX = 82;//横向间隔 167
  2989. int locationY = 29;//纵向间隔 27
  2990. int starX_Index = 0;
  2991. int starY_Index = 0;
  2992. foreach ( LYFZ.Model.Model_ErpStyle styleModel in styleList )
  2993. {
  2994. chboxStarTablIndex++;
  2995. CheckBoxEx chBox = new CheckBoxEx();
  2996. chBox.Name = "chk_" + styleModel.ID.ToString();
  2997. chBox.Text = styleModel.Style_Name;
  2998. chBox.TabIndex = chboxStarTablIndex;
  2999. chBox.Tag = styleModel.ID;
  3000. chBox.Location = new Point( locationX + (starX_Index * 167), locationY + (starY_Index * 27) );
  3001. this.plStyleMain.Controls.Add( chBox );
  3002. starX_Index++;
  3003. if ( starX_Index >= 5 )
  3004. {
  3005. starX_Index = 0;
  3006. starY_Index++;
  3007. }
  3008. }
  3009. this.plStyleMain.Height = 35 + 27 * (starY_Index + 1);
  3010. UCustomerInfo.RefreshParentHeight( this.flKeFuZhiNiaoBlock );
  3011. }
  3012. /// <summary>
  3013. /// 获取喜爱格调
  3014. /// </summary>
  3015. /// <param name="isPrefix">是否有前缀</param>
  3016. /// <returns></returns>
  3017. private List<string> GetStyleList( bool isPrefix = false )
  3018. {
  3019. List<string> ListID = new List<string>();
  3020. foreach ( Control control in this.plStyleMain.Controls )//订单资料
  3021. {
  3022. if ( control is CheckBoxEx )
  3023. {
  3024. CheckBoxEx tmp = (CheckBoxEx)control;
  3025. if ( tmp.Checked )
  3026. {
  3027. if ( isPrefix )
  3028. {
  3029. ListID.Add( String.Format( "{0}", tmp.Name.Trim() ) );
  3030. }
  3031. else
  3032. {
  3033. ListID.Add( String.Format( "{0}", tmp.Tag.ToString().Trim() ) );
  3034. }
  3035. }
  3036. }
  3037. }
  3038. return ListID;
  3039. }
  3040. /// <summary>
  3041. /// 选择意向客户
  3042. /// </summary>
  3043. /// <param name="sender"></param>
  3044. /// <param name="e"></param>
  3045. private void LkYiXiangClient_Click( object sender, EventArgs e )
  3046. {
  3047. if ( IsNewOrder )
  3048. {
  3049. LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.OrderSelectSuperSmallForm frm = new SuperSmallForm.OrderSelectSuperSmallForm();
  3050. frm.Text = "选择订单(双击选择)";
  3051. if ( frm.ShowDialog() == DialogResult.OK )
  3052. {
  3053. this.SelectIntentClient( frm.SelectOrderNumber, frm.SelectClientGroupNumber );
  3054. }
  3055. }
  3056. }
  3057. /// <summary>
  3058. /// 选择意向订单或意向客户组
  3059. /// </summary>
  3060. /// <param name="SelectOrderNumber"></param>
  3061. /// <param name="SelectClientGroupNumber"></param>
  3062. void SelectIntentClient( string SelectOrderNumber, string SelectClientGroupNumber )
  3063. {
  3064. if ( !this.IsNewOrder )
  3065. {
  3066. //如果不是新开订单时,不允许选择意向客户
  3067. return;
  3068. }
  3069. if ( !string.IsNullOrEmpty( SelectOrderNumber ) )
  3070. {
  3071. this.OrderNumber = SelectOrderNumber.Trim();
  3072. if ( this.OpenLoadOrderData( this.OrderNumber ) )
  3073. {
  3074. this.lkYiXiangClient.Hide();
  3075. BindOrderData();
  3076. }
  3077. }
  3078. else
  3079. {
  3080. this.customerGroup = customerGroupBll.GetModelByEntity( "GP_CustomerGroupID", SelectClientGroupNumber );
  3081. if ( customerGroup.ID > 0 )
  3082. {
  3083. if ( !String.IsNullOrEmpty( customerGroup.GP_IntroducerCustomerID ) )
  3084. {
  3085. this.customerFriends = customerBll.GetModel( "Cus_CustomerNumber", customerGroup.GP_IntroducerCustomerID );
  3086. if ( this.customerFriends.ID > 0 )
  3087. {
  3088. this.memberCardModelFriends = memberCardBll.GetModel( "Mc_CustomerNumber", this.customerFriends.Cus_CustomerNumber );
  3089. }
  3090. }
  3091. this.customerGroupMembersList = customerGroupMembersBll.GetModelList( String.Format( "GM_CustomerGroupID = '{0}'", customerGroup.GP_CustomerGroupID ) );
  3092. StringBuilder tempCusIDs = new StringBuilder();
  3093. foreach ( LYFZ.Model.Model_ErpCustomerGroupMembers cusGroupMember in customerGroupMembersList )
  3094. {
  3095. tempCusIDs.Append( String.Format( "'{0}',", cusGroupMember.GM_CustomerID ) );
  3096. }
  3097. this.customerList = customerBll.GetModelList( String.Format( "Cus_CustomerNumber in ({0})", tempCusIDs.ToString().Trim( ',' ) ) );
  3098. //设置客户信息
  3099. this.BindCustomerInfo();
  3100. }
  3101. }
  3102. }
  3103. /// <summary>
  3104. /// 选择医院跟踪客户
  3105. /// </summary>
  3106. /// <param name="sender"></param>
  3107. /// <param name="e"></param>
  3108. private void RdoHospitalClient_Click( object sender, EventArgs e )
  3109. {
  3110. if ( IsNewOrder )
  3111. {
  3112. LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.SelectHospitalClientSuperSmallForm frm = new SuperSmallForm.SelectHospitalClientSuperSmallForm();
  3113. if ( frm.ShowDialog() == DialogResult.OK )
  3114. {
  3115. this.ClearCustomerControls();
  3116. this.ComeSingleLotNumber = frm.model.Hct_Oddnumber;
  3117. this.uMainCusInfo.SetHospitalClientValue( frm.model );
  3118. this.SetHospitalChildrenClientInfo( frm.model );
  3119. }
  3120. }
  3121. }
  3122. /// <summary>
  3123. /// 设置医院跟踪系统选择的儿童信息
  3124. /// </summary>
  3125. /// <param name="model"></param>
  3126. void SetHospitalChildrenClientInfo( LYFZ.Model.Model_ErpHospitalClient model )
  3127. {
  3128. this.childModel = new Model.Model_ErpCustomer();
  3129. if ( model != null )
  3130. {
  3131. this.maskBirthday.StrValue = LYFZ.Command.Command_Validate.DateTimeToString( model.Hct_BabyBirthday );
  3132. this.chkBirthday.Checked = model.Hct_AreLunar;
  3133. this.txtCusName.Text = model.Hct_BabyName;
  3134. if ( model.Hct_BabySex == "女" )
  3135. {
  3136. this.rdoCusSex2.Checked = true;
  3137. }
  3138. else
  3139. {
  3140. this.rdoCusSex1.Checked = true;
  3141. }
  3142. if ( !string.IsNullOrEmpty( this.maskBirthday.StrValue ) )
  3143. {
  3144. this.txtZodiac.Text = LYFZ.Command.Command_CalendarTurnLunar.GetZodiac( this.maskBirthday.StrValue, this.chkBirthday.Checked );
  3145. }
  3146. }
  3147. }
  3148. /// <summary>
  3149. /// 清除儿童信息
  3150. /// </summary>
  3151. void ClearChildrenInfo()
  3152. {
  3153. this.childModel = new Model.Model_ErpCustomer();
  3154. this.maskBirthday.StrValue = "";
  3155. this.chkBirthday.Checked = false;
  3156. this.txtCusName.Text = "";
  3157. this.rdoCusSex1.Checked = true;
  3158. this.txtZodiac.Text = "";
  3159. this.txtCusName.ReadOnly = false;
  3160. }
  3161. /// <summary>
  3162. /// 朋友介绍
  3163. /// </summary>
  3164. /// <param name="sender"></param>
  3165. /// <param name="e"></param>
  3166. private void RdoFriends_Click( object sender, EventArgs e )
  3167. {
  3168. LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.FriendIntroducedSuperSmallForm frm = new SuperSmallForm.FriendIntroducedSuperSmallForm();
  3169. if ( frm.ShowDialog() == DialogResult.OK )
  3170. {
  3171. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  3172. {
  3173. backgroundWorker.ReportProgress( 0, "正在加载数据... " );
  3174. this.memberCardModelFriends = memberCardBll.GetMemberCardModel( String.Format( "Mc_CustomerNumber='{0}'and Mc_Status='1'", frm.model.Cus_CustomerNumber ) );
  3175. } );
  3176. this.customerFriends = frm.model;
  3177. if ( frm.modelVice != null )
  3178. {
  3179. this.modelViceCardFriends = frm.modelVice;
  3180. }
  3181. this.SetFriendIntroduction();
  3182. }
  3183. }
  3184. /// <summary>
  3185. /// 设置儿童信息
  3186. /// </summary>
  3187. /// <param name="childernCusModel"></param>
  3188. void SetCusChildrenInfo( LYFZ.Model.Model_ErpCustomer childernCusModel )
  3189. {
  3190. this.childModel = childernCusModel;
  3191. this.ClearChildrenInfo();
  3192. if ( childernCusModel != null )
  3193. {
  3194. if ( childernCusModel.ID > 0 )
  3195. {
  3196. this.maskBirthday.StrValue = LYFZ.Command.Command_Validate.DateTimeToString( childernCusModel.Cus_Birthday );
  3197. this.chkBirthday.Checked = childernCusModel.Cus_BirthdayLunar == "1" ? true : false;
  3198. this.txtCusName.Text = childernCusModel.Cus_Name;
  3199. if ( childernCusModel.Cus_Sex )
  3200. {
  3201. this.rdoCusSex2.Checked = true;
  3202. }
  3203. else
  3204. {
  3205. this.rdoCusSex1.Checked = true;
  3206. }
  3207. if ( !string.IsNullOrEmpty( this.maskBirthday.StrValue ) )
  3208. {
  3209. this.txtZodiac.Text = LYFZ.Command.Command_CalendarTurnLunar.GetZodiac( this.maskBirthday.StrValue, this.chkBirthday.Checked );
  3210. }
  3211. this.txtCusName.ReadOnly = true;
  3212. }
  3213. }
  3214. }
  3215. /// <summary>
  3216. /// 选择老客户
  3217. /// </summary>
  3218. /// <param name="sender"></param>
  3219. /// <param name="e"></param>
  3220. private void RdoOldClient_Click( object sender, EventArgs e )
  3221. {
  3222. if ( IsNewOrder )
  3223. {
  3224. LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.ClientGroupSelectSuperSmallForm frm = new SuperSmallForm.ClientGroupSelectSuperSmallForm();
  3225. if ( frm.ShowDialog() == DialogResult.OK )
  3226. {
  3227. this.ClearCustomerControls();
  3228. if ( frm.mlist.Count > 0 )
  3229. {
  3230. this.uMainCusInfo.SetOldCustomerInfo( frm.mlist, frm.htData["MainClientNumber"].ToString().Trim() );
  3231. if ( this.plBaoBei.Visible )
  3232. {
  3233. this.SetCusChildrenInfo( frm.mlist.Find( c => c.Cus_Type == "儿童" && String.IsNullOrEmpty( c.Cus_Telephone ) ) );
  3234. }
  3235. }
  3236. }
  3237. }
  3238. }
  3239. /// <summary>
  3240. /// 重新加载所有套系名称
  3241. /// </summary>
  3242. void LoadAllPackagesName()
  3243. {
  3244. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  3245. {
  3246. LYFZ.BLL.BLL_ErpPackages.LoadAllPackagesName();
  3247. } );
  3248. }
  3249. /// <summary>
  3250. /// 重新加载所有类别
  3251. /// </summary>
  3252. void LoadAllSystemCategory()
  3253. {
  3254. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  3255. {
  3256. LYFZ.BLL.WageStatisticsProcess.LoadAllSystemCategory();
  3257. } );
  3258. }
  3259. /// <summary>
  3260. /// 设置客户来源
  3261. /// </summary>
  3262. /// <param name="sender"></param>
  3263. /// <param name="e"></param>
  3264. private void LkSetClientSource_Click( object sender, EventArgs e )
  3265. {
  3266. LYFZ.Software.MainBusiness.InitialSet.FrmSystemSet frm = new InitialSet.FrmSystemSet();
  3267. frm.TypeName = BLL.BLL_ErpSystemCategory.GetSysTemCategoryCode( BLL.SysTemCategoryCodeType.客户来源 ).ToUpper();
  3268. frm.IsLoadAllCategory = false;
  3269. if ( frm.ShowDialog() == DialogResult.OK )
  3270. {
  3271. LoadAllSystemCategory();
  3272. this.BindClientSource();
  3273. }
  3274. }
  3275. /// <summary>
  3276. /// 客户来源其它选项 选择事件
  3277. /// </summary>
  3278. /// <param name="sender"></param>
  3279. /// <param name="e"></param>
  3280. private void RdoOther_CheckedChanged( object sender, EventArgs e )
  3281. {
  3282. this.cmbtreevClientSource.Enabled = this.rdoOther.Checked;
  3283. if ( !this.rdoOther.Checked )
  3284. {
  3285. this.cmbtreevClientSource.SetTextAndTag_ValueNull();
  3286. }
  3287. }
  3288. /// <summary>
  3289. /// 自定义提成信息数据
  3290. /// </summary>
  3291. string customCommissionData = "";
  3292. /// <summary>
  3293. /// 选择接单人
  3294. /// </summary>
  3295. /// <param name="sender"></param>
  3296. /// <param name="e"></param>
  3297. private void LkSelectOrderPerson_Click( object sender, EventArgs e )
  3298. {
  3299. customCommissionData = new LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses().txtOrdersPerson( this.txtOrderPerson, this.customCommissionData );
  3300. // this.ordersPersonList
  3301. }
  3302. /// <summary>
  3303. /// 隐藏订单标注
  3304. /// </summary>
  3305. /// <param name="sender"></param>
  3306. /// <param name="e"></param>
  3307. private void LbHideBiaoZhu_Click( object sender, EventArgs e )
  3308. {
  3309. this.plBiaoZhiu.Hide();
  3310. }
  3311. /// <summary>
  3312. /// 显示订单标注
  3313. /// </summary>
  3314. /// <param name="sender"></param>
  3315. /// <param name="e"></param>
  3316. private void PictAnnotation_Click( object sender, EventArgs e )
  3317. {
  3318. this.plBiaoZhiu.Show();
  3319. }
  3320. /// <summary>
  3321. /// 关闭窗体
  3322. /// </summary>
  3323. /// <param name="sender"></param>
  3324. /// <param name="e"></param>
  3325. private void BtnOrderClose_Click( object sender, EventArgs e )
  3326. {
  3327. this.Close();
  3328. }
  3329. /// <summary>
  3330. /// 测试时 打开旧版开单页
  3331. /// </summary>
  3332. /// <param name="sender"></param>
  3333. /// <param name="e"></param>
  3334. private void LblOpenType_Click( object sender, EventArgs e )
  3335. {
  3336. //this.OpenLoadOrderData("HS17051700005");
  3337. //BindOrderData();
  3338. // BindShowControls();
  3339. // return;
  3340. //LYFZ.Software.MainBusiness.DoorCityProcess.OnSingleFormMain01 frm = new OnSingleFormMain01();
  3341. //frm.EnumLoadFormType = OnSingleFormMain01.LoadFormType.开单选择;
  3342. //frm.OrdType = this.OrderType;
  3343. //frm.IsShowUcNavigationTool = false;
  3344. //frm.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  3345. //frm.Show();
  3346. }
  3347. LYFZ.EnumPublic.OrderType _OrdType = EnumPublic.OrderType.写真订单;
  3348. /// <summary>
  3349. /// 订单类型
  3350. /// </summary>
  3351. public LYFZ.EnumPublic.OrderType OrderType
  3352. {
  3353. get
  3354. {
  3355. return _OrdType;
  3356. }
  3357. set
  3358. {
  3359. _OrdType = value;
  3360. }
  3361. }
  3362. bool isSelectPhoto = false;
  3363. /// <summary>
  3364. /// 是否是从选片界面进入的修改订单
  3365. /// </summary>
  3366. public bool IsSelectPhoto { get => isSelectPhoto; set => isSelectPhoto = value; }
  3367. string _OrderNumber = "";
  3368. /// <summary>
  3369. /// 当前订单号
  3370. /// </summary>
  3371. public string OrderNumber
  3372. {
  3373. get
  3374. {
  3375. return _OrderNumber.Trim();
  3376. }
  3377. set
  3378. {
  3379. _OrderNumber = value;
  3380. }
  3381. }
  3382. /// <summary>
  3383. /// 是否为新开订单
  3384. /// </summary>
  3385. bool IsNewOrder
  3386. {
  3387. get
  3388. {
  3389. return String.IsNullOrEmpty( this.OrderNumber );
  3390. }
  3391. }
  3392. /// <summary>
  3393. /// 接单人信息
  3394. /// </summary>
  3395. List<LYFZ.Model.Model_ErpOrdersPerson> ordersPersonList = new List<Model.Model_ErpOrdersPerson>();
  3396. /// <summary>
  3397. /// 客户组
  3398. /// </summary>
  3399. LYFZ.Model.Model_ErpCustomerGroup customerGroup = new Model.Model_ErpCustomerGroup();
  3400. /// <summary>
  3401. /// 客户组成员集合
  3402. /// </summary>
  3403. List<LYFZ.Model.Model_ErpCustomerGroupMembers> customerGroupMembersList = new List<Model.Model_ErpCustomerGroupMembers>();
  3404. /// <summary>
  3405. /// 客户成员信息集合
  3406. /// </summary>
  3407. List<LYFZ.Model.Model_ErpCustomer> customerList = new List<Model.Model_ErpCustomer>();
  3408. /// <summary>
  3409. /// 主要联系人成员表信息对象
  3410. /// </summary>
  3411. LYFZ.Model.Model_ErpCustomerGroupMembers mainCusGroupMember = new Model.Model_ErpCustomerGroupMembers();
  3412. /// <summary>
  3413. /// 当前主要联系人信息对象
  3414. /// </summary>
  3415. LYFZ.Model.Model_ErpCustomer mainCusModel = new Model.Model_ErpCustomer();
  3416. /// <summary>
  3417. /// 宝宝成员表信息对象
  3418. /// </summary>
  3419. LYFZ.Model.Model_ErpCustomerGroupMembers childGroupMember = new Model.Model_ErpCustomerGroupMembers();
  3420. /// <summary>
  3421. /// 当前宝宝信息对象
  3422. /// </summary>
  3423. LYFZ.Model.Model_ErpCustomer childModel = new Model.Model_ErpCustomer();
  3424. /// <summary>
  3425. /// 介绍人
  3426. /// </summary>
  3427. LYFZ.Model.Model_ErpCustomer customerFriends = new Model.Model_ErpCustomer();
  3428. /// <summary>
  3429. /// (介绍人)会员卡信息对象
  3430. /// </summary>
  3431. LYFZ.Model.Model_ErpMemberCard memberCardModelFriends = new Model.Model_ErpMemberCard();
  3432. /// <summary>
  3433. /// (介绍人)会员副卡信息对象
  3434. /// </summary>
  3435. LYFZ.Model.Model_ErpMemberCardViceCard modelViceCardFriends = new Model.Model_ErpMemberCardViceCard();
  3436. /// <summary>
  3437. /// 当前订单消费的返现副卡信息
  3438. /// </summary>
  3439. LYFZ.Model.Model_ErpMemberCardBackCashSet modelCashSet = new Model.Model_ErpMemberCardBackCashSet();
  3440. /// <summary>
  3441. /// 会员卡信息对象
  3442. /// </summary>
  3443. LYFZ.Model.Model_ErpMemberCard memberCardModel = new Model.Model_ErpMemberCard();
  3444. /// <summary>
  3445. /// 会员副卡信息对象
  3446. /// </summary>
  3447. LYFZ.Model.Model_ErpMemberCardViceCard modelViceCard = new Model.Model_ErpMemberCardViceCard();
  3448. /// <summary>
  3449. /// 订单数码表 儿童订单时一个订单对应数码表多条数据(每条数据表示一个阶段)、其它订单时一个订单只对应一条数据
  3450. /// </summary>
  3451. List<LYFZ.Model.Model_ErpOrderDigital> orderDigitalList = new List<Model.Model_ErpOrderDigital>();
  3452. /// <summary>
  3453. /// 订单摄影表 儿童订单时一个阶段对应一条数据,其它订单时一条数码数据对应多条数据(多个景点)
  3454. /// </summary>
  3455. List<LYFZ.Model.Model_ErpOrdersPhotography> photographyList = new List<Model.Model_ErpOrdersPhotography>();
  3456. /// <summary>
  3457. /// 订单商品集合
  3458. /// </summary>
  3459. List<LYFZ.Model.Model_ErpOrderProductList> orderProductList = new List<Model.Model_ErpOrderProductList>();
  3460. /// <summary>
  3461. /// 订单服务集合
  3462. /// </summary>
  3463. List<LYFZ.Model.Model_ErpWeddingService> orderWeddingServiceList = new List<Model.Model_ErpWeddingService>();
  3464. /// <summary>
  3465. /// 订单景店数据
  3466. /// </summary>
  3467. DataTable OrderSightsDataTable = null;
  3468. /// <summary>
  3469. /// 儿童订单 成长阶段数据
  3470. /// </summary>
  3471. DataTable OrderStagesDataTable = null;
  3472. /// <summary>
  3473. /// 订单商品数据
  3474. /// </summary>
  3475. DataTable OrderProductDataTable = null;
  3476. /// <summary>
  3477. /// 订单服务数据
  3478. /// </summary>
  3479. DataTable OrderServiceDataTable = null;
  3480. #region 打开订单操作
  3481. /// <summary>
  3482. /// 当前打开的订单是否为意向订单
  3483. /// </summary>
  3484. bool isCurrentOpentIntentOrder = false;
  3485. /// <summary>
  3486. /// 加载订单数据
  3487. /// </summary>
  3488. bool LoadOrderData( string loadOrderNumber )
  3489. {
  3490. this.OrderNumber = loadOrderNumber;
  3491. if ( !String.IsNullOrEmpty( loadOrderNumber ) )
  3492. {
  3493. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  3494. {
  3495. backgroundWorker.ReportProgress( 0, "正在加载订单数据..." );
  3496. this.currentOrderModel = this.orderBll.GetModel( this.OrderNumber );
  3497. } );
  3498. this.newTempOrd_SeriesName = this.currentOrderModel.Ord_SeriesName;
  3499. this.cmbtreevStoreName.TagFindText(this.currentOrderModel.Ord_DividedShop);
  3500. List<string> mlist = LYFZ.BLL.BLL_ErpUser.GetGroupRights("retailProcess", "CSA003");
  3501. if(!mlist.Contains(this.currentOrderModel.Ord_DividedShop))
  3502. {
  3503. mlist.Add(this.currentOrderModel.Ord_DividedShop);
  3504. }
  3505. List<TreeNode> deleTreeNodes = new List<TreeNode>();
  3506. foreach(TreeNode trNode in cmbtreevStoreName.TreeView.Nodes)
  3507. {
  3508. if(!mlist.Contains(trNode.Tag.ToString_s()))
  3509. {
  3510. deleTreeNodes.Add(trNode);
  3511. }
  3512. }
  3513. foreach(TreeNode trNode in deleTreeNodes)
  3514. {
  3515. cmbtreevStoreName.TreeView.Nodes.Remove(trNode);
  3516. }
  3517. if ( currentOrderModel.ID > 0 )
  3518. {
  3519. if ( this.currentOrderModel.Ord_Class == "0" )
  3520. {
  3521. isCurrentOpentIntentOrder = true;
  3522. this.btnSaveIntent.Show();
  3523. }
  3524. else
  3525. {
  3526. isCurrentOpentIntentOrder = false;
  3527. this.btnSaveIntent.Hide();
  3528. }
  3529. this.OrderType = (LYFZ.EnumPublic.OrderType)Enum.Parse( typeof( LYFZ.EnumPublic.OrderType ), currentOrderModel.Ord_Type );
  3530. this.orderProductControl.OrdType = this.OrderType;
  3531. this.orderServiceControl.OrdType = this.OrderType;
  3532. }
  3533. else
  3534. {
  3535. MessageBoxCustom.Show( String.Format( "没有找到订单号“{0}”的订单数据,或该订单已被删除。", this.OrderNumber ) );
  3536. return false;
  3537. }
  3538. }
  3539. BindShowControls();
  3540. return true;
  3541. }
  3542. /// <summary>
  3543. /// 加载订单明细数据
  3544. /// </summary>
  3545. void LoadOrderDataDetails()
  3546. {
  3547. this.ClearFriendIntroduction();
  3548. this.customerList.Clear();
  3549. this.ordersPersonList.Clear();
  3550. this.customerGroupMembersList.Clear();
  3551. this.OrderStagesDataTable = null;
  3552. this.OrderSightsDataTable = null;
  3553. this.OrderProductDataTable = null;
  3554. this.OrderServiceDataTable = null;
  3555. this.orderWeddingServiceList.Clear();
  3556. this.customerGroup = new Model.Model_ErpCustomerGroup();
  3557. this.customerFriends = new Model.Model_ErpCustomer();
  3558. this.modelCashSet = new Model.Model_ErpMemberCardBackCashSet();
  3559. this.memberCardModelFriends = new Model.Model_ErpMemberCard();
  3560. this.orderDigitalList.Clear();
  3561. this.photographyList.Clear();
  3562. this.orderProductList.Clear();
  3563. this.ClearCustomerControls();
  3564. if ( currentOrderModel.ID > 0 )
  3565. {
  3566. List<double> doubleList = new List<double>();
  3567. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  3568. {
  3569. backgroundWorker.ReportProgress( 0, "正在加载订单数据..." );
  3570. DateTime starTime = DateTime.Now;
  3571. // if (this.OrderType == EnumPublic.OrderType.儿童订单)
  3572. this.OrderStagesDataTable = LYFZ.DAL.DAL_ErpOrder.GetOrderStagesDataTable( this.OrderNumber );
  3573. this.OrderSightsDataTable = LYFZ.DAL.DAL_ErpOrder.GetOrderSightsDataTable( this.OrderNumber );
  3574. this.OrderProductDataTable = LYFZ.DAL.DAL_ErpOrder.GetOrderProductDataTable( this.OrderNumber );
  3575. this.OrderServiceDataTable = LYFZ.DAL.DAL_ErpOrder.GetOrderServiceDataTable( this.OrderNumber );
  3576. doubleList.Add( LYFZ.WinAPI.CustomPublicMethod.ExecDateDiff( starTime, DateTime.Now ) );
  3577. starTime = DateTime.Now;
  3578. this.orderWeddingServiceList = this.weddingServiceBll.GetModelList( String.Format( "Ws_Number='{0}'", this.OrderNumber ) );
  3579. doubleList.Add( LYFZ.WinAPI.CustomPublicMethod.ExecDateDiff( starTime, DateTime.Now ) );
  3580. starTime = DateTime.Now;
  3581. this.orderProductList = this.orderBll.GetOrderProductList( this.OrderNumber, DAL.OrderProductType.制作商品 );
  3582. doubleList.Add( LYFZ.WinAPI.CustomPublicMethod.ExecDateDiff( starTime, DateTime.Now ) );
  3583. starTime = DateTime.Now;
  3584. this.ordersPersonList = ordersPersonBll.GetModelList( String.Format( "OrdPe_OrderNumber = '{0}'", this.OrderNumber ), "OrdPe_Type ASC" );
  3585. doubleList.Add( LYFZ.WinAPI.CustomPublicMethod.ExecDateDiff( starTime, DateTime.Now ) );
  3586. starTime = DateTime.Now;
  3587. this.customerGroup = customerGroupBll.GetModelByEntity( "GP_OrderNumber", this.OrderNumber );
  3588. doubleList.Add( LYFZ.WinAPI.CustomPublicMethod.ExecDateDiff( starTime, DateTime.Now ) );
  3589. starTime = DateTime.Now;
  3590. if ( customerGroup.ID > 0 )
  3591. {
  3592. if ( !String.IsNullOrEmpty( customerGroup.GP_IntroducerCustomerID ) )
  3593. {
  3594. this.customerFriends = customerBll.GetModel( "Cus_CustomerNumber", customerGroup.GP_IntroducerCustomerID );
  3595. if ( this.customerFriends.ID > 0 )
  3596. {
  3597. this.memberCardModelFriends = memberCardBll.GetModel( "Mc_CustomerNumber", this.customerFriends.Cus_CustomerNumber );
  3598. }
  3599. modelCashSet = cardBackCashSetBll.GetModel( "Mcb_OrderNumber", this.OrderNumber );
  3600. if ( modelCashSet.ID > 0 )
  3601. {
  3602. this.modelViceCardFriends = cardViceCardBll.GetModel( "Mvc_ViceNumber", modelCashSet.Mcb_ViceNumber );
  3603. }
  3604. }
  3605. this.customerGroupMembersList = customerGroupMembersBll.GetModelList( String.Format( "GM_CustomerGroupID = '{0}'", customerGroup.GP_CustomerGroupID ) );
  3606. StringBuilder tempCusIDs = new StringBuilder();
  3607. foreach ( LYFZ.Model.Model_ErpCustomerGroupMembers cusGroupMember in customerGroupMembersList )
  3608. {
  3609. tempCusIDs.Append( String.Format( "'{0}',", cusGroupMember.GM_CustomerID ) );
  3610. }
  3611. doubleList.Add( LYFZ.WinAPI.CustomPublicMethod.ExecDateDiff( starTime, DateTime.Now ) );
  3612. starTime = DateTime.Now;
  3613. this.customerList = customerBll.GetModelList( String.Format( "Cus_CustomerNumber in ({0})", tempCusIDs.ToString().Trim( ',' ) ) );
  3614. doubleList.Add( LYFZ.WinAPI.CustomPublicMethod.ExecDateDiff( starTime, DateTime.Now ) );
  3615. starTime = DateTime.Now;
  3616. }
  3617. starTime = DateTime.Now;
  3618. this.orderDigitalList = orderDigitalBll.GetModelList( String.Format( "Ordv_Number='{0}'", this.currentOrderModel.Ord_Number ), "Ordv_DigitalNumber asc" );
  3619. doubleList.Add( LYFZ.WinAPI.CustomPublicMethod.ExecDateDiff( starTime, DateTime.Now ) );
  3620. starTime = DateTime.Now;
  3621. this.photographyList = photographyBll.GetModelList( String.Format( "Ordpg_Number='{0}'", this.currentOrderModel.Ord_Number ) );
  3622. doubleList.Add( LYFZ.WinAPI.CustomPublicMethod.ExecDateDiff( starTime, DateTime.Now ) );
  3623. } );
  3624. }
  3625. }
  3626. /// <summary>
  3627. /// 清除介绍人信息
  3628. /// </summary>
  3629. void ClearFriendIntroduction()
  3630. {
  3631. this.memberCardModelFriends = new Model.Model_ErpMemberCard();
  3632. this.modelViceCardFriends = new Model.Model_ErpMemberCardViceCard();
  3633. this.rdoFriends.Text = this.rdoFriends.Tag.ToString();
  3634. this.toolTipMsg.SetToolTip( this.rdoFriends, "" );
  3635. this.customerFriends = new Model.Model_ErpCustomer();
  3636. }
  3637. /// <summary>
  3638. /// 设置朋友介绍信息显示
  3639. /// </summary>
  3640. void SetFriendIntroduction()
  3641. {
  3642. string StrCardType = "";//主卡等级 用于 SetToolTip 提示
  3643. string StrCardTypeShow = ""; //主卡等级 用于显示到控到Text
  3644. if ( this.memberCardModelFriends.ID > 0 && !String.IsNullOrEmpty( this.memberCardModelFriends.Mc_CradNumber.Trim() ) )
  3645. {
  3646. StrCardType = String.Format( " 主卡等级:{0}", this.memberCardModelFriends.Mc_CardType.Trim() );
  3647. if ( this.memberCardModelFriends.Mc_CardType.Trim() != "无" )
  3648. {
  3649. StrCardTypeShow = "-" + this.memberCardModelFriends.Mc_CardType.Trim();
  3650. }
  3651. }
  3652. if ( this.customerFriends.ID > 0 )
  3653. {
  3654. //如果使用了副卡时
  3655. if ( this.modelViceCardFriends.ID > 0 )
  3656. {
  3657. this.rdoFriends.Text = String.Format( "{0}({1}{2}-副卡)", this.rdoFriends.Tag.ToString(), this.customerFriends.Cus_Name.Trim(), StrCardTypeShow );
  3658. this.toolTipMsg.SetToolTip( this.rdoFriends, String.Format( "朋友介绍(介绍人:{0}{1};副卡卡号:{2})", this.customerFriends.Cus_Name, StrCardType, this.modelViceCardFriends.Mvc_ViceCardNumber ) );
  3659. }
  3660. else
  3661. {
  3662. this.rdoFriends.Text = String.Format( "{0}({1}{2})", this.rdoFriends.Tag.ToString(), this.customerFriends.Cus_Name.Trim(), StrCardTypeShow );
  3663. this.toolTipMsg.SetToolTip( this.rdoFriends, String.Format( "朋友介绍(介绍人:{0}{1})", this.customerFriends.Cus_Name, StrCardType ) );
  3664. }
  3665. }
  3666. }
  3667. /// <summary>
  3668. /// 清除客户控件
  3669. /// </summary>
  3670. void ClearCustomerControls()
  3671. {
  3672. this.ClearChildrenInfo();
  3673. List<UCustomerInfo> delUcustomerList = new List<UCustomerInfo>();
  3674. foreach ( Control control in this.flKeFuZhiNiaoBlock.Controls )
  3675. {
  3676. ///成人客户信息
  3677. if ( control is UCustomerInfo )
  3678. {
  3679. UCustomerInfo tmpCus = (UCustomerInfo)control;
  3680. if ( tmpCus.IsMainCustomer )
  3681. {
  3682. tmpCus.ClearCustomerInfo();
  3683. }
  3684. else
  3685. {
  3686. delUcustomerList.Add( tmpCus );
  3687. }
  3688. }
  3689. }
  3690. foreach ( UCustomerInfo ucus in delUcustomerList )
  3691. {
  3692. ucus.PictDelete_Click( null, null );
  3693. }
  3694. }
  3695. /// <summary>
  3696. /// 绑定客户信息
  3697. /// </summary>
  3698. void BindCustomerInfo()
  3699. {
  3700. if ( this.customerGroup.ID > 0 )
  3701. {
  3702. //主要联系人
  3703. this.mainCusGroupMember = customerGroupMembersList.Find( c => c.GM_Master == 1 );
  3704. this.mainCusModel = customerList.Find( c => c.Cus_CustomerNumber == this.mainCusGroupMember.GM_CustomerID );
  3705. if (this.mainCusModel != null)
  3706. {
  3707. //设置婚期
  3708. if (String.IsNullOrEmpty(this.mainCusModel.Cus_DayForMarriage))
  3709. {
  3710. this.mskMarriage.StrValue = "";
  3711. }
  3712. else
  3713. {
  3714. this.mskMarriage.StrValue = this.mainCusModel.Cus_DayForMarriage;
  3715. }
  3716. }
  3717. else {
  3718. this.mskMarriage.StrValue = "";
  3719. }
  3720. if (this.mainCusModel != null)
  3721. this.chkMarriage.Checked = LYFZ.Command.Command_Validate.DateLunar( this.mainCusModel.Cus_DayForMarriageLunar );
  3722. //设置宝宝资料
  3723. //宝宝
  3724. this.childGroupMember = customerGroupMembersList.Find( c => c.GM_CustomerID == c.GM_RelatedPersonID );
  3725. this.SetCusChildrenInfo( customerList.Find( c => c.Cus_CustomerNumber == this.childGroupMember.GM_CustomerID ) );
  3726. //主要联系人资料
  3727. if (this.mainCusModel != null)
  3728. this.uMainCusInfo.SetCustomerInfo( this.customerGroup, this.mainCusGroupMember, this.mainCusModel );
  3729. //其它联系人
  3730. UCustomerInfo newCusInfo = null;
  3731. foreach ( LYFZ.Model.Model_ErpCustomerGroupMembers gMember in customerGroupMembersList )
  3732. {
  3733. if ( gMember.GM_CustomerID != this.mainCusGroupMember.GM_CustomerID && gMember.GM_CustomerID != this.childGroupMember.GM_CustomerID )
  3734. {
  3735. LYFZ.Model.Model_ErpCustomer tempCustomer = customerList.Find( c => c.Cus_CustomerNumber == gMember.GM_CustomerID );
  3736. if ( tempCustomer != null && tempCustomer.ID > 0 )
  3737. {
  3738. if ( newCusInfo == null )
  3739. {
  3740. newCusInfo = uMainCusInfo.AddClientToParentControls();
  3741. }
  3742. else
  3743. {
  3744. newCusInfo = newCusInfo.AddClientToParentControls();
  3745. }
  3746. UCustomerInfo.RefreshParentHeight( this.flKeFuZhiNiaoBlock );
  3747. newCusInfo.SetCustomerInfo( this.customerGroup, gMember, tempCustomer );
  3748. }
  3749. }
  3750. }
  3751. }
  3752. }
  3753. /// <summary>
  3754. /// 套系升级日志
  3755. /// </summary>
  3756. string SetOfSystemUpgradeLog = "";
  3757. /// <summary>
  3758. /// 套系升级
  3759. /// </summary>
  3760. /// <param name="sender"></param>
  3761. /// <param name="e"></param>
  3762. private void LbTaoXiShenJi_Click( object sender, EventArgs e )
  3763. {
  3764. if ( MessageBoxCustom.Show( "你确定要升级套系吗?", msgBoxButton: MessageBoxButtons.YesNo ) == DialogResult.Yes )
  3765. {
  3766. this.cmbtreevTaoXiName.Enabled = true;
  3767. }
  3768. }
  3769. /// <summary>
  3770. /// 设置套系升级方案
  3771. /// </summary>
  3772. /// <param name="isShow"></param>
  3773. void SetTaoXiShenJiJiLu( bool isShow = true )
  3774. {
  3775. if ( isShow )
  3776. {
  3777. this.lbTaoXiShenJiJiLu.Show();
  3778. }
  3779. else
  3780. {
  3781. this.lbTaoXiShenJiJiLu.Hide();
  3782. }
  3783. this.toolTipMsg.SetToolTip( this.lbTaoXiShenJiJiLu, String.Format( "升级前旧套系名称为:{0} 套系价格为:{1}元", currentOrderModel.Ord_OldSeriesName, currentOrderModel.Ord_OldSeriesPrice.ToString( "n2" ) ) );
  3784. }
  3785. /// <summary>
  3786. /// 绑定订单数据
  3787. /// </summary>
  3788. void BindOrderData()
  3789. {
  3790. this.lbTaoXiShenJiJiLu.Hide();
  3791. this.lbTaoXiShenJi.Hide();
  3792. if ( currentOrderModel.ID > 0 )
  3793. {
  3794. #region 如果套系升过级时 显示旧套系信息处理
  3795. if ( !String.IsNullOrEmpty( currentOrderModel.Ord_OldSeriesCode ) )
  3796. {
  3797. this.SetTaoXiShenJiJiLu( true );
  3798. }
  3799. #endregion
  3800. #region 如果套系已有景点拍照OK,且需要修改套系时,显示套系升级按钮
  3801. if ( this.photographyList != null && this.photographyList.Count > 0 )
  3802. {
  3803. if ( this.photographyList.Any( p => p.Ordpg_PhotographyStatus == "1" || p.Ordpg_PhotographyStatus == "2" ) )
  3804. {
  3805. this.cmbtreevTaoXiName.Enabled = false;
  3806. if ( BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.SeriesUpgrade )
  3807. {
  3808. this.lbTaoXiShenJi.Show();
  3809. }
  3810. }
  3811. }
  3812. #endregion
  3813. #region 接单人信息处理
  3814. this.customCommissionData = this.currentOrderModel.Ord_CommissionRatio;
  3815. string OrdersPersonString = String.Join<LYFZ.Model.Model_ErpOrdersPerson>( ",", ordersPersonList );
  3816. string PersonTypeString = "0".PadRight( ordersPersonList.Count, '1' ).Replace( "1", ",1" );
  3817. this.txtOrderPerson.Text = LYFZ.DAL.DAL_ErpUser.GetUserIDToUserName( OrdersPersonString, ',' );
  3818. this.txtOrderPerson.Tag = String.Format( "{0}|{1}", OrdersPersonString, PersonTypeString );
  3819. #endregion
  3820. #region 客户来源处理
  3821. switch ( this.currentOrderModel.Ord_CustomerSource.Trim() )
  3822. {
  3823. case "朋友介绍":
  3824. #region 介绍人显示处理
  3825. this.rdoFriends.Checked = true;
  3826. this.SetFriendIntroduction();
  3827. #endregion
  3828. break;
  3829. case "老客户":
  3830. this.rdoOldClient.Checked = true;
  3831. break;
  3832. case "爱婴跟踪客户":
  3833. this.rdoHospitalClient.Checked = true;
  3834. break;
  3835. default:
  3836. this.rdoOther.Checked = true;
  3837. this.cmbtreevClientSource.Enabled = true;
  3838. this.cmbtreevClientSource.TextFindTag( this.currentOrderModel.Ord_CustomerSource.Trim() );
  3839. break;
  3840. }
  3841. #endregion
  3842. #region 喜爱格调处理
  3843. if ( this.currentOrderModel.Ord_LovedStyle.Trim() != "" )
  3844. {
  3845. List<string> styleValueList = new List<string>();
  3846. styleValueList.AddRange( this.currentOrderModel.Ord_LovedStyle.Trim().Split( '|' ) );
  3847. this.SetCheckedSelectStyle( styleValueList, true );
  3848. }
  3849. #endregion
  3850. #region 客户资料处理
  3851. if ( this.customerGroup.ID > 0 )
  3852. {
  3853. this.BindCustomerInfo();
  3854. }
  3855. #endregion
  3856. #region 订单资料处理
  3857. #region 基本资料
  3858. //订单号
  3859. this.txtSysTempOrderNumber.Text = this.currentOrderModel.Ord_Number;
  3860. this.txtSinceOrderNumber.Text = this.currentOrderModel.Ord_SinceOrderNumber;
  3861. if ( this.currentOrderModel.Ord_Number.ToLower() == this.currentOrderModel.Ord_SinceOrderNumber.ToLower() )
  3862. {
  3863. this.plZhiDingYiDianHao.Hide();
  3864. }
  3865. else
  3866. {
  3867. this.plZhiDingYiDianHao.Show();
  3868. }
  3869. //套系资料
  3870. this.cmbtreevOrderClass.TextFindTag( this.currentOrderModel.Ord_OrderClass.Trim() );//订单类别
  3871. this.cmbtreevTaoXiName.TextFindTag( this.currentOrderModel.Ord_OrderClass.Trim() );//订单套系
  3872. string orderSeriesName = this.currentOrderModel.Ord_SeriesName.Trim();
  3873. if ( String.IsNullOrEmpty( orderSeriesName ) )
  3874. {
  3875. orderSeriesName = this.currentOrderModel.Ord_PhotographyCategory.Trim();
  3876. }
  3877. this.cmbtreevTaoXiName.TextFindTag( orderSeriesName );//套系名称
  3878. this.numTaoXiJiaGe.Value = (this.currentOrderModel.Ord_SeriesPrice - this.currentOrderModel.Ord_PackagePrice);//this.currentOrderModel.Ord_SeriesPrice;//套系价格
  3879. //礼包
  3880. this.cmbtreevPackageName.TextFindTag( this.currentOrderModel.Ord_PackageName );
  3881. this.numLiBaoJiaGe.Value = this.currentOrderModel.Ord_PackagePrice > 0 ? this.currentOrderModel.Ord_PackagePrice : 0;
  3882. //订单相片 非儿童订单时的 入底、入册
  3883. if ( this.OrderType != EnumPublic.OrderType.儿童订单 )
  3884. {
  3885. if ( this.orderDigitalList.Count > 0 )
  3886. {
  3887. LYFZ.Model.Model_ErpOrderDigital tempDigital = this.orderDigitalList.First();
  3888. //礼包入底、入册
  3889. this.numIntoRegisterPackage.Value = tempDigital.Ordv_IntoRegisterQuantityPackage;
  3890. this.numIntoBottomPackage.Value = tempDigital.Ordv_IntoBottomQuantityPackage;
  3891. //订单入底、入册
  3892. this.numIntoRegister.Value = tempDigital.Ordv_IntoRegisterQuantity - tempDigital.Ordv_IntoRegisterQuantityPackage;
  3893. this.numIntoBottom.Value = tempDigital.Ordv_IntoBottomQuantity;
  3894. if ( tempDigital.Ordv_IntoBottomQuantity > 0 )
  3895. {
  3896. this.numIntoBottom.Value = tempDigital.Ordv_IntoBottomQuantity - tempDigital.Ordv_IntoBottomQuantityPackage;
  3897. }
  3898. }
  3899. else
  3900. {
  3901. this.numIntoRegister.Value = 0;
  3902. this.numIntoBottom.Value = 0;
  3903. this.numIntoRegisterPackage.Value = 0;
  3904. this.numIntoBottomPackage.Value = 0;
  3905. }
  3906. }
  3907. //酒店信息
  3908. this.txtHotelInfo.Text = this.currentOrderModel.Ord_HotelInfo;
  3909. //订单备注
  3910. this.txtOrderRemarks.Text = this.currentOrderModel.Ord_Remark;
  3911. //订单套系标注
  3912. this.txtBiaoZhu.Text = this.currentOrderModel.Ord_OrderAnnotation;
  3913. if ( !String.IsNullOrEmpty( this.currentOrderModel.Ord_OrderAnnotation ) )
  3914. {
  3915. this.plBiaoZhiu.Show();
  3916. }
  3917. else
  3918. {
  3919. this.plBiaoZhiu.Hide();
  3920. }
  3921. #endregion
  3922. #region 订单 景点、商品、服务 信息处理
  3923. bool IsActivity = this.GetIsActivity();
  3924. if ( this.orderSightsControl.Parent != null )
  3925. {
  3926. this.orderSightsControl.OrderPhotographyList = photographyList;
  3927. this.orderSightsControl.OrderDigitalList = orderDigitalList;
  3928. this.orderSightsControl.CurrentOrderModel = this.currentOrderModel;
  3929. this.orderSightsControl.IsActivityTaoXi = IsActivity;
  3930. this.orderSightsControl.SetOrderSightsValue( this.currentOrderModel.Ord_SeriesName, this.OrderSightsDataTable );
  3931. }
  3932. if ( this.orderStagesControl.Parent != null )
  3933. {
  3934. this.orderStagesControl.OrderPhotographyList = photographyList;
  3935. this.orderStagesControl.OrderDigitalList = orderDigitalList;
  3936. this.orderStagesControl.CurrentOrderModel = this.currentOrderModel;
  3937. this.orderStagesControl.IsActivityTaoXi = IsActivity;
  3938. this.orderStagesControl.SetOrderStagesValue( this.currentOrderModel.Ord_SeriesName, this.OrderStagesDataTable );
  3939. }
  3940. try
  3941. {
  3942. if ( this.orderServiceControl.Parent != null )
  3943. {
  3944. this.orderServiceControl.OrderPhotographyList = photographyList;
  3945. this.orderServiceControl.OrderDigitalList = orderDigitalList;
  3946. this.orderServiceControl.CurrentOrderModel = this.currentOrderModel;
  3947. this.orderServiceControl.OrderWeddingServiceList = this.orderWeddingServiceList;
  3948. this.orderServiceControl.SetOrderServiceValue( IsActivity, this.currentOrderModel.Ord_SeriesName, this.OrderServiceDataTable );
  3949. }
  3950. if ( this.orderProductControl.Parent != null )
  3951. {
  3952. this.orderProductControl.OrderPhotographyList = photographyList;
  3953. this.orderProductControl.OrderDigitalList = orderDigitalList;
  3954. this.orderProductControl.CurrentOrderModel = this.currentOrderModel;
  3955. this.orderProductControl.OrderProductList = this.orderProductList;
  3956. this.orderProductControl.SetOrderProductValue( IsActivity, this.currentOrderModel.Ord_SeriesName, this.OrderProductDataTable );
  3957. }
  3958. }
  3959. catch ( Exception ex )
  3960. {
  3961. MessageBoxCustom.Show( ex.Message + ",原因:可能是“tb_ErpOrderProductList”商品唯一标识重复" );
  3962. }
  3963. #endregion
  3964. #endregion
  3965. }
  3966. }
  3967. #endregion
  3968. /// <summary>
  3969. /// 打开指定订单数据
  3970. /// </summary>
  3971. /// <param name="loadOrderNumber"></param>
  3972. bool OpenLoadOrderData( string loadOrderNumber )
  3973. {
  3974. if ( !this.LoadOrderData( loadOrderNumber ) )
  3975. {
  3976. return false;
  3977. }
  3978. else
  3979. {
  3980. LoadOrderDataDetails();
  3981. }
  3982. return true;
  3983. }
  3984. /// <summary>
  3985. /// 窗体加载时
  3986. /// </summary>
  3987. /// <param name="sender"></param>
  3988. /// <param name="e"></param>
  3989. private void FrmNewOrder_Load( object sender, EventArgs e )
  3990. {
  3991. //如果有传入订单号,为修改订单时,加载订单数据
  3992. if ( !IsNewOrder )
  3993. {
  3994. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindGroupStoreName(this.cmbtreevStoreName, IsShowAllText: false, bHideMainOpenForm: false);
  3995. //this.cmbtreevStoreName.Enabled = false;
  3996. if ( !this.OpenLoadOrderData( this.OrderNumber ) )
  3997. {
  3998. this.Close();
  3999. return;
  4000. }
  4001. }
  4002. else
  4003. {
  4004. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindGroupStoreName(this.cmbtreevStoreName, StrGroupKeyCode: "retailProcess", StrKeyCode: "CSA003", IsShowAllText: false, bHideMainOpenForm: false);
  4005. BindShowControls();
  4006. }
  4007. }
  4008. /// <summary>
  4009. /// 绑定显示控件
  4010. /// </summary>
  4011. void BindShowControls()
  4012. {
  4013. this.Text = String.Format( "{0}", this.OrderType.ToString() );
  4014. if ( this.OrderType == EnumPublic.OrderType.婚纱订单 )
  4015. {
  4016. uMainCusInfo.UCustomerAddMaximum = 2;
  4017. }
  4018. if ( this.OrderType == EnumPublic.OrderType.儿童订单 )
  4019. {
  4020. uMainCusInfo.IsChildCustomer = true;
  4021. this.uMainCusInfo.SetShowRelation( true );
  4022. }
  4023. else
  4024. {
  4025. uMainCusInfo.IsChildCustomer = false;
  4026. this.uMainCusInfo.SetShowRelation( false );
  4027. }
  4028. AddUCustomerInfo( uMainCusInfo );
  4029. AddOrderControls( this.OrderType );
  4030. this.btnPrint.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights( LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.Print );
  4031. this.lbStyle.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights( LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.OrderLoveStyleSet );
  4032. this.lkSetClientSource.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights( LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.OrderClientSourceSet );
  4033. this.lbSetOrderClass.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights( LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.OrderClsssSet );
  4034. this.lbSetTaoXiName.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights( LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.OrderPackagesNameSet );
  4035. //如果是新开订单 要隐藏订单详情页
  4036. if ( IsNewOrder )
  4037. {
  4038. this.tbQiTaXiangQing.Parent = null;
  4039. if ( LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.OrderAutoOpenMemberCard )
  4040. {
  4041. this.chkTransactmemberCard.Show();
  4042. this.chkTransactmemberCard.Checked = true;
  4043. }
  4044. else
  4045. {
  4046. this.chkTransactmemberCard.Show();
  4047. this.chkTransactmemberCard.Checked = false;
  4048. }
  4049. this.lkYiXiangClient.Show();
  4050. this.SetDingDanQianZhuiShow( GetOrderCustomPrefix( this.OrderType ), true );
  4051. }
  4052. else
  4053. {
  4054. //保存为意向订单
  4055. this.btnSaveIntent.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights( LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.ModifyOrder );
  4056. this.chkTransactmemberCard.Hide();
  4057. this.lkYiXiangClient.Hide();
  4058. this.SetDingDanQianZhuiShow( GetOrderCustomPrefix( this.OrderType ), false );
  4059. }
  4060. SystemSpecterTypeSet();
  4061. SetOrderTypeShow( this.OrderType );
  4062. SetCustomOrderNumber();
  4063. }
  4064. /// <summary>
  4065. /// 当前锁定订单时的客户端ID
  4066. /// </summary>
  4067. string LockOrderClientMarkID = "";
  4068. /// <summary>
  4069. /// 锁定订单
  4070. /// </summary>
  4071. void LockOrderUpdate()
  4072. {
  4073. if (!IsSelectPhoto)
  4074. {
  4075. if (this.currentOrderModel.ID > 0)
  4076. {
  4077. if (orderBll.LockOrderUpdate(this.currentOrderModel.ID))
  4078. {
  4079. this.LockOrderClientMarkID = HPSocketCS.Extended.CommonLibrary.ClientMarkID;
  4080. }
  4081. }
  4082. }
  4083. }
  4084. /// <summary>
  4085. /// 窗体首次显示时
  4086. /// </summary>
  4087. /// <param name="sender"></param>
  4088. /// <param name="e"></param>
  4089. private void FrmNewOrder_Shown( object sender, EventArgs e )
  4090. {
  4091. if (LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.SoftwareInfo.SalesType == (int)EnumPermissions.SalesType.铂金版)
  4092. {
  4093. if(LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.OpenOrderChangeShop)
  4094. {
  4095. cmbtreevStoreName.Visible = true;
  4096. labelEx9.Visible = true;
  4097. }
  4098. else
  4099. {
  4100. cmbtreevStoreName.Visible = false;
  4101. labelEx9.Visible = false;
  4102. }
  4103. }
  4104. else
  4105. {
  4106. cmbtreevStoreName.Visible = false;
  4107. labelEx9.Visible = false;
  4108. }
  4109. this.Activate();
  4110. List<LYFZ.Model.Model_ErpStyle> tbStyleList = new List<Model.Model_ErpStyle>();
  4111. // 当前订单是否被锁定
  4112. bool isLockOrder = false;
  4113. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  4114. {
  4115. backgroundWorker.ReportProgress( 0, "正在初始化..." );
  4116. LYFZ.BLL.WageStatisticsProcess.LoadAllSystemCategory();
  4117. tbStyleList = styleBll.GetModelList( "1=1" );
  4118. LYFZ.BLL.BLL_ErpPackages.LoadAllPackagesName();
  4119. if (!IsSelectPhoto)
  4120. {
  4121. if (this.currentOrderModel.ID > 0 && LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.EnableOrderLockFeature)
  4122. {
  4123. isLockOrder = orderBll.CheckOrderLock(this.currentOrderModel.ID);
  4124. }
  4125. }
  4126. } );
  4127. if ( LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.EnableOrderLockFeature )
  4128. {
  4129. if ( isLockOrder )
  4130. {
  4131. this.btnSave.Enabled = false;
  4132. if ( MessageBoxCustom.Show( String.Format( "当前订单已被其他人员锁定,你不能修改此订单。\r\n当有人正在修改订单或选片时,订单会被锁定。\r\n如果要强制解锁请选“是”进行解锁订单" ), msgBoxButton: MessageBoxButtons.YesNo ) == DialogResult.Yes )
  4133. {
  4134. LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.AuthorizeLoginSuperSmallForm frm = new MainBusiness.DoorCityProcess.SuperSmallForm.AuthorizeLoginSuperSmallForm( null, CustomAttributes.OperatingAuthority.ErrorPrivilegeValue, 2 );
  4135. frm.StrWindowText = "解锁订单授权";
  4136. if ( frm.ShowDialog() == System.Windows.Forms.DialogResult.OK )
  4137. {
  4138. // if (!LYFZ.BLL.BLL_ErpUser.CheckAdministrator(frm.User_BelongRoles))
  4139. if ( !LYFZ.BLL.BLL_ErpUser.GetRights( LYFZ.BLL.BLL_ErpUser.CurrentUserRights.OtherPermissionsSet, LYFZ.CustomAttributes.OperatingAuthority.UnlockOrderLock ) )
  4140. {
  4141. string msg = "授权失败,没有权限强制解锁订单";
  4142. frm.SetAuthorizationResult( msg );
  4143. MessageBoxCustom.Show( msg );
  4144. }
  4145. else
  4146. {
  4147. this.btnSave.Enabled = true;
  4148. LockOrderUpdate();
  4149. frm.SetAuthorizationResult();
  4150. }
  4151. }
  4152. }
  4153. }
  4154. else
  4155. {
  4156. LockOrderUpdate();
  4157. }
  4158. }
  4159. //绑定喜爱风格
  4160. BindStyleList( tbStyleList );
  4161. //绑定客户来源
  4162. BindClientSource();
  4163. //绑定订单类别
  4164. BindOrderClass();
  4165. //绑定套系名称
  4166. BindTaoXiMing();
  4167. //绑定礼包
  4168. BindLiBao();
  4169. //绑定订单数据
  4170. BindOrderData();
  4171. RefreshNumericUpDownEx();
  4172. }
  4173. #region 初始化控件操作
  4174. /// <summary>
  4175. /// 根据开单类型 添景点(阶段)、商品和服务控件
  4176. /// </summary>
  4177. /// <param name="_oType"></param>
  4178. void AddOrderControls( LYFZ.EnumPublic.OrderType _oType )
  4179. {
  4180. this.flPanelDingDanZhiLiao.Height = 1115;
  4181. switch ( _oType )
  4182. {
  4183. case EnumPublic.OrderType.婚纱订单:
  4184. AddOrderSightsControls();
  4185. break;
  4186. case EnumPublic.OrderType.儿童订单:
  4187. AddOrderStagesControls();
  4188. break;
  4189. case EnumPublic.OrderType.写真订单:
  4190. AddOrderSightsControls();
  4191. break;
  4192. case EnumPublic.OrderType.婚庆订单:
  4193. this.flPanelDingDanZhiLiao.Height = 850;
  4194. break;
  4195. case EnumPublic.OrderType.服务订单:
  4196. this.flPanelDingDanZhiLiao.Height = 850;
  4197. break;
  4198. }
  4199. AddOrderProductControls();
  4200. AddOrderServiceControls();
  4201. }
  4202. /// <summary>
  4203. /// 添加拍摄阶段
  4204. /// </summary>
  4205. void AddOrderStagesControls()
  4206. {
  4207. this.orderStagesControl.Width = 890;
  4208. if ( this.orderStagesControl.Parent == null )
  4209. {
  4210. this.flPanelDingDanZhiLiao.Controls.Add( this.orderStagesControl );
  4211. this.orderStagesControl.OrderProductEx = this.orderProductControl;
  4212. this.orderStagesControl.OrderServiceEx = this.orderServiceControl;
  4213. }
  4214. if ( this.orderSightsControl.Parent != null )
  4215. {
  4216. this.flPanelDingDanZhiLiao.Controls.Remove( this.orderSightsControl );
  4217. }
  4218. this.orderProductControl.SendToBack();
  4219. this.orderServiceControl.SendToBack();
  4220. this.orderProductControl.Refresh();
  4221. this.orderServiceControl.Refresh();
  4222. this.flPanelDingDanZhiLiao.Refresh();
  4223. }
  4224. /// <summary>
  4225. /// 添加订单景点
  4226. /// </summary>
  4227. void AddOrderSightsControls()
  4228. {
  4229. this.orderSightsControl.Width = 890;
  4230. if ( this.orderSightsControl.Parent == null )
  4231. {
  4232. this.flPanelDingDanZhiLiao.Controls.Add( this.orderSightsControl );
  4233. }
  4234. if ( this.orderStagesControl.Parent != null )
  4235. {
  4236. this.flPanelDingDanZhiLiao.Controls.Remove( this.orderStagesControl );
  4237. }
  4238. this.orderProductControl.SendToBack();
  4239. this.orderServiceControl.SendToBack();
  4240. this.orderProductControl.Refresh();
  4241. this.orderServiceControl.Refresh();
  4242. this.flPanelDingDanZhiLiao.Refresh();
  4243. }
  4244. /// <summary>
  4245. ///添加订单商品
  4246. /// </summary>
  4247. void AddOrderProductControls()
  4248. {
  4249. this.orderProductControl.Width = 890;
  4250. this.orderProductControl.OrdType = this.OrderType;
  4251. if ( this.orderProductControl.Parent == null )
  4252. {
  4253. this.flPanelDingDanZhiLiao.Controls.Add( this.orderProductControl );
  4254. }
  4255. }
  4256. /// <summary>
  4257. /// 添加订单服务
  4258. /// </summary>
  4259. void AddOrderServiceControls()
  4260. {
  4261. this.orderServiceControl.Width = 890;
  4262. this.orderServiceControl.OrdType = this.OrderType;
  4263. if ( this.orderServiceControl.Parent == null )
  4264. {
  4265. this.flPanelDingDanZhiLiao.Controls.Add( orderServiceControl );
  4266. }
  4267. }
  4268. /// <summary>
  4269. /// 添加客户控件
  4270. /// </summary>
  4271. /// <param name="ucusInfo"></param>
  4272. void AddUCustomerInfo( UCustomerInfo ucusInfo )
  4273. {
  4274. ucusInfo.AddClientToParentControls( this.flKeFuZhiNiaoBlock );
  4275. UCustomerInfo.RefreshParentHeight( this.flKeFuZhiNiaoBlock );
  4276. }
  4277. #endregion;
  4278. /// <summary>
  4279. /// 刷新NumericUpDownEx显示
  4280. /// </summary>
  4281. void RefreshNumericUpDownEx()
  4282. {
  4283. this.numTaoXiJiaGe.Refresh();
  4284. this.numIntoBottom.Refresh();
  4285. this.numIntoRegister.Refresh();
  4286. this.numLiBaoJiaGe.Refresh();
  4287. this.numIntoBottomPackage.Refresh();
  4288. this.numIntoRegisterPackage.Refresh();
  4289. }
  4290. /// <summary>
  4291. /// 绑定礼包
  4292. /// </summary>
  4293. void BindLiBao()
  4294. {
  4295. FinancialManagement.frmEditStatisticsProgram.BindTreeView_SystemCategory( BLL.BLL_ErpSystemCategory.GetSysTemCategoryCode( BLL.SysTemCategoryCodeType.订单礼包 ).ToUpper(), this.cmbtreevPackageName.TreeView, isExpandAll: false, IsFirstNodeNull: true, codeType: BLL.SysTemCategoryCodeType.订单礼包 );
  4296. FinancialManagement.frmEditStatisticsProgram.RemoveInvalidTaoXi( this.cmbtreevPackageName.TreeView );
  4297. }
  4298. /// <summary>
  4299. /// 绑定套系名称
  4300. /// </summary>
  4301. void BindTaoXiMing()
  4302. {
  4303. FinancialManagement.frmEditStatisticsProgram.BindTreeView_SystemCategory( BLL.BLL_ErpSystemCategory.GetSysTemCategoryCode( BLL.SysTemCategoryCodeType.套系名称 ).ToUpper(), this.cmbtreevTaoXiName.TreeView, isExpandAll: false, codeType: BLL.SysTemCategoryCodeType.套系名称 );
  4304. FinancialManagement.frmEditStatisticsProgram.RemoveInvalidTaoXi( this.cmbtreevTaoXiName.TreeView );
  4305. }
  4306. /// <summary>
  4307. /// 绑定订单类别
  4308. /// </summary>
  4309. void BindOrderClass()
  4310. {
  4311. FinancialManagement.frmEditStatisticsProgram.BindTreeView_SystemCategory( BLL.BLL_ErpSystemCategory.GetSysTemCategoryCode( BLL.SysTemCategoryCodeType.订单类别 ).ToUpper(), this.cmbtreevOrderClass.TreeView, isExpandAll: false );
  4312. }
  4313. /// <summary>
  4314. /// 绑定客户来源
  4315. /// </summary>
  4316. void BindClientSource()
  4317. {
  4318. FinancialManagement.frmEditStatisticsProgram.BindTreeView_SystemCategory( BLL.BLL_ErpSystemCategory.GetSysTemCategoryCode( BLL.SysTemCategoryCodeType.客户来源 ).ToUpper(), this.cmbtreevClientSource.TreeView, isExpandAll: false, ExclusionsList: "BFACBABGBGBJGDHIE,BFAFBCBADBDCABFDD,AAAAABT" );
  4319. }
  4320. /// <summary>
  4321. /// 设置是否显示自定义单号
  4322. /// </summary>
  4323. void SetCustomOrderNumber()
  4324. {
  4325. if ( LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.IsCustomOrderNumber )
  4326. {
  4327. this.plZhiDingYiDianHao.Show();
  4328. }
  4329. else
  4330. {
  4331. this.plZhiDingYiDianHao.Hide();
  4332. }
  4333. }
  4334. /// <summary>
  4335. /// 根据销售版本类型设置显示隐藏相关控件
  4336. /// </summary>
  4337. void SystemSpecterTypeSet()
  4338. {
  4339. ///保存意向订单的版本权限
  4340. List<Control> hideControl = new List<Control>();
  4341. //LYFZSS.SystemSpecterPossessed.ISystemSpecterPossessed.GetMySystemSpecter = LYFZSS.SystemSpecterType.SST_D;
  4342. hideControl.Add( this.btnSaveIntent );
  4343. LYFZ.Software.MainBusiness.VersionControl.StaticVersion.BindVersionShowHideControl(
  4344. VersionControl.VersionFunctionEnum.开单保存意向订单, hideControl, null, null );
  4345. ///自动开会员版本权
  4346. hideControl = new List<Control>();
  4347. hideControl.Add( this.chkTransactmemberCard );
  4348. LYFZ.Software.MainBusiness.VersionControl.StaticVersion.BindVersionShowHideControl(
  4349. VersionControl.VersionFunctionEnum.开单自动开会员, hideControl, null, null );
  4350. if ( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetBusinessType() == EnumPermissions.BusinessType.婚纱版 )
  4351. {
  4352. this.rdoHospitalClient.Hide();
  4353. }
  4354. else
  4355. {
  4356. if ( this.OrderType == EnumPublic.OrderType.婚纱订单 )
  4357. {
  4358. this.rdoHospitalClient.Hide();
  4359. }
  4360. else
  4361. {
  4362. this.rdoHospitalClient.Show();
  4363. }
  4364. }
  4365. }
  4366. /// <summary>
  4367. /// 控制是否显示套系礼包功能
  4368. /// </summary>
  4369. void ShowLiBaoMain()
  4370. {
  4371. if ( LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.GiftsPacksSetsofLines )
  4372. {
  4373. this.plLiBaoMain.Show();
  4374. }
  4375. else
  4376. {
  4377. this.plLiBaoMain.Hide();
  4378. }
  4379. }
  4380. /// <summary>
  4381. /// 根据订单类型设置对应订单控件
  4382. /// </summary>
  4383. /// <param name="_oType"></param>
  4384. void SetOrderTypeShow( LYFZ.EnumPublic.OrderType _oType )
  4385. {
  4386. switch ( _oType )
  4387. {
  4388. case EnumPublic.OrderType.婚纱订单:
  4389. this.plHunQi.Show();
  4390. this.plBaoBei.Hide();
  4391. this.plStyleMain.Show();
  4392. this.plTaoXiMingCheng.Show();
  4393. this.plDingDanXiangPian.Show();
  4394. this.plJiuDianXingXi.Hide();
  4395. this.plLiBaoRuDiRuChe.Show();
  4396. this.ShowLiBaoMain();
  4397. break;
  4398. case EnumPublic.OrderType.儿童订单:
  4399. this.plHunQi.Hide();
  4400. this.plBaoBei.Show();
  4401. this.plStyleMain.Show();
  4402. this.plTaoXiMingCheng.Show();
  4403. this.plDingDanXiangPian.Hide();
  4404. this.plJiuDianXingXi.Hide();
  4405. this.plLiBaoRuDiRuChe.Hide();
  4406. this.ShowLiBaoMain();
  4407. break;
  4408. case EnumPublic.OrderType.写真订单:
  4409. this.plHunQi.Hide();
  4410. this.plBaoBei.Hide();
  4411. this.plStyleMain.Show();
  4412. this.plTaoXiMingCheng.Show();
  4413. this.plDingDanXiangPian.Show();
  4414. this.plJiuDianXingXi.Hide();
  4415. this.plLiBaoRuDiRuChe.Show();
  4416. this.ShowLiBaoMain();
  4417. break;
  4418. case EnumPublic.OrderType.婚庆订单:
  4419. this.plHunQi.Show();
  4420. this.plBaoBei.Hide();
  4421. this.plStyleMain.Hide();
  4422. this.plTaoXiMingCheng.Show();
  4423. this.plDingDanXiangPian.Hide();
  4424. this.plJiuDianXingXi.Show();
  4425. this.plLiBaoMain.Hide();
  4426. break;
  4427. case EnumPublic.OrderType.服务订单:
  4428. this.plHunQi.Show();
  4429. this.plBaoBei.Hide();
  4430. this.plStyleMain.Hide();
  4431. this.plTaoXiMingCheng.Hide();
  4432. this.plDingDanXiangPian.Hide();
  4433. this.plJiuDianXingXi.Hide();
  4434. this.plLiBaoMain.Hide();
  4435. break;
  4436. }
  4437. }
  4438. /// <summary>
  4439. /// 订单保存类型 0 意向订单保存,1为正常交易订单开单
  4440. /// </summary>
  4441. public enum OrderSaveType
  4442. {
  4443. 意向订单 = 0,
  4444. 交易订单 = 1,
  4445. }
  4446. /// <summary>
  4447. /// 流程类型
  4448. /// </summary>
  4449. public enum FlowchrtType
  4450. {
  4451. 初修 = 0,
  4452. 选片 = 1,
  4453. 精修 = 2,
  4454. 设计 = 3,
  4455. 看版 = 4,
  4456. 取件 = 5,
  4457. 服务 = 6
  4458. }
  4459. }
  4460. }