123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776 |
- using LYFZ.ComponentLibrary;
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- namespace LYFZ.Software.MainBusiness.DoorCityProcess
- {
- public partial class OnSingleFormMain : LYFZ.Software.UI.DoorCityProcess.OnSingleFormMain
- {
- LYFZ.BLL.BLL_ErpOrder orbll = new BLL.BLL_ErpOrder();
- LYFZ.BLL.BLL_ErpStyle stbll = new BLL.BLL_ErpStyle();
- LYFZ.BLL.BLL_ErpPayment ptbll = new BLL.BLL_ErpPayment();
- LYFZ.BLL.BLL_ErpCustomer ctbll = new BLL.BLL_ErpCustomer();
- LYFZ.BLL.BLL_ErpMemberCard mcbll = new BLL.BLL_ErpMemberCard();
- LYFZ.BLL.BLL_ErpSystemLogs slogbll = new BLL.BLL_ErpSystemLogs();
- LYFZ.BLL.BLL_ErpOrderDigital odbll = new BLL.BLL_ErpOrderDigital();
- LYFZ.BLL.BLL_ErpOrdersPerson orpbll = new BLL.BLL_ErpOrdersPerson();
- LYFZ.BLL.BLL_SMSTemplates smsTemplates = new BLL.BLL_SMSTemplates();
- LYFZ.BLL.BLL_ErpCustomerGroup cgbll = new BLL.BLL_ErpCustomerGroup();
- LYFZ.BLL.BLL_ErpHospitalClient hcbll = new BLL.BLL_ErpHospitalClient();
- LYFZ.BLL.BLL_ErpWeddingService wsbll = new BLL.BLL_ErpWeddingService();
- LYFZ.BLL.BLL_ErpOrderProductLOG ptlog = new BLL.BLL_ErpOrderProductLOG();
- LYFZ.BLL.BLL_ErpSystemConfigure sgbll = new BLL.BLL_ErpSystemConfigure();
- LYFZ.BLL.BLL_ErpOrderProductList libll = new BLL.BLL_ErpOrderProductList();
- LYFZ.BLL.BLL_ErpOrdersPhotography opbll = new BLL.BLL_ErpOrdersPhotography();
- LYFZ.BLL.BLL_ErpMemberCardPoints mcptsbll = new BLL.BLL_ErpMemberCardPoints();
- LYFZ.BLL.BLL_ErpOrderNumberRecord ornrbll = new BLL.BLL_ErpOrderNumberRecord();
- LYFZ.BLL.BLL_ErpMemberCardViceCard mcvbll = new BLL.BLL_ErpMemberCardViceCard();
- LYFZ.BLL.BLL_ErpOrderDigitalStatus orsbll = new BLL.BLL_ErpOrderDigitalStatus();
- LYFZ.BLL.BLL_ErpMemberCardBackCash mcbcbll = new BLL.BLL_ErpMemberCardBackCash();
- LYFZ.BLL.BLL_ErpCustomerGroupMembers cgmbll = new BLL.BLL_ErpCustomerGroupMembers();
- LYFZ.BLL.BLL_ErpMemberCardOperateLOG mcopbll = new BLL.BLL_ErpMemberCardOperateLOG();
- LYFZ.BLL.BLL_ErpMemberCardPointsLOG mcpslogbll = new BLL.BLL_ErpMemberCardPointsLOG();
- LYFZ.BLL.BLL_ErpPackagesGiftMerchandise pgbll = new BLL.BLL_ErpPackagesGiftMerchandise();
- LYFZ.BLL.BLL_ErpMemberCardBackCashSet mcbcsetbll = new BLL.BLL_ErpMemberCardBackCashSet();
- LYFZ.BLL.BLL_ErpMemberCardInterfaceManagement mcimbll = new BLL.BLL_ErpMemberCardInterfaceManagement();
- #region 属性
- /// <summary>
- /// 是否是修改订单(从订单报表、保存后这里都会为true)
- /// </summary>
- public bool IsUpdateOrderLoad = false;
- /// <summary>
- /// 关闭窗体前判断是否提示
- /// </summary>
- private bool isClose = true;
- /// <summary>
- /// 订单编号
- /// </summary>
- public string StrNumber = "";
- /// <summary>
- /// 是否保存
- /// </summary>
- public bool IsSaveed = false;
- /// <summary>
- /// 订单类型
- /// </summary>
- public LYFZ.EnumPublic.OrderType OrdType;
- /// <summary>
- /// 用于写入成人客户控件的序号
- /// </summary>
- private int ClientAdultNameCount = 1;
- /// <summary>
- /// 用于写入儿童客户控件的序号
- /// </summary>
- private int ClientChildNameCount = 1;
- /// <summary>
- /// 是否显示写真版
- /// </summary>
- private bool IsPortrait = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsEnablePhotoEdition;
- /// <summary>
- /// 登录都姓名
- /// </summary>
- string StrUserName = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_Name;
- /// <summary>
- /// 登录者员工ID
- /// </summary>
- string strUserID = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;
- /// <summary>
- /// 本地分店ID
- /// </summary>
- string strInfoID = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID();
- /// <summary>
- /// 当前客户数量
- /// </summary>
- int AddClinetCount = 0;
- /// <summary>
- /// 订单客户组编号
- /// </summary>
- string OrderGroupNumber = "";
- /// <summary>
- /// 来单批号
- /// </summary>
- string ComeSingleLotNumber = "";
- /// <summary>
- /// 覆盖订单数据时候,是否覆盖客户数据
- /// </summary>
- bool UpdateOrderIsUpdateClientData = true;
- /// <summary>
- /// 如果没有保存权限,是否已授过权
- /// </summary>
- bool IsSaveedHadAuthorized = false;
- /// <summary>
- /// 当前登录者、授权者的保利系数
- /// </summary>
- decimal dec_OrderDiscounts = 0;
- /// <summary>
- /// 客户来源《朋友介绍——副卡资料》
- /// </summary>
- LYFZ.Model.Model_ErpMemberCardViceCard modelViceCard = null;
- /// <summary>
- /// 客户来源《朋友介绍——朋友资料》
- /// </summary>
- LYFZ.Model.Model_ErpCustomer modelFriends = null;
- /// <summary>
- /// 老客户信息
- /// </summary>
- LYFZ.Model.Model_ErpCustomer modelOldClient = null;
- /// <summary>
- /// 介绍人要办理的会员卡号
- /// </summary>
- public string StrReferralsMemberCardNumber = "";
- /// <summary>
- /// 介绍人要修改的电话号码
- /// </summary>
- public string StrReferralsClientPhone = "";
- bool _isIntentionOrder = false;
- /// <summary>
- /// 当前打开的是否为意向订单
- /// </summary>
- bool IsIntentionOrder
- {
- get { return _isIntentionOrder; }
- set { _isIntentionOrder = value; }
- }
- public LoadFormType EnumLoadFormType;
- public enum LoadFormType
- {
- 订单报表,
- 开单选择
- }
- #endregion
- #region 窗体事件
- public OnSingleFormMain()
- {
- this.Shown += OnSingleFormMain_Shown;
- this.Load += OnSingleFormMain_Load;
- this.btnSaveIntent.Click += btnSaveIntent_Click;
- this.btnSave.Click += btnSave_Click;
- this.btnPrint.Click += btnPrint_Click;
- this.btnNewOrder.Click += btnNewOrder_Click;
- this.btnOrderClose.Click += btnOrderClose_Click;
- this.FormClosing += OnSingleFormMain_FormClosing;
- this.FormClosed += OnSingleFormMain_FormClosed;
- this.Resize += OnSingleFormMain_Resize;
- #region 第一页
- this.btnSourceSet.Click += btnSourceSet_Click;
- this.btnStyleSet.Click += btnStyleSet_Click;
- this.pictAddClient.Click += pictAddClient_Click;
- this.btnSelectUser.Click += btnSelectUser_Click;
- this.panelEx3.Click += panelEx3_Click;
- this.panelEx2.Click += panelEx2_Click;
- this.panelVice1.Click += panelVice1_Click;
- this.PanelMain1.Click += PanelMain1_Click;
- this.chkOldClient.Click += chkOldClient_Click;
- this.chkFriends.Click += chkFriends_Click;
- this.chkHospitalClient.Click += chkHospitalClient_Click;
- this.chkOther.Click += chkOther_Click;
- this.lblYiXiangClient.Click += lblYiXiangClient_Click;
- this.lblBrowseSelect.Click += lblBrowseSelect_Click;
- #endregion
- #region 第二页
- this.tabControl.SelectedIndexChanged += tabControl_SelectedIndexChanged;
- this.PanelMain2.Click += PanelMain2_Click;
- this.PanelMain3.Click += PanelMain3_Click;
- #endregion
- }
- /// <summary>
- /// 窗体加载事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void OnSingleFormMain_Shown(object sender, EventArgs e)
- {
- this.Text = "开单(" + this.OrdType.ToString().Trim() + ")";
- this.flowPanel0.Location = new Point(this.flowPanel0.Location.X, tabControl.Location.Y - 2);// this.flowPanel0.Location.Y);
- this.FillClientDataPanelHeight();
- this.PanelMain1_Click(this, null);
- }
- /// <summary>
- /// 窗体加载事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void OnSingleFormMain_Load(object sender, EventArgs e)
- {
- this.StyleSetAdd();
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_ClientSourec("AAAAAAF", this.cmbtreevClientSource, strHideFiled: "BFACBABGBGBJGDHIE,BFAFBCBADBDCABFDD,AAAAABT");
- this.chBox_Click();
- #region 权限与加载
- if (this.StrNumber == "")
- {
- this.tap3.Parent = null;
- //this.btnSave.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.NewOrder);
- this.GetTransactmemberCard();
- }
- else
- {
- this.btnSaveIntent.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.ModifyOrder);
- this.OpenSingleLoad();
- }
- this.btnPrint.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.Print);
- this.btnStyleSet.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.OrderLoveStyleSet);
- this.btnSourceSet.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.OrderClientSourceSet);
- #endregion
- }
- /// <summary>
- /// 打开订单数据
- /// </summary>
- void OpenSingleLoad()
- {
- this.IsSaveedHadAuthorized = false;
- LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate(object obj, BackgroundWorker backgroundWorker)
- {
- LYFZ.Model.Model_ErpOrder modelorder = orbll.GetModel(this.StrNumber);
- if (modelorder.ID <= 0)
- { return; }
- else
- {
- this.OrdType = (LYFZ.EnumPublic.OrderType)Enum.Parse(typeof(LYFZ.EnumPublic.OrderType), modelorder.Ord_Type);
- if (modelorder.Ord_Class == "0")
- {
- IsIntentionOrder = true;
- }
- DataTable tbl_P = orbll.GetView_Custom("tb_ErpOrdersPerson", StrWhere: "OrdPe_OrderNumber = '" + this.StrNumber + "'", filedOrder: "OrdPe_Type ASC", ShowColumnName: "dbo.fn_CheckUserIDGetUserName(OrdPe_OrdersPerson) AS OrdPe_OrdersPersonName,OrdPe_OrdersPerson,OrdPe_Type").Tables[0];
- DataTable tblFriends = orbll.GetView_Custom("tb_ErpCustomerGroup", StrWhere: "GP_OrderNumber = '" + this.StrNumber + "'", ShowColumnName: "GP_CustomerGroupID,GP_IntroducerCustomerID").Tables[0];
- List<LYFZ.Model.Model_ErpCustomer> mlistClient = new List<Model.Model_ErpCustomer>();
- List<string> mlistClientRelation = new List<string>();
- string StrMasterNumber = "";
- string StrChildNumber = "";
- DataTable tblGroup = orbll.GetView_Custom("tb_ErpCustomerGroup", StrWhere: "GP_OrderNumber = '" + this.StrNumber + "'", ShowColumnName: "GP_CustomerGroupID").Tables[0];
- if (tblGroup.Rows.Count > 0)
- {
- DataTable tblClientGroup = orbll.GetView_Custom("View_CustomerGroupMembersAndErpCustomer", StrWhere: "GM_CustomerGroupID = '" + tblGroup.Rows[0]["GP_CustomerGroupID"].ToString().Trim() + "'", ShowColumnName: "Cus_CustomerNumber,GM_Master,GM_RelatedPersonID,GM_Relation,GM_ProtagonistCustomer").Tables[0];
- for (int i = 0; i < tblClientGroup.Rows.Count; i++)
- {
- if (tblClientGroup.Rows[i]["GM_Master"].ToString().Trim() == "1")
- { StrMasterNumber = tblClientGroup.Rows[i]["Cus_CustomerNumber"].ToString().Trim(); }
- if (modelorder.Ord_Type == "1")
- {
- if (tblClientGroup.Rows[i]["GM_ProtagonistCustomer"].ToString().Trim() == "1")
- { StrChildNumber = tblClientGroup.Rows[i]["Cus_CustomerNumber"].ToString().Trim(); }
- }
- LYFZ.Model.Model_ErpCustomer modelClient = ctbll.GetModel("Cus_CustomerNumber", tblClientGroup.Rows[i]["Cus_CustomerNumber"].ToString().Trim());
- if (modelClient.ID > 0)
- {
- mlistClient.Add(modelClient);
- mlistClientRelation.Add(tblClientGroup.Rows[i]["GM_Relation"].ToString().Trim());
- }
- }
- }
- try
- {
- this.Invoke(new LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.UpdateControl(delegate()
- {
- if (modelorder.Ord_Class == "1")
- { this.btnSaveIntent.Visible = false; }
- else
- { this.btnSaveIntent.Visible = true; }
- if (this.IsUpdateOrderLoad)
- { this.lblYiXiangClient.Enabled = false; this.panelTransactmemberCard.Visible = false; }
- #region 订单资料
- if (this.UpdateOrderIsUpdateClientData)
- {
- this.AddClinetCount = 0;
- }
- this.tabControl.SelectedIndex = 1;
- bool IsActivity = false;
- switch (this.OrdType)
- {
- case EnumPublic.OrderType.婚纱订单:
- case EnumPublic.OrderType.儿童订单:
- case EnumPublic.OrderType.写真订单:
- case EnumPublic.OrderType.婚庆订单:
- this.OrderEx.StrCustomPrefix = this.GetOrderCustomPrefix();
- IsActivity = this.OrderEx.SetOrderValue(modelorder);
- if (this.OrderSightsEx != null)
- { this.OrderSightsEx.SetOrderSightsValue(this.StrNumber, modelorder.Ord_SeriesName); }
- else if (this.OrderStagesEx != null)
- { this.OrderStagesEx.SetOrderStagesValue(this.StrNumber, modelorder.Ord_SeriesName); }
- break;
- case EnumPublic.OrderType.服务订单:
- this.ServiceOrderEx.StrCustomPrefix = this.GetOrderCustomPrefix();
- this.ServiceOrderEx.SetOrderValue(modelorder);
- break;
- }
- try
- {
- this.OrderServiceEx.SetOrderServiceValue(this.StrNumber, IsActivity, modelorder.Ord_SeriesName);
- this.OrderProductEx.SetOrderProductValue(this.StrNumber, IsActivity, modelorder.Ord_SeriesName);
- }
- catch (Exception ex)
- {
- MessageBoxCustom.Show(ex.Message + ",原因:可能是“tb_ErpOrderProductList”商品唯一标识重复");
- }
- #endregion
- #region 接单人
- string PersonName = "";
- string PersonTag = "";
- string PersonType = "";
- for (int i = 0; i < tbl_P.Rows.Count; i++)
- {
- if (i == 0)
- {
- PersonName = tbl_P.Rows[i]["OrdPe_OrdersPersonName"].ToString().Trim();
- PersonTag = tbl_P.Rows[i]["OrdPe_OrdersPerson"].ToString().Trim();
- PersonType = tbl_P.Rows[i]["OrdPe_Type"].ToString().Trim();
- }
- else
- {
- PersonName += "," + tbl_P.Rows[i]["OrdPe_OrdersPersonName"].ToString().Trim();
- PersonTag += "," + tbl_P.Rows[i]["OrdPe_OrdersPerson"].ToString().Trim();
- PersonType += "," + tbl_P.Rows[i]["OrdPe_Type"].ToString().Trim();
- }
- }
- this.txtOrderPerson.Text = PersonName;
- this.txtOrderPerson.Tag = PersonTag + "|" + PersonType;
- #endregion
- #region 客户来源
- if (modelorder.Ord_CustomerSource.Trim() == "朋友介绍")
- {
- this.chkFriends.Checked = true;
- if (tblFriends.Rows.Count > 0)
- {
- if (tblFriends.Rows[0]["GP_IntroducerCustomerID"].ToString().Trim() != "")
- {
- this.modelFriends = ctbll.GetModel("Cus_CustomerNumber", tblFriends.Rows[0]["GP_IntroducerCustomerID"]);
- string StrCardType = "";
- string StrCardTypeShow = "";
- DataTable dt = orbll.GetView_Custom("tb_ErpMemberCard", StrWhere: "Mc_CustomerNumber = '" + this.modelFriends.Cus_CustomerNumber + "' And Mc_CradNumber != ''", ShowColumnName: "Mc_CardType").Tables[0];
- if (dt.Rows.Count > 0)
- {
- StrCardType = ";主卡等级:" + dt.Rows[0]["Mc_CardType"].ToString().Trim();
- if (dt.Rows[0]["Mc_CardType"].ToString().Trim() != "无")
- { StrCardTypeShow = " - " + dt.Rows[0]["Mc_CardType"].ToString().Trim(); }
- }
- LYFZ.Model.Model_ErpMemberCardBackCashSet modelCashSet = mcbcsetbll.GetModel("Mcb_OrderNumber", modelorder.Ord_Number);
- if (modelCashSet.ID > 0)
- {
- this.modelViceCard = mcvbll.GetModel("Mvc_ViceNumber", modelCashSet.Mcb_ViceNumber);
- this.chkFriends.Text = this.chkFriends.Tag + "(" + this.modelFriends.Cus_Name.Trim() + StrCardTypeShow + " - 副卡)";
- this.toolTip1.SetToolTip(this.chkFriends, "朋友介绍(介绍人:" + this.modelFriends.Cus_Name + StrCardType + ";副卡卡号:" + this.modelViceCard.Mvc_ViceCardNumber + ")");
- }
- else
- {
- if (this.modelFriends.Cus_Name != null)
- {
- this.chkFriends.Text = this.chkFriends.Tag + "(" + this.modelFriends.Cus_Name.Trim() + StrCardTypeShow + ")";
- this.toolTip1.SetToolTip(this.chkFriends, "朋友介绍(介绍人:" + this.modelFriends.Cus_Name + StrCardType + ")");
- }
- }
- }
- }
- }
- else if (modelorder.Ord_CustomerSource.Trim() == "老客户")
- { this.chkOldClient.Checked = true; }
- else if (modelorder.Ord_CustomerSource.Trim() == "老客户")
- { this.chkOldClient.Checked = true; }
- else if (modelorder.Ord_CustomerSource.Trim() == "医院跟踪客户")
- { this.chkHospitalClient.Checked = true; }
- else
- {
- this.chkOther.Checked = true;
- this.cmbtreevClientSource.Enabled = true;
- this.cmbtreevClientSource.TextFindTag(modelorder.Ord_CustomerSource.Trim());
- }
- #endregion
- #region 喜爱格调
- if (modelorder.Ord_LovedStyle.Trim() != "")
- {
- if (modelorder.Ord_LovedStyle.Trim().IndexOf('|') != -1)
- {
- string[] LovedStylelist = modelorder.Ord_LovedStyle.Trim().Split('|');
- if (LovedStylelist.Length > 0)
- {
- for (int i = 0; i < LovedStylelist.Length; i++)
- {
- try
- {
- ((CheckBoxEx)panelEx3.Controls[LovedStylelist[i]]).Checked = true;
- }
- catch { }
- }
- }
- }
- else
- { ((CheckBoxEx)panelEx3.Controls[modelorder.Ord_LovedStyle.Trim()]).Checked = true; }
- }
- #endregion
- #region 客户资料
- this.chBox_Click();
- if (this.UpdateOrderIsUpdateClientData)
- {
- foreach (Control control in this.flowPanel1.Controls)
- {
- if (control is SetCustomControls.OrderClientParentsControlsEx)
- {
- SetCustomControls.OrderClientParentsControlsEx tmp = (SetCustomControls.OrderClientParentsControlsEx)control;
- if (tmp.StrClientAttribute == "Man_")
- {
- for (int i = 0; i < mlistClient.Count; i++)
- {
- if (mlistClient[i].Cus_CustomerNumber == StrMasterNumber)
- {
- this.SetMarriageValue(mlistClient[i].Cus_DayForMarriage.Trim(), mlistClient[i].Cus_DayForMarriageLunar);
- tmp.SetClientValue(mlistClient[i], true, mlistClientRelation[i].Trim());
- tmp.IsPictResetShow = true;
- tmp.IsPictEditShow = true;
- mlistClient.RemoveAt(i);
- mlistClientRelation.RemoveAt(i);
- break;
- }
- }
- }
- else
- {
- for (int i = 0; i < mlistClient.Count; i++)
- {
- if (mlistClient[i].Cus_CustomerNumber != StrChildNumber && mlistClient[i].Cus_CustomerNumber.Trim() == StrMasterNumber)
- {
- this.SetMarriageValue(mlistClient[i].Cus_DayForMarriage.Trim(), mlistClient[i].Cus_DayForMarriageLunar);
- tmp.SetClientValue(mlistClient[i], true, mlistClientRelation[i].Trim());
- tmp.IsPictResetShow = true;
- tmp.IsPictEditShow = true;
- mlistClient.RemoveAt(i);
- mlistClientRelation.RemoveAt(i);
- break;
- }
- }
- }
- }
- else if (control is SetCustomControls.OrderClientChildrenControlsEx)
- {
- SetCustomControls.OrderClientChildrenControlsEx tmp = (SetCustomControls.OrderClientChildrenControlsEx)control;
- for (int i = 0; i < mlistClient.Count; i++)
- {
- if (mlistClient[i].Cus_CustomerNumber.Trim() == StrChildNumber)
- {
- tmp.SetClientValue(mlistClient[i], true);
- tmp.IsPictResetShow = true;
- tmp.IsPictEditShow = true;
- mlistClient.RemoveAt(i);
- mlistClientRelation.RemoveAt(i);
- break;
- }
- }
- }
- }
- if (mlistClient.Count > 0)
- {
- for (int i = 0; i < mlistClient.Count; i++)
- {
- this.SetMarriageValue(mlistClient[i].Cus_DayForMarriage.Trim(), mlistClient[i].Cus_DayForMarriageLunar);
- this.ClientAdultPanelAdd("其他联系人" + ClientAdultNameCount, model: mlistClient[i], MainClientRelation: mlistClientRelation[i].Trim());
- this.AddClinetCount++;
- }
- }
- }
- #endregion
- this.Text = "开单(" + this.OrdType.ToString().Trim() + ")";
- }));
- }
- catch { }
- }
- });
- this.tabControl.SelectedIndex = 0;
- }
- /// <summary>
- /// 赋婚期值
- /// </summary>
- /// <param name="StrValue"></param>
- /// <param name="StrLunar"></param>
- void SetMarriageValue(string StrValue, string StrLunar)
- {
- switch (this.OrdType)
- {
- case EnumPublic.OrderType.婚纱订单:
- case EnumPublic.OrderType.婚庆订单:
- case EnumPublic.OrderType.服务订单:
- this.mskMarriage.StrValue = StrValue;
- this.chkMarriage.Checked = LYFZ.Command.Command_Validate.DateLunar(StrLunar);
- break;
- }
- }
- /// <summary>
- /// 获取前缀
- /// </summary>
- /// <returns></returns>
- private string GetOrderCustomPrefix()
- {
- string StrCustomPrefix = "";
- if (this.OrdType == LYFZ.EnumPublic.OrderType.婚纱订单)
- { StrCustomPrefix = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetPrefix(LYFZ.EnumPublic.OrderNumberPrefixType.婚纱订单).Trim(); }
- else if (this.OrdType == LYFZ.EnumPublic.OrderType.儿童订单)
- { StrCustomPrefix = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetPrefix(LYFZ.EnumPublic.OrderNumberPrefixType.儿童订单).Trim(); }
- else if (this.OrdType == LYFZ.EnumPublic.OrderType.写真订单)
- { StrCustomPrefix = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetPrefix(LYFZ.EnumPublic.OrderNumberPrefixType.写真订单).Trim(); }
- else if (this.OrdType == LYFZ.EnumPublic.OrderType.服务订单)
- { StrCustomPrefix = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetPrefix(LYFZ.EnumPublic.OrderNumberPrefixType.服务订单).Trim(); }
- else if (this.OrdType == LYFZ.EnumPublic.OrderType.婚庆订单)
- { StrCustomPrefix = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetPrefix(LYFZ.EnumPublic.OrderNumberPrefixType.婚庆订单).Trim(); }
- return StrCustomPrefix;
- }
- /// <summary>
- /// 填充客户层的高
- /// </summary>
- void FillClientDataPanelHeight()
- {
- if (this.panelVice1.Height < (this.tap1.Height - 12))
- {
- this.panelVice1.Height = this.tap1.Height - 12;
- this.flowPanel1.Height = this.panelVice1.Height - this.flowPanel1.Location.Y;
- }
- }
- /// <summary>
- /// 检查数据是否被修改过
- /// </summary>
- /// <returns></returns>
- bool CheckDataIsUpdate()
- {
- bool IsUpdateSaveed = false;
- if (this.OrdType == EnumPublic.OrderType.服务订单)
- { }
- else
- {
- ComboBoxTreeViewEx cmbtreevTaoXiName = OrderEx.CmbtreevTaoXi;
- if (cmbtreevTaoXiName.Tag != null)
- {
- DataRow[] dtRow0 = null;
- DataRow[] dtRow1 = null;
- DataRow[] dtRow2 = null;
- DataTable tbl0 = null;
- DataTable tbl1 = null;
- DataTable tbl2 = null;
- string ExecuteSql = "select tb_ErpPackagesGiftMerchandise.ID,Sc_ClassName,Pgm_GiveType,Pgm_IntoRegisterQuantity,Pgm_IntoBottomQuantity,Pgm_Quantity " +
- "from tb_ErpPackagesGiftMerchandise Left Join tb_ErpTheScenery on cast(tb_ErpTheScenery.ID as varchar(20)) = Pgm_ProductNumber " +
- "Left Join tb_ErpSystemCategory on Tsc_Rating = Sc_ClassCode where Pgm_GiveType in ('2','3') And Pgm_PackagesCode = '" + cmbtreevTaoXiName.Tag.ToString().Trim() + "';";
- ExecuteSql += "select tb_ErpPackagesGiftMerchandise.ID,Prod_Batch,Pgm_Quantity,Pgm_GiveType from tb_ErpPackagesGiftMerchandise " +
- "Left Join tb_ErpProduct on Prod_Number = Pgm_ProductNumber where Pgm_GiveType in ('0','1') And Pgm_PackagesCode = '" + cmbtreevTaoXiName.Tag.ToString().Trim() + "';";
- ExecuteSql += "select Pak_UnitPrice from tb_ErpPackages where Pak_PackagesID = '" + cmbtreevTaoXiName.Tag.ToString().Trim() + "';";
- DataSet dsData = orbll.GetView_Custom(ExecuteSql);
- DataTable dt0 = dsData.Tables["ds"];
- DataTable dt1 = dsData.Tables["ds1"];
- DataTable dt2 = dsData.Tables["ds2"];
- switch (this.OrdType)
- {
- case EnumPublic.OrderType.儿童订单:
- case EnumPublic.OrderType.婚纱订单:
- case EnumPublic.OrderType.写真订单:
- case EnumPublic.OrderType.婚庆订单:
- #region 判断价格
- if (dt2.Rows.Count > 0)
- {
- if (Convert.ToDecimal(dt2.Rows[0]["Pak_UnitPrice"]) != Convert.ToDecimal(this.OrderEx.TaoXiPrice))
- { IsUpdateSaveed = true; }
- }
- #endregion
- #region 判断入底入册
- switch (this.OrdType)
- {
- case EnumPublic.OrderType.写真订单:
- case EnumPublic.OrderType.婚庆订单:
- try
- {
- DataTable dt = orbll.GetView_Custom("tb_ErpPackages", StrWhere: "Pak_PackagesID = '" + cmbtreevTaoXiName.Tag.ToString().Trim() + "'", ShowColumnName: "Pak_IntoTheArchive,Pak_IntoTheBook").Tables[0];
- Hashtable htDataPackages = this.OrderEx.GetIntoRegisterAndIntoBottom();
- if (dt.Rows.Count == 0 && htDataPackages.Count > 0)
- { IsUpdateSaveed = true; }
- else if (Convert.ToInt32(dt.Rows[0]["Pak_IntoTheArchive"]) != Convert.ToInt32(htDataPackages["IntoBottom"].ToString()) || Convert.ToInt32(dt.Rows[0]["Pak_IntoTheBook"]) != Convert.ToInt32(htDataPackages["IntoRegister"].ToString()))
- { IsUpdateSaveed = true; }
- }
- catch
- { }
- break;
- }
- #endregion
- #region 商品与服务
- if (!IsUpdateSaveed)
- {
- dtRow0 = dt1.Select("Pgm_GiveType = '0'");
- tbl0 = this.OrderProductEx.GetListViewData();
- if (dtRow0.Length != tbl0.Rows.Count)
- { IsUpdateSaveed = true; }
- else if (dtRow0.Length > 0 && tbl0.Rows.Count > 0)
- {
- for (int j = 0; j < tbl0.Rows.Count; j++)
- {
- if (string.IsNullOrEmpty(tbl0.Rows[j]["PgmID"].ToString().Trim()))
- {
- IsUpdateSaveed = true;
- break;
- }
- }
- if (!IsUpdateSaveed)
- {
- for (int i = 0; i < dtRow0.Length; i++)
- {
- DataRow[] dtRow = tbl0.Select("PgmID = '" + dtRow0[i]["ID"].ToString().Trim() + "'");
- if (dtRow0.Length <= 0)
- { IsUpdateSaveed = true; }
- else
- {
- if (Convert.ToInt32(dtRow[0]["商品P数"]) != Convert.ToInt32(dtRow0[i]["Prod_Batch"]) || Convert.ToInt32(dtRow[0]["商品数量"]) != Convert.ToInt32(dtRow0[i]["Pgm_Quantity"]))
- {
- IsUpdateSaveed = true;
- break;
- }
- }
- }
- }
- }
- }
- if (!IsUpdateSaveed)
- {
- dtRow1 = dt1.Select("Pgm_GiveType = '1'");
- tbl1 = this.OrderServiceEx.GetListViewData();
- if (dtRow1.Length != tbl1.Rows.Count)
- { IsUpdateSaveed = true; }
- else if (dtRow1.Length > 0 && tbl1.Rows.Count > 0)
- {
- for (int j = 0; j < tbl1.Rows.Count; j++)
- {
- if (string.IsNullOrEmpty(tbl1.Rows[j]["PgmID"].ToString().Trim()))
- {
- IsUpdateSaveed = true;
- break;
- }
- }
- if (!IsUpdateSaveed)
- {
- for (int i = 0; i < dtRow1.Length; i++)
- {
- DataRow[] dtRow = tbl1.Select("PgmID = '" + dtRow1[i]["ID"].ToString().Trim() + "'");
- if (dtRow1.Length <= 0)
- { IsUpdateSaveed = true; }
- else
- {
- if (Convert.ToInt32(dtRow[0]["服务数量"]) != Convert.ToInt32(dtRow1[i]["Pgm_Quantity"]))
- {
- IsUpdateSaveed = true;
- break;
- }
- }
- }
- }
- }
- }
- #endregion
- #region 景点与拍摄次数
- if (!IsUpdateSaveed)
- {
- switch (this.OrdType)
- {
- case EnumPublic.OrderType.婚纱订单:
- case EnumPublic.OrderType.写真订单:
- dtRow2 = dt0.Select("Pgm_GiveType = '2'");
- tbl2 = this.OrderSightsEx.GetListViewData();
- break;
- case EnumPublic.OrderType.儿童订单:
- dtRow2 = dt0.Select("Pgm_GiveType = '3'");
- tbl2 = this.OrderStagesEx.GetListViewData();
- break;
- }
- if (dtRow2.Length != tbl2.Rows.Count)
- { IsUpdateSaveed = true; }
- else if (dtRow2.Length > 0 && tbl2.Rows.Count > 0)
- {
- for (int j = 0; j < tbl2.Rows.Count; j++)
- {
- if (string.IsNullOrEmpty(tbl2.Rows[j]["PgmID"].ToString().Trim()))
- {
- IsUpdateSaveed = true;
- break;
- }
- }
- if (!IsUpdateSaveed)
- {
- for (int i = 0; i < dtRow2.Length; i++)
- {
- DataRow[] dtRow = tbl2.Select("PgmID = '" + dtRow2[i]["ID"].ToString().Trim() + "'");
- if (dtRow2.Length <= 0)
- { IsUpdateSaveed = true; }
- else
- {
- if (dtRow[0]["拍摄级别"].ToString().Trim() != dtRow2[i]["Sc_ClassName"].ToString().Trim() || Convert.ToInt32(dtRow[0]["服装套数"]) != Convert.ToInt32(dtRow2[i]["Pgm_Quantity"]))
- {
- IsUpdateSaveed = true;
- break;
- }
- if (!IsUpdateSaveed)
- {
- switch (this.OrdType)
- {
- case EnumPublic.OrderType.儿童订单:
- 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"]))
- {
- IsUpdateSaveed = true;
- break;
- }
- break;
- }
- }
- }
- }
- }
- }
- }
- #endregion
- break;
- }
- }
- }
- return IsUpdateSaveed;
- }
- /// <summary>
- /// 保存意向
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnSaveIntent_Click(object sender, EventArgs e)
- {
- DateTime strTime = SDateTime.Now;
- string strOrderPrefix = this.GetOrderCustomPrefix();
- List<Helper.CommandInfo> clist = null;
- bool IsSaveedOK = false;
- while (!IsSaveedOK)
- {
- clist = new List<Helper.CommandInfo>();
- #region 客户资料
- LYFZ.Model.Model_ErpCustomer modelCilent = null;
- LYFZ.Model.Model_ErpCustomer modelCilentMain = null;
- LYFZ.Model.Model_ErpCustomer modelChildCilent = null;
- List<LYFZ.Model.Model_ErpCustomer> ctmlist = new List<Model.Model_ErpCustomer>();
- string CilentMainRelation = "本人";
- string ChildCilentRelation = "本人";
- List<string> ClientRelation = new List<string>();
- int ClientIndex = 1;
- foreach (Control control in this.flowPanel1.Controls)
- {
- if (control is SetCustomControls.OrderClientParentsControlsEx)
- {
- #region 如果是婚纱版,则验证并设置婚期
- string Marriage = "";
- string MarriageLunar = "";
- switch (this.OrdType)
- {
- case EnumPublic.OrderType.婚纱订单:
- case EnumPublic.OrderType.婚庆订单:
- case EnumPublic.OrderType.服务订单:
- int intMasse = this.mskMarriage.CheckDateValue(this.mskMarriage, chkMarriage);
- if (intMasse == 1) { MessageBoxCustom.Show("婚期日期日期格式输入错误"); return; }
- else if (intMasse == 2)
- { MessageBoxCustom.Show("婚期日期:" + this.mskMarriage.StrValue.Trim() + "不是公历日期,若要保存请勾上农历"); return; }
- if (this.mskMarriage.StrValue.Trim() != "")
- {
- Marriage = this.mskMarriage.StrValue.Trim();//婚期
- if (this.chkMarriage.Checked)//婚期历类
- { MarriageLunar = "1"; }
- else { MarriageLunar = "0"; }
- }
- break;
- }
- #endregion
- SetCustomControls.OrderClientParentsControlsEx tmp = (SetCustomControls.OrderClientParentsControlsEx)control;
- if (tmp.StrClientAttribute == "Man_")
- {
- #region 主要联系人
- if (this.OrdType == EnumPublic.OrderType.儿童订单)
- { CilentMainRelation = ""; }
- LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.ClientModel ClientModel = tmp.GetClientValue(ref CilentMainRelation);
- if (ClientModel == null)
- { return; }
- if (ClientModel.ID > 0)
- {
- modelCilentMain = ctbll.GetModel(ClientModel.ID);
- modelCilentMain.Cus_UpdateDateTime = strTime;
- modelCilentMain.Cus_UpdateName = strUserID;
- }
- else
- {
- modelCilentMain = new Model.Model_ErpCustomer();
- modelCilentMain.Cus_CustomerNumber = LYFZ.BLL.BLL_ErpCustomer.GetClientNumber();
- modelCilentMain.Cus_DividedShop = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID();
- modelCilentMain.Cus_CreateDateTime = strTime;
- modelCilentMain.Cus_CreateName = strUserID;
- }
- modelCilentMain.Cus_Type = "";
- modelCilentMain.Cus_Address = ClientModel.CusAddress;
- modelCilentMain.Cus_Birthday = ClientModel.CusBirthday;
- modelCilentMain.Cus_BirthdayLunar = ClientModel.CusBirthdayLunar;
- modelCilentMain.Cus_DayForMarriage = "";
- modelCilentMain.Cus_DayForMarriageLunar = "";
- switch (this.OrdType)
- {
- case EnumPublic.OrderType.婚纱订单:
- case EnumPublic.OrderType.婚庆订单:
- case EnumPublic.OrderType.服务订单:
- modelCilentMain.Cus_DayForMarriage = Marriage;
- modelCilentMain.Cus_DayForMarriageLunar = MarriageLunar;
- break;
- }
- if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.EnabledIDNumber)
- { modelCilentMain.Cus_IDNumber = ClientModel.CusIDNumber; }
- modelCilentMain.Cus_FixedPhone = ClientModel.CusFixedPhone;
- modelCilentMain.Cus_MicroSignal = ClientModel.CusMicroSignal;
- modelCilentMain.Cus_Name = ClientModel.CusName;
- modelCilentMain.Cus_NamePinyin = ClientModel.CusNamePinyin;
- modelCilentMain.Cus_QQ = ClientModel.CusQQ;
- modelCilentMain.Cus_Region = ClientModel.CusRegion;
- modelCilentMain.Cus_Relations = ClientModel.CusRelations;
- modelCilentMain.Cus_Sex = ClientModel.CusSex;
- modelCilentMain.Cus_Telephone = ClientModel.CusTelephone;
- modelCilentMain.Cus_WorkUnit = ClientModel.CusWorkUnit;
- modelCilentMain.Cus_Zodiac = ClientModel.CusZodiac;
- if (modelCilentMain.ID == 0)
- { clist.Add(ctbll.GetAddCommandInfo(modelCilentMain)); }
- else
- { clist.Add(ctbll.GetUpdateCommandInfo(modelCilentMain)); }
- #endregion
- }
- else
- {
- #region 其他联系人
- string strOtherClienRelation = "";
- LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.ClientModel ClientModel = tmp.GetClientValue(ref strOtherClienRelation);
- ClientRelation.Add(strOtherClienRelation);
- if (ClientModel == null)
- { return; }
- if (ClientModel.ID > 0)
- {
- modelCilent = ctbll.GetModel(ClientModel.ID);
- modelCilent.Cus_UpdateDateTime = strTime;
- modelCilent.Cus_UpdateName = strUserID;
- }
- else
- {
- modelCilent = new Model.Model_ErpCustomer();
- modelCilent.Cus_CustomerNumber = LYFZ.BLL.BLL_ErpCustomer.GetClientNumber();
- modelCilent.Cus_DividedShop = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID();
- modelCilent.Cus_CreateDateTime = strTime;
- modelCilent.Cus_CreateName = strUserID;
- }
- modelCilent.Cus_Type = "";
- modelCilent.Cus_Address = ClientModel.CusAddress;
- modelCilent.Cus_Birthday = ClientModel.CusBirthday;
- modelCilent.Cus_BirthdayLunar = ClientModel.CusBirthdayLunar;
- modelCilent.Cus_DayForMarriage = "";
- modelCilent.Cus_DayForMarriageLunar = "";
- switch (this.OrdType)
- {
- case EnumPublic.OrderType.婚纱订单:
- case EnumPublic.OrderType.婚庆订单:
- case EnumPublic.OrderType.服务订单:
- modelCilent.Cus_DayForMarriage = Marriage;
- modelCilent.Cus_DayForMarriageLunar = MarriageLunar;
- break;
- }
- if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.EnabledIDNumber)
- { modelCilent.Cus_IDNumber = ClientModel.CusIDNumber; }
- modelCilent.Cus_FixedPhone = ClientModel.CusFixedPhone;
- modelCilent.Cus_MicroSignal = ClientModel.CusMicroSignal;
- modelCilent.Cus_Name = ClientModel.CusName;
- modelCilent.Cus_NamePinyin = ClientModel.CusNamePinyin;
- modelCilent.Cus_QQ = ClientModel.CusQQ;
- modelCilent.Cus_Region = ClientModel.CusRegion;
- modelCilent.Cus_Relations = ClientModel.CusRelations;
- modelCilent.Cus_Sex = ClientModel.CusSex;
- modelCilent.Cus_Telephone = ClientModel.CusTelephone;
- modelCilent.Cus_WorkUnit = ClientModel.CusWorkUnit;
- modelCilent.Cus_Zodiac = ClientModel.CusZodiac;
- if (modelCilent.ID <= 0)
- { clist.Add(ctbll.GetAddCommandInfo(modelCilent)); }
- else
- { clist.Add(ctbll.GetUpdateCommandInfo(modelCilent)); }
- ctmlist.Add(modelCilent);
- #endregion
- }
- }
- if (control is SetCustomControls.OrderClientChildrenControlsEx)
- {
- #region 儿童客户
- SetCustomControls.OrderClientChildrenControlsEx tmp = (SetCustomControls.OrderClientChildrenControlsEx)control;
- LYFZ.Model.Model_ErpCustomer ChildClientModel = tmp.GetClientValue(ref ChildCilentRelation);
- if (ChildClientModel == null)
- { return; }
- if (ChildClientModel.ID > 0)
- {
- modelChildCilent = ctbll.GetModel(ChildClientModel.ID);
- modelChildCilent.Cus_UpdateDateTime = strTime;
- modelChildCilent.Cus_UpdateName = strUserID;
- }
- else
- {
- modelChildCilent = new Model.Model_ErpCustomer();
- modelChildCilent.Cus_CustomerNumber = LYFZ.BLL.BLL_ErpCustomer.GetClientNumber();
- modelChildCilent.Cus_DividedShop = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID();
- modelChildCilent.Cus_CreateDateTime = strTime;
- modelChildCilent.Cus_CreateName = strUserID;
- }
- modelChildCilent.Cus_Type = "儿童";
- modelChildCilent.Cus_Birthday = ChildClientModel.Cus_Birthday;
- modelChildCilent.Cus_BirthdayLunar = ChildClientModel.Cus_BirthdayLunar;
- modelChildCilent.Cus_Name = ChildClientModel.Cus_Name;
- modelChildCilent.Cus_NamePinyin = ChildClientModel.Cus_NamePinyin;
- modelChildCilent.Cus_Sex = ChildClientModel.Cus_Sex;
- modelChildCilent.Cus_Zodiac = ChildClientModel.Cus_Zodiac;
- if (modelChildCilent.ID == 0)
- { clist.Add(ctbll.GetAddCommandInfo(modelChildCilent)); }
- else
- { clist.Add(ctbll.GetUpdateCommandInfo(modelChildCilent)); }
- #endregion
- }
- ClientIndex++;
- }
- #endregion
- #region 订单资料
- //int IntoRegisterQuantity = 0;
- //int IntoBottomQuantity = 0;
- //int IntoRegisterQuantityPackage = 0;
- //int IntoBottomQuantityPackage = 0;
- Hashtable htData_RegisterAndBottom = new Hashtable();
- htData_RegisterAndBottom["IntoRegisterQuantity"] = 0;
- htData_RegisterAndBottom["IntoBottomQuantity"] = 0;
- htData_RegisterAndBottom["IntoRegisterQuantityPackage"] = 0;
- htData_RegisterAndBottom["IntoBottomQuantityPackage"] = 0;
- LYFZ.Model.Model_ErpOrder modelOrder = null;
- string StrLovedStyle = this.GetStyle();
- string StrCustomerSource = this.GetClientSource();
- string StrNewOrderNumber = LYFZ.BLL.BLL_ErpOrder.GenerateNewMainOrderNo(SDateTime.Now, strOrderPrefix);
- string StrOrderType = Convert.ToInt32(this.OrdType).ToString();
- bool IsOrderFind = false;
- switch (this.OrdType)
- {
- case EnumPublic.OrderType.婚纱订单:
- case EnumPublic.OrderType.儿童订单:
- case EnumPublic.OrderType.写真订单:
- case EnumPublic.OrderType.婚庆订单:
- if (this.OrderEx != null)
- {
- modelOrder = this.OrderEx.GetOrderValue(ref htData_RegisterAndBottom, StrNewOrderNumber: StrNewOrderNumber, StrOrderType: StrOrderType, StrLovedStyle: StrLovedStyle,
- StrCustomerSource: StrCustomerSource, StrClass: "0", StrInfoID: strInfoID, StrTime: strTime, StrUserID: strUserID, IsMagess: false);
- IsOrderFind = true;
- }
- break;
- case EnumPublic.OrderType.服务订单:
- if (this.ServiceOrderEx != null)
- {
- modelOrder = this.ServiceOrderEx.GetOrderValue(StrNewOrderNumber: StrNewOrderNumber, StrOrderType: StrOrderType, StrLovedStyle: StrLovedStyle, StrCustomerSource: StrCustomerSource,
- StrClass: "0", StrInfoID: strInfoID, StrTime: strTime, StrUserID: strUserID, IsMagess: false);
- IsOrderFind = true;
- }
- break;
- }
- if (!IsOrderFind)
- {
- modelOrder = new Model.Model_ErpOrder();
- modelOrder.Ord_Number = StrNewOrderNumber;
- modelOrder.Ord_SinceOrderNumber = modelOrder.Ord_Number;
- modelOrder.Ord_Type = StrOrderType;
- modelOrder.Ord_DividedShop = strInfoID;
- modelOrder.Ord_Class = "0";
- modelOrder.Ord_CustomerSource = StrCustomerSource;
- modelOrder.Ord_LovedStyle = StrLovedStyle;
- modelOrder.Ord_CreateDateTime = strTime;
- modelOrder.Ord_CreateName = strUserID;
- }
- #endregion
- #region 订单客户组
- LYFZ.Model.Model_ErpCustomerGroup modelClientGroup = null;
- if (this.OrderGroupNumber != "")
- { modelClientGroup = cgbll.GetModel("GP_CustomerGroupID", this.OrderGroupNumber); }
- else
- { modelClientGroup = cgbll.GetModel("GP_OrderNumber", modelOrder.Ord_Number); }
- string strClientSource = this.GetClientSource();
- if (strClientSource == "")
- { MessageBoxCustom.Show("请选择客户来源!"); return; }
- if (modelClientGroup.ID > 0)
- {
- modelClientGroup.GP_GroupType = 2;
- modelClientGroup.GP_CustomerType = Convert.ToInt32(this.OrdType);
- modelClientGroup.GP_OrderNumber = modelOrder.Ord_Number;
- modelClientGroup.GP_CustomerSource = strClientSource;
- modelClientGroup.GP_CustomerStatus = "意向";
- modelClientGroup.GP_UpdateDatetime = strTime;
- modelClientGroup.GP_UpdateName = strUserID;
- modelClientGroup.GP_ISIntentionCustomer = 2;
- if (this.modelFriends != null)
- { modelClientGroup.GP_IntroducerCustomerID = this.modelFriends.Cus_CustomerNumber; }
- else
- { modelClientGroup.GP_IntroducerCustomerID = ""; }
- clist.Add(cgbll.GetUpdateCommandInfo(modelClientGroup));
- }
- else
- {
- modelClientGroup = new Model.Model_ErpCustomerGroup();
- modelClientGroup.GP_DividedShop = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID();
- modelClientGroup.GP_OrderNumber = modelOrder.Ord_Number;
- modelClientGroup.GP_CustomerGroupID = LYFZ.BLL.BLL_ErpCustomer.GetNewClientGroupNumber();
- modelClientGroup.GP_GroupType = 2;
- modelClientGroup.GP_CustomerType = Convert.ToInt32(this.OrdType);
- modelClientGroup.GP_CustomerStatus = "意向";
- modelClientGroup.GP_LossReason = "";
- modelClientGroup.GP_DegreeOfIntent = "";
- modelClientGroup.GP_CustomerSource = strClientSource;
- if (this.modelFriends != null)
- { modelClientGroup.GP_IntroducerCustomerID = this.modelFriends.Cus_CustomerNumber; }
- else
- { modelClientGroup.GP_IntroducerCustomerID = ""; }
- modelClientGroup.GP_Remark = "";
- modelClientGroup.GP_BelongsPersonID = strUserID;
- modelClientGroup.GP_CreateDatetime = strTime;
- modelClientGroup.GP_CreateName = strUserID;
- modelClientGroup.GP_ISIntentionCustomer = 2;
- clist.Add(cgbll.GetAddCommandInfo(modelClientGroup));
- }
- #endregion
- #region 客户成员组
- LYFZ.Model.Model_ErpCustomerGroupMembers modelGroupMember = null;
- List<LYFZ.Model.Model_ErpCustomerGroupMembers> Gmlist = cgmbll.GetModelList("GM_CustomerGroupID='" + modelClientGroup.GP_CustomerGroupID + "'");
- List<LYFZ.Model.Model_ErpCustomer> ctmlistGroup = ctmlist;
- List<string> ClientRelationGroup = ClientRelation;
- if (Gmlist.Count > 0)
- {
- if (modelChildCilent != null)
- {
- bool IsBl = true;
- for (int i = 0; i < Gmlist.Count; i++)
- {
- if (Gmlist[i].GM_CustomerID.Trim() == modelChildCilent.Cus_CustomerNumber)
- {
- modelGroupMember = Gmlist[i];
- modelGroupMember.GM_Master = 0;
- modelGroupMember.GM_Relation = ChildCilentRelation;
- clist.Add(cgmbll.GetUpdateCommandInfo(modelGroupMember));
- IsBl = false;
- Gmlist.RemoveAt(i);
- break;
- }
- }
- if (IsBl)
- {
- modelGroupMember = new Model.Model_ErpCustomerGroupMembers();
- modelGroupMember.GM_DividedShop = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID();
- modelGroupMember.GM_CustomerGroupID = modelClientGroup.GP_CustomerGroupID;
- modelGroupMember.GM_CustomerID = modelChildCilent.Cus_CustomerNumber;
- modelGroupMember.GM_Master = 0;
- modelGroupMember.GM_ProtagonistCustomer = 1;
- modelGroupMember.GM_RelatedPersonID = modelChildCilent.Cus_CustomerNumber;
- modelGroupMember.GM_Relation = ChildCilentRelation;
- clist.Add(cgmbll.GetAddCommandInfo(modelGroupMember));
- }
- }
- if (modelCilentMain != null)
- {
- bool IsBl = true;
- for (int i = 0; i < Gmlist.Count; i++)
- {
- if (Gmlist[i].GM_CustomerID.Trim() == modelCilentMain.Cus_CustomerNumber)
- {
- modelGroupMember = Gmlist[i];
- modelGroupMember.GM_Master = 1;
- switch (this.OrdType)
- {
- case EnumPublic.OrderType.儿童订单:
- modelGroupMember.GM_RelatedPersonID = modelChildCilent.Cus_CustomerNumber;
- modelGroupMember.GM_ProtagonistCustomer = 0;
- break;
- default:
- modelGroupMember.GM_RelatedPersonID = modelCilentMain.Cus_CustomerNumber;
- modelGroupMember.GM_ProtagonistCustomer = 1;
- break;
- }
- modelGroupMember.GM_Relation = CilentMainRelation;
- clist.Add(cgmbll.GetUpdateCommandInfo(modelGroupMember));
- IsBl = false;
- Gmlist.RemoveAt(i);
- break;
- }
- }
- if (IsBl)
- {
- modelGroupMember = new Model.Model_ErpCustomerGroupMembers();
- modelGroupMember.GM_DividedShop = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID();
- modelGroupMember.GM_CustomerGroupID = modelClientGroup.GP_CustomerGroupID;
- modelGroupMember.GM_CustomerID = modelCilentMain.Cus_CustomerNumber;
- modelGroupMember.GM_Master = 1;
- switch (this.OrdType)
- {
- case EnumPublic.OrderType.儿童订单:
- modelGroupMember.GM_RelatedPersonID = modelChildCilent.Cus_CustomerNumber;
- modelGroupMember.GM_ProtagonistCustomer = 0;
- break;
- default:
- modelGroupMember.GM_RelatedPersonID = modelCilentMain.Cus_CustomerNumber;
- modelGroupMember.GM_ProtagonistCustomer = 1;
- break;
- }
- modelGroupMember.GM_Relation = CilentMainRelation;
- clist.Add(cgmbll.GetAddCommandInfo(modelGroupMember));
- }
- }
- for (int i = 0; i < Gmlist.Count; i++)
- {
- bool IsBl = true;
- for (int j = 0; j < ctmlistGroup.Count; j++)
- {
- if (Gmlist[i].GM_CustomerID == ctmlistGroup[j].Cus_CustomerNumber)
- {
- modelGroupMember = Gmlist[i];
- switch (this.OrdType)
- {
- case EnumPublic.OrderType.儿童订单:
- modelGroupMember.GM_RelatedPersonID = modelChildCilent.Cus_CustomerNumber;
- modelGroupMember.GM_ProtagonistCustomer = 0;
- break;
- default:
- modelGroupMember.GM_RelatedPersonID = modelCilentMain.Cus_CustomerNumber;
- modelGroupMember.GM_ProtagonistCustomer = 1;
- break;
- }
- modelGroupMember.GM_Master = 0;
- modelGroupMember.GM_Relation = ClientRelationGroup[j].Trim();
- clist.Add(cgmbll.GetUpdateCommandInfo(modelGroupMember));
- ctmlistGroup.RemoveAt(j);
- ClientRelationGroup.RemoveAt(j);
- IsBl = false;
- }
- }
- if (IsBl)
- { clist.Add(cgmbll.GetDeleteCommandInfo("ID", "=", Gmlist[i].ID)); }
- }
- }
- else
- {
- switch (this.OrdType)
- {
- case EnumPublic.OrderType.儿童订单:
- modelGroupMember = new Model.Model_ErpCustomerGroupMembers();
- modelGroupMember.GM_DividedShop = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID();
- modelGroupMember.GM_CustomerGroupID = modelClientGroup.GP_CustomerGroupID;
- modelGroupMember.GM_CustomerID = modelChildCilent.Cus_CustomerNumber;
- modelGroupMember.GM_Master = 0;
- modelGroupMember.GM_ProtagonistCustomer = 1;
- modelGroupMember.GM_RelatedPersonID = modelChildCilent.Cus_CustomerNumber;
- modelGroupMember.GM_Relation = ChildCilentRelation;
- clist.Add(cgmbll.GetAddCommandInfo(modelGroupMember));
- modelGroupMember = new Model.Model_ErpCustomerGroupMembers();
- modelGroupMember.GM_DividedShop = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID();
- modelGroupMember.GM_CustomerGroupID = modelClientGroup.GP_CustomerGroupID;
- modelGroupMember.GM_CustomerID = modelCilentMain.Cus_CustomerNumber;
- modelGroupMember.GM_Master = 1;
- modelGroupMember.GM_ProtagonistCustomer = 0;
- modelGroupMember.GM_RelatedPersonID = modelChildCilent.Cus_CustomerNumber;
- modelGroupMember.GM_Relation = CilentMainRelation;
- clist.Add(cgmbll.GetAddCommandInfo(modelGroupMember));
- break;
- default:
- modelGroupMember = new Model.Model_ErpCustomerGroupMembers();
- modelGroupMember.GM_DividedShop = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID();
- modelGroupMember.GM_CustomerGroupID = modelClientGroup.GP_CustomerGroupID;
- modelGroupMember.GM_CustomerID = modelCilentMain.Cus_CustomerNumber;
- modelGroupMember.GM_Master = 1;
- modelGroupMember.GM_ProtagonistCustomer = 1;
- modelGroupMember.GM_RelatedPersonID = modelCilentMain.Cus_CustomerNumber;
- modelGroupMember.GM_Relation = CilentMainRelation;
- clist.Add(cgmbll.GetAddCommandInfo(modelGroupMember));
- break;
- }
- }
- for (int i = 0; i < ctmlistGroup.Count; i++)
- {
- modelGroupMember = new Model.Model_ErpCustomerGroupMembers();
- modelGroupMember.GM_DividedShop = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID();
- modelGroupMember.GM_CustomerGroupID = modelClientGroup.GP_CustomerGroupID;
- modelGroupMember.GM_CustomerID = ctmlistGroup[i].Cus_CustomerNumber;
- modelGroupMember.GM_Master = 0;
- modelGroupMember.GM_Relation = ClientRelationGroup[i].Trim();
- switch (this.OrdType)
- {
- case EnumPublic.OrderType.儿童订单:
- modelGroupMember.GM_RelatedPersonID = modelChildCilent.Cus_CustomerNumber;
- modelGroupMember.GM_ProtagonistCustomer = 0;
- break;
- default:
- modelGroupMember.GM_RelatedPersonID = modelCilentMain.Cus_CustomerNumber;
- modelGroupMember.GM_ProtagonistCustomer = 1;
- break;
- }
- clist.Add(cgmbll.GetAddCommandInfo(modelGroupMember));
- }
- #endregion
- #region 订单人员表
- if (this.txtOrderPerson.Text.Trim() == "")
- { MessageBoxCustom.Show("接单人员不能为空!"); return; }
- string[] StrValue = txtOrderPerson.Tag.ToString().Trim().Split('|')[0].Trim().Split(',');
- string[] StrTag = txtOrderPerson.Tag.ToString().Trim().Split('|')[1].Trim().Split(',');
- DataTable dtList = orbll.GetView_Custom("tb_ErpOrdersPerson", StrWhere: "OrdPe_OrderNumber='" + modelOrder.Ord_Number + "'", ShowColumnName: "*", filedOrder: "OrdPe_Type ASC").Tables[0];// orpbll.GetModelList("OrdPe_OrderNumber='" + modelOrder.Ord_Number + "'");
- //List<LYFZ.Model.Model_ErpOrdersPerson> nmlist = orpbll.GetModelList("OrdPe_OrderNumber='" + modelOrder.Ord_Number + "'");
- LYFZ.Model.Model_ErpOrdersPerson modelPerson = null;
- ArrayList Removelist = new ArrayList();
- for (int i = 0; i < StrValue.Length; i++)
- {
- bool IsFind = false;
- for (int j = 0; j < dtList.Rows.Count; j++)
- {
- if (dtList.Rows[j]["OrdPe_OrdersPerson"].ToString().Trim() == StrValue[i].Trim())
- {
- IsFind = true;
- modelPerson = orpbll.DataRowToModel(dtList.Rows[j]);
- modelPerson.OrdPe_Type = StrTag[i].Trim();
- modelPerson.OrdPe_UpdateDateTime = strTime;
- modelPerson.OrdPe_UpdateName = strUserID;
- clist.Add(orpbll.GetUpdateCommandInfo(modelPerson));
- dtList.Rows.Remove(dtList.Rows[j]);
- break;
- }
- }
- if (!IsFind)
- {
- modelPerson = new Model.Model_ErpOrdersPerson();
- modelPerson.OrdPe_OrderNumber = modelOrder.Ord_Number;
- modelPerson.OrdPe_OrdersPerson = StrValue[i].Trim();
- modelPerson.OrdPe_Type = StrTag[i].Trim();
- modelPerson.OrdPe_CreateDateTime = strTime;
- modelPerson.OrdPe_CreateName = strUserID;
- clist.Add(orpbll.GetAddCommandInfo(modelPerson));
- }
- }
- for (int i = 0; i < dtList.Rows.Count; i++)
- { clist.Add(orpbll.GetDeleteCommandInfo("ID", "=", dtList.Rows[i]["ID"].ToString().Trim())); }
- modelOrder.Ord_OrderPersonNumber = txtOrderPerson.Tag.ToString().Trim().Split('|')[0].Trim();
- modelOrder.Ord_OrderPersonName = txtOrderPerson.Text.Trim();
- //if (this.txtOrderPerson.Text.Trim() == "")
- //{ MessageBoxCustom.Show("接单人员不能为空!"); return; }
- //string[] StrValue = txtOrderPerson.Tag.ToString().Trim().Split('|')[0].Trim().Split(',');
- //string[] StrTag = txtOrderPerson.Tag.ToString().Trim().Split('|')[1].Trim().Split(',');
- //List<LYFZ.Model.Model_ErpOrdersPerson> nmlist = orpbll.GetModelList("OrdPe_OrderNumber='" + modelOrder.Ord_Number + "'");
- //LYFZ.Model.Model_ErpOrdersPerson modelPerson = null;
- //ArrayList Removelist = new ArrayList();
- //for (int i = 0; i < nmlist.Count; i++)
- //{
- // bool isbl = true;
- // for (int k = 0; k < StrValue.Length; k++)
- // {
- // if (nmlist[i].OrdPe_OrdersPerson.Trim() == StrValue[k].Trim())//说明有
- // {
- // if (nmlist[i].OrdPe_Type.Trim() != StrTag[k].Trim())
- // {
- // modelPerson = nmlist[i];
- // modelPerson.OrdPe_Type = StrTag[k].Trim();
- // modelPerson.OrdPe_UpdateDateTime = strTime;
- // modelPerson.OrdPe_UpdateName = strUserID;
- // clist.Add(orpbll.GetUpdateCommandInfo(modelPerson));
- // }
- // Removelist.Add(k);
- // isbl = false;
- // break;
- // }
- // }
- // if (isbl)
- // { clist.Add(orpbll.GetDeleteCommandInfo("ID", "=", nmlist[i].ID)); }
- //}
- //for (int l = 0; l < Removelist.Count; l++)
- //{
- // List<string> a = StrValue.ToList();
- // a.RemoveAt(l);
- // StrValue = a.ToArray();
- // List<string> b = StrTag.ToList();
- // b.RemoveAt(l);
- // StrTag = b.ToArray();
- // Removelist.RemoveAt(l);
- // l--;
- //}
- //for (int k = 0; k < StrValue.Length; k++)
- //{
- // modelPerson = new Model.Model_ErpOrdersPerson();
- // modelPerson.OrdPe_OrderNumber = modelOrder.Ord_Number;
- // modelPerson.OrdPe_OrdersPerson = StrValue[k].Trim();
- // modelPerson.OrdPe_Type = StrTag[k].Trim();
- // modelPerson.OrdPe_CreateDateTime = strTime;
- // modelPerson.OrdPe_CreateName = strUserID;
- // clist.Add(orpbll.GetAddCommandInfo(modelPerson));
- //}
- #endregion
- #region 景点与阶段资料
- Hashtable htGroupList = new Hashtable();
- List<LYFZ.Model.Model_ErpOrdersPhotography> plist = new List<Model.Model_ErpOrdersPhotography>();
- List<LYFZ.Model.Model_ErpOrdersPhotography> pmlist = new List<Model.Model_ErpOrdersPhotography>();
- switch (this.OrdType)
- {
- case EnumPublic.OrderType.婚纱订单:
- case EnumPublic.OrderType.写真订单:
- if (this.OrderSightsEx != null)
- {
- bool IsContinueA = false;
- List<Helper.CommandInfo> mClistA = this.OrderSightsEx.GetOrderSightsValue(htData_RegisterAndBottom, modelOrder.Ord_Number, strTime, ref IsContinueA, IsMagess: false);
- if (!IsContinueA)
- { clist.AddRange(mClistA); }
- }
- break;
- case EnumPublic.OrderType.儿童订单:
- if (this.OrderStagesEx != null)
- {
- bool IsContinueB = false;
- List<Helper.CommandInfo> mClistB = OrderStagesEx.GetOrderStagesValue(modelOrder.Ord_Number, strTime, ref IsContinueB, ref htGroupList, IsMagess: false);
- if (!IsContinueB)
- { clist.AddRange(mClistB); }
- }
- break;
- }
- #endregion
- #region 订单数码
- switch (this.OrdType)
- {
- case EnumPublic.OrderType.服务订单:
- case EnumPublic.OrderType.婚庆订单:
- DataTable dt = orbll.GetView_Custom("tb_ErpOrderDigital", StrWhere: "Ordv_Number = '" + modelOrder.Ord_Number + "'", ShowColumnName: "ID").Tables[0];
- if (dt.Rows.Count <= 0)
- {
- LYFZ.Model.Model_ErpOrderDigital ViceModel = new Model.Model_ErpOrderDigital();
- ViceModel.Ordv_Number = modelOrder.Ord_Number;
- ViceModel.Ordv_ViceNumber = ViceModel.Ordv_Number + "_001";
- ViceModel.Ordv_DigitalNumber = 1;
- ViceModel.Ordv_IntoRegisterQuantity = 0;
- ViceModel.Ordv_IntoBottomQuantity = 0;
- ViceModel.Ordv_IntoRegisterQuantityPackage = 0;
- ViceModel.Ordv_IntoBottomQuantityPackage = 0;
- ViceModel.Ordv_IntoBottomAddPickQuantity = 0;
- ViceModel.Ordv_IntoRegisterAddPickQuantity = 0;
- ViceModel.Ordv_ClothingDispatcher = "";
- ViceModel.Ordv_ClothingName = "";
- ViceModel.Ordv_ClothingRemark = "";
- ViceModel.Ordv_ClothingStatus = "0";
- ViceModel.Ordv_DesignerDispatcher = "";
- ViceModel.Ordv_DesignerName = "";
- ViceModel.Ordv_DesignerStatus = "0";
- ViceModel.Ordv_DesignValidation = "";
- ViceModel.Ordv_EarlyRepairDispatcher = "";
- ViceModel.Ordv_EarlyRepairName = "";
- ViceModel.Ordv_EarlyRepairStatus = "0";
- ViceModel.Ordv_FilmSelectionDispatcher = "";
- ViceModel.Ordv_FilmSelectionName = "";
- ViceModel.Ordv_FilmSelectionStatus = "0";
- ViceModel.Ordv_LookDesignClaim = "";
- ViceModel.Ordv_LookDesignDispatcher = "";
- ViceModel.Ordv_LookDesignName = "";
- ViceModel.Ordv_LookDesignStatus = "0";
- ViceModel.Ordv_RefinementDispatcher = "";
- ViceModel.Ordv_RefinementName = "";
- ViceModel.Ordv_RefinementStatus = "0";
- ViceModel.Ordv_ReservationClothingName = "";
- ViceModel.Ordv_ReservationDesignerName = "";
- ViceModel.Ordv_ReservationEarlyRepairName = "";
- ViceModel.Ordv_ReservationFilmSelectionName = "";
- ViceModel.Ordv_ReservationLookDesignName = "";
- ViceModel.Ordv_ReservationRefinementName = "";
- ViceModel.Ordv_ReservationSendPhotoName = "";
- ViceModel.Ordv_ReservationSendPhotoStatus = "0";
- ViceModel.Ordv_SelectionDesign = "";
- ViceModel.Ordv_SelectionFilm = "";
- ViceModel.Ordv_UpdateName = "";
- ViceModel.Ordv_CreateDatetime = strTime;
- ViceModel.Ordv_CreateName = strUserID;
- clist.Add(odbll.GetAddCommandInfo(ViceModel));
- LYFZ.Model.Model_ErpOrderDigitalStatus modelStatus = new Model.Model_ErpOrderDigitalStatus();
- modelStatus.Ords_Number = "ORDS_" + LYFZ.BLL.BLL_ErpCustomer.GetClientNumber();
- modelStatus.Ords_OrdNumber = ViceModel.Ordv_Number;
- modelStatus.Ords_ViceNumber = ViceModel.Ordv_ViceNumber;
- modelStatus.Ords_DigitalNumber = ViceModel.Ordv_DigitalNumber;
- modelStatus.Ords_OutSendEarlyRepairName = "";
- modelStatus.Ords_OutSendEarlyRepairQuantity = 0;
- modelStatus.Ords_OutSendEarlyRepairStatus = "未发";
- modelStatus.Ords_OutSendEarlyRepairVendor = "";
- modelStatus.Ords_OutSendEarlyRepairVendorQQ = "";
- modelStatus.Ords_PhotographStatus = "未拍";
- modelStatus.Ords_PhotographIntStatus = 0;
- modelStatus.Ords_SightsName = "";
- modelStatus.Ords_Photographer = "";
- modelStatus.Ords_PhotographyAssistant = "";
- modelStatus.Ords_MakeupArtist = "";
- modelStatus.Ords_MakeupAssistant = "";
- modelStatus.Ords_BootDivision = "";
- modelStatus.Ords_BootDivisionAssistant = "";
- modelStatus.Ords_ProductSendStatus = "未发";
- modelStatus.Ords_ProductCompletedStatus = "未完";
- modelStatus.Ords_ProductPickupStatus = "未取";
- modelStatus.Ords_ProductPickupIntStatus = 0;
- modelStatus.Ords_ProductIsExpedited = "否";
- modelStatus.Ords_ServiceStatus = "未进行";
- modelStatus.Ords_ServiceIntStatus = 0;
- clist.Add(orsbll.GetAddCommandInfo(modelStatus));
- }
- break;
- }
- #endregion
- #region 套系服务
- if (this.OrderServiceEx != null)
- {
- bool IsServiceContinue = false;
- List<Helper.CommandInfo> AddServiceclist = this.OrderServiceEx.GetOrderServiceValue(strTime, ref IsServiceContinue, modelOrder.Ord_Number, Marriage: "", htGroupList: htGroupList);
- if (!IsServiceContinue)
- { clist.AddRange(AddServiceclist); }
- }
- #endregion
- #region 套系商品
- if (this.OrderEx != null)
- {
- if (this.OrderProductEx != null)
- {
- string StrCode = "";
- ComboBoxTreeViewEx cmbtreevTaoXiName = OrderEx.CmbtreevTaoXi;
- if (cmbtreevTaoXiName.Tag != null)
- { StrCode = cmbtreevTaoXiName.Tag.ToString().Trim(); }
- bool IsContinue = false;
- List<Helper.CommandInfo> AddProductclist = this.OrderProductEx.GetOrderProductValue(strTime, ref IsContinue, modelOrder.Ord_Number, htGroupList, StrCode, IsMagess: false);
- if (!IsContinue)
- { clist.AddRange(AddProductclist); }
- }
- }
- #endregion
- #region 保存订单
- if (modelOrder.ID > 0)
- { clist.Add(orbll.GetUpdateCommandInfo(modelOrder)); }
- else
- { clist.Add(orbll.GetAddCommandInfo(modelOrder)); }
- #endregion
- #region 写日志
- string StrContent = "";
- LYFZ.EnumPublic.SystemLogsType SysType;
- if (modelOrder.ID > 0)
- {
- SysType = LYFZ.EnumPublic.SystemLogsType.修改订单;
- StrContent = "[修改为意向订单] 订单号为:" + modelOrder.Ord_Number + ";接单人员为:" + this.txtOrderPerson.Text.Trim() + ";订单类别为:" + modelOrder.Ord_OrderClass + ";套系名称为:" + modelOrder.Ord_SeriesName + ";套系价格为:" + modelOrder.Ord_SeriesPrice;
- }
- else
- {
- SysType = LYFZ.EnumPublic.SystemLogsType.新开订单;
- StrContent = "[新开意向订单] 订单号为:" + modelOrder.Ord_Number + ";接单人员为:" + this.txtOrderPerson.Text.Trim() + ";订单类别为:" + modelOrder.Ord_OrderClass + ";套系名称为:" + modelOrder.Ord_SeriesName + ";套系价格为:" + modelOrder.Ord_SeriesPrice;
- }
- clist.Add(slogbll.GetAddCommandInfo(LYFZ.BLL.BLL_ErpSystemLogs.GetWriteLogModel(SysType, StrContent, strUserID, StrUserName, LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.User_IP)));
- #endregion
- #region 办理会员卡
- //办理介绍人的
- if (modelClientGroup.GP_IntroducerCustomerID != "")
- {
- LYFZ.Model.Model_ErpMemberCard modelMc2 = mcbll.GetModel("Mc_CustomerNumber", modelClientGroup.GP_IntroducerCustomerID);
- if (modelMc2.ID <= 0)
- {
- LYFZ.Model.Model_ErpSystemConfigure sgModel = LYFZ.BLL.OrderPayment_Member.GetNewMenberNumber(1);
- clist.Add(sgbll.GetUpdateCommandInfo(sgModel));
- modelMc2 = new Model.Model_ErpMemberCard();
- modelMc2.Mc_DividedShop = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID();
- modelMc2.Mc_Number = sgModel.Sconfig_Value;
- if (!string.IsNullOrEmpty(this.StrReferralsMemberCardNumber))
- {
- modelMc2.Mc_CradNumber = this.StrReferralsMemberCardNumber;
- #region 打开管理界面
- LYFZ.Model.Model_ErpMemberCardInterfaceManagement Modelmcim = mcimbll.GetModel("Mcim_Number", modelMc2.Mc_Number);
- if (Modelmcim.ID <= 0)
- {
- DataTable newdtb = new DataTable();
- newdtb.Columns.Add("Points", typeof(bool));
- newdtb.Columns.Add("StoredValue", typeof(bool));
- newdtb.Columns.Add("BackCash", typeof(bool));
- newdtb.Columns.Add("Service", typeof(bool));
- newdtb.Columns.Add("NewTaken", typeof(bool));
- DataRow newRow = newdtb.NewRow();
- newRow["Points"] = "True";
- newRow["StoredValue"] = "True";
- newRow["BackCash"] = "False";
- newRow["Service"] = "False";
- newRow["NewTaken"] = "False";
- newdtb.Rows.Add(newRow);
- Modelmcim = new Model.Model_ErpMemberCardInterfaceManagement();
- Modelmcim.Mcim_Number = modelMc2.Mc_Number;
- Modelmcim.Mcim_InterfaceName = new Json.JsontoDataTable().toJson(newdtb);
- Modelmcim.Mcim_UpdateDatetime = strTime;
- Modelmcim.Mcim_UpdateName = strUserID;
- clist.Add(mcimbll.GetAddCommandInfo(Modelmcim));
- }
- #endregion
- }
- else
- { modelMc2.Mc_CradNumber = ""; }
- modelMc2.Mc_CustomerNumber = modelClientGroup.GP_IntroducerCustomerID;
- //modelMc2.Mc_CardType = "积分卡";
- modelMc2.Mc_CardType = "无";
- modelMc2.Mc_TotalMoney = 0;
- modelMc2.Mc_Money = 0;
- modelMc2.Mc_TraderPassword = "";
- modelMc2.Mc_UsedNumber = "";
- modelMc2.Mc_Status = "1";
- if (modelOrder.ID <= 0)
- { modelMc2.Mc_OpenCardSource = "订单介绍保存," + new System.Diagnostics.StackTrace(new System.Diagnostics.StackFrame(true)).ToString(); }
- else
- { modelMc2.Mc_OpenCardSource = "订单介绍修改," + new System.Diagnostics.StackTrace(new System.Diagnostics.StackFrame(true)).ToString(); }
- modelMc2.Mc_Remark = "";
- modelMc2.Mc_CreateDatetime = strTime;
- modelMc2.Mc_CreateName = strUserID;
- modelMc2.Mc_TouchAccount = 0;
- modelMc2.Mc_TotalTouchAccount = 0;
- clist.Add(mcbll.GetAddCommandInfo(modelMc2));
- }
- }
- #endregion
- #region 修改介绍的电话号码
- if (!string.IsNullOrEmpty(this.StrReferralsClientPhone.Trim()))
- {
- clist.Add(ctbll.GetUpdateCommandInfo(this.modelFriends));
- }
- #endregion
- if (clist.Count > 0)
- {
- #region 保存前检测订单号
- if (modelOrder.ID <= 0)
- {
- DataTable tbl = orbll.GetView_Custom("tb_ErpOrder", StrWhere: "Ord_Number = '" + modelOrder.Ord_Number + "'", ShowColumnName: "Ord_Number").Tables[0];
- if (tbl.Rows.Count > 0)
- {
- //if (strOrderPrefix != "")
- //{ tbl = orbll.GetView_Custom("tb_ErpOrder", StrWhere: "Ord_Number like '" + strOrderPrefix + "%'", filedOrder: " Ord_Number DESC", ShowColumnName: "Ord_Number", TopCount: 1).Tables[0]; }
- //else
- //{ tbl = orbll.GetView_Custom("tb_ErpOrder", filedOrder: " Ord_Number DESC", ShowColumnName: "Ord_Number", TopCount: 1).Tables[0];
- //}
- //if (tbl.Rows.Count > 0)
- //{
- #region 刘工 2017-03-26 修改
- LYFZ.BLL.BLL_ErpOrder.UpdateOrderNumberRecord(modelOrder.Ord_Number, strUserID, SDateTime.Now);
- #endregion
- /*string strUpdateNumber = modelOrder.Ord_Number;
- if (tbl.Rows[0]["Ord_Number"].ToString().Trim() == modelOrder.Ord_Number)
- { strUpdateNumber = tbl.Rows[0]["Ord_Number"].ToString().Trim(); }
- DataTable tbl2 = ornrbll.GetList("Ornr_OrderDate = '" + Convert.ToDateTime(SDateTime.Now.ToString("yyyy-MM-dd")).ToString("yyyy-MM-dd HH:mm:ss") + "'").Tables[0];
- LYFZ.Model.Model_ErpOrderNumberRecord modelrecotd = null;
- if (tbl2.Rows.Count > 0)
- {
- modelrecotd = ornrbll.DataTableToList(tbl2)[0];
- modelrecotd.Ornr_OrderCount = modelrecotd.Ornr_OrderCount + 1;
- modelrecotd.Ornr_LastNumber = strUpdateNumber;
- modelrecotd.Ornr_UpdateDateTime = strTime;
- modelrecotd.Ornr_UpdateName = strUserID;
- ornrbll.Update(modelrecotd);
- }
- else
- {
- modelrecotd = new Model.Model_ErpOrderNumberRecord();
- modelrecotd.Ornr_LastNumber = strUpdateNumber;
- modelrecotd.Ornr_OrderCount = 1;
- modelrecotd.Ornr_CreateDateTime = strTime;
- modelrecotd.Ornr_CreateName = strUserID;
- ornrbll.Add(modelrecotd);
- }*/
- //MessageBoxCustom.Show("此订单号已被占用,请重新保存!"); return;
- IsSaveedOK = false;
- //}
- //else
- //{ IsSaveedOK = true; }
- }
- else
- { IsSaveedOK = true; }
- }
- else
- { IsSaveedOK = true; }
- #endregion
- if (IsSaveedOK)
- {
- #region 修改最后订单号的记录
- /* if (modelOrder.ID <= 0)
- {
- LYFZ.Model.Model_ErpOrderNumberRecord modelNR = ornrbll.GetModel("Ornr_OrderDate", Convert.ToDateTime(strTime.ToString("yyyy-MM-dd")).ToString("yyyy-MM-dd HH:mm:ss"));
- if (modelNR.ID <= 0)
- {
- modelNR.Ornr_LastNumber = modelOrder.Ord_Number;
- modelNR.Ornr_OrderCount = 1;
- modelNR.Ornr_OrderDate = Convert.ToDateTime(strTime.ToString("yyyy-MM-dd"));
- modelNR.Ornr_CreateDateTime = strTime;
- modelNR.Ornr_CreateName = strUserID;
- clist.Add(ornrbll.GetAddCommandInfo(modelNR));
- }
- else
- {
- modelNR.Ornr_LastNumber = modelOrder.Ord_Number;
- modelNR.Ornr_OrderCount = modelNR.Ornr_OrderCount + 1;
- modelNR.Ornr_UpdateDateTime = strTime;
- modelNR.Ornr_UpdateName = strUserID;
- clist.Add(ornrbll.GetUpdateCommandInfo(modelNR));
- }
- }*/
- #endregion
- if (MessageBoxCustom.Show("确定要保存为意向订单吗?", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.No)
- { return; }
- if (LYFZ.BLL.BaseBllOperate.ExecuteSqlTran(clist) > 0)
- {
- #region 刘工 2017-03-26 修改
- if (modelOrder.ID <= 0)
- {
- LYFZ.BLL.BLL_ErpOrder.UpdateOrderNumberRecord(modelOrder.Ord_Number, strUserID, SDateTime.Now);
- }
- #endregion
- this.StrNumber = modelOrder.Ord_Number;
- this.IsSaveed = true;
- switch (this.OrdType)
- {
- case EnumPublic.OrderType.婚纱订单:
- case EnumPublic.OrderType.儿童订单:
- case EnumPublic.OrderType.写真订单:
- case EnumPublic.OrderType.婚庆订单:
- if (this.OrderEx != null)
- { this.OrderEx.SetOrderValue(orbll.GetModel(modelOrder.Ord_Number)); }
- break;
- case EnumPublic.OrderType.服务订单:
- if (this.ServiceOrderEx != null)
- { this.ServiceOrderEx.SetOrderValue(orbll.GetModel(modelOrder.Ord_Number)); }
- break;
- }
- this.IsUpdateOrderLoad = true;
- LYFZ.DAL.DAL_ErpCustomer.UpdateAggregationCustomer(this.StrNumber);
- if (modelOrder.Ord_Number.Trim().Length > 0)
- { LYFZ.BLL.BLL_ErpOrderDigitalStatus.UpdateDigitalStatus(modelOrder.Ord_Number, LYFZ.EnumPublic.OrderDigitalStatusEnum.开单); }
- this.OpenSingleLoad();
- MessageBoxCustom.Show("保存成功!");
- }
- else
- { MessageBoxCustom.Show("保存失败!"); }
- IsSaveedOK = true;
- }
- }
- }
- }
- /// <summary>
- /// 保存
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnSave_Click(object sender, EventArgs e)
- {
-
- #region 检查授权
- if (this.StrNumber.Trim() == "")
- {
- if (!LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.NewOrder))
- {
- if (!this.IsSaveedHadAuthorized)
- {
- bool IsCheckDataIsUpdate = this.CheckDataIsUpdate();
- string strWindowText = "开订单";
- if (IsCheckDataIsUpdate)
- { strWindowText += "、修改新订单"; }
- LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.AuthorizeLoginSuperSmallForm frm = new SuperSmallForm.AuthorizeLoginSuperSmallForm("StoresOPenSingle", LYFZ.CustomAttributes.OperatingAuthority.NewOrder);
- frm.StrWindowText = strWindowText;
- frm.ShowDialog();
- if (!frm.IsSaveed)
- { return; }
- else if (!LYFZ.BLL.BLL_ErpUser.GetRights(frm.CurrentAuthorizeUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.NewOrder, frm.User_BelongRoles))
- {
- frm.SetAuthorizationResult(String.Format("授权失败,授权人没有'开订单'权限"));
- MessageBoxCustom.Show("对不起!授权帐号:" + frm.StrUserAccount + "没有'开订单'权限。"); return; }
- else {
- frm.SetAuthorizationResult();
- }
- this.dec_OrderDiscounts = frm.CurrentAuthorizeUserRights.GetOrderDiscounts(Convert.ToInt32(this.OrdType));
- #region 检测套系是否被修改过
- if (IsCheckDataIsUpdate)
- {
- if (!LYFZ.BLL.BLL_ErpUser.GetRights(frm.CurrentAuthorizeUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.ModifyNewOrder, frm.User_BelongRoles))
- {
- frm.SetAuthorizationResult(String.Format("授权失败,授权人没有'修改新订单'权限"));
- MessageBoxCustom.Show("对不起!授权帐号:" + frm.StrUserAccount + "没有'修改新订单'权限。"); return; }
- else {
- frm.SetAuthorizationResult();
- }
- }
- #endregion
- }
- }
- else
- {
- #region 检测套系是否被修改过
- if (!LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.ModifyNewOrder))
- {
- if (this.CheckDataIsUpdate())
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.AuthorizeLoginSuperSmallForm frm = new SuperSmallForm.AuthorizeLoginSuperSmallForm("StoresOPenSingle", LYFZ.CustomAttributes.OperatingAuthority.ModifyNewOrder);
- frm.StrWindowText = "修改新订单";
- frm.ShowDialog();
- if (!frm.IsSaveed)
- { return; }
- else if (!LYFZ.BLL.BLL_ErpUser.GetRights(frm.CurrentAuthorizeUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.ModifyNewOrder, frm.User_BelongRoles))
- {
- frm.SetAuthorizationResult(String.Format("授权失败,授权人没有'修改新订单'权限"));
- MessageBoxCustom.Show("对不起!授权帐号:" + frm.StrUserAccount + "没有'修改新订单'权限。"); return;
- }
- else {
- frm.SetAuthorizationResult();
- }
- }
- }
- #endregion
- this.dec_OrderDiscounts = LYFZ.BLL.BLL_ErpUser.CurrentUserRights.GetOrderDiscounts(Convert.ToInt32(this.OrdType));
- }
- }
- else
- {
- if (!LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.ModifyOrder))
- {
- if (!this.IsSaveedHadAuthorized)
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.AuthorizeLoginSuperSmallForm frm = new SuperSmallForm.AuthorizeLoginSuperSmallForm("StoresOPenSingle", LYFZ.CustomAttributes.OperatingAuthority.ModifyOrder);
- frm.StrWindowText = "修改已订单";
- frm.ShowDialog();
- if (!frm.IsSaveed)
- { return; }
- else
- {
- if (!LYFZ.BLL.BLL_ErpUser.GetRights(frm.CurrentAuthorizeUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.ModifyOrder, frm.User_BelongRoles))
- {
- frm.SetAuthorizationResult(String.Format("授权失败,授权人没有'修改已订单'权限"));
- MessageBoxCustom.Show("对不起!授权帐号:" + frm.StrUserAccount + "没有'修改已订单'权限。"); return; }
- else {
- frm.SetAuthorizationResult();
- }
- this.dec_OrderDiscounts = frm.CurrentAuthorizeUserRights.GetOrderDiscounts(Convert.ToInt32(this.OrdType));
- }
- }
- }
- else
- { this.dec_OrderDiscounts = LYFZ.BLL.BLL_ErpUser.CurrentUserRights.GetOrderDiscounts(Convert.ToInt32(this.OrdType)); }
- }
- this.IsSaveedHadAuthorized = true;
- #endregion
- DateTime strTime = SDateTime.Now;
- string strOrderPrefix = this.GetOrderCustomPrefix();
- //Model.SMSParameters sparametersModel = null;
- List<Helper.CommandInfo> clist = null;
- //是否为添加新订单
- bool isAddOrder = false;
- bool IsSaveedOK = false;
- string StrMainClientNumber = "";
- string StrSeriesName = "";
- while (!IsSaveedOK)
- {
- clist = new List<Helper.CommandInfo>();
- #region 客户资料
- LYFZ.Model.Model_ErpCustomer modelCilent = null;
- LYFZ.Model.Model_ErpCustomer modelCilentMain = null;
- LYFZ.Model.Model_ErpCustomer modelChildCilent = null;
- List<LYFZ.Model.Model_ErpCustomer> ctmlist = new List<Model.Model_ErpCustomer>();
- string CilentMainRelation = "本人";
- string ChildCilentRelation = "本人";
- List<string> ClientRelation = new List<string>();
- int ClientIndex = 1;
- #region 如果是婚纱版,则验证并设置婚期
- string Marriage = "";
- string MarriageLunar = "";
- switch (this.OrdType)
- {
- case EnumPublic.OrderType.婚纱订单:
- case EnumPublic.OrderType.婚庆订单:
- case EnumPublic.OrderType.服务订单:
- int intMasse = this.mskMarriage.CheckDateValue(this.mskMarriage, chkMarriage);
- if (intMasse == 1) { MessageBoxCustom.Show("婚期日期日期格式输入错误"); return; }
- else if (intMasse == 2)
- { MessageBoxCustom.Show("婚期日期:" + this.mskMarriage.StrValue.Trim() + "不是公历日期,若要保存请勾上农历"); return; }
- if (this.mskMarriage.StrValue.Trim() != "")
- {
- Marriage = this.mskMarriage.StrValue.Trim();//婚期
- if (this.chkMarriage.Checked)//婚期历类
- { MarriageLunar = "1"; }
- else
- { MarriageLunar = "0"; }
- }
- break;
- }
- #endregion
- foreach (Control control in this.flowPanel1.Controls)
- {
- if (control is SetCustomControls.OrderClientParentsControlsEx)
- {
- SetCustomControls.OrderClientParentsControlsEx tmp = (SetCustomControls.OrderClientParentsControlsEx)control;
- if (tmp.StrClientAttribute == "Man_")
- {
- #region 主要联系人
- if (this.OrdType == EnumPublic.OrderType.儿童订单)
- { CilentMainRelation = ""; }
- LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.ClientModel ClientModel = tmp.GetClientValue(ref CilentMainRelation);
- if (ClientModel == null)
- { return; }
- if (ClientModel.ID > 0)
- {
- modelCilentMain = ctbll.GetModel(ClientModel.ID);
- modelCilentMain.Cus_UpdateDateTime = strTime;
- modelCilentMain.Cus_UpdateName = strUserID;
- }
- else
- {
- modelCilentMain = new Model.Model_ErpCustomer();
- modelCilentMain.Cus_CustomerNumber = LYFZ.BLL.BLL_ErpCustomer.GetClientNumber();
- modelCilentMain.Cus_DividedShop = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID();
- modelCilentMain.Cus_CreateDateTime = strTime;
- modelCilentMain.Cus_CreateName = strUserID;
- }
- modelCilentMain.Cus_Address = ClientModel.CusAddress;
- modelCilentMain.Cus_Birthday = ClientModel.CusBirthday;
- modelCilentMain.Cus_BirthdayLunar = ClientModel.CusBirthdayLunar;
- modelCilentMain.Cus_DayForMarriage = "";
- modelCilentMain.Cus_DayForMarriageLunar = "";
- switch (this.OrdType)
- {
- case EnumPublic.OrderType.婚纱订单:
- case EnumPublic.OrderType.婚庆订单:
- case EnumPublic.OrderType.服务订单:
- modelCilentMain.Cus_DayForMarriage = Marriage;
- modelCilentMain.Cus_DayForMarriageLunar = MarriageLunar;
- break;
- }
- if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.EnabledIDNumber)
- { modelCilentMain.Cus_IDNumber = ClientModel.CusIDNumber; }
- modelCilentMain.Cus_Type = "";
- modelCilentMain.Cus_FixedPhone = ClientModel.CusFixedPhone;
- modelCilentMain.Cus_MicroSignal = ClientModel.CusMicroSignal;
- modelCilentMain.Cus_Name = ClientModel.CusName;
- modelCilentMain.Cus_NamePinyin = ClientModel.CusNamePinyin;
- modelCilentMain.Cus_QQ = ClientModel.CusQQ;
- modelCilentMain.Cus_Region = ClientModel.CusRegion;
- modelCilentMain.Cus_Relations = ClientModel.CusRelations;
- modelCilentMain.Cus_Sex = ClientModel.CusSex;
- modelCilentMain.Cus_Telephone = ClientModel.CusTelephone;
- modelCilentMain.Cus_WorkUnit = ClientModel.CusWorkUnit;
- modelCilentMain.Cus_Zodiac = ClientModel.CusZodiac;
- StrMainClientNumber = modelCilentMain.Cus_CustomerNumber;
- if (modelCilentMain.ID == 0)
- { clist.Add(ctbll.GetAddCommandInfo(modelCilentMain)); }
- else
- { clist.Add(ctbll.GetUpdateCommandInfo(modelCilentMain)); }
- #endregion
- }
- else
- {
- #region 其他联系人
- string strOtherClienRelation = "";
- LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.ClientModel ClientModel = tmp.GetClientValue(ref strOtherClienRelation);
- ClientRelation.Add(strOtherClienRelation);
- if (ClientModel == null)
- { return; }
- if (ClientModel.ID > 0)
- {
- modelCilent = ctbll.GetModel(ClientModel.ID);
- modelCilent.Cus_UpdateDateTime = strTime;
- modelCilent.Cus_UpdateName = strUserID;
- }
- else
- {
- modelCilent = new Model.Model_ErpCustomer();
- modelCilent.Cus_CustomerNumber = LYFZ.BLL.BLL_ErpCustomer.GetClientNumber();
- modelCilent.Cus_DividedShop = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID();
- modelCilent.Cus_CreateDateTime = strTime;
- modelCilent.Cus_CreateName = strUserID;
- }
- if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.EnabledIDNumber)
- { modelCilent.Cus_IDNumber = ClientModel.CusIDNumber; }
- modelCilent.Cus_Address = ClientModel.CusAddress;
- modelCilent.Cus_Birthday = ClientModel.CusBirthday;
- modelCilent.Cus_BirthdayLunar = ClientModel.CusBirthdayLunar;
- modelCilent.Cus_DayForMarriage = "";
- modelCilent.Cus_DayForMarriageLunar = "";
- switch (this.OrdType)
- {
- case EnumPublic.OrderType.婚纱订单:
- case EnumPublic.OrderType.婚庆订单:
- case EnumPublic.OrderType.服务订单:
- modelCilent.Cus_DayForMarriage = Marriage;
- modelCilent.Cus_DayForMarriageLunar = MarriageLunar;
- break;
- }
- modelCilent.Cus_Type = "";
- modelCilent.Cus_FixedPhone = ClientModel.CusFixedPhone;
- modelCilent.Cus_MicroSignal = ClientModel.CusMicroSignal;
- modelCilent.Cus_Name = ClientModel.CusName;
- modelCilent.Cus_NamePinyin = ClientModel.CusNamePinyin;
- modelCilent.Cus_QQ = ClientModel.CusQQ;
- modelCilent.Cus_Region = ClientModel.CusRegion;
- modelCilent.Cus_Relations = ClientModel.CusRelations;
- modelCilent.Cus_Sex = ClientModel.CusSex;
- modelCilent.Cus_Telephone = ClientModel.CusTelephone;
- modelCilent.Cus_WorkUnit = ClientModel.CusWorkUnit;
- modelCilent.Cus_Zodiac = ClientModel.CusZodiac;
- if (modelCilent.ID <= 0)
- { clist.Add(ctbll.GetAddCommandInfo(modelCilent)); }
- else
- { clist.Add(ctbll.GetUpdateCommandInfo(modelCilent)); }
- ctmlist.Add(modelCilent);
- #endregion
- }
- }
- if (control is SetCustomControls.OrderClientChildrenControlsEx)
- {
- #region 儿童客户
- SetCustomControls.OrderClientChildrenControlsEx tmp = (SetCustomControls.OrderClientChildrenControlsEx)control;
- LYFZ.Model.Model_ErpCustomer ChildClientModel = tmp.GetClientValue(ref ChildCilentRelation);
- if (ChildClientModel == null)
- { return; }
- if (ChildClientModel.ID > 0)
- {
- modelChildCilent = ctbll.GetModel(ChildClientModel.ID);
- modelChildCilent.Cus_UpdateDateTime = strTime;
- modelChildCilent.Cus_UpdateName = strUserID;
- }
- else
- {
- modelChildCilent = new Model.Model_ErpCustomer();
- modelChildCilent.Cus_CustomerNumber = LYFZ.BLL.BLL_ErpCustomer.GetClientNumber();
- modelChildCilent.Cus_DividedShop = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID();
- modelChildCilent.Cus_CreateDateTime = strTime;
- modelChildCilent.Cus_CreateName = strUserID;
- }
- modelChildCilent.Cus_Type = "儿童";
- modelChildCilent.Cus_Birthday = ChildClientModel.Cus_Birthday;
- modelChildCilent.Cus_BirthdayLunar = ChildClientModel.Cus_BirthdayLunar;
- modelChildCilent.Cus_Name = ChildClientModel.Cus_Name;
- modelChildCilent.Cus_NamePinyin = ChildClientModel.Cus_NamePinyin;
- modelChildCilent.Cus_Sex = ChildClientModel.Cus_Sex;
- modelChildCilent.Cus_Zodiac = ChildClientModel.Cus_Zodiac;
- if (modelChildCilent.ID == 0)
- { clist.Add(ctbll.GetAddCommandInfo(modelChildCilent)); }
- else
- { clist.Add(ctbll.GetUpdateCommandInfo(modelChildCilent)); }
- #endregion
- }
- ClientIndex++;
- }
- #endregion
- #region 订单资料
- Hashtable htData_RegisterAndBottom = new Hashtable();
- htData_RegisterAndBottom["IntoRegisterQuantity"] = 0;
- htData_RegisterAndBottom["IntoBottomQuantity"] = 0;
- htData_RegisterAndBottom["IntoRegisterQuantityPackage"] = 0;
- htData_RegisterAndBottom["IntoBottomQuantityPackage"] = 0;
- LYFZ.Model.Model_ErpOrder modelOrder = null;
- string StrLovedStyle = this.GetStyle();
- string StrCustomerSource = this.GetClientSource();
- string StrNewOrderNumber = LYFZ.BLL.BLL_ErpOrder.GenerateNewMainOrderNo(SDateTime.Now, strOrderPrefix);
- string StrOrderType = Convert.ToInt32(this.OrdType).ToString();
- switch (this.OrdType)
- {
- case EnumPublic.OrderType.婚纱订单:
- case EnumPublic.OrderType.儿童订单:
- case EnumPublic.OrderType.写真订单:
- case EnumPublic.OrderType.婚庆订单:
- if (this.OrderEx != null)
- {
- modelOrder = this.OrderEx.GetOrderValue(ref htData_RegisterAndBottom, StrNewOrderNumber: StrNewOrderNumber, StrOrderType: StrOrderType, StrLovedStyle: StrLovedStyle,
- StrCustomerSource: StrCustomerSource, StrClass: "1", StrInfoID: strInfoID, StrTime: strTime, StrUserID: strUserID);
- }
- else
- { MessageBoxCustom.Show("订单信息未填写!"); return; }
- break;
- case EnumPublic.OrderType.服务订单:
- if (this.ServiceOrderEx != null)
- {
- modelOrder = this.ServiceOrderEx.GetOrderValue(StrNewOrderNumber: StrNewOrderNumber, StrOrderType: StrOrderType, StrLovedStyle: StrLovedStyle, StrCustomerSource: StrCustomerSource,
- StrClass: "1", StrInfoID: strInfoID, StrTime: strTime, StrUserID: strUserID);
- }
- else
- { MessageBoxCustom.Show("订单信息未填写!"); return; }
- break;
- }
- if (modelOrder == null)
- { return; }
- StrSeriesName = modelOrder.Ord_SeriesName;
- #endregion
- #region 医院跟踪客户修改
- if (!string.IsNullOrEmpty(this.ComeSingleLotNumber))
- {
- LYFZ.Model.Model_ErpHospitalClient modelHospitalClient = hcbll.GetModel("Hct_Oddnumber", this.ComeSingleLotNumber);
- modelHospitalClient.Hct_OrderNumber = modelOrder.Ord_Number;
- modelHospitalClient.Hct_CustomerOrders = 1;
- clist.Add(hcbll.GetUpdateCommandInfo(modelHospitalClient));
- }
- #endregion
- #region 订单客户组
- LYFZ.Model.Model_ErpCustomerGroup modelClientGroup = null;
- if (this.OrderGroupNumber != "")
- { modelClientGroup = cgbll.GetModel("GP_CustomerGroupID", this.OrderGroupNumber); }
- else
- { modelClientGroup = cgbll.GetModel("GP_OrderNumber", modelOrder.Ord_Number); }
- string strClientSource = this.GetClientSource();
- if (strClientSource == "")
- { MessageBoxCustom.Show("请选择客户来源!"); return; }
- if (modelClientGroup.ID > 0)
- {
- modelClientGroup.GP_GroupType = 0;
- modelClientGroup.GP_CustomerType = Convert.ToInt32(this.OrdType);
- modelClientGroup.GP_OrderNumber = modelOrder.Ord_Number;
- modelClientGroup.GP_CustomerSource = strClientSource;
- if (modelClientGroup.GP_CustomerStatus.Trim() != "正常")
- {
- modelClientGroup.GP_CustomerStatus = "追回";
- modelClientGroup.GP_RecoverDateTime = strTime;
- if (string.IsNullOrEmpty(LYFZ.Command.Command_Validate.DateTimeToString(modelClientGroup.GP_TransactionTime)))
- { modelClientGroup.GP_TransactionTime = strTime; }
- }
- modelClientGroup.GP_UpdateDatetime = strTime;
- modelClientGroup.GP_UpdateName = strUserID;
- if (this.modelFriends != null)
- { modelClientGroup.GP_IntroducerCustomerID = this.modelFriends.Cus_CustomerNumber; }
- else
- { modelClientGroup.GP_IntroducerCustomerID = ""; }
- clist.Add(cgbll.GetUpdateCommandInfo(modelClientGroup));
- }
- else
- {
- modelClientGroup = new Model.Model_ErpCustomerGroup();
- modelClientGroup.GP_DividedShop = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID();
- modelClientGroup.GP_OrderNumber = modelOrder.Ord_Number;
- modelClientGroup.GP_CustomerGroupID = LYFZ.BLL.BLL_ErpCustomer.GetNewClientGroupNumber();
- modelClientGroup.GP_GroupType = 0;
- modelClientGroup.GP_CustomerType = Convert.ToInt32(this.OrdType);
- modelClientGroup.GP_CustomerStatus = "正常";
- modelClientGroup.GP_LossReason = "";
- modelClientGroup.GP_DegreeOfIntent = "";
- modelClientGroup.GP_CustomerSource = strClientSource;
- if (this.modelFriends != null)
- { modelClientGroup.GP_IntroducerCustomerID = this.modelFriends.Cus_CustomerNumber; }
- else
- { modelClientGroup.GP_IntroducerCustomerID = ""; }
- modelClientGroup.GP_Remark = "";
- modelClientGroup.GP_BelongsPersonID = strUserID;
- modelClientGroup.GP_CreateDatetime = strTime;
- modelClientGroup.GP_CreateName = strUserID;
- modelClientGroup.GP_ISIntentionCustomer = 0;
- clist.Add(cgbll.GetAddCommandInfo(modelClientGroup));
- }
- #endregion
- #region 客户成员组
- LYFZ.Model.Model_ErpCustomerGroupMembers modelGroupMember = null;
- List<LYFZ.Model.Model_ErpCustomerGroupMembers> Gmlist = cgmbll.GetModelList("GM_CustomerGroupID='" + modelClientGroup.GP_CustomerGroupID + "'");
- List<LYFZ.Model.Model_ErpCustomer> ctmlistGroup = ctmlist;
- List<string> ClientRelationGroup = ClientRelation;
- if (Gmlist.Count > 0)
- {
- if (modelChildCilent != null)
- {
- bool IsBl = true;
- for (int i = 0; i < Gmlist.Count; i++)
- {
- if (Gmlist[i].GM_CustomerID.Trim() == modelChildCilent.Cus_CustomerNumber)
- {
- IsBl = false;
- modelGroupMember = Gmlist[i];
- modelGroupMember.GM_Master = 0;
- modelGroupMember.GM_Relation = ChildCilentRelation;
- clist.Add(cgmbll.GetUpdateCommandInfo(modelGroupMember));
- Gmlist.RemoveAt(i);
- break;
- }
- }
- if (IsBl)
- {
- modelGroupMember = new Model.Model_ErpCustomerGroupMembers();
- modelGroupMember.GM_DividedShop = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID();
- modelGroupMember.GM_CustomerGroupID = modelClientGroup.GP_CustomerGroupID;
- modelGroupMember.GM_CustomerID = modelChildCilent.Cus_CustomerNumber;
- modelGroupMember.GM_Master = 0;
- modelGroupMember.GM_ProtagonistCustomer = 1;
- modelGroupMember.GM_RelatedPersonID = modelChildCilent.Cus_CustomerNumber;
- modelGroupMember.GM_Relation = ChildCilentRelation;
- clist.Add(cgmbll.GetAddCommandInfo(modelGroupMember));
- }
- }
- if (modelCilentMain != null)
- {
- bool IsBl = true;
- for (int i = 0; i < Gmlist.Count; i++)
- {
- if (Gmlist[i].GM_CustomerID.Trim() == modelCilentMain.Cus_CustomerNumber)
- {
- IsBl = false;
- modelGroupMember = Gmlist[i];
- modelGroupMember.GM_Master = 1;
- switch (this.OrdType)
- {
- case EnumPublic.OrderType.儿童订单:
- modelGroupMember.GM_RelatedPersonID = modelChildCilent.Cus_CustomerNumber;
- modelGroupMember.GM_ProtagonistCustomer = 0;
- break;
- default:
- modelGroupMember.GM_RelatedPersonID = modelCilentMain.Cus_CustomerNumber;
- modelGroupMember.GM_ProtagonistCustomer = 1;
- break;
- }
- modelGroupMember.GM_Relation = CilentMainRelation;
- clist.Add(cgmbll.GetUpdateCommandInfo(modelGroupMember));
- Gmlist.RemoveAt(i);
- break;
- }
- }
- if (IsBl)
- {
- modelGroupMember = new Model.Model_ErpCustomerGroupMembers();
- modelGroupMember.GM_DividedShop = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID();
- modelGroupMember.GM_CustomerGroupID = modelClientGroup.GP_CustomerGroupID;
- modelGroupMember.GM_CustomerID = modelCilentMain.Cus_CustomerNumber;
- modelGroupMember.GM_Master = 1;
- switch (this.OrdType)
- {
- case EnumPublic.OrderType.儿童订单:
- modelGroupMember.GM_RelatedPersonID = modelChildCilent.Cus_CustomerNumber;
- modelGroupMember.GM_ProtagonistCustomer = 0;
- break;
- default:
- modelGroupMember.GM_RelatedPersonID = modelCilentMain.Cus_CustomerNumber;
- modelGroupMember.GM_ProtagonistCustomer = 1;
- break;
- }
- modelGroupMember.GM_Relation = CilentMainRelation;
- clist.Add(cgmbll.GetAddCommandInfo(modelGroupMember));
- }
- }
- for (int i = 0; i < Gmlist.Count; i++)
- {
- bool IsBl = true;
- for (int j = 0; j < ctmlistGroup.Count; j++)
- {
- if (Gmlist[i].GM_CustomerID == ctmlistGroup[j].Cus_CustomerNumber)
- {
- IsBl = false;
- modelGroupMember = Gmlist[i];
- switch (this.OrdType)
- {
- case EnumPublic.OrderType.儿童订单:
- modelGroupMember.GM_RelatedPersonID = modelChildCilent.Cus_CustomerNumber;
- modelGroupMember.GM_ProtagonistCustomer = 0;
- break;
- default:
- modelGroupMember.GM_RelatedPersonID = modelCilentMain.Cus_CustomerNumber;
- modelGroupMember.GM_ProtagonistCustomer = 1;
- break;
- }
- modelGroupMember.GM_Master = 0;
- modelGroupMember.GM_Relation = ClientRelationGroup[j].Trim();
- clist.Add(cgmbll.GetUpdateCommandInfo(modelGroupMember));
- ctmlistGroup.RemoveAt(j);
- ClientRelationGroup.RemoveAt(j);
- }
- }
- if (IsBl)
- { clist.Add(cgmbll.GetDeleteCommandInfo("ID", "=", Gmlist[i].ID)); }
- }
- }
- else
- {
- switch (this.OrdType)
- {
- case EnumPublic.OrderType.儿童订单:
- modelGroupMember = new Model.Model_ErpCustomerGroupMembers();
- modelGroupMember.GM_DividedShop = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID();
- modelGroupMember.GM_CustomerGroupID = modelClientGroup.GP_CustomerGroupID;
- modelGroupMember.GM_CustomerID = modelChildCilent.Cus_CustomerNumber;
- modelGroupMember.GM_Master = 0;
- modelGroupMember.GM_ProtagonistCustomer = 1;
- modelGroupMember.GM_RelatedPersonID = modelChildCilent.Cus_CustomerNumber;
- modelGroupMember.GM_Relation = ChildCilentRelation;
- clist.Add(cgmbll.GetAddCommandInfo(modelGroupMember));
- modelGroupMember = new Model.Model_ErpCustomerGroupMembers();
- modelGroupMember.GM_DividedShop = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID();
- modelGroupMember.GM_CustomerGroupID = modelClientGroup.GP_CustomerGroupID;
- modelGroupMember.GM_CustomerID = modelCilentMain.Cus_CustomerNumber;
- modelGroupMember.GM_Master = 1;
- modelGroupMember.GM_ProtagonistCustomer = 0;
- modelGroupMember.GM_RelatedPersonID = modelChildCilent.Cus_CustomerNumber;
- modelGroupMember.GM_Relation = CilentMainRelation;
- clist.Add(cgmbll.GetAddCommandInfo(modelGroupMember));
- break;
- default:
- modelGroupMember = new Model.Model_ErpCustomerGroupMembers();
- modelGroupMember.GM_DividedShop = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID();
- modelGroupMember.GM_CustomerGroupID = modelClientGroup.GP_CustomerGroupID;
- modelGroupMember.GM_CustomerID = modelCilentMain.Cus_CustomerNumber;
- modelGroupMember.GM_Master = 1;
- modelGroupMember.GM_ProtagonistCustomer = 1;
- modelGroupMember.GM_RelatedPersonID = modelCilentMain.Cus_CustomerNumber;
- modelGroupMember.GM_Relation = CilentMainRelation;
- clist.Add(cgmbll.GetAddCommandInfo(modelGroupMember));
- break;
- }
- }
- for (int i = 0; i < ctmlistGroup.Count; i++)
- {
- modelGroupMember = new Model.Model_ErpCustomerGroupMembers();
- modelGroupMember.GM_DividedShop = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID();
- modelGroupMember.GM_CustomerGroupID = modelClientGroup.GP_CustomerGroupID;
- modelGroupMember.GM_CustomerID = ctmlistGroup[i].Cus_CustomerNumber;
- modelGroupMember.GM_Master = 0;
- modelGroupMember.GM_Relation = ClientRelationGroup[i].Trim();
- switch (this.OrdType)
- {
- case EnumPublic.OrderType.儿童订单:
- modelGroupMember.GM_RelatedPersonID = modelChildCilent.Cus_CustomerNumber;
- modelGroupMember.GM_ProtagonistCustomer = 0;
- break;
- default:
- modelGroupMember.GM_RelatedPersonID = modelCilentMain.Cus_CustomerNumber;
- modelGroupMember.GM_ProtagonistCustomer = 1;
- break;
- }
- clist.Add(cgmbll.GetAddCommandInfo(modelGroupMember));
- }
- #endregion
- #region 订单人员表
- if (this.txtOrderPerson.Text.Trim() == "")
- { MessageBoxCustom.Show("接单人员不能为空!"); return; }
- string[] StrValue = txtOrderPerson.Tag.ToString().Trim().Split('|')[0].Trim().Split(',');
- string[] StrTag = txtOrderPerson.Tag.ToString().Trim().Split('|')[1].Trim().Split(',');
- DataTable dtList = orbll.GetView_Custom("tb_ErpOrdersPerson", StrWhere: "OrdPe_OrderNumber='" + modelOrder.Ord_Number + "'", ShowColumnName: "*", filedOrder: "OrdPe_Type ASC").Tables[0];// orpbll.GetModelList("OrdPe_OrderNumber='" + modelOrder.Ord_Number + "'");
- //List<LYFZ.Model.Model_ErpOrdersPerson> nmlist = orpbll.GetModelList("OrdPe_OrderNumber='" + modelOrder.Ord_Number + "'");
- LYFZ.Model.Model_ErpOrdersPerson modelPerson = null;
- ArrayList Removelist = new ArrayList();
- for (int i = 0; i < StrValue.Length; i++)
- {
- bool IsFind = false;
- for (int j = 0; j < dtList.Rows.Count; j++)
- {
- if (dtList.Rows[j]["OrdPe_OrdersPerson"].ToString().Trim() == StrValue[i].Trim())
- {
- IsFind = true;
- modelPerson = orpbll.DataRowToModel(dtList.Rows[j]);
- modelPerson.OrdPe_Type = StrTag[i].Trim();
- modelPerson.OrdPe_UpdateDateTime = strTime;
- modelPerson.OrdPe_UpdateName = strUserID;
- clist.Add(orpbll.GetUpdateCommandInfo(modelPerson));
- dtList.Rows.Remove(dtList.Rows[j]);
- break;
- }
- }
- if (!IsFind)
- {
- modelPerson = new Model.Model_ErpOrdersPerson();
- modelPerson.OrdPe_OrderNumber = modelOrder.Ord_Number;
- modelPerson.OrdPe_OrdersPerson = StrValue[i].Trim();
- modelPerson.OrdPe_Type = StrTag[i].Trim();
- modelPerson.OrdPe_CreateDateTime = strTime;
- modelPerson.OrdPe_CreateName = strUserID;
- clist.Add(orpbll.GetAddCommandInfo(modelPerson));
- }
- }
- for (int i = 0; i < dtList.Rows.Count; i++)
- { clist.Add(orpbll.GetDeleteCommandInfo("ID", "=", dtList.Rows[i]["ID"].ToString().Trim())); }
- modelOrder.Ord_OrderPersonNumber = txtOrderPerson.Tag.ToString().Trim().Split('|')[0].Trim();
- modelOrder.Ord_OrderPersonName = txtOrderPerson.Text.Trim();
- #endregion
- #region 景点与阶段资料
- Hashtable htGroupList = new Hashtable();
- switch (this.OrdType)
- {
- case EnumPublic.OrderType.婚纱订单:
- case EnumPublic.OrderType.写真订单:
- if (this.OrderSightsEx != null)
- {
- bool IsContinueA = false;
- List<Helper.CommandInfo> mClistA = this.OrderSightsEx.GetOrderSightsValue(htData_RegisterAndBottom, modelOrder.Ord_Number, strTime, ref IsContinueA, IsMagess: true);
- if (IsContinueA)
- { return; }
- clist.AddRange(mClistA);
- }
- break;
- case EnumPublic.OrderType.儿童订单:
- bool IsContinueB = false;
- List<Helper.CommandInfo> mClistB = OrderStagesEx.GetOrderStagesValue(modelOrder.Ord_Number, strTime, ref IsContinueB, ref htGroupList, IsMagess: true);
- if (IsContinueB)
- { return; }
- clist.AddRange(mClistB);
- break;
- }
- #endregion
- #region 订单数码
- switch (this.OrdType)
- {
- case EnumPublic.OrderType.服务订单:
- case EnumPublic.OrderType.婚庆订单:
- DataTable dt = orbll.GetView_Custom("tb_ErpOrderDigital", StrWhere: "Ordv_Number = '" + modelOrder.Ord_Number + "'", ShowColumnName: "ID").Tables[0];
- if (dt.Rows.Count <= 0)
- {
- LYFZ.Model.Model_ErpOrderDigital ViceModel = new Model.Model_ErpOrderDigital();
- ViceModel.Ordv_Number = modelOrder.Ord_Number;
- ViceModel.Ordv_ViceNumber = ViceModel.Ordv_Number + "_001";
- ViceModel.Ordv_DigitalNumber = 1;
- ViceModel.Ordv_IntoRegisterQuantity = 0;
- ViceModel.Ordv_IntoBottomQuantity = 0;
- ViceModel.Ordv_IntoRegisterQuantityPackage = 0;
- ViceModel.Ordv_IntoBottomQuantityPackage = 0;
- ViceModel.Ordv_IntoBottomAddPickQuantity = 0;
- ViceModel.Ordv_IntoRegisterAddPickQuantity = 0;
- ViceModel.Ordv_ClothingDispatcher = "";
- ViceModel.Ordv_ClothingName = "";
- ViceModel.Ordv_ClothingRemark = "";
- ViceModel.Ordv_ClothingStatus = "0";
- ViceModel.Ordv_DesignerDispatcher = "";
- ViceModel.Ordv_DesignerName = "";
- ViceModel.Ordv_DesignerStatus = "0";
- ViceModel.Ordv_DesignValidation = "";
- ViceModel.Ordv_EarlyRepairDispatcher = "";
- ViceModel.Ordv_EarlyRepairName = "";
- ViceModel.Ordv_EarlyRepairStatus = "0";
- ViceModel.Ordv_FilmSelectionDispatcher = "";
- ViceModel.Ordv_FilmSelectionName = "";
- ViceModel.Ordv_FilmSelectionStatus = "0";
- ViceModel.Ordv_LookDesignClaim = "";
- ViceModel.Ordv_LookDesignDispatcher = "";
- ViceModel.Ordv_LookDesignName = "";
- ViceModel.Ordv_LookDesignStatus = "0";
- ViceModel.Ordv_RefinementDispatcher = "";
- ViceModel.Ordv_RefinementName = "";
- ViceModel.Ordv_RefinementStatus = "0";
- ViceModel.Ordv_ReservationClothingName = "";
- ViceModel.Ordv_ReservationDesignerName = "";
- ViceModel.Ordv_ReservationEarlyRepairName = "";
- ViceModel.Ordv_ReservationFilmSelectionName = "";
- ViceModel.Ordv_ReservationLookDesignName = "";
- ViceModel.Ordv_ReservationRefinementName = "";
- ViceModel.Ordv_ReservationSendPhotoName = "";
- ViceModel.Ordv_ReservationSendPhotoStatus = "0";
- ViceModel.Ordv_SelectionDesign = "";
- ViceModel.Ordv_SelectionFilm = "";
- ViceModel.Ordv_UpdateName = "";
- ViceModel.Ordv_CreateDatetime = strTime;
- ViceModel.Ordv_CreateName = strUserID;
- clist.Add(odbll.GetAddCommandInfo(ViceModel));
- LYFZ.Model.Model_ErpOrderDigitalStatus modelStatus = new Model.Model_ErpOrderDigitalStatus();
- modelStatus.Ords_Number = "ORDS_" + LYFZ.BLL.BLL_ErpCustomer.GetClientNumber();
- modelStatus.Ords_OrdNumber = ViceModel.Ordv_Number;
- modelStatus.Ords_ViceNumber = ViceModel.Ordv_ViceNumber;
- modelStatus.Ords_DigitalNumber = ViceModel.Ordv_DigitalNumber;
- modelStatus.Ords_OutSendEarlyRepairName = "";
- modelStatus.Ords_OutSendEarlyRepairQuantity = 0;
- modelStatus.Ords_OutSendEarlyRepairStatus = "未发";
- modelStatus.Ords_OutSendEarlyRepairVendor = "";
- modelStatus.Ords_OutSendEarlyRepairVendorQQ = "";
- modelStatus.Ords_PhotographStatus = "未拍";
- modelStatus.Ords_PhotographIntStatus = 0;
- modelStatus.Ords_SightsName = "";
- modelStatus.Ords_Photographer = "";
- modelStatus.Ords_PhotographyAssistant = "";
- modelStatus.Ords_MakeupArtist = "";
- modelStatus.Ords_MakeupAssistant = "";
- modelStatus.Ords_BootDivision = "";
- modelStatus.Ords_BootDivisionAssistant = "";
- modelStatus.Ords_ProductSendStatus = "未发";
- modelStatus.Ords_ProductCompletedStatus = "未完";
- modelStatus.Ords_ProductPickupStatus = "未取";
- modelStatus.Ords_ProductPickupIntStatus = 0;
- modelStatus.Ords_ProductIsExpedited = "否";
- modelStatus.Ords_ServiceStatus = "未进行";
- modelStatus.Ords_ServiceIntStatus = 0;
- clist.Add(orsbll.GetAddCommandInfo(modelStatus));
- }
- break;
- }
- #endregion
- #region 套系服务
- //DateTime DateMarriage = LYFZ.WinAPI.CustomPublicMethod.GetNullDateTime();
- //if (Marriage != "")
- //{
- // if (MarriageLunar.Trim() == "1")
- // {
- // if (string.IsNullOrEmpty(LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetLunarCalendarToSolarCalendar(Marriage)))
- // { MessageBoxCustom.Show("婚期日期:农历不存在" + Marriage + "此日期!"); return; }
- // DateMarriage = Convert.ToDateTime(LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetLunarCalendarToSolarCalendar(Marriage));
- // }
- // else
- // { DateMarriage = Convert.ToDateTime(Marriage); }
- //}
- bool IsServiceContinue = false;
- List<Helper.CommandInfo> AddServiceclist = OrderServiceEx.GetOrderServiceValue(strTime, ref IsServiceContinue, modelOrder.Ord_Number, Marriage, htGroupList, MarriageLunar);
- if (IsServiceContinue)
- { return; }
- clist.AddRange(AddServiceclist);
- #endregion
- #region 套系商品
- switch (this.OrdType)
- {
- case EnumPublic.OrderType.婚纱订单:
- case EnumPublic.OrderType.儿童订单:
- case EnumPublic.OrderType.写真订单:
- case EnumPublic.OrderType.婚庆订单:
- ComboBoxTreeViewEx cmbtreevTaoXiName = OrderEx.CmbtreevTaoXi;
- //if (cmbtreevTaoXiName.Tag != null)
- {
- bool IsContinue = false;
- string strPackagesCode = "";
- if (cmbtreevTaoXiName.Tag != null)
- {strPackagesCode = cmbtreevTaoXiName.Tag.ToString().Trim(); }
- List<Helper.CommandInfo> AddProductclist = OrderProductEx.GetOrderProductValue(strTime, ref IsContinue, modelOrder.Ord_Number, htGroupList, strPackagesCode);
- if (IsContinue)
- { return; }
- clist.AddRange(AddProductclist);
- #region 计算权限套系价格
- if (cmbtreevTaoXiName.StrGetName.Trim() != "true" && cmbtreevTaoXiName.StrGetName.Trim() != "")
- {
- if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.EnableOrderCostControlSystem)
- {
- //当前总成本价
- decimal Old_PackagesAmount = OrderProductEx.GetProductAoumnt();
- Old_PackagesAmount += OrderServiceEx.GetServiceAoumnt();
- if (this.OrdType == EnumPublic.OrderType.儿童订单)
- { Old_PackagesAmount += this.OrderStagesEx.GetStagesAoumnt(); }
- else if (this.OrdType != EnumPublic.OrderType.婚庆订单)
- { Old_PackagesAmount += this.OrderSightsEx.GetSightsAoumnt(); }
- if (modelOrder.Ord_SeriesPrice < (Old_PackagesAmount * this.dec_OrderDiscounts))
- {
- if (MessageBoxCustom.Show("您输入的套系价格低于订单总成本,无法保存!\r\n是否需要去授权?", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.No)
- { return; }
- else
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.AuthorizeLoginSuperSmallForm frm = new SuperSmallForm.AuthorizeLoginSuperSmallForm(null, CustomAttributes.OperatingAuthority.ErrorPrivilegeValue, 1);
- frm.ShowDialog();
- if (!frm.IsSaveed)
- { return; }
- else
- {
- if (modelOrder.Ord_SeriesPrice < (Old_PackagesAmount * frm.CurrentAuthorizeUserRights.GetOrderDiscounts(Convert.ToInt32(this.OrdType))))
- {
- frm.SetAuthorizationResult(String.Format("授权失败,授权人成本管控权限不够"));
- MessageBoxCustom.Show("授权帐号:" + frm.StrUserAccount + ",授权后的套系价格低于订单总成本,无法保存!"); return; }
- else {
- frm.SetAuthorizationResult();
- }
- }
- }
- }
- }
- }
- #endregion
- }
- break;
- case EnumPublic.OrderType.服务订单:
- bool IsContinueA = false;
- List<Helper.CommandInfo> AddProductclistA = OrderProductEx.GetOrderProductValue(strTime, ref IsContinueA, modelOrder.Ord_Number, htGroupList, "".Trim());
- if (IsContinueA)
- { return; }
- clist.AddRange(AddProductclistA);
- decimal Old_PackagesAmountA = OrderProductEx.GetProductAoumnt();
- Old_PackagesAmountA += OrderServiceEx.GetServiceAoumnt();
- if (modelOrder.Ord_SeriesPrice < (Old_PackagesAmountA * this.dec_OrderDiscounts))
- {
- if (MessageBoxCustom.Show("您输入的套系价格低于订单总成本,无法保存!\r\n是否需要去授权?", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.No)
- { return; }
- else
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.AuthorizeLoginSuperSmallForm frm = new SuperSmallForm.AuthorizeLoginSuperSmallForm(null, CustomAttributes.OperatingAuthority.ErrorPrivilegeValue,1);
- frm.ShowDialog();
- if (!frm.IsSaveed)
- { return; }
- else
- {
- if (modelOrder.Ord_SeriesPrice < (Old_PackagesAmountA * frm.CurrentAuthorizeUserRights.GetOrderDiscounts(Convert.ToInt32(this.OrdType))))
- {
- frm.SetAuthorizationResult(String.Format("授权失败,授权人成本管控权限不够"));
- MessageBoxCustom.Show("授权帐号:" + frm.StrUserAccount + ",授权后的套系价格低于订单总成本,无法保存!"); return; }
- else {
- frm.SetAuthorizationResult();
- }
- }
- }
- }
- break;
- }
- #endregion
- #region 朋友介绍副卡使用
- if (this.modelViceCard != null)
- {
- if (this.modelViceCard.Mvc_Status == "1")
- {
- if (this.modelViceCard.Mvc_ViceCardType == "返现副卡")
- {
- string StrRemark = "";
- bool IsValidity = LYFZ.BLL.OrderPayment_Member.VerifiedValidity(this.modelViceCard.Mvc_Number, LYFZ.EnumPublic.MemberFunctionAttribute.返现);
- if (!IsValidity)
- { StrRemark = "主卡返现有效期已过,不支持返现!"; }
- decimal IntCoefficient = 1;
- DataTable tblSconfig = orbll.GetView_Custom("tb_ErpSystemConfigure", StrWhere: " Sconfig_Code = 'BackCashCoefficient'", ShowColumnName: "Sconfig_Value").Tables[0];
- if (tblSconfig.Rows.Count > 0)
- { IntCoefficient = Convert.ToDecimal(tblSconfig.Rows[0]["Sconfig_Value"].ToString().Trim()); }
- LYFZ.Model.Model_ErpMemberCardBackCash modelBackCash = mcbcbll.GetModel("Mcbc_Number", this.modelViceCard.Mvc_Number);
- this.modelViceCard.Mvc_Status = "2";
- this.modelViceCard.Mvc_UpdateDateTime = strTime;
- this.modelViceCard.Mvc_UpdateName = strUserID;
- this.modelViceCard.Mvc_Remark = StrRemark;
- clist.Add(mcvbll.GetUpdateCommandInfo(this.modelViceCard));
- LYFZ.Model.Model_ErpMemberCardOperateLOG modelopLog = new Model.Model_ErpMemberCardOperateLOG();
- modelopLog.mcol_DividedShop = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID();
- modelopLog.mcol_Number = this.modelViceCard.Mvc_ViceNumber;
- modelopLog.mcol_Type = "4";
- modelopLog.mcol_Remark = StrRemark;
- modelopLog.mcol_CreateDatetime = strTime;
- modelopLog.mcol_CreateName = strUserID;
- clist.Add(mcopbll.GetAddCommandInfo(modelopLog));
- if (IsValidity)
- {
- List<LYFZ.Model.Model_ErpMemberCardBackCashSet> mlistBackCashSet = mcbcsetbll.GetModelList("Mcb_Number = '" + this.modelViceCard.Mvc_Number + "' and (Mcb_ViceNumber = '' or Mcb_ViceNumber is NULL)");
- if (mlistBackCashSet.Count > 0)
- {
- LYFZ.Model.Model_ErpMemberCardBackCashSet modelMcBcSet = mlistBackCashSet[0];
- if ((modelBackCash.Mcbc_PackagesMoney * IntCoefficient) <= modelOrder.Ord_SeriesPrice)
- {
- modelMcBcSet.Mcb_IsSpending = 1;
- modelMcBcSet.Mcb_ViceNumber = modelViceCard.Mvc_ViceNumber;
- modelMcBcSet.Mcb_OrderNumber = modelOrder.Ord_Number;
- modelMcBcSet.Mcb_SpendingTime = strTime;
- modelMcBcSet.Mcb_UpdateDateTime = strTime;
- modelMcBcSet.Mcb_UpdateName = strUserID;
- DataTable tbl = orbll.GetView_Custom("tb_ErpMemberCardBackCashSet", StrWhere: "Mcb_Number = '" + this.modelViceCard.Mvc_Number + "' and Mcb_CashBackGroup = '" + this.modelViceCard.Mvc_CashBackGroup + "'", ShowColumnName: "Mcb_CashBackAmount,Mcb_IsSpending").Tables[0];
- DataRow[] dtRow = tbl.Select("Mcb_IsSpending = '0'");
- decimal DecBackCashAmount = 0;
- if (dtRow.Length == 1)
- {
- for (int i = 0; i < tbl.Rows.Count; i++)
- {
- if (tbl.Rows[i]["Mcb_IsSpending"].ToString().Trim() == "1")
- {
- if (tbl.Rows[i]["Mcb_CashBackAmount"].ToString().Trim() != "")
- { DecBackCashAmount += Convert.ToDecimal(tbl.Rows[i]["Mcb_CashBackAmount"]); }
- }
- }
- DecBackCashAmount = modelBackCash.Mcbc_PackagesMoney - DecBackCashAmount;
- }
- else
- { DecBackCashAmount = (modelMcBcSet.Mcb_Proportion / 100) * modelBackCash.Mcbc_PackagesMoney; }
- List<LYFZ.Model.Model_ErpMemberCardViceCard> mlist = mcvbll.GetModelList("Mvc_Number = '" + this.modelViceCard.Mvc_Number + "' and Mvc_ViceCardType = '返现副卡' and Mvc_CashBackGroup = '" + this.modelViceCard.Mvc_CashBackGroup + "' and Mvc_Status = '1'");
- if (mlist.Count == 1)
- {
- modelBackCash.Mcbc_PackagesMoney = 0;
- modelBackCash.Mcbc_CashBackNumber = 0;
- modelBackCash.Mcbc_CashBackProportion = "";
- }
- modelBackCash.Mcbc_AlreadyCashBack += DecBackCashAmount;
- modelBackCash.Mcbc_UpdateDateTime = strTime;
- modelBackCash.Mcbc_UpdateName = strUserID;
- clist.Add(mcbcbll.GetUpdateCommandInfo(modelBackCash));
- modelMcBcSet.Mcb_CashBackAmount = DecBackCashAmount;
- clist.Add(mcbcsetbll.GetUpdateCommandInfo(modelMcBcSet));
- }
- else
- { MessageBoxCustom.Show("订单套系不在返现套系范围内!"); return; }
- }
- else
- {
- if (MessageBoxCustom.Show("此返现副所属的主卡返现次数已经使用完,是否要回收副卡?", "温馨提示!", MessageBoxButtons.YesNo) == DialogResult.No)
- { return; }
- }
- }
- }
- else if (modelViceCard.Mvc_ViceCardType == "积分副卡")
- {
- modelViceCard.Mvc_Status = "2";
- modelViceCard.Mvc_UpdateDateTime = strTime;
- modelViceCard.Mvc_UpdateName = strUserID;
- clist.Add(mcvbll.GetUpdateCommandInfo(modelViceCard));
- LYFZ.Model.Model_ErpMemberCardOperateLOG modelOPLog = new Model.Model_ErpMemberCardOperateLOG();
- modelOPLog.mcol_DividedShop = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID();
- modelOPLog.mcol_Number = modelViceCard.Mvc_Number;
- modelOPLog.mcol_Type = "4";
- modelOPLog.mcol_Remark = "副卡消费订单" + modelOrder.Ord_Number;
- modelOPLog.mcol_CreateDatetime = strTime;
- modelOPLog.mcol_CreateName = strUserID;
- clist.Add(mcopbll.GetAddCommandInfo(modelOPLog));
- }
- }
- }
- #endregion
- #region 保存订单
- if (modelOrder.ID > 0)
- { clist.Add(orbll.GetUpdateCommandInfo(modelOrder)); }
- else
- {
- isAddOrder = true;
- clist.Add(orbll.GetAddCommandInfo(modelOrder));
- }
- #endregion
- #region 写日志
- string StrContent = "";
- LYFZ.EnumPublic.SystemLogsType SysType;
- if (modelOrder.ID > 0)
- {
- SysType = LYFZ.EnumPublic.SystemLogsType.修改订单;
- StrContent = "[修改为订单] 订单号为:" + modelOrder.Ord_Number + ";接单人员为:" + this.txtOrderPerson.Text.Trim() + ";订单类别为:" + modelOrder.Ord_OrderClass + ";套系名称为:" + modelOrder.Ord_SeriesName + ";套系价格为:" + modelOrder.Ord_SeriesPrice;
- }
- else
- {
- SysType = LYFZ.EnumPublic.SystemLogsType.新开订单;
- StrContent = "[新开订单] 订单号为:" + modelOrder.Ord_Number + ";接单人员为:" + this.txtOrderPerson.Text.Trim() + ";订单类别为:" + modelOrder.Ord_OrderClass + ";套系名称为:" + modelOrder.Ord_SeriesName + ";套系价格为:" + modelOrder.Ord_SeriesPrice;
- }
- clist.Add(slogbll.GetAddCommandInfo(LYFZ.BLL.BLL_ErpSystemLogs.GetWriteLogModel(SysType, StrContent, strUserID, StrUserName, LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.User_IP)));
- #region 系统记录
- string StrContentDetails = "";
- if (this.OrderSightsEx != null)
- { StrContentDetails += this.OrderSightsEx.GetOrderSightsContentDetails(); }
- if (this.OrderStagesEx != null)
- { StrContentDetails += this.OrderStagesEx.GetOrderStagesContentDetails(); }
- if (this.OrderProductEx != null)
- { StrContentDetails = this.OrderProductEx.GetOrderProuctContentDetails(); }
- if (this.OrderServiceEx != null)
- { StrContentDetails += this.OrderServiceEx.GetOrderServiceContentDetails(); }
- //if (this.SightsEx != null)
- //{
- // StrContentDetails += "拍摄景点(";
- // DataGridViewEc dgvSights = this.SightsEx.GetdgvData;
- // for (int i = 0; i < dgvSights.Rows.Count; i++)
- // { StrContentDetails += "名称:" + dgvSights.Rows[i].Cells["S_Sights"].Value.ToString().Trim() + " 套数:" + dgvSights.Rows[i].Cells["S_Quantity"].Value.ToString().Trim() + " ;"; }
- // StrContentDetails = StrContentDetails.Trim(';') + ")";
- //}
- //if (this.StagesEx != null)
- //{
- // StrContentDetails += " 拍摄阶段(";
- // DataGridViewEc dgvStages = this.StagesEx.GetdgvData;
- // for (int i = 0; i < dgvStages.Rows.Count; i++)
- // { StrContentDetails += "名称:" + dgvStages.Rows[i].Cells["S_Sights"].Value.ToString().Trim() + " 套数:" + dgvStages.Rows[i].Cells["S_Quantity"].Value.ToString().Trim() + " ;"; }
- // StrContentDetails = StrContentDetails.Trim(';') + ")";
- //}
- //if (this.ProductEx != null)
- //{
- // StrContentDetails += " 订单商品(";
- // DataGridViewEc dgvProduct = this.ProductEx.GetdgvData;
- // for (int i = 0; i < dgvProduct.Rows.Count; i++)
- // { StrContentDetails += "名称:" + dgvProduct.Rows[i].Cells["T_Column2"].Value.ToString().Trim() + " 数量:" + dgvProduct.Rows[i].Cells["T_Column4"].Value.ToString().Trim() + " ;"; }
- // StrContentDetails = StrContentDetails.Trim(';') + ")";
- //}
- //if (this.ServiceEx != null)
- //{
- // StrContentDetails += " 订单服务(";
- // DataGridViewEc dgvService = this.ServiceEx.GetdgvData;
- // for (int i = 0; i < dgvService.Rows.Count; i++)
- // { StrContentDetails += "名称:" + dgvService.Rows[i].Cells["H_Column2"].Value.ToString().Trim() + " 数量:" + dgvService.Rows[i].Cells["H_Column4"].Value.ToString().Trim() + " ;"; }
- // StrContentDetails = StrContentDetails.Trim(';') + ")";
- //}
- clist.Add(new BLL.BLL_ErpACVBSYS().GetAddCommandInfo(LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetModelLog(SysType.ToString(), StrContent, StrContentDetails, strTime)));
- #endregion
- #endregion
- #region 办理会员卡
- bool IsOpenCardSendSMS = false;
- //办理自己的
- LYFZ.Model.Model_ErpMemberCard modelMc = mcbll.GetModel("Mc_CustomerNumber", modelCilentMain.Cus_CustomerNumber);
- if (modelMc.ID <= 0)
- {
- LYFZ.Model.Model_ErpSystemConfigure sgModel = LYFZ.BLL.OrderPayment_Member.GetNewMenberNumber();
- clist.Add(sgbll.GetUpdateCommandInfo(sgModel));
- modelMc = new Model.Model_ErpMemberCard();
- modelMc.Mc_DividedShop = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID();
- modelMc.Mc_Number = sgModel.Sconfig_Value;
- modelMc.Mc_CradNumber = "";
- if (this.chkTransactmemberCard.Checked)
- {
- modelMc.Mc_CradNumber = modelCilentMain.Cus_Telephone;
- IsOpenCardSendSMS = true;
- #region 打开管理界面
- LYFZ.Model.Model_ErpMemberCardInterfaceManagement Modelmcim = mcimbll.GetModel("Mcim_Number", modelMc.Mc_Number);
- if (Modelmcim.ID <= 0)
- {
- DataTable newdtb = new DataTable();
- newdtb.Columns.Add("Points", typeof(bool));
- newdtb.Columns.Add("StoredValue", typeof(bool));
- newdtb.Columns.Add("BackCash", typeof(bool));
- newdtb.Columns.Add("Service", typeof(bool));
- newdtb.Columns.Add("NewTaken", typeof(bool));
- DataRow newRow = newdtb.NewRow();
- newRow["Points"] = "True";
- newRow["StoredValue"] = "True";
- newRow["BackCash"] = "False";
- newRow["Service"] = "False";
- newRow["NewTaken"] = "False";
- newdtb.Rows.Add(newRow);
- Modelmcim = new Model.Model_ErpMemberCardInterfaceManagement();
- Modelmcim.Mcim_Number = modelMc.Mc_Number;
- Modelmcim.Mcim_InterfaceName = new Json.JsontoDataTable().toJson(newdtb);
- Modelmcim.Mcim_UpdateDatetime = strTime;
- Modelmcim.Mcim_UpdateName = strUserID;
- clist.Add(mcimbll.GetAddCommandInfo(Modelmcim));
- }
- #endregion
- }
- modelMc.Mc_CustomerNumber = modelCilentMain.Cus_CustomerNumber;
- modelMc.Mc_CardType = "无";
- modelMc.Mc_TotalMoney = 0;
- modelMc.Mc_Money = 0;
- modelMc.Mc_TraderPassword = "";
- modelMc.Mc_UsedNumber = "";
- modelMc.Mc_Status = "1";
- modelMc.Mc_Remark = "";
- if (modelOrder.ID <= 0)
- { modelMc.Mc_OpenCardSource = "订单保存," + new System.Diagnostics.StackTrace(new System.Diagnostics.StackFrame(true)).ToString(); }
- else
- { modelMc.Mc_OpenCardSource = "订单修改," + new System.Diagnostics.StackTrace(new System.Diagnostics.StackFrame(true)).ToString(); }
- modelMc.Mc_CreateDatetime = strTime;
- modelMc.Mc_CreateName = strUserID;
- modelMc.Mc_TouchAccount = 0;
- modelMc.Mc_TotalTouchAccount = 0;
- string StrChlid = "";
- if (this.OrdType == EnumPublic.OrderType.儿童订单)
- {
- StrChlid = LYFZ.DAL.DAL_ErpCustomer.ClientNumberGetClientAllChildName(modelCilentMain.Cus_CustomerNumber);
- if (modelChildCilent != null)
- {
- if (modelChildCilent.Cus_Name.Trim().Length > 0 && !StrChlid.Contains(modelChildCilent.Cus_Name.Trim()))
- {
- if (StrChlid.Trim().Length > 0)
- { StrChlid += "/"; }
- StrChlid += modelChildCilent.Cus_Name.Trim();
- }
- }
- }
- else if (this.OrdType == EnumPublic.OrderType.婚纱订单)
- {
- if (modelCilent != null)
- { StrChlid = modelCilent.Cus_Name; }
- }
- modelMc.Mc_SecondQueryName = StrChlid.TrimEnd('/');
- clist.Add(mcbll.GetAddCommandInfo(modelMc));
- }
- else
- {
- if (modelMc.Mc_CradNumber == "" && this.chkTransactmemberCard.Checked)
- {
- IsOpenCardSendSMS = true;
- modelMc.Mc_CradNumber = modelCilentMain.Cus_Telephone;
- modelMc.Mc_UpdateDateTime = strTime;
- modelMc.Mc_UpdateName = strUserID;
- clist.Add(mcbll.GetUpdateCommandInfo(modelMc));
- }
- else
- {
- string StrChlid = "";
- if (this.OrdType == EnumPublic.OrderType.儿童订单)
- {
- StrChlid = LYFZ.DAL.DAL_ErpCustomer.ClientNumberGetClientAllChildName(modelCilentMain.Cus_CustomerNumber);
- if (modelChildCilent != null)
- {
- if (modelChildCilent.Cus_Name.Trim().Length > 0 && !StrChlid.Contains(modelChildCilent.Cus_Name.Trim()))
- {
- if (StrChlid.Trim().Length > 0)
- { StrChlid += "/"; }
- StrChlid += modelChildCilent.Cus_Name.Trim();
- }
- }
- }
- else if (this.OrdType == EnumPublic.OrderType.婚纱订单)
- {
- if (modelCilent != null)
- { StrChlid = modelCilent.Cus_Name; }
- }
- if (StrChlid.Trim().Length > 0)
- {
- modelMc.Mc_SecondQueryName = StrChlid.TrimEnd('/');
- clist.Add(mcbll.GetUpdateCommandInfo(modelMc));
- }
- }
- }
- LYFZ.Model.Model_ErpMemberCardPoints modelPoints = mcptsbll.GetModel("Mcps_Number", modelMc.Mc_Number);
- if (modelPoints.ID <= 0)
- {
- modelPoints = new Model.Model_ErpMemberCardPoints();
- modelPoints.Mcps_Number = modelMc.Mc_Number;
- modelPoints.Mcps_TotalPoints = 0;
- modelPoints.Mcps_AvailablePoints = 0;
- if (modelOrder.ID <= 0)
- { modelPoints.Mcps_OpenCardSource = "服务保存," + new System.Diagnostics.StackTrace(new System.Diagnostics.StackFrame(true)).ToString(); }
- else
- { modelPoints.Mcps_OpenCardSource = "服务修改," + new System.Diagnostics.StackTrace(new System.Diagnostics.StackFrame(true)).ToString(); }
- modelPoints.Mcps_UpdateDateTime = strTime;
- modelPoints.Mcps_UpdateName = strUserID;
- clist.Add(mcptsbll.GetAddCommandInfo(modelPoints));
- //积分有效期
- clist.AddRange(LYFZ.BLL.OrderPayment_Member.PointsChangeAutoValidity(modelMc.Mc_Number, modelMc.Mc_CradNumber));
- }
- //办理介绍人的
- if (modelClientGroup.GP_IntroducerCustomerID != "")
- {
- LYFZ.Model.Model_ErpMemberCard modelMc2 = mcbll.GetModel("Mc_CustomerNumber", modelClientGroup.GP_IntroducerCustomerID);
- if (modelMc2.ID <= 0)
- {
- LYFZ.Model.Model_ErpSystemConfigure sgModel = LYFZ.BLL.OrderPayment_Member.GetNewMenberNumber(1);
- clist.Add(sgbll.GetUpdateCommandInfo(sgModel));
- modelMc2 = new Model.Model_ErpMemberCard();
- modelMc2.Mc_DividedShop = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID();
- modelMc2.Mc_Number = sgModel.Sconfig_Value;
- if (!string.IsNullOrEmpty(this.StrReferralsMemberCardNumber))
- {
- modelMc2.Mc_CradNumber = this.StrReferralsMemberCardNumber;
- #region 打开管理界面
- LYFZ.Model.Model_ErpMemberCardInterfaceManagement Modelmcim = mcimbll.GetModel("Mcim_Number", modelMc2.Mc_Number);
- if (Modelmcim.ID <= 0)
- {
- DataTable newdtb = new DataTable();
- newdtb.Columns.Add("Points", typeof(bool));
- newdtb.Columns.Add("StoredValue", typeof(bool));
- newdtb.Columns.Add("BackCash", typeof(bool));
- newdtb.Columns.Add("Service", typeof(bool));
- newdtb.Columns.Add("NewTaken", typeof(bool));
- DataRow newRow = newdtb.NewRow();
- newRow["Points"] = "True";
- newRow["StoredValue"] = "True";
- newRow["BackCash"] = "False";
- newRow["Service"] = "False";
- newRow["NewTaken"] = "False";
- newdtb.Rows.Add(newRow);
- Modelmcim = new Model.Model_ErpMemberCardInterfaceManagement();
- Modelmcim.Mcim_Number = modelMc2.Mc_Number;
- Modelmcim.Mcim_InterfaceName = new Json.JsontoDataTable().toJson(newdtb);
- Modelmcim.Mcim_UpdateDatetime = strTime;
- Modelmcim.Mcim_UpdateName = strUserID;
- clist.Add(mcimbll.GetAddCommandInfo(Modelmcim));
- }
- #endregion
- }
- else
- { modelMc2.Mc_CradNumber = ""; }
- modelMc2.Mc_CustomerNumber = modelClientGroup.GP_IntroducerCustomerID;
- //modelMc2.Mc_CardType = "积分卡";
- modelMc2.Mc_CardType = "无";
- modelMc2.Mc_TotalMoney = 0;
- modelMc2.Mc_Money = 0;
- modelMc2.Mc_TraderPassword = "";
- modelMc2.Mc_UsedNumber = "";
- modelMc2.Mc_Status = "1";
- modelMc2.Mc_Remark = "";
- if (modelOrder.ID <= 0)
- { modelMc2.Mc_OpenCardSource = "订单介绍保存," + new System.Diagnostics.StackTrace(new System.Diagnostics.StackFrame(true)).ToString(); }
- else
- { modelMc2.Mc_OpenCardSource = "订单介绍修改," + new System.Diagnostics.StackTrace(new System.Diagnostics.StackFrame(true)).ToString(); }
- modelMc2.Mc_CreateDatetime = strTime;
- modelMc2.Mc_CreateName = strUserID;
- modelMc2.Mc_TouchAccount = 0;
- modelMc2.Mc_TotalTouchAccount = 0;
- modelMc2.Mc_SecondQueryName = LYFZ.DAL.DAL_ErpCustomer.ClientNumberGetClientAllChildName(modelClientGroup.GP_IntroducerCustomerID);
- clist.Add(mcbll.GetAddCommandInfo(modelMc2));
- }
- else
- {
- if (!string.IsNullOrEmpty(this.StrReferralsMemberCardNumber))
- {
- modelMc2.Mc_CradNumber = this.StrReferralsMemberCardNumber;
- clist.Add(mcbll.GetUpdateCommandInfo(modelMc2));
- }
- }
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.ReferralAmountPaidPoints)
- {
- DataTable tblPointLog = orbll.GetView_Custom("tb_ErpMemberCardPointsLOG", StrWhere: "MPlg_Type = '3' and MPlg_OrderNumber = '" + modelOrder.Ord_Number + "'", ShowColumnName: "ID").Tables[0];
- if (tblPointLog.Rows.Count <= 0)
- {
- LYFZ.Model.Model_ErpMemberCardPointsLOG modelPointsIntrLOG = new Model.Model_ErpMemberCardPointsLOG();
- int IntPointsIntr = LYFZ.BLL.BLL_ErpMemberCard.GetPoints_AgoPeriod(LYFZ.EnumPublic.MemberPointsType.txtReferral_RMB, modelOrder.Ord_SeriesPrice, strInfoID, ClientNumber: modelClientGroup.GP_IntroducerCustomerID, IsHaveCardNumber: true);
- if (IntPointsIntr > 0)
- {
- LYFZ.Model.Model_ErpMemberCardPoints modelPoints2 = mcptsbll.GetModel("Mcps_Number", modelMc2.Mc_Number);
- if (modelPoints2.ID <= 0)
- {
- modelPoints2 = new Model.Model_ErpMemberCardPoints();
- modelPointsIntrLOG.MPlg_OriginalPoints = 0;
- modelPoints2.Mcps_Number = modelMc2.Mc_Number;
- modelPoints2.Mcps_TotalPoints = IntPointsIntr;
- modelPoints2.Mcps_AvailablePoints = IntPointsIntr;
- if (modelOrder.ID <= 0)
- { modelPoints2.Mcps_OpenCardSource = "订单介绍保存," + new System.Diagnostics.StackTrace(new System.Diagnostics.StackFrame(true)).ToString(); }
- else
- { modelPoints2.Mcps_OpenCardSource = "订单介绍修改," + new System.Diagnostics.StackTrace(new System.Diagnostics.StackFrame(true)).ToString(); }
- modelPoints2.Mcps_UpdateDateTime = strTime;
- modelPoints2.Mcps_UpdateName = strUserID;
- clist.Add(mcptsbll.GetAddCommandInfo(modelPoints2));
- }
- else
- {
- modelPointsIntrLOG.MPlg_OriginalPoints = modelPoints2.Mcps_AvailablePoints;
- modelPoints2.Mcps_TotalPoints = modelPoints2.Mcps_TotalPoints + IntPointsIntr;
- modelPoints2.Mcps_AvailablePoints = modelPoints2.Mcps_AvailablePoints + IntPointsIntr;
- modelPoints2.Mcps_UpdateDateTime = strTime;
- modelPoints2.Mcps_UpdateName = strUserID;
- clist.Add(mcptsbll.GetUpdateCommandInfo(modelPoints2));
- }
- modelPointsIntrLOG.MPlg_DividedShop = LYFZ.BLL.OrderPayment_Member.StrInfoID;
- modelPointsIntrLOG.MPlg_Number = modelPoints2.Mcps_Number;
- modelPointsIntrLOG.MPlg_Type = "3";
- modelPointsIntrLOG.MPlg_ExistingPoints = modelPoints2.Mcps_AvailablePoints;
- modelPointsIntrLOG.MPlg_UsePoints = IntPointsIntr;
- modelPointsIntrLOG.MPlg_RedeemArticle = "";
- modelPointsIntrLOG.MPlg_RedeemAmount = 0;
- modelPointsIntrLOG.MPlg_OrderNumber = modelOrder.Ord_SinceOrderNumber.Trim() != "" ? modelOrder.Ord_SinceOrderNumber.Trim() : modelOrder.Ord_Number;
- modelPointsIntrLOG.MPlg_ViceCardNumber = "";
- modelPointsIntrLOG.MPlg_Remark = "你介绍" + modelCilentMain.Cus_Name + "来订单,订单号:" + modelPointsIntrLOG.MPlg_OrderNumber + "付款,获得积分:" + IntPointsIntr;
- modelPointsIntrLOG.MPlg_CreateDatetime = strTime;
- modelPointsIntrLOG.MPlg_CreateName = strUserID;
- clist.Add(mcpslogbll.GetAddCommandInfo(modelPointsIntrLOG));
- //积分有效期
- clist.AddRange(LYFZ.BLL.OrderPayment_Member.PointsChangeAutoValidity(modelMc2.Mc_Number, modelMc2.Mc_CradNumber));
- }
- }
- }
- }
- #endregion
- #region 修改介绍的电话号码
- if (!string.IsNullOrEmpty(this.StrReferralsClientPhone.Trim()))
- {
- clist.Add(ctbll.GetUpdateCommandInfo(this.modelFriends));
- }
- #endregion
- if (clist.Count > 0)
- {
- #region 保存前检测订单号
- if (modelOrder.ID <= 0)
- {
- DataTable tbl = orbll.GetView_Custom("tb_ErpOrder", StrWhere: "Ord_Number = '" + modelOrder.Ord_Number + "'", ShowColumnName: "Ord_Number").Tables[0];
- if (tbl.Rows.Count > 0)
- {
- //if (strOrderPrefix != "")
- //{ tbl = orbll.GetView_Custom("tb_ErpOrder", StrWhere: "Ord_Number like '" + strOrderPrefix + "%'", filedOrder: " Ord_Number DESC", ShowColumnName: "Ord_Number", TopCount: 1).Tables[0]; }
- //else
- //{ tbl = orbll.GetView_Custom("tb_ErpOrder", filedOrder: " Ord_Number DESC", ShowColumnName: "Ord_Number", TopCount: 1).Tables[0]; }
- //if (tbl.Rows.Count > 0)
- //{
- #region 刘工 2017-03-26 修改
- LYFZ.BLL.BLL_ErpOrder.UpdateOrderNumberRecord(modelOrder.Ord_Number, strUserID,SDateTime.Now);
- #endregion
- /* string strUpdateNumber = modelOrder.Ord_Number;
- if (tbl.Rows[0]["Ord_Number"].ToString().Trim() == modelOrder.Ord_Number)
- { strUpdateNumber = tbl.Rows[0]["Ord_Number"].ToString().Trim(); }
- DataTable tbl2 = ornrbll.GetList("Ornr_OrderDate = '" + Convert.ToDateTime(SDateTime.Now.ToString("yyyy-MM-dd")).ToString("yyyy-MM-dd HH:mm:ss") + "'").Tables[0];
- LYFZ.Model.Model_ErpOrderNumberRecord modelrecotd = null;
- if (tbl2.Rows.Count > 0)
- {
- modelrecotd = ornrbll.DataTableToList(tbl2)[0];
- modelrecotd.Ornr_OrderCount = modelrecotd.Ornr_OrderCount + 1;
- modelrecotd.Ornr_LastNumber = strUpdateNumber;
- modelrecotd.Ornr_UpdateDateTime = strTime;
- modelrecotd.Ornr_UpdateName = strUserID;
- ornrbll.Update(modelrecotd);
- }
- else
- {
- modelrecotd = new Model.Model_ErpOrderNumberRecord();
- modelrecotd.Ornr_LastNumber = strUpdateNumber;
- modelrecotd.Ornr_OrderCount = 1;
- modelrecotd.Ornr_CreateDateTime = strTime;
- modelrecotd.Ornr_CreateName = strUserID;
- ornrbll.Add(modelrecotd);
- }*/
-
- //MessageBoxCustom.Show("此订单号已被占用,请重新保存!"); return;
- IsSaveedOK = false;
- //}
- //else
- //{ IsSaveedOK = true; }
- }
- else
- { IsSaveedOK = true; }
- }
- else
- { IsSaveedOK = true; }
- #endregion
- if (IsSaveedOK)
- {
- #region 修改最后订单号的记录
- /* if (modelOrder.ID <= 0)
- {
- LYFZ.Model.Model_ErpOrderNumberRecord modelNR = ornrbll.GetModel("Ornr_OrderDate", Convert.ToDateTime(strTime.ToString("yyyy-MM-dd")).ToString("yyyy-MM-dd HH:mm:ss"));
- if (modelNR.ID <= 0)
- {
- modelNR.Ornr_LastNumber = modelOrder.Ord_Number;
- modelNR.Ornr_OrderCount = 1;
- modelNR.Ornr_OrderDate = Convert.ToDateTime(strTime.ToString("yyyy-MM-dd"));
- modelNR.Ornr_CreateDateTime = strTime;
- modelNR.Ornr_CreateName = strUserID;
- clist.Add(ornrbll.GetAddCommandInfo(modelNR));
- }
- else
- {
- modelNR.Ornr_LastNumber = modelOrder.Ord_Number;
- modelNR.Ornr_OrderCount = modelNR.Ornr_OrderCount + 1;
- modelNR.Ornr_UpdateDateTime = strTime;
- modelNR.Ornr_UpdateName = strUserID;
- clist.Add(ornrbll.GetUpdateCommandInfo(modelNR));
- }
- }*/
- #endregion
- if (MessageBoxCustom.Show("确定要保存吗?", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.No)
- { return; }
- //test(clist, StrNewOrderNumber);
- if (LYFZ.BLL.BaseBllOperate.ExecuteSqlTran(clist) > 0)
- {
- #region 刘工 2017-03-26 修改
- if (modelOrder.ID <= 0)
- {
- LYFZ.BLL.BLL_ErpOrder.UpdateOrderNumberRecord(modelOrder.Ord_Number, strUserID, SDateTime.Now);
- }
- #endregion
- if (IsOpenCardSendSMS)
- { LYFZ.BLL.OrderPayment_Member.OpenMemberSendSMS(modelCilentMain.Cus_CustomerNumber, modelMc.Mc_CradNumber, StrStoreNumber: LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID()); }
- this.StrNumber = modelOrder.Ord_Number;
- this.IsSaveed = true;
- switch (this.OrdType)
- {
- case EnumPublic.OrderType.婚纱订单:
- case EnumPublic.OrderType.儿童订单:
- case EnumPublic.OrderType.写真订单:
- case EnumPublic.OrderType.婚庆订单:
- if (this.OrderEx != null)
- { this.OrderEx.SetOrderValue(orbll.GetModel(modelOrder.Ord_Number)); }
- break;
- case EnumPublic.OrderType.服务订单:
- if (this.ServiceOrderEx != null)
- { this.ServiceOrderEx.SetOrderValue(orbll.GetModel(modelOrder.Ord_Number)); }
- break;
- }
- this.IsUpdateOrderLoad = true;
- //更新客户组成员表
- if (string.IsNullOrEmpty(this.OrderGroupNumber))
- { LYFZ.DAL.DAL_ErpCustomer.UpdateAggregationCustomer(this.StrNumber); }
- else
- { LYFZ.DAL.DAL_ErpCustomer.UpdateAggregationCustomer(this.OrderGroupNumber); }
- if (modelOrder.Ord_Number.Trim().Length > 0)
- { LYFZ.BLL.BLL_ErpOrderDigitalStatus.UpdateDigitalStatus(modelOrder.Ord_Number, LYFZ.EnumPublic.OrderDigitalStatusEnum.开单); }
- #region 收款 并 积分
- bool IsPayment = true;
- if (LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.OrdersReceivablesCompetence, LYFZ.CustomAttributes.OperatingAuthority.OrdersReceivables))
- {
- if (modelOrder.Ord_SeriesPrice > 0)
- {
- if (ptbll.GetRecordCount("Pay_OrdNumber = '" + modelOrder.Ord_Number + "'") <= 0)
- {
- LYFZ.Software.MainBusiness.FinancialManagement.OrdersReceivables.FrmPrePayment frm = new FinancialManagement.OrdersReceivables.FrmPrePayment();
- //frm.StrOrdType = this.OrdType.ToString();
- frm.StrOrdNumber = this.StrNumber;
- //frm.StrCope = modelOrder.Ord_SeriesPrice;
- frm.IsShowButtonPayment = true;
- //frm.StrPaid = 0;
- //frm.StrArrears = modelOrder.Ord_SeriesPrice;
- frm.ShowDialog();
- IsPayment = false;
- }
- }
- }
- #endregion
- this.OpenSingleLoad();
- if (IsPayment)
- { MessageBoxCustom.Show("保存成功!"); }
- }
- else
- { MessageBoxCustom.Show("保存失败!"); }
- IsSaveedOK = true;
- }
- }
- }
- if (IsSaveedOK)
- {
- #region 流程短信
- if (isAddOrder || IsIntentionOrder)
- {
- System.Threading.Thread t = new System.Threading.Thread(new System.Threading.ThreadStart(delegate()
- {
- Model.SMSParameters sparameters = new Model.SMSParameters();
- sparameters.OrderNumber = this.StrNumber;
- try
- { smsTemplates.GenerateEventSMS(EnumPublic.SmsSendEvent.客人订单后X分钟, sparameters); }
- catch { }
- if (this.modelFriends != null)
- {
- if (this.OrderEx != null)
- {
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.ReferralAmountPaidPoints)
- {
- sparameters = new Model.SMSParameters();
- sparameters.CurrentSpendingMemberID = StrMainClientNumber;
- sparameters.Referrals = modelFriends.Cus_CustomerNumber;
- sparameters.ReferralsBonusPoints = LYFZ.BLL.BLL_ErpMemberCard.GetPoints_AgoPeriod(EnumPublic.MemberPointsType.txtReferral_RMB, OrderEx.TaoXiPrice, strInfoID, ClientNumber: modelFriends.Cus_CustomerNumber);
- try
- { smsTemplates.GenerateEventSMS(EnumPublic.SmsSendEvent.转介绍后X分钟发送短信给介绍人, sparameters); }
- catch { }
- }
- }
- }
- //客户名称:XXX 订单金额:OrderAmount 订单号:OrderNO 订单号(显示用):ShowOrderNO 订单时间:Time 套系名称:GroupName
- try
- {
- DataTable dtShowNumber = orbll.GetView_Custom("tb_ErpOrder", StrWhere: "Ord_Number = '" + this.StrNumber + "'", ShowColumnName: "CASE Ord_SinceOrderNumber WHEN '' THEN Ord_Number ELSE Ord_SinceOrderNumber END AS 订单号").Tables[0];
- dynamic tMParameters = new System.Dynamic.ExpandoObject();
- tMParameters.OrderNO = this.StrNumber;
- tMParameters.ShowOrderNO = dtShowNumber.Rows[0]["订单号"].ToString().Trim();
- tMParameters.OrderAmount = this.OrderEx.TaoXiPrice.ToString("n2") + "元";
- tMParameters.Time = strTime;
- tMParameters.GroupName = StrSeriesName;
- smsTemplates.GenerateEventTemplateMessage(EnumPublic.MicroSendEvent.客人订单后X分钟, tMParameters);
- }
- catch
- { }
- if (this.modelViceCard != null)
- {
- DataTable dt = orbll.GetView_Custom("tb_ErpMemberCard", StrWhere: "Mc_Number = '" + this.modelViceCard.Mvc_Number + "' And Mc_CradNumber != ''", ShowColumnName: "Mc_CustomerNumber,Mc_CradNumber").Tables[0];
- if (dt.Rows.Count > 0)
- {
- if (this.modelViceCard.Mvc_ViceCardType == "返现副卡")
- {
- DataTable dtPackagesMoney = orbll.GetView_Custom("tb_ErpMemberCardBackCash", StrWhere: "Mcbc_Number = '" + this.modelViceCard.Mvc_Number + "'", ShowColumnName: "Mcbc_PackagesMoney").Tables[0];
- if (dtPackagesMoney.Rows.Count > 0)
- {
- dec_OrderDiscounts = 1;
- DataTable tbl = orbll.GetView_Custom("tb_ErpSystemConfigure", StrWhere: " Sconfig_Code = 'BackCashCoefficient'", ShowColumnName: "Sconfig_Value").Tables[0];
- if (tbl.Rows.Count > 0)
- { dec_OrderDiscounts = Convert.ToDecimal(tbl.Rows[0]["Sconfig_Value"].ToString().Trim()); }
- else
- {
- LYFZ.Model.Model_ErpSystemConfigure model = new Model.Model_ErpSystemConfigure();
- model.Sconfig_Code = "BackCashCoefficient";
- model.Sconfig_Name = "返现系数";
- model.Sconfig_Value = dec_OrderDiscounts.ToString().Trim();
- model.Sconfig_IsEnabled = true;
- model.Sconfig_Type = "";
- model.Sconfig_Remark = "返现系数(实现返现范围)";
- model.Sconfig_Order = 0;
- model.Sconfig_CreateDatetime = SDateTime.Now;
- model.Sconfig_CreateName = "";
- sgbll.Add(model);
- }
- decimal decTaoXiPrice = Convert.ToDecimal(dtPackagesMoney.Rows[0]["Mcbc_PackagesMoney"]) * dec_OrderDiscounts;
- if (decTaoXiPrice <= this.OrderEx.TaoXiPrice)
- {
- List<LYFZ.Model.Model_ErpMemberCardBackCashSet> mlistBackCashSet = mcbcsetbll.GetModelList("Mcb_Number = '" + modelViceCard.Mvc_Number + "' and (Mcb_ViceNumber = '' or Mcb_ViceNumber is NULL)");
- if (mlistBackCashSet.Count > 0)
- {
- LYFZ.Model.Model_ErpMemberCardBackCashSet modelCardBack = mlistBackCashSet[0];
- DataTable tblBackCash = orbll.GetView_Custom("tb_ErpMemberCardBackCashSet", StrWhere: "Mcb_Number = '" + modelViceCard.Mvc_Number + "' and Mcb_CashBackGroup = '" + modelViceCard.Mvc_CashBackGroup + "'", ShowColumnName: "Mcb_CashBackAmount,Mcb_IsSpending").Tables[0];
- DataRow[] dtRow = tblBackCash.Select("Mcb_IsSpending = '0'");
- decimal DecBackCashAmount = 0;
- if (dtRow.Length == 1)
- {
- for (int i = 0; i < tbl.Rows.Count; i++)
- {
- if (tbl.Rows[i]["Mcb_IsSpending"].ToString().Trim() == "1")
- {
- if (tbl.Rows[i]["Mcb_CashBackAmount"].ToString().Trim() != "")
- { DecBackCashAmount += Convert.ToDecimal(tbl.Rows[i]["Mcb_CashBackAmount"]); }
- }
- }
- DecBackCashAmount = decTaoXiPrice - DecBackCashAmount;
- }
- else
- { DecBackCashAmount = (modelCardBack.Mcb_Proportion / 100) * decTaoXiPrice; }
- //XXX 为客户姓名;XXN 为会员卡号;TEXT 为获得返现金内容(如:本次某某朋友为您返现金5000元); XXT 为获得返现金时间
- sparameters = new Model.SMSParameters();
- sparameters.CurrentSpendingMemberID = dt.Rows[0]["Mc_CustomerNumber"].ToString().Trim();
- sparameters.CardNumber = dt.Rows[0]["Mc_CradNumber"].ToString().Trim();
- sparameters.XXT = strTime;
- sparameters.TEXT = "您朋友持返现副卡" + this.modelViceCard.Mvc_ViceCardNumber + "来订单,获得返现" + DecBackCashAmount.ToString("0.00") + "元";
- sparameters.ReferralsBonusPoints = 0;
- try
- { smsTemplates.GenerateEventSMS(EnumPublic.SmsSendEvent.会员返现卡获得返现金后X分钟, sparameters); }
- catch { }
- }
- }
- }
- }
- else if (modelViceCard.Mvc_ViceCardType == "积分副卡")
- {
- DataTable dtAvailablePoints = orbll.GetView_Custom("tb_ErpMemberCardPoints", StrWhere: "Mcps_Number = '" + this.modelViceCard.Mvc_Number + "'", ShowColumnName: "Mcps_AvailablePoints").Tables[0];// mcpsbll.GetModel("Mcps_Number", modelMc.Mc_Number);
- if (dtAvailablePoints.Rows.Count > 0)
- {
- //XXX 为客户姓名;XXN 为会员卡号;TEXT 为获得返现金内容(如:本次某某朋友为您返现金5000元); XXT 为获得返现金时间
- int IntPointsIntr = LYFZ.BLL.BLL_ErpMemberCard.GetPoints_AgoPeriod(LYFZ.EnumPublic.MemberPointsType.txtReferral_RMB, this.OrderEx.TaoXiPrice, LYFZ.BLL.OrderPayment_Member.StrInfoID, StrMainClientNumber);
- sparameters = new Model.SMSParameters();
- sparameters.CurrentSpendingMemberID = dt.Rows[0]["Mc_CustomerNumber"].ToString().Trim();
- sparameters.CardNumber = dt.Rows[0]["Mc_CradNumber"].ToString().Trim();
- sparameters.XXT = strTime;
- sparameters.TEXT = "您朋友持积分副卡" + this.modelViceCard.Mvc_ViceCardNumber + "来订单,获得" + IntPointsIntr + "积分";
- sparameters.ReferralsBonusPoints = IntPointsIntr;
- sparameters.AvailablePoints = Convert.ToInt32(dtAvailablePoints.Rows[0]["Mcps_AvailablePoints"]);
- try
- { smsTemplates.GenerateEventSMS(EnumPublic.SmsSendEvent.当积分达到或超过X分时, sparameters); }
- catch { }
- try
- { smsTemplates.GenerateEventSMS(EnumPublic.SmsSendEvent.当积分接近X的百分之80时, sparameters); }
- catch { }
- try
- {
- if (!string.IsNullOrEmpty(sparameters.TEXT))
- { smsTemplates.GenerateEventSMS(EnumPublic.SmsSendEvent.会员积分变动后X分钟, sparameters); }
- }
- catch { }
- }
- }
- }
- }
- }));
- t.Start();
- }
- #endregion
- }
- }
- void test(List<Helper.CommandInfo> clist, string newOrderNumber)
- {
- foreach (Helper.CommandInfo commd in clist)
- {
- foreach (System.Data.SqlClient.SqlParameter Par in commd.Parameters)
- {
- if ("orderNuber,eddiid,iiii,dddd".Contains(Par.ParameterName))
- {
- Par.Value = newOrderNumber;
- }
- }
- }
- }
- /// <summary>
- /// 获取订单数码表的摄次数种子值
- /// </summary>
- /// <param name="dlist"></param>
- /// <returns></returns>
- int GetDigitalNumber(List<LYFZ.Model.Model_ErpOrderDigital> dlist)
- {
- int DigitalNumber = 0;
- if (dlist != null && dlist.Count > 0)
- {
- DigitalNumber = Convert.ToInt32(dlist[dlist.Count - 1].Ordv_DigitalNumber);
- while (ViceNumberEquals(dlist, DigitalNumber))
- { DigitalNumber++; }
- DigitalNumber--;
- }
- return DigitalNumber;
- }
- /// <summary>
- /// 栓检查DigitalNumber是否存在
- /// </summary>
- /// <param name="dlist"></param>
- /// <param name="DigitalNumber"></param>
- /// <returns></returns>
- bool ViceNumberEquals(List<LYFZ.Model.Model_ErpOrderDigital> dlist, int DigitalNumber)
- {
- bool bl = false;
- if (dlist != null)
- {
- int tempMaxNumber = 0;
- foreach (LYFZ.Model.Model_ErpOrderDigital modelDig in dlist)
- {
- string tempViceNumer = modelDig.Ordv_Number + "_" + LYFZ.Command.Command_Validate.GetBeforeAddZero(DigitalNumber, 3);
- if (modelDig.Ordv_ViceNumber.Equals(tempViceNumer))
- {
- bl = true;
- break;
- }
- else
- {
- int tempNu = 0;
- try
- { tempNu = Convert.ToInt32(modelDig.Ordv_ViceNumber.Split('_')[1]); }
- catch
- { tempNu = dlist.Count + modelDig.Ordv_DigitalNumber; }
- if (tempNu > tempMaxNumber)
- { tempMaxNumber = tempNu; }
- }
- }
- if (tempMaxNumber >= DigitalNumber)
- { bl = true; }
- }
- return bl;
- }
- /// <summary>
- /// 打印
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnPrint_Click(object sender, EventArgs e)
- {
- if (this.StrNumber.Trim() != "")
- {
- Hashtable htData = new Hashtable();
- htData["strNumber"] = this.StrNumber.Trim();
- htData["strOrdType"] = this.OrdType.ToString().Trim();
- LYFZ.Software.MainBusiness.ReportPrint.ReportFixedFormat.PrintFixedFormat(LYFZ.EnumPublic.PrintTypeEnum.订单预约单, htData);
- }
- }
- /// <summary>
- /// 新订单
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnNewOrder_Click(object sender, EventArgs e)
- {
- if (MessageBoxCustom.Show("重置后将清空所有数据,您确定要重置订单吗?", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
- {
- this.IsGoForm = true;
- this.EnumLoadFormType = LoadFormType.开单选择;
- this.Close();
- }
- }
- /// <summary>
- /// 清空数据重置
- /// </summary>
- void ClearDataReset()
- {
- this.btnSaveIntent.Visible = true;
- this.btnSaveIntent.Enabled = true;
- this.StrNumber = "";
- this.txtOrderPerson.Text = "";
- this.txtOrderPerson.Tag = null;
- this.mskMarriage.Text = "";
- this.chkMarriage.Checked = false;
- this.StyleSetAdd();
- this.ClearClientSource();
- this.mskMarriage.StrValue = "";
- this.chkMarriage.Checked = false;
- this.flowPanel2.Controls.Clear();
- this.tabControl.SelectedIndex = 0;
- this.tabControl.TabPages["tap2"].Tag = null;
- this.lblYiXiangClient.Enabled = true;
- this.IsUpdateOrderLoad = false;
- this.IsSaveedHadAuthorized = false;
- this.FillClientDataPanelHeight();
- this.GetTransactmemberCard();
- }
- /// <summary>
- /// 获取是否自动办理会员卡
- /// </summary>
- void GetTransactmemberCard()
- {
- this.panelTransactmemberCard.Visible = true;
- this.chkTransactmemberCard.Checked = LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.OrderAutoOpenMemberCard;
- }
- /// <summary>
- /// 关闭
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnOrderClose_Click(object sender, EventArgs e)
- {
- isClose = false;
- if (!isClose)
- {
- if (MessageBoxCustom.Show("你确定要关闭吗?", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.No)
- { return; }
- }
- this.Close();
- }
- /// <summary>
- /// 关闭窗体之前发生
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void OnSingleFormMain_FormClosing(object sender, FormClosingEventArgs e)
- {
- if (!this.IsGoForm)
- {
- if (this.isClose)
- {
- if (MessageBoxCustom.Show("你确定要关闭吗?", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.No)
- { e.Cancel = true; }
- }
- }
- }
- bool IsGoForm = false;
- /// <summary>
- /// 关闭窗体之后发生
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void OnSingleFormMain_FormClosed(object sender, FormClosedEventArgs e)
- {
- if (this.IsGoForm)
- {
- this.Hide();
- switch (this.EnumLoadFormType)
- {
- case LoadFormType.开单选择:
- LYFZ.Software.MainBusiness.DoorCityProcess.OnSingleFirstFormMain frm = new OnSingleFirstFormMain();
- frm.StartPosition = FormStartPosition.CenterScreen;
- frm.Show();
- break;
- }
- }
- }
- /// <summary>
- /// 窗体大小 发生变化
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void OnSingleFormMain_Resize(object sender, EventArgs e)
- { this.FillClientDataPanelHeight(); }
- #endregion
- #region 第一页
- #region 添加成年人客户控件
- /// <summary>
- /// 添加客户控件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void pictAddClient_Click(object sender, EventArgs e)
- {
- if (this.OrdType == EnumPublic.OrderType.婚纱订单)
- {
- if (this.AddClinetCount >= 2)
- { MessageBoxCustom.Show("婚纱订单,添加客户最多只能" + this.AddClinetCount + "个!"); return; }
- this.ClientAdultPanelAdd("其他联系人" + this.ClientAdultNameCount, IsPhoneSymbol: false);
- }
- else if (this.OrdType == EnumPublic.OrderType.儿童订单)
- {
- if (this.AddClinetCount >= 5)
- { MessageBoxCustom.Show("儿童订单,添加客户最多只能" + this.AddClinetCount + "个!"); return; }
- this.ClientAdultPanelAdd("其他联系人" + this.ClientAdultNameCount, IsShowRelation: true, lblRelation: "与宝贝关系:", IsPhoneSymbol: false);
- }
- else
- {
- if (this.AddClinetCount >= 5)
- { MessageBoxCustom.Show("写真订单,添加客户最多只能" + this.AddClinetCount + "个!"); return; }
- this.ClientAdultPanelAdd("其他联系人" + this.ClientAdultNameCount, IsPhoneSymbol: false);
- }
- this.AddClinetCount++;
- }
- /// <summary>
- /// 客户成年人资料
- /// </summary>
- /// <param name="lblClentName">层标题名称</param>
- /// <param name="PanelName">层Name</param>
- /// <param name="IsShowRemove">是否显示移除按钮</param>
- /// <param name="IsShowRelation">是否显示关系控件</param>
- /// <param name="lblRelation">关系控件lable的名称</param>
- void ClientAdultPanelAdd(string lblClentName = "", string PanelName = "Adult_", bool IsShowRemove = true, bool IsShowRelation = true, string lblRelation = "与客户关系:", LYFZ.Model.Model_ErpCustomer model = null, string MainClientRelation = "", bool IsPhoneSymbol = true)
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.OrderClientParentsControlsEx Client = new SetCustomControls.OrderClientParentsControlsEx();
- Client.IsUpdateOrderLoad = this.IsUpdateOrderLoad;
- Client.Name = PanelName + ClientAdultNameCount;
- Client.StrClientAttribute = PanelName;
- Client.IsPictDeleteShow = IsShowRemove;
- if (model != null)
- {
- Client.SetClientValue(model, true, MainClientRelation: MainClientRelation);
- Client.IsPictResetShow = true;
- Client.IsPictEditShow = true;
- }
- else
- {
- Client.IsPictEditShow = false;
- Client.IsPictResetShow = false;
- }
- Client.LblClientName = lblClentName;
- Client.IsShowRelation = IsShowRelation;
- Client.LblRelationText = lblRelation;
- Client.Location = new Point(this.panelAddClient.Location.X, this.panelAddClient.Location.Y + this.flowPanel1.Location.Y);
- Client.IsExistClient += Client_IsExistClient;
- Client.DeleteClick += Client_DeleteClick;
- Client.RelationSet += Client_RelationSet;
- Client.RegionSet += Client_RegionSet;
- Client.PhoneLeave += Client_PhoneLeave;
- Client.UpdateOrderGroup += Client_UpdateOrderGroup;
- Client.isShowPhoneSymbol(IsPhoneSymbol);
- this.flowPanel1.Controls.Add(Client);
- this.ClientAdultNameCount++;
- this.panelAddClient.Location = new Point(this.panelAddClient.Location.X, Client.Location.Y + Client.Height + 6);
- if (this.flowPanel1.Height < (panelAddClient.Location.Y + panelAddClient.Height + Client.Height))
- {
- this.panelVice1.Height = this.panelVice1.Height + ((panelAddClient.Location.Y + (panelAddClient.Height * 2) + Client.Height) - this.flowPanel1.Height);
- this.flowPanel1.Height = this.panelVice1.Height - this.flowPanel1.Location.Y;
- }
- this.panelAddClient.SendToBack();
- this.PanelMain1_Click(this, null);
- }
- /// <summary>
- /// 判断当前客户在其他资料是否存在,一个订单不能同时存在两个相同的客户
- /// </summary>
- /// <param name="StrControlsName"></param>
- /// <param name="StrClientNumber"></param>
- /// <returns></returns>
- string Client_IsExistClient(string StrControlsName, string StrClientNumber)
- {
- foreach (Control control in this.flowPanel1.Controls)
- {
- if (control is SetCustomControls.OrderClientParentsControlsEx)
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.OrderClientParentsControlsEx tmp = (SetCustomControls.OrderClientParentsControlsEx)control;
- if (tmp.Name.Trim() != StrControlsName.Trim())
- {
- if (tmp.modelCilent != null)
- {
- if (tmp.modelCilent.Cus_CustomerNumber.Trim() != "")
- {
- if (tmp.modelCilent.Cus_CustomerNumber.Trim() == StrClientNumber.Trim())
- { return tmp.LblClientName.Trim(); }
- }
- }
- }
- }
- }
- return "";
- }
- /// <summary>
- /// 移除客户控件
- /// </summary>
- void Client_DeleteClick(SetCustomControls.OrderClientParentsControlsEx senderEx)
- {
- if (this.modelOldClient != null)
- {
- if (senderEx.modelCilent != null)
- {
- if (this.modelOldClient.Cus_CustomerNumber == senderEx.modelCilent.Cus_CustomerNumber)
- { this.modelOldClient = null; }
- }
- }
- if ((this.flowPanel1.Height + this.flowPanel1.Location.Y - this.panelAddClient.Height) >= this.PanelMain1.Height)
- {
- this.panelVice1.Height = this.panelVice1.Height - senderEx.Height;
- if (this.PanelMain1.Height > (this.panelVice1.Height + 6))
- { this.panelVice1.Height = this.PanelMain1.Height - 6; }
- this.flowPanel1.Height = this.panelVice1.Height - this.flowPanel1.Location.Y;
- }
- this.AddClinetCount--;
- }
- /// <summary>
- /// 客户关系
- /// </summary>
- /// <param name="obj"></param>
- void Client_RelationSet(object obj)
- {
- foreach (Control control in this.flowPanel1.Controls)
- {
- if (control is SetCustomControls.OrderClientParentsControlsEx)
- {
- SetCustomControls.OrderClientParentsControlsEx tmp = (SetCustomControls.OrderClientParentsControlsEx)control;
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_ClientRelation("BFABDBAJBJCEBDJCJ", tmp.CmbtreevRelation);
- }
- }
- }
- /// <summary>
- /// 客户地区设置
- /// </summary>
- /// <param name="obj"></param>
- void Client_RegionSet(object obj)
- {
- foreach (Control control in this.flowPanel1.Controls)
- {
- if (control is SetCustomControls.OrderClientParentsControlsEx)
- {
- SetCustomControls.OrderClientParentsControlsEx tmp = (SetCustomControls.OrderClientParentsControlsEx)control;
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_ClientRelation("AAAAAAC", tmp.CmbtreevRegion, true);
- }
- }
- }
- /// <summary>
- /// 客户电话输入后离开事件,去检测是否有相同电话的
- /// </summary>
- /// <param name="objForm"></param>
- void Client_PhoneLeave(object objForm)
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.OrderClientParentsControlsEx ClientEx = (SetCustomControls.OrderClientParentsControlsEx)objForm;
- foreach (Control control in this.flowPanel1.Controls)
- {
- if (control is SetCustomControls.OrderClientParentsControlsEx)
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.OrderClientParentsControlsEx tmp = (SetCustomControls.OrderClientParentsControlsEx)control;
- if (!ClientEx.Equals(tmp))
- {
- if (ClientEx.StrClientPhone.Trim() != "" && tmp.StrClientPhone.Trim() != "")
- {
- if (ClientEx.StrClientPhone.Trim() == tmp.StrClientPhone.Trim())
- { MessageBoxCustom.Show("'" + ClientEx.LblClientName.Trim() + "' 与 '" + tmp.LblClientName.Trim() + "' 的手机号码不能一样!"); ClientEx.StrClientPhone = ""; }
- }
- }
- }
- }
- }
- /// <summary>
- /// 电话输入事件——模糊查询
- /// </summary>
- /// <param name="obj"></param>
- /// <param name="senderEx"></param>
- void Client_UpdateOrderGroup(object obj)
- {
- if (obj != null && obj.ToString().Trim().Length > 0)
- {
- string[] StrArray = obj.ToString().Trim().Split('|');
- switch (StrArray[0].Trim())
- {
- case "ClientGroup":
- this.OrderGroupNumber = StrArray[1].Trim();
- break;
- case "OrderNumber":
- this.UpdateOrderIsUpdateClientData = true;
- this.StrNumber = StrArray[1].Trim();
- this.OpenSingleLoad();
- this.UpdateOrderIsUpdateClientData = true;
- break;
- case "IntentClient":
- string[] StrList = StrArray[1].Trim().Split(',');
- this.UpdateOrderIsUpdateClientData = false;
- this.SelectIntentClient(StrList[0].Trim(), StrList[1].Trim());
- this.UpdateOrderIsUpdateClientData = true;
- break;
- }
- }
- }
- #endregion
- #region 添加儿童客户资料
- /// <summary>
- /// 添加儿童客户资料
- /// </summary>
- /// <param name="lbClentName"></param>
- /// <param name="PanelName"></param>
- /// <param name="IsShowRemove"></param>
- void ClientChildPanelAdd(string lbClentName = "宝贝资料", string PanelName = "Child_", bool IsShowRemove = true)
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.OrderClientChildrenControlsEx Children = new SetCustomControls.OrderClientChildrenControlsEx();
- Children.IsUpdateOrderLoad = this.IsUpdateOrderLoad;
- Children.Name = PanelName + ClientAdultNameCount;
- Children.StrClientAttribute = PanelName;
- Children.IsPictDeleteShow = IsShowRemove;
- Children.LblClientName = lbClentName;
- Children.Location = new Point(this.panelAddClient.Location.X, this.panelAddClient.Location.Y + this.flowPanel1.Location.Y);
- Children.DeleteClick += Children_DeleteClick;
- this.flowPanel1.Controls.Add(Children);
- this.ClientChildNameCount++;
- this.panelAddClient.Location = new Point(this.panelAddClient.Location.X, Children.Location.Y + Children.Height + 6);
- if (this.flowPanel1.Height < (panelAddClient.Location.Y + panelAddClient.Height + Children.Height))
- { this.panelVice1.Height += Children.Height; }
- this.panelAddClient.SendToBack();
- }
- /// <summary>
- /// 移除客户控件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void Children_DeleteClick(SetCustomControls.OrderClientChildrenControlsEx senderEx)
- {
- if (this.panelVice1.Height >= this.PanelMain1.Height)
- { this.panelVice1.Height = this.panelVice1.Height - senderEx.Height; }
- this.AddClinetCount--;
- }
- #endregion
- #region 开单类型
- /// <summary>
- /// 开单类型选择
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void chBox_Click()
- {
- List<SetCustomControls.OrderClientParentsControlsEx> ClistA = new List<SetCustomControls.OrderClientParentsControlsEx>();
- List<SetCustomControls.OrderClientChildrenControlsEx> ClistB = new List<SetCustomControls.OrderClientChildrenControlsEx>();
- foreach (Control control in this.flowPanel1.Controls)
- {
- if (control is SetCustomControls.OrderClientParentsControlsEx)
- {
- SetCustomControls.OrderClientParentsControlsEx tmp = (SetCustomControls.OrderClientParentsControlsEx)control;
- ClistA.Add(tmp);
- }
- if (control is SetCustomControls.OrderClientChildrenControlsEx)
- {
- SetCustomControls.OrderClientChildrenControlsEx tmp = (SetCustomControls.OrderClientChildrenControlsEx)control;
- ClistB.Add(tmp);
- }
- }
- for (int i = 0; i < ClistA.Count; i++)
- { this.flowPanel1.Controls.Remove(ClistA[i]); }
- for (int i = 0; i < ClistB.Count; i++)
- { this.flowPanel1.Controls.Remove(ClistB[i]); }
- this.ClientAdultNameCount = 1;
- this.ClientChildNameCount = 1;
- this.AddClinetCount = 0;
- this.AddClinetCount++;
- this.panelMarriage.Visible = false;
- switch (this.OrdType)
- {
- case EnumPublic.OrderType.婚纱订单:
- this.panelHospitalClient.Visible = false;
- this.panelMarriage.Visible = true;
- this.ClientAdultPanelAdd("客户资料", PanelName: "Man_", IsShowRemove: false, IsShowRelation: false);
- break;
- case EnumPublic.OrderType.儿童订单:
- this.AddClinetCount++;
- this.panelHospitalClient.Visible = true;
- this.ClientChildPanelAdd(IsShowRemove: false);
- this.ClientAdultPanelAdd("家长资料", PanelName: "Man_", IsShowRemove: false, IsShowRelation: true, lblRelation: "与宝贝关系:");
- break;
- case EnumPublic.OrderType.写真订单:
- this.panelHospitalClient.Visible = true;
- this.ClientAdultPanelAdd("客户资料", PanelName: "Man_", IsShowRemove: false, IsShowRelation: false);
- break;
- case EnumPublic.OrderType.婚庆订单:
- this.panelHospitalClient.Visible = false;
- this.panelMarriage.Visible = true;
- this.panelEx3.Visible = false;
- this.ClientAdultPanelAdd("客户资料", PanelName: "Man_", IsShowRemove: false, IsShowRelation: false);
- break;
- case EnumPublic.OrderType.服务订单:
- this.panelHospitalClient.Visible = true;
- this.panelMarriage.Visible = true;
- this.panelEx3.Visible = false;
- this.ClientAdultPanelAdd("客户资料", PanelName: "Man_", IsShowRemove: false, IsShowRelation: false);
- break;
- }
- if (LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetBusinessType() == LYFZ.Software.MainBusiness.EnumPermissions.BusinessType.儿童版 || LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetBusinessType() == LYFZ.Software.MainBusiness.EnumPermissions.BusinessType.旗舰版)
- { this.pictAddClient.Visible = true; }
- else
- { this.panelHospitalClient.Visible = false; }
- SetCustomControls.OrderClientParentsControlsEx frmClient = (SetCustomControls.OrderClientParentsControlsEx)flowPanel1.Controls["Man_1"];
- if (this.modelOldClient != null)
- {
- frmClient.SetClientValue(this.modelOldClient, true);
- frmClient.IsPictEditShow = true;
- frmClient.IsPictResetShow = true;
- }
- else
- {
- frmClient.SetClientValue(null);
- frmClient.IsPictEditShow = false;
- frmClient.IsPictResetShow = false;
- }
- //this.CurrentClickCount = Convert.ToInt32(chk.Tag);
- }
- #endregion
- #region 客户来源
- /// <summary>
- /// 客户来源设置
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnSourceSet_Click(object sender, EventArgs e)
- {
- LYFZ.Software.MainBusiness.InitialSet.FrmSystemSet frm = new InitialSet.FrmSystemSet();
- frm.TypeName = "AAAAAAF";
- frm.Version = "Version";
- if (frm.ShowDialog() == DialogResult.OK)
- { LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_ClientSourec("AAAAAAF", this.cmbtreevClientSource, strHideFiled: "BFACBABGBGBJGDHIE,BFAFBCBADBDCABFDD,AAAAABT"); }
- }
- /// <summary>
- /// 老客户
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void chkOldClient_Click(object sender, EventArgs e)
- {
- if (string.IsNullOrEmpty(this.StrNumber))
- {
- if (!this.chkOldClient.Checked)
- { return; }
- LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.ClientGroupSelectSuperSmallForm frm = new SuperSmallForm.ClientGroupSelectSuperSmallForm();
- frm.ShowDialog();
- if (frm.IsSaveed)
- {
- #region
- this.chBox_Click();
- if (frm.mlist.Count > 0)
- {
- if (frm.mlist.Count == 1)
- {
- foreach (Control control in this.flowPanel1.Controls)
- {
- if (control is SetCustomControls.OrderClientParentsControlsEx)
- {
- SetCustomControls.OrderClientParentsControlsEx tmp = (SetCustomControls.OrderClientParentsControlsEx)control;
- if (tmp.StrClientAttribute == "Man_")
- {
- tmp.SetClientValue(frm.mlist[0], true);
- tmp.IsPictResetShow = true;
- tmp.IsPictEditShow = true;
- break;
- }
- }
- else if (control is SetCustomControls.OrderClientChildrenControlsEx)
- {
- SetCustomControls.OrderClientChildrenControlsEx tmp = (SetCustomControls.OrderClientChildrenControlsEx)control;
- if (frm.mlist[0].Cus_Telephone == "")
- {
- tmp.SetClientValue(frm.mlist[0], true);
- tmp.IsPictResetShow = true;
- tmp.IsPictEditShow = true;
- break;
- }
- }
- }
- }
- else
- {
- foreach (Control control in this.flowPanel1.Controls)
- {
- if (control is SetCustomControls.OrderClientParentsControlsEx)
- {
- SetCustomControls.OrderClientParentsControlsEx tmp = (SetCustomControls.OrderClientParentsControlsEx)control;
- if (tmp.StrClientAttribute == "Man_")
- {
- for (int i = 0; i < frm.mlist.Count; i++)
- {
- if (frm.mlist[i].Cus_CustomerNumber == frm.htData["MainClientNumber"].ToString().Trim())
- {
- tmp.SetClientValue(frm.mlist[i], true);
- tmp.IsPictResetShow = true;
- tmp.IsPictEditShow = true;
- frm.mlist.RemoveAt(i);
- break;
- }
- }
- }
- else
- {
- for (int i = 0; i < frm.mlist.Count; i++)
- {
- if (frm.mlist[i].Cus_CustomerNumber != frm.htData["MainClientNumber"].ToString().Trim() && frm.mlist[i].Cus_Telephone.Trim() != "")
- {
- tmp.SetClientValue(frm.mlist[i], true);
- tmp.IsPictResetShow = true;
- tmp.IsPictEditShow = true;
- frm.mlist.RemoveAt(i);
- break;
- }
- }
- }
- }
- else if (control is SetCustomControls.OrderClientChildrenControlsEx)
- {
- SetCustomControls.OrderClientChildrenControlsEx tmp = (SetCustomControls.OrderClientChildrenControlsEx)control;
- for (int i = 0; i < frm.mlist.Count; i++)
- {
- if (frm.mlist[i].Cus_Telephone == "")
- {
- tmp.SetClientValue(frm.mlist[i], true);
- tmp.IsPictResetShow = true;
- tmp.IsPictEditShow = true;
- frm.mlist.RemoveAt(i);
- break;
- }
- }
- }
- }
- if (frm.mlist.Count > 0)
- {
- for (int i = 0; i < frm.mlist.Count; i++)
- {
- ClientAdultPanelAdd("其他联系人" + ClientAdultNameCount, model: frm.mlist[i]);
- this.AddClinetCount++;
- }
- }
- }
- if (frm.htData["Ord_Number"].ToString().Trim() == "")
- { this.OrderGroupNumber = frm.htData["GP_CustomerGroupID"].ToString().Trim(); }
- }
- #endregion
- }
- this.chkFriends.Enabled = true;
- }
- this.chkOldClient.Checked = true;
- this.chkOther.Checked = false;
- this.chkFriends.Checked = false;
- this.modelViceCard = null;
- this.toolTip1.SetToolTip(this.chkFriends, "");
- this.chkFriends.Text = this.chkFriends.Tag.ToString();
- this.cmbtreevClientSource.Text = "";
- this.cmbtreevClientSource.Tag = "";
- this.cmbtreevClientSource.StrGetName = "";
- this.cmbtreevClientSource.Enabled = false;
- this.chkHospitalClient.Checked = false;
- this.modelFriends = null;
- this.ComeSingleLotNumber = "";
- }
- /// <summary>
- /// 朋友介绍
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void chkFriends_Click(object sender, EventArgs e)
- {
- if (!this.chkFriends.Checked)
- {
- this.chkFriends.Text = this.chkFriends.Tag.ToString();
- return;
- }
- LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.FriendIntroducedSuperSmallForm frm = new SuperSmallForm.FriendIntroducedSuperSmallForm();
- frm.ShowDialog();
- this.toolTip1.SetToolTip(this.chkFriends, "");
- this.modelViceCard = null;
- if (frm.IsSaveed)
- {
- this.StrReferralsClientPhone = frm.StrReferralsClientPhone;
- this.StrReferralsMemberCardNumber = frm.StrReferralsMemberCardNumber;
- string StrCardType = "";
- string StrCardTypeShow = "";
- DataTable dt = orbll.GetView_Custom("tb_ErpMemberCard", StrWhere: "Mc_CustomerNumber = '" + frm.model.Cus_CustomerNumber + "' And Mc_CradNumber != ''", ShowColumnName: "Mc_CardType").Tables[0];
- if (dt.Rows.Count > 0)
- {
- StrCardType = ";主卡等级:" + dt.Rows[0]["Mc_CardType"].ToString().Trim();
- if (dt.Rows[0]["Mc_CardType"].ToString().Trim() != "无")
- { StrCardTypeShow = " - " + dt.Rows[0]["Mc_CardType"].ToString().Trim(); }
- }
- this.modelFriends = frm.model;
- if (frm.modelVice != null)
- {
- this.chkFriends.Text = "朋友介绍(" + frm.model.Cus_Name + StrCardTypeShow + " - 副卡)";
- this.modelViceCard = frm.modelVice;
- this.toolTip1.SetToolTip(this.chkFriends, "朋友介绍(介绍人:" + frm.model.Cus_Name + StrCardType + ";副卡卡号:" + frm.modelVice.Mvc_ViceCardNumber + ")");
- }
- else
- {
- this.chkFriends.Text = "朋友介绍(" + frm.model.Cus_Name + StrCardTypeShow + ")";
- this.toolTip1.SetToolTip(this.chkFriends, "朋友介绍(介绍人:" + frm.model.Cus_Name + StrCardType + ")");
- }
- }
- else
- {
- this.chkFriends.Text = this.chkFriends.Tag.ToString();
- this.modelFriends = null;
- }
- this.chkFriends.Checked = true;
- this.chkOldClient.Checked = false;
- this.chkOldClient.Enabled = true;
- this.cmbtreevClientSource.Text = "";
- this.cmbtreevClientSource.Tag = "";
- this.cmbtreevClientSource.StrGetName = "";
- this.ComeSingleLotNumber = "";
- this.chkOther.Checked = false;
- this.chkHospitalClient.Checked = false;
- this.cmbtreevClientSource.Enabled = false;
- }
- /// <summary>
- /// 医院跟踪客户
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void chkHospitalClient_Click(object sender, EventArgs e)
- {
- if (!this.chkHospitalClient.Checked)
- { return; }
- LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.SelectHospitalClientSuperSmallForm frm = new SuperSmallForm.SelectHospitalClientSuperSmallForm();
- frm.ShowDialog();
- if (frm.IsSaveed)
- {
- this.chBox_Click();
- LYFZ.Model.Model_ErpHospitalClient model = frm.model;
- this.ComeSingleLotNumber = model.Hct_Oddnumber;
- foreach (Control control in this.flowPanel1.Controls)
- {
- if (control is SetCustomControls.OrderClientParentsControlsEx)
- {
- SetCustomControls.OrderClientParentsControlsEx tmp = (SetCustomControls.OrderClientParentsControlsEx)control;
- if (tmp.StrClientAttribute == "Man_")
- {
- tmp.setHospitalClientValue(model);
- tmp.IsPictResetShow = true;
- tmp.IsPictEditShow = true;
- }
- }
- else if (control is SetCustomControls.OrderClientChildrenControlsEx)
- {
- if (this.OrdType == EnumPublic.OrderType.儿童订单)
- {
- SetCustomControls.OrderClientChildrenControlsEx tmp = (SetCustomControls.OrderClientChildrenControlsEx)control;
- tmp.setHospitalClientValue(model);
- tmp.IsPictResetShow = true;
- tmp.IsPictEditShow = true;
- }
- }
- }
- }
- this.chkOldClient.Checked = false;
- this.chkOldClient.Enabled = true;
- this.cmbtreevClientSource.Text = "";
- this.cmbtreevClientSource.Tag = "";
- this.cmbtreevClientSource.StrGetName = "";
- this.cmbtreevClientSource.Enabled = false;
- this.chkOther.Checked = false;
- this.chkFriends.Checked = false;
- this.modelViceCard = null;
- this.toolTip1.SetToolTip(this.chkFriends, "");
- this.modelFriends = null;
- this.chkFriends.Text = this.chkFriends.Tag.ToString();
- }
- /// <summary>
- /// 其他
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void chkOther_Click(object sender, EventArgs e)
- {
- if (this.chkOther.Checked)
- {
- this.chkOther.Checked = true;
- this.cmbtreevClientSource.Enabled = true;
- }
- else
- {
- this.chkOther.Checked = false;
- this.cmbtreevClientSource.Text = "";
- this.cmbtreevClientSource.Tag = "";
- this.cmbtreevClientSource.StrGetName = "";
- this.cmbtreevClientSource.Enabled = false;
- }
- this.modelFriends = null;
- this.chkFriends.Checked = false;
- this.modelViceCard = null;
- this.toolTip1.SetToolTip(this.chkFriends, "");
- this.chkOldClient.Checked = false;
- this.chkHospitalClient.Checked = false;
- this.chkFriends.Enabled = true;
- this.chkOldClient.Enabled = true;
- this.chkFriends.Text = this.chkFriends.Tag.ToString();
- this.ComeSingleLotNumber = "";
- }
- /// <summary>
- /// 意向客户点击选择
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void lblYiXiangClient_Click(object sender, EventArgs e)
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.OrderSelectSuperSmallForm frm = new SuperSmallForm.OrderSelectSuperSmallForm();
- frm.Text = "选择订单(双击选择)";
- frm.ShowDialog();
- if (frm.IsSaveed)
- {
- this.chkFriends.Checked = false;
- this.chkOldClient.Checked = false;
- this.chkFriends.Enabled = true;
- this.chkOldClient.Enabled = true;
- this.chkFriends.Text = this.chkFriends.Tag.ToString();
- this.ComeSingleLotNumber = "";
- this.modelOldClient = null;
- this.SelectIntentClient(frm.SelectOrderNumber, frm.SelectClientGroupNumber);
- }
- }
- /// <summary>
- /// 选择意向订单或意向客户组
- /// </summary>
- /// <param name="SelectOrderNumber"></param>
- /// <param name="SelectClientGroupNumber"></param>
- void SelectIntentClient(string SelectOrderNumber, string SelectClientGroupNumber)
- {
- if (this.IsUpdateOrderLoad)
- { return; }
- if (!string.IsNullOrEmpty(SelectOrderNumber))
- {
- this.StrNumber = SelectOrderNumber;
- this.OrderGroupNumber = SelectClientGroupNumber;
- this.OpenSingleLoad();
- }
- else
- {
- DataTable tblGroup = orbll.GetView_Custom("tb_ErpCustomerGroup", StrWhere: "GP_CustomerGroupID = '" + SelectClientGroupNumber + "'", ShowColumnName: "GP_CustomerType").Tables[0];
- this.OrdType = (LYFZ.EnumPublic.OrderType)Convert.ToInt32(tblGroup.Rows[0]["GP_CustomerType"]);
- this.ClearDataReset();
- this.OrderGroupNumber = SelectClientGroupNumber;
- DataTable tbl = orbll.GetView_Custom("tb_ErpCustomerGroupMembers", StrWhere: "GM_CustomerGroupID = '" + this.OrderGroupNumber + "'", ShowColumnName: "GM_CustomerID,GM_Master,GM_ProtagonistCustomer,GM_RelatedPersonID").Tables[0];
- if (tbl.Rows.Count > 0)
- {
- List<SetCustomControls.OrderClientParentsControlsEx> AdultList = new List<SetCustomControls.OrderClientParentsControlsEx>();
- List<SetCustomControls.OrderClientChildrenControlsEx> ChildList = new List<SetCustomControls.OrderClientChildrenControlsEx>();
- foreach (Control control in this.flowPanel1.Controls)
- {
- if (control is SetCustomControls.OrderClientParentsControlsEx)
- {
- SetCustomControls.OrderClientParentsControlsEx tmp = (SetCustomControls.OrderClientParentsControlsEx)control;
- bool Isbl = true;
- if (tbl.Rows.Count > 0)
- {
- if (tmp.StrClientAttribute == "Man_")
- {
- for (int i = 0; i < tbl.Rows.Count; i++)
- {
- if (tbl.Rows[i]["GM_Master"].ToString().Trim() == "1")
- {
- tmp.SetClientValue(ctbll.GetModel("Cus_CustomerNumber", tbl.Rows[i]["GM_CustomerID"].ToString().Trim()), true);
- tmp.IsPictResetShow = true;
- tmp.IsPictEditShow = true;
- Isbl = false;
- tbl.Rows.RemoveAt(i);
- break;
- }
- }
- }
- else
- {
- for (int i = 0; i < tbl.Rows.Count; i++)
- {
- if (tbl.Rows[i]["GM_Master"].ToString().Trim() == "0" && tbl.Rows[i]["GM_ProtagonistCustomer"].ToString().Trim() == "1" && !tbl.Rows[i]["GM_CustomerID"].Equals(tbl.Rows[i]["GM_RelatedPersonID"]))
- {
- tmp.SetClientValue(ctbll.GetModel("Cus_CustomerNumber", tbl.Rows[i]["GM_CustomerID"].ToString().Trim()), true);
- tmp.IsPictResetShow = true;
- tmp.IsPictEditShow = true;
- Isbl = false;
- tbl.Rows.RemoveAt(i);
- break;
- }
- }
- }
- }
- if (Isbl)
- { AdultList.Add(tmp); }
- }
- else if (control is SetCustomControls.OrderClientChildrenControlsEx)
- {
- SetCustomControls.OrderClientChildrenControlsEx tmp = (SetCustomControls.OrderClientChildrenControlsEx)control;
- bool Isbl = true;
- if (tbl.Rows.Count > 0)
- {
- for (int i = 0; i < tbl.Rows.Count; i++)
- {
- if (tbl.Rows[i]["GM_Master"].ToString().Trim() == "0" && tbl.Rows[i]["GM_ProtagonistCustomer"].ToString().Trim() == "1" && tbl.Rows[i]["GM_CustomerID"].Equals(tbl.Rows[i]["GM_RelatedPersonID"]))
- {
- tmp.SetClientValue(ctbll.GetModel("Cus_CustomerNumber", tbl.Rows[i]["GM_CustomerID"].ToString().Trim()), true);
- tmp.IsPictResetShow = true;
- tmp.IsPictEditShow = true;
- Isbl = false;
- tbl.Rows.RemoveAt(i);
- break;
- }
- }
- }
- if (Isbl)
- { ChildList.Add(tmp); }
- }
- }
- //移除多余的客户组件
- for (int i = 0; i < AdultList.Count; i++)
- { this.flowPanel1.Controls.Remove(AdultList[i]); }
- for (int i = 0; i < ChildList.Count; i++)
- { this.flowPanel1.Controls.Remove(ChildList[i]); }
- }
- }
- }
- /// <summary>
- /// 清空客户来源
- /// </summary>
- void ClearClientSource()
- {
- this.chkOldClient.Checked = false;
- this.chkFriends.Checked = false;
- this.chkFriends.Text = this.chkFriends.Tag.ToString();
- this.chkOther.Checked = false;
- this.cmbtreevClientSource.SetTextAndTag_ValueNull();
- this.modelOldClient = null;
- this.modelFriends = null;
- this.OrderGroupNumber = "";
- this.ComeSingleLotNumber = "";
- }
- /// <summary>
- /// 获取客户来源
- /// </summary>
- /// <returns></returns>
- private string GetClientSource()
- {
- string StrClientSource = "";
- foreach (Control control in this.flowPanelClientSource.Controls)
- {
- foreach (Control control2 in control.Controls)
- {
- if (control2 is CheckBoxEx)
- {
- CheckBoxEx tmp = (CheckBoxEx)control2;
- if (tmp.Checked)
- {
- if (tmp.Tag.ToString().Trim() == "其他")
- { StrClientSource = this.cmbtreevClientSource.Text.Trim(); }
- else
- { StrClientSource = tmp.Tag.ToString().Trim(); }
- }
- }
- }
- }
- return StrClientSource;
- }
- #endregion
- #region 喜爱格调
- /// <summary>
- /// 喜爱格调设置
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnStyleSet_Click(object sender, EventArgs e)
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.StyleSetSmallForm frm = new SetSmallForm.StyleSetSmallForm();
- frm.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
- frm.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y);
- frm.Size = new Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height);
- frm.ShowDialog();
- if (frm.IsSaveed)
- { this.StyleSetAdd(); }
- }
- /// <summary>
- /// 添加Check控件
- /// </summary>
- private void StyleSetAdd()
- {
- List<CheckBoxEx> chklist = new List<CheckBoxEx>();
- foreach (Control control in this.panelEx3.Controls)
- {
- if (control is CheckBoxEx)
- {
- CheckBoxEx tmp = (CheckBoxEx)control;
- chklist.Add(tmp);
- }
- }
- for (int i = 0; i < chklist.Count; i++)
- { this.panelEx3.Controls.Remove(chklist[i]); }
- DataTable tbl = stbll.GetAllList(" ID ASC").Tables[0];
- if (tbl.Rows.Count > 0)
- {
- int StrTablIndex = 11;
- int LocationY = this.lblStyle.Location.Y + this.lblStyle.Height + 11;
- CheckBoxEx chBox = null;
- int[] Str1 = { 0, 5, 10, 15 };
- int[] Str2 = { 1, 6, 11, 16 };
- int[] Str3 = { 2, 7, 12, 17 };
- int[] Str4 = { 3, 8, 13, 18 };
- int[] Str5 = { 4, 9, 14, 19 };
- for (int i = 0; i < tbl.Rows.Count; i++)
- {
- chBox = new CheckBoxEx();
- if (Array.IndexOf(Str1, i) != -1)
- { chBox.Location = new Point(20, LocationY); }
- else if (Array.IndexOf(Str2, i) != -1)
- { chBox.Location = new Point(180, LocationY); }
- else if (Array.IndexOf(Str3, i) != -1)
- { chBox.Location = new Point(340, LocationY); }
- else if (Array.IndexOf(Str4, i) != -1)
- { chBox.Location = new Point(500, LocationY); }
- else if (Array.IndexOf(Str5, i) != -1)
- { chBox.Location = new Point(670, LocationY); LocationY += 25; }
- chBox.Name = "chk_" + tbl.Rows[i]["ID"].ToString();
- chBox.Text = tbl.Rows[i]["Style_Name"].ToString();
- chBox.TabIndex = StrTablIndex;
- StrTablIndex++;
- this.panelEx3.Controls.Add(chBox);
- }
- }
- }
- /// <summary>
- /// 获取喜爱格调
- /// </summary>
- /// <returns></returns>
- private string GetStyle()
- {
- String strStyle = "";
- foreach (Control control in this.panelEx3.Controls)//订单资料
- {
- if (control is CheckBoxEx)
- {
- CheckBoxEx tmp = (CheckBoxEx)control;
- if (tmp.Checked)
- { strStyle += tmp.Name.Trim() + "|"; }
- }
- }
- return strStyle.TrimEnd('|');
- }
- /// <summary>
- /// 获取喜爱格调
- /// </summary>
- /// <returns></returns>
- private List<string> GetStyleList()
- {
- List<string> ListID = new List<string>();
- foreach (Control control in this.panelEx3.Controls)//订单资料
- {
- if (control is CheckBoxEx)
- {
- CheckBoxEx tmp = (CheckBoxEx)control;
- if (tmp.Checked)
- {
- string[] strArray = tmp.Name.Trim().Split('_');
- ListID.Add(strArray[1].Trim());
- }
- }
- }
- return ListID;
- }
- /// <summary>
- /// 喜爱风格—浏览选择
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void lblBrowseSelect_Click(object sender, EventArgs e)
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.StyleViewSmallForm frm = new SetSmallForm.StyleViewSmallForm();
- frm.frmStyleViewVersion = SetSmallForm.StyleViewSmallForm.StyleViewVersion.风格浏览;
- frm.OldSelectStyleList = GetStyleList();
- frm.WindowState = FormWindowState.Maximized;
- frm.ShowDialog();
- if (frm.IsSaveed)
- {
- List<string> strList = frm.SelectStyleList;
- foreach (Control control in this.panelEx3.Controls)//订单资料
- {
- if (control is CheckBoxEx)
- {
- CheckBoxEx tmp = (CheckBoxEx)control;
- bool IsFind = false;
- for (int i = 0; i < strList.Count; i++)
- {
- string[] strArray = tmp.Name.Trim().Split('_');
- if (strArray[1].Trim() == strList[i].Trim())
- {
- IsFind = true;
- tmp.Checked = true;
- strList.RemoveAt(i);
- break;
- }
- }
- if (!IsFind)
- { tmp.Checked = false; }
- }
- }
- }
- }
- #endregion
- #region 选择接单人员
- /// <summary>
- /// 选择接单人员
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnSelectUser_Click(object sender, EventArgs e)
- { new LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses().txtOrdersPerson(this.txtOrderPerson); }
- #endregion
- #region 点击让滚动条获取焦点
- /// <summary>
- /// 点击让滚动条获取焦点
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void panelEx3_Click(object sender, EventArgs e)
- {
- this.PanelMain1_Click(this, null);
- }
- /// <summary>
- /// 点击让滚动条获取焦点
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void panelEx2_Click(object sender, EventArgs e)
- {
- this.PanelMain1_Click(this, null);
- }
- /// <summary>
- /// 点击让滚动条获取焦点
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void panelVice1_Click(object sender, EventArgs e)
- {
- this.PanelMain1_Click(this, null);
- }
- /// <summary>
- /// 点击让滚动条获取焦点
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void PanelMain1_Click(object sender, EventArgs e)
- {
- this.PanelMain1.Focus();
- }
- #endregion
- #endregion
- #region 第二页
- LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.OrderInfoOneControlsEx OrderEx = null;
- LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.OrderInfoTwoControlsEx ServiceOrderEx = null;
- LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.OrderProductControlsEx OrderProductEx = null;
- LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.OrderServiceControlsEx OrderServiceEx = null;
- LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.OrderStagesControlsEx OrderStagesEx = null;
- LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.OrderSightsControlsEx OrderSightsEx = null;
- LYFZ.Software.MainBusiness.DoorCityProcess.SetCustomControls.OrderProcessModule_PaymentDetailsControlsEx OrderProcessesEx = null;
- /// <summary>
- /// 选项卡选择事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void tabControl_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (this.tabControl.SelectedTab.Name.Trim() == this.tabControl.TabPages["tap2"].Name.Trim())
- {
- if (this.tabControl.TabPages["tap2"].Tag == null)
- {
- int PanelVice2Height = 0;
- Hashtable htData = new Hashtable();
- htData["IsShowSinceOrderNumber"] = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsCustomOrderNumber();
- htData["IsOrderNumber"] = "";
- htData["StrPrefix"] = this.GetOrderCustomPrefix();
- htData["StrOrderType"] = this.OrdType.ToString().Trim();
- switch (this.OrdType)
- {
- case EnumPublic.OrderType.服务订单:
- if (this.ServiceOrderEx == null)
- {
- this.ServiceOrderEx = new SetCustomControls.OrderInfoTwoControlsEx(htData);
- this.flowPanel2.Controls.Add(this.ServiceOrderEx);
- }
- PanelVice2Height += this.ServiceOrderEx.Height;
- break;
- default:
- if (this.OrderEx == null)
- {
- this.OrderEx = new SetCustomControls.OrderInfoOneControlsEx(htData);
- switch (this.OrdType)
- {
- case EnumPublic.OrderType.婚庆订单:
- this.OrderEx.IsHotelInfo = true;
- break;
- case EnumPublic.OrderType.儿童订单:
- this.OrderEx.IsShowIntoRegisterAndIntoBottom = false;
- break;
- }
- this.OrderEx.OrderTaoXiNodeMouseClick += OrderEx_OrderTaoXiNodeMouseClick;
- this.flowPanel2.Controls.Add(this.OrderEx);
- #region 权限
- if (!LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.OrderPackagesNameSet))
- { this.OrderEx.IsShowTaoXiNameSet = false; }
- if (!LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.OrderClsssSet))
- { this.OrderEx.IsOrderClsssSet = false; }
- #endregion
- }
- PanelVice2Height += this.OrderEx.Height;
- break;
- }
- switch (this.OrdType)
- {
- case EnumPublic.OrderType.婚纱订单:
- case EnumPublic.OrderType.写真订单:
- if (this.OrderSightsEx == null)
- {
- this.OrderSightsEx = new SetCustomControls.OrderSightsControlsEx();
- this.flowPanel2.Controls.Add(this.OrderSightsEx);
- #region 权限
- if (!LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.OrderSightsOrStageSet))
- { this.OrderSightsEx.IsShowSightsSet = false; }
- #endregion
- }
- this.OrderSightsEx.StrOrdNumber = this.StrNumber;
- PanelVice2Height += this.OrderSightsEx.Height;
- break;
- case EnumPublic.OrderType.儿童订单:
- if (this.OrderStagesEx == null)
- {
- this.OrderStagesEx = new SetCustomControls.OrderStagesControlsEx();
- this.flowPanel2.Controls.Add(this.OrderStagesEx);
- #region 权限
- if (!LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresOPenSingle, LYFZ.CustomAttributes.OperatingAuthority.OrderSightsOrStageSet))
- { this.OrderStagesEx.IsShowStagesSet = false; }
- #endregion
- }
- this.OrderStagesEx.StrOrdNumber = this.StrNumber;
- PanelVice2Height += this.OrderStagesEx.Height;
- break;
- }
- switch (this.OrdType)
- {
- case EnumPublic.OrderType.婚纱订单:
- case EnumPublic.OrderType.儿童订单:
- case EnumPublic.OrderType.婚庆订单:
- case EnumPublic.OrderType.写真订单:
- case EnumPublic.OrderType.服务订单:
- if (this.OrderProductEx == null)
- {
- this.OrderProductEx = new SetCustomControls.OrderProductControlsEx();
- this.OrderProductEx.OrdType = this.OrdType;
- this.flowPanel2.Controls.Add(this.OrderProductEx);
- if (this.OrderStagesEx != null)
- { this.OrderStagesEx.OrderProductEx = this.OrderProductEx; }
- }
- this.OrderProductEx.StrNumber = this.StrNumber;
- PanelVice2Height += this.OrderProductEx.Height;
- break;
- }
- if (this.OrderServiceEx == null)
- {
- this.OrderServiceEx = new SetCustomControls.OrderServiceControlsEx();
- this.OrderServiceEx.OrdType = this.OrdType;
- this.flowPanel2.Controls.Add(this.OrderServiceEx);
- if (this.OrderStagesEx != null)
- { this.OrderStagesEx.OrderServiceEx = this.OrderServiceEx; }
- }
- PanelVice2Height += this.OrderServiceEx.Height;
- this.panelVice2.Height = PanelVice2Height + 40;
- }
- this.PanelClick(this.panelVice2, 2);
- this.PanelMain2_Click(this, null);
- }
- else
- {
- if (this.tap3.Parent != null)
- {
- if (this.tabControl.SelectedTab.Name.Trim() == this.tabControl.TabPages["tap3"].Name.Trim())
- {
- if (this.OrderProcessesEx == null)
- {
- LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate(object obj, BackgroundWorker backgroundWorker)
- {
- try
- {
- this.Invoke(new LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.UpdateControl(delegate()
- {
- this.OrderProcessesEx = new SetCustomControls.OrderProcessModule_PaymentDetailsControlsEx(this.StrNumber, Convert.ToInt32(this.OrdType).ToString());
- //this.OrderProcessesEx.Dock = DockStyle.Fill;
- this.panelVice3.Controls.Add(this.OrderProcessesEx);
- if (this.panelVice3.Height < this.OrderProcessesEx.Height)
- { this.panelVice3.Height = this.OrderProcessesEx.Height; }
- //else
- //{ this.panelVice3.Height = this.PanelMain3.Height; }
- this.PanelClick(this.panelVice3, 3);
- this.PanelMain3_Click(this, null);
- }));
- }
- catch
- { }
- });
- }
- }
- }
- }
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="Panelcontrol"></param>
- void PanelClick(Control Panelcontrol, int LoadType)
- {
- if (Panelcontrol.Controls.Count > 0)
- {
- foreach (Control control in Panelcontrol.Controls)
- {
- if (control is LYFZ.ComponentLibrary.PanelEx || control is UserControl || control is FlowLayoutPanel)
- {
- if (LoadType == 2)
- { control.Click += PanelMain2_Click; }
- else if (LoadType == 3)
- { control.Click += PanelMain3_Click; }
- if (control.Controls.Count > 0)
- {
- this.PanelClick(control, LoadType);
- }
- }
- }
- }
- }
- /// <summary>
- /// 点击让滚动条获取焦点
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void PanelMain2_Click(object sender, EventArgs e)
- { this.PanelMain2.Focus(); }
- /// <summary>
- /// 点击让滚动条获取焦点
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void PanelMain3_Click(object sender, EventArgs e)
- {
- this.PanelMain3.Focus();
- }
- /// <summary>
- /// 套系选择
- /// </summary>
- /// <param name="objTaoXiNameTag">套系编号</param>
- /// <param name="IsActivity">是否可以操作</param>
- /// <param name="PackagesType">类型,判断是礼包还是套系</param>
- /// <param name="dtPackages">礼包几选几数据</param>
- void OrderEx_OrderTaoXiNodeMouseClick(object objTaoXiNameTag, bool IsActivity, LYFZ.EnumPublic.EnumPackagesType PackagesType, Hashtable htData)
- {
- if (objTaoXiNameTag != null)
- {
- string StrWhere = " And Pgm_PackagesCode = '" + objTaoXiNameTag.ToString().Trim() + "'";
- if (htData.ContainsKey("OptionalSeveral") && htData["OptionalSeveral"].ToString().Trim().Length > 0 && Convert.ToInt32(htData["OptionalSeveral"]) >= 0)
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.ToolboxPackageListViewSamllForm frm = new SetSmallForm.ToolboxPackageListViewSamllForm();
- frm.intOptionalSeveral = Convert.ToInt32(htData["OptionalSeveral"]);
- frm.StrPackageCode = objTaoXiNameTag.ToString().Trim();
- frm.StrOrderType = this.OrdType;
- frm.ShowDialog();
- if (frm.IsSaveed)
- {
- List<int> listID = frm.listID;
- string StrIDing = "";
- for (int i = 0; i < listID.Count; i++)
- { StrIDing += listID[i].ToString().Trim() + ","; }
- if (!string.IsNullOrEmpty(StrIDing))
- { StrWhere = " And tb_ErpPackagesGiftMerchandise.ID in (" + StrIDing.TrimEnd(',') + ")"; }
- }
- else
- { OrderEx.RemovePackageItem(); return; }
- }
- string strMagess = "";
- LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate(object obj, BackgroundWorker backgroundWorker)
- {
- if (!string.IsNullOrEmpty(objTaoXiNameTag.ToString().Trim()))
- {
- string StrSource = "'' AS TaoXiNameSource,";
- if (PackagesType == EnumPublic.EnumPackagesType.AAAAACA)
- { StrSource = "'礼包' AS TaoXiNameSource,"; }
- string ExecuteSql = "select tb_ErpTheScenery.ID," + StrSource + "tb_ErpPackagesGiftMerchandise.ID AS PgmID,Tsc_Rating,Sc_ClassName,Tcs_Category,case when Tcs_Category = 0 then '内景' else '外景' end AS Tcs_CategoryText,Tsc_CostPrice,Tsc_SalesPrice,Tsc_Remark,Pgm_ProductName,Pgm_GiveType," +
- "Pgm_IntoRegisterQuantity,Pgm_IntoBottomQuantity,Pgm_Quantity from tb_ErpPackagesGiftMerchandise Left Join tb_ErpTheScenery on cast(tb_ErpTheScenery.ID as varchar(20)) = Pgm_ProductNumber " +
- "Left Join tb_ErpSystemCategory on Tsc_Rating = Sc_ClassCode where Pgm_GiveType in ('2','3') " + StrWhere + ";";
- ExecuteSql += "select Prod_Number," + StrSource + "tb_ErpPackagesGiftMerchandise.ID AS PgmID,Pgm_ProductNumber,Prod_Name,Prod_Batch,Prod_CostPrice,Prod_SalesPrice,Prod_Class,Prod_Unit,Prod_Thumbnail,Pgm_ProductNumber,Pgm_ProductName,Pgm_IntoRegisterQuantity,Pgm_IntoBottomQuantity,Pgm_GiveType," +
- "Pgm_Quantity,Pgm_GiveType,Pgm_ProductGroupName from tb_ErpPackagesGiftMerchandise Left Join tb_ErpProduct on Prod_Number = Pgm_ProductNumber where Pgm_GiveType in ('0','1') " + StrWhere + ";";
- DataSet dsData = orbll.GetView_Custom(ExecuteSql);
- DataTable dtSights = dsData.Tables["ds"];
- DataTable dtProduct = dsData.Tables["ds1"];
- try
- {
- this.Invoke(new LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.UpdateControl(delegate()
- {
- if (this.OrderSightsEx != null)
- {
- DataRow[] dtRow = dtSights.Select("Pgm_GiveType = '2'");
- strMagess += this.OrderSightsEx.SetOrderSightsValue(dtRow, IsActivity, PackagesType);
- }
- if (this.OrderStagesEx != null)
- {
- DataRow[] dtRow = dtSights.Select("Pgm_GiveType = '3'");
- strMagess += this.OrderStagesEx.SetOrderStagesValue(dtRow, IsActivity, PackagesType);
- }
- if (this.OrderServiceEx != null)
- {
- DataRow[] dtRow = dtProduct.Select("Pgm_GiveType = '1'");
- strMagess += this.OrderServiceEx.SetOrderServiceValue(dtRow, IsActivity, PackagesType);
- }
- if (this.OrderProductEx != null)
- {
- DataRow[] dtRow = dtProduct.Select("Pgm_GiveType = '0'");
- strMagess += this.OrderProductEx.SetOrderProductValue(dtRow, IsActivity, PackagesType);
- }
- }));
- }
- catch { }
- }
- else if (PackagesType == EnumPublic.EnumPackagesType.AAAAACA)
- {
- this.Invoke(new LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.UpdateControl(delegate()
- {
- if (this.OrderSightsEx != null)
- {
- try
- { this.OrderSightsEx.RemovePackageItem(); }
- catch { }
- }
- if (this.OrderStagesEx != null)
- {
- try
- { this.OrderStagesEx.RemovePackageItem(); }
- catch { }
- }
- if (this.OrderServiceEx != null)
- {
- try
- { this.OrderServiceEx.RemovePackageItem(); }
- catch { }
- }
- if (this.OrderProductEx != null)
- {
- try
- { this.OrderProductEx.RemovePackageItem(); }
- catch { }
- }
- }));
- }
- });
- if (strMagess.Trim() != "")
- { MessageBoxCustom.Show(strMagess); }
- }
- }
- #endregion
- }
- }
|