123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210 |
- <?xml version="1.0" encoding="utf-8" ?>
- <Forms>
- <Form Name="FrmCustomer">
- <Client>
- <Events>
- <Load>
- <![CDATA[
- @SetFlag=1;
- @Title="客户基本资料";
- @HaveSearchCustomerList=false;
- GetSchema();
- Search("SearchSystemSetting");
- @SysCurrency=#SystemSetting.SysCurrency_SystemSetting;
- ChangeMode("Search");
- RecordHistoryRead("FrmCustomer");
- Search("SearchIsMain");
- ]]>
- </Load>
- <Closing>
- RecordHistoryWrite("FrmCustomer","dtStartBill","dtEndBill","ckNearlyBill","tbNearlyBill","ckQueryPriceBill","ckSaleBill","ckSaleRtnBill","ckInventoryBill","dtStartProduct"
- ,"dtEndProduct","ckNearlyProduct","tbNearlyProduct","ckQueryPriceProduct","ckSaleProduct","ckSaleRtnProduct","ckInventoryProduct","ckSaleOutDepotBill","ckIndentBill","ckSaleOutDepotProduct","ckIndentProduct");
- </Closing>
- <Closed>
- ;
- </Closed>
- </Events>
- <Mode>
- <Search>
- <Lable name="Search" />
- </Search>
- <New>
- <Lable name="New" />
- </New>
- <View>
- <Lable name="View" />
- </View>
- <Modify>
- <Lable name="Modify" />
- </Modify>
- </Mode>
- <Controls>
- <IKTextButton name="tbNo" DataSource="Customer.No_Customer">
- <Events>
- <Enter>
- <![CDATA[
- if(tbNo.ReadOnly == false)
- {
- if(tbNo.CValue != StringEmpty())
- {
- UpdateForm(false, "");
- Empty("#ExchangeProduct");
- Empty("#ExchangeBill");
- if(Search("SearchCustomerWithNo", tbNo.CValue))
- {
-
- if(!Search("SearchCustomersIsInRegionalLeader",#Customer.No_Customer, GetCurrentUser()))
- {
- MessageBox("你与客户不在同一个区域,不能查看!");
- ChangeMode("Search");
- return;
- }
- if(!GetRight("客户基本资料","全权查看"))
- {
- if( !Equals(#Customer.ID_Creator,GetLoginUserID()) )
- {
- @EnterNo=tbNo.CValue;
- ChangeMode("Search");
- tbNo.CValue = @EnterNo;
- MessageBox("您没有查看此客户基本资料的权限!",@Title);
- return;
- }
- }
- ChangeMode("View");
- }
- else
- {
- if(GetRight(@Title,"新增"))
- ChangeMode("New");
- else
- MessageBox("您没有新增客户基本资料的权限!",@Title);
- }
- }
- else
- {
- MessageBox("请输入客户编号!",@Title);
- }
- }
- ]]>
- </Enter>
- <Click>
- <![CDATA[
- if (tbNo.ReadOnly == false)
- {
- @temp = ShowSearchBox("CustomerSearch","INFOMATION",tbNo.CValue);
- if( @temp == "" )
- return;
- tbNo.CValue = @temp;
- ActiveControlEvent("tbNo", "Enter");
- }
- ]]>
- </Click>
- </Events>
- </IKTextButton>
- <IKTextButton name="tbNo2" DataSource="Customer.No2_Customer">
- <Events>
- <Enter>
- if(tbNo2.CValue != StringEmpty())
- {
- if (tbNo2.CValue.ToUpper()!=tbNo.CValue.ToUpper())
- {
- #Customer.No_Customer = tbNo2.CValue;
- if(Search("SearchCustomerWithNo2", tbNo2.CValue))
- {
- #Customer.IsCustomersCustomer_Customer = 1;
- #Customer.CustomerID_Customer = #Customer2.ID_Customer;
- tbNo2.CValue = #Customer2.No_Customer;
- txtShortName2.CValue = #Customer2.ShortName_Customer;
- }
- else
- {
- #Customer.IsCustomersCustomer_Customer = 0;
- #Customer.CustomerID_Customer = GuidEmpty();
- tbNo2.CValue = "";
- txtShortName2.CValue = "";
- MessageBox("找不到此客户!!");
- }
- #Customer.No_Customer = tbNo.CValue;
- }
- else
- {
- #Customer.IsCustomersCustomer_Customer = 0;
- #Customer.CustomerID_Customer = GuidEmpty();
- tbNo2.CValue = "";
- txtShortName2.CValue = "";
- MessageBox("所属客户不可与客户名相同!");
- tbNo2.Focus();
- }
- }
- </Enter>
- <Click>
- tbNo2.CValue="";
- txtShortName2.CValue="";
- @Temp2 = ShowSearchBox("CustomerSearch","INFOMATION",tbNo2.CValue);
- if( @Temp2 != StringEmpty() )
- {
- tbNo2.CValue = @Temp2;
- if (tbNo2.CValue!=tbNo.CValue)
- {
- if(Search("SearchCustomerWithNo2",tbNo2.CValue))
- {
- #Customer.IsCustomersCustomer_Customer = 1;
- #Customer.CustomerID_Customer = #Customer2.ID_Customer;
- tbNo2.CValue = #Customer2.No_Customer;
- txtShortName2.CValue = #Customer2.ShortName_Customer;
- }
- else
- {
- #Customer.IsCustomersCustomer_Customer = 0;
- #Customer.CustomerID_Customer = GuidEmpty();
- tbNo2.CValue = "";
- txtShortName2.CValue = "";
- }
- }
- else
- {
- #Customer.IsCustomersCustomer_Customer = 0;
- #Customer.CustomerID_Customer = GuidEmpty();
- tbNo2.CValue = "";
- txtShortName2.CValue = "";
- MessageBox("所属客户不可与客户名相同!");
- tbNo2.Focus();
- }
- }
- </Click>
- </Events>
- </IKTextButton>
- <IKTextBox name="txtShortName" DataSource="Customer.ShortName_Customer"/>
- <IKTextBox name="txtShortName2" DataSource="Customer.ShortName2_Customer"/>
- <IKTextBox name="txtName" DataSource="Customer.Name_Customer"/>
- <IKTextBox name="txtRegistedAddress" DataSource="Customer.RegistedAddress_Customer">
- <Events>
- <Enter>
- if(txtRegistedAddress.CValue!=StringEmpty())
- {
- txtSendAddr.CValue=txtRegistedAddress.CValue;
- Search("InsertRecord",txtName.CValue,txtRegistedAddress.CValue);
- MergeTable("#TempInvoice","#Invoice");
- }
- else
- {
- MessageBox("请输入客户注册地址!",@Title);
- }
- </Enter>
- </Events>
- </IKTextBox>
- <IKCountryCombo name="cbCountry" DataSource="Customer.Country_Customer"/>
- <IKTextBox name="txtPostalCode" DataSource="Customer.PostalCode_Customer"/>
- <IKPhoneControl name="pcPhone" DataSource="Telephone" ValueMember="ID_Telephone" DisplayMember="Name_Telephone" NoMember="No_Telephone" FocusMember="Focus_Telephone"></IKPhoneControl>
- <IKPhoneControl name="pcFax" DataSource="Fax" ValueMember="ID_Fax" DisplayMember="Name_Fax" NoMember="No_Fax" FocusMember="Focus_Fax"></IKPhoneControl>
- <IKNumericTextBox name="txtPayLimit" DataSource="Customer.PayLimit_Customer"/>
- <IKComboBoxEx name="cbPayLimitType" DataSource="GetPayLimitType" DisplayMember="Name_Type">
- <Events>
- <Reload>
- UpdateForm(false,"cbPayLimitType");
- Search("SearchPayLimitType");
- UpdateForm(true,"cbPayLimitType");
- </Reload>
- </Events>
- </IKComboBoxEx>
- <IKNumericTextBox name="txtPayLimit2" DataSource="Customer.OpeningBalanceAdjust_Customer"/>
- <IKNumericTextBox name="tbDunDate" DataSource="Customer.DunDate_Customer"/>
- <IKNumericTextBox name="tbLowDiscount" DataSource="Customer.LowDiscount_Customer"/>
- <IKComboBoxEx name="cbGetMethod" DisplaySource="Customer.GetMethod_Customer" DataSource="GetMethodType" DisplayMember="Name_TypeDef">
- <Events>
- <Reload>
- UpdateForm(false, "cbGetMethod");
- Search("SearchGetMethodType");
- UpdateForm(true, "cbGetMethod");
- </Reload>
- <SelectedIndexChanged>
- if(cbGetMethod.SelectedName=="先款后货")
- {
- txtPayLimit.CValue=0;
- txtPayLimit.Enabled=false;
- }
- else
- {
- txtPayLimit.Enabled=GetFieldRight(@Title,"信用额度","修改");;
- }
- </SelectedIndexChanged>
- </Events>
- </IKComboBoxEx>
- <IKTextBox name="txtSendAddr" DataSource="Customer.SendAddr_Customer"/>
- <IKDateTimeText name="dttCreateDate" DataSource="Customer.CreateDate_Customer"/>
- <IKTextBox name="txtCreator" DataSource="Customer.CreatorName_Customer"/>
- <!--Customer.CreatorName_Customer isn't DB's Field-->
- <IKDateTimePause name="dtpIsSuspend" DataSource="Customer.SuspendDate_Customer"/>
- <IKTextBox name="txtComment" DataSource="Customer.Comment_Customer"/>
- <IKTextBox name="txtRemark" DataSource="Customer.RemarkBalance_Customer"/>
- <IKComboBoxEx name="comboArea" ValueSource ="Customer.ID_RegionalLeader" DisplaySource="Customer.Name_RegionalLeader" NoSource="Customer.No_RegionalLeader" DataSource="RegionalLeader" ValueMember="ID_RegionalLeader" DisplayMember="Name_RegionalLeader" NoMember="No_RegionalLeader">
- <Events>
- <Reload>
- UpdateForm(false, "comboArea");
- Search("SearchAreaType");
- UpdateForm(true, "comboArea");
- </Reload>
- </Events>
- </IKComboBoxEx>
- <IKComboBoxEx name="cbIndustry" DisplaySource="Customer.Industry_Customer" DataSource="IndustryType" DisplayMember="Name_TypeDef">
- <Events>
- <Reload>
- UpdateForm(false, "cbIndustry");
- Search("SearchIndustryType");
- UpdateForm(true, "cbIndustry");
- </Reload>
- </Events>
- </IKComboBoxEx>
- <IKComboBoxEx name="cbZone" DisplaySource="Customer.Zone_Customer" DataSource="ZoneType" DisplayMember="Name_TypeDef">
- <Events>
- <Reload>
- UpdateForm(false, "cbZone");
- Search("SearchZoneType");
- UpdateForm(true, "cbZone");
- </Reload>
- </Events>
- </IKComboBoxEx>
- <IKComboBoxEx name="cbType" DisplaySource="Customer.Type_Customer" DataSource="Type" DisplayMember="Name_TypeDef">
- <Events>
- <Reload>
- UpdateForm(false, "cbType");
- Search("SearchType");
- UpdateForm(true, "cbType");
- </Reload>
- </Events>
- </IKComboBoxEx>
- <IKCheckBox name="cbIsGeneric" DataSource="Customer.IsGeneric_Customer"/>
- <IKComboBoxEx name="cbSource" DisplaySource="Customer.Source_Customer" DataSource="SourceType" DisplayMember="Name_TypeDef">
- <Events>
- <Reload>
- UpdateForm(false, "cbSource");
- Search("SearchSourceType");
- UpdateForm(true, "cbSource");
- </Reload>
- </Events>
- </IKComboBoxEx>
- <IKComboBoxEx name="cbLevel" DisplaySource="Customer.Level_Customer" DataSource="LevelType" DisplayMember="Name_TypeDef">
- <Events>
- <Reload>
- UpdateForm(false, "cbLevel");
- Search("SearchLevelType");
- UpdateForm(true, "cbLevel");
- </Reload>
- </Events>
- </IKComboBoxEx>
- <IKComboBoxEx name="cbBank" DisplaySource="Customer.Bank_Customer" DataSource="BankType" DisplayMember="Name_TypeDef">
- <Events>
- <Reload>
- UpdateForm(false, "cbBank");
- Search("SearchBankType");
- UpdateForm(true, "cbBank");
- </Reload>
- </Events>
- </IKComboBoxEx>
- <IKComboBoxEx name="cbCompany" DisplaySource="Customer.Company_Customer" DataSource="CompanyType" DisplayMember="Name_TypeDef">
- <Events>
- <Reload>
- UpdateForm(false, "cbCompany");
- Search("SearchCompanyType");
- UpdateForm(true, "cbCompany");
- </Reload>
- </Events>
- </IKComboBoxEx>
- <IKTextBox name="ikTextBox1" DataSource="Customer.Note_Customer"/>
- <IKTextBox name="txtAccount" DataSource="Customer.Account_Customer"/>
- <IKTextBox name="txtRevenueRegisterNo" DataSource="Customer.RevenueRegisterNo_Customer"/>
- <IKTextBox name="txtMender" DataSource="Customer.LastModUser"/>
- <IKDateTimeText name="dttMendeDate" DataSource="Customer.LastModDate_Customer"/>
- <IKDateTimePicker name="dtpBeginDate" DataSource="Customer.BeginDate_Customer"/>
- <IKDataGridEx name="dgInvoice" DataSource="Invoice" TableStyleIndex="0">
- <DataColumn Index="0" DataSource="Invoice.IsCommon_Invoice" >
- <IKDataGridComboBoxColumn DisplaySourceEx="Invoice.IsCommon_Invoice" ValueSourceEx="Invoice.Common_Invoice" DataSourceEx="IsMain" DisplayMemberEx="Result" ValueMemberEx="Value">
- <Events>
- <Reload>
- Search("SearchIsMain");
- SetDataGridColumnDataSource(0,"dgInvoice");
- </Reload>
- </Events>
- </IKDataGridComboBoxColumn>
- </DataColumn>
- <DataColumn Index="1" DataSource="Invoice.Title_Invoice" />
- <DataColumn Index="2" DataSource="Invoice.Address_Invoice" />
- <DataColumn Index="3" DataSource="Invoice.Tel_Invoice" />
- <DataColumn Index="4" DataSource="Invoice.Linkman_Invoice" />
- <DataColumn Index="5" DataSource="Invoice.Comment_Invoice" />
- </IKDataGridEx>
- <IKDataGridEx name="dgPrincipal" DataSource="Principal" TableStyleIndex="0">
- <DataColumn Index="0" DataSource="Principal.No_Employee" >
- <IKDataGridTextButtonColumn>
- <Events>
- <Click>
- @SetFlag=1;
- @temp = ShowSearchBox("EmployeeSearch","INFOMATION",#Principal.No_Employee);
- if(@temp != "")
- {
- ResumeColumnEvent("#Principal.No_Employee");
- #Principal.No_Employee = @temp;
- ClearColumnEvent();
- }
- </Click>
- <SetFlagBeforeClick>
- @SetFlag=0;
- </SetFlagBeforeClick>
- </Events>
- </IKDataGridTextButtonColumn>
- </DataColumn>
- <DataColumn Index="1" DataSource="Principal.Name_Employee" />
- <DataColumn Index="2" DataSource="Principal.IsMainStr_Principal" >
- <IKDataGridComboBoxColumn DisplaySourceEx="Principal.IsMainStr_Principal" ValueSourceEx="Principal.IsMain_Principal" DataSourceEx="IsMain" DisplayMemberEx="Result" ValueMemberEx="Value">
- <Events>
- <Reload>
- Search("SearchIsMain");
- SetDataGridColumnDataSource(2,"dgPrincipal");
- </Reload>
- </Events>
- </IKDataGridComboBoxColumn>
- </DataColumn>
- <DataColumn Index="3" DataSource="Principal.Comment_Principal" />
- </IKDataGridEx>
- <IKDataGridEx name="dgLinkMan" DataSource="Linkman" TableStyleIndex="0">
- <DataColumn Index="0" DataSource="Linkman.IsMainStr_Linkman" >
- <IKDataGridComboBoxColumn DisplaySourceEx="Linkman.IsMainStr_Linkman" ValueSourceEx="Linkman.IsMain_Linkman" DataSourceEx="IsMain" DisplayMemberEx="Result" ValueMemberEx="Value">
- <Events>
- <Reload>
- Search("SearchIsMain");
- SetDataGridColumnDataSource(0,"dgLinkMan");
- </Reload>
- </Events>
- </IKDataGridComboBoxColumn>
- </DataColumn>
- <DataColumn Index="1" DataSource="Linkman.Name_Linkman" />
- <DataColumn Index="2" DataSource="Linkman.Department_Linkman" />
- <DataColumn Index="3" DataSource="Linkman.Duty_Linkman" />
- <DataColumn Index="4" DataSource="Linkman.Tel_Linkman" />
- <DataColumn Index="5" DataSource="Linkman.Fax_Linkman" />
- <DataColumn Index="6" DataSource="Linkman.Mobile_Linkman" />
- <DataColumn Index="7" DataSource="Linkman.Email_Linkman" />
- <DataColumn Index="8" DataSource="Linkman.Comment_Linkman" />
- </IKDataGridEx>
- <IKDataGridEx name="dgCustomer" DataSource="CustomerList" TableStyleIndex="0">
- <DataColumn Index="0" DataSource="CustomerList.No_Customer" />
- <DataColumn Index="1" DataSource="CustomerList.ShortName_Customer" />
- <Events>
- <RowHeaderDoubleClick>
- if(Search("SearchCustomerWithNo",#CustomerList.No_Customer))
- {
- ChangeMode("View");
- }
- </RowHeaderDoubleClick>
- </Events>
- </IKDataGridEx>
- <IKDataGridEx name="dgExchangeBill" DataSource="ExchangeBill" TableStyleIndex="0">
- <DataColumn Index="0" DataSource="ExchangeBill.Date" />
- <DataColumn Index="1" DataSource="ExchangeBill.Name_Bill" />
- <DataColumn Index="2" DataSource="ExchangeBill.No_Bill" />
- <DataColumn Index="3" DataSource="ExchangeBill.ConsultNo" />
- <DataColumn Index="4" DataSource="ExchangeBill.Principal" />
- <DataColumn Index="5" DataSource="ExchangeBill.Money" />
- <Events>
- <RowHeaderDoubleClick>
- DgDoubleClick(#ExchangeBill.Name_Bill,#ExchangeBill.No_Bill);
- </RowHeaderDoubleClick>
- </Events>
- </IKDataGridEx>
- <IKButton name="btSearchBill">
- <Events>
- <Click>
- <![CDATA[
- if(dtStartBill.Checked==true)
- @StartTime = dtStartBill.CValue;
- else
- @StartTime = DBNull();
-
- if(dtEndBill.Checked==true)
- @EndTime = dtEndBill.CValue;
- else
- @EndTime = DBNull();
-
- @tbNearlyBill=tbNearlyBill.CValue;
-
- if(!Search("SearchExchangeBill",@StartTime, @EndTime,ckNearlyBill.Checked,@tbNearlyBill,ckQueryPriceBill.Checked,ckSaleBill.Checked,ckSaleRtnBill.Checked,ckInventoryBill.Checked,tbNo.CValue,ckSaleOutDepotBill.Checked,ckIndentBill.Checked,txtShortName.CValue,GetFieldRight("订货单","特价单","查看"),GetFieldRight("销货单","特价单","查看"),GetFieldRight("报价单","最低报价","查看")))
- Empty("#ExchangeBill");
- ]]>
- </Click>
- </Events>
- </IKButton>
- <IKDataGridEx name="dgExchangeProduct" DataSource="ExchangeProduct" TableStyleIndex="0">
- <DataColumn Index="0" DataSource="ExchangeProduct.No_Product" />
- <DataColumn Index="1" DataSource="ExchangeProduct.Name_Product" />
- <DataColumn Index="2" DataSource="ExchangeProduct.Date" />
- <DataColumn Index="3" DataSource="ExchangeProduct.Name_Bill" />
- <DataColumn Index="4" DataSource="ExchangeProduct.No_Bill" />
- <DataColumn Index="5" DataSource="ExchangeProduct.Num" />
- <DataColumn Index="6" DataSource="ExchangeProduct.Price" />
- <DataColumn Index="7" DataSource="ExchangeProduct.TaxCurrency" />
- <DataColumn Index="8" DataSource="ExchangeProduct.Money" />
- <DataColumn Index="9" DataSource="ExchangeProduct.Comment" />
- <Events>
- <RowHeaderDoubleClick>
- DgDoubleClick(#ExchangeProduct.Name_Bill,#ExchangeProduct.No_Bill);
- </RowHeaderDoubleClick>
- </Events>
- </IKDataGridEx>
- <IKDataGridEx name="dgRemark" DataSource="BasicComment" TableStyleIndex="0">
- <DataColumn Index="0" DataSource="BasicComment.Comment_BasicComment" />
- </IKDataGridEx>
- <IKDataGridEx name="dgInfo" DataSource="CustomerInfo" TableStyleIndex="0">
- <DataColumn Index="0" DataSource="CustomerInfo.No_CustomerInfo" />
- <DataColumn Index="1" DataSource="CustomerInfo.Date_CustomerInfo" />
- <DataColumn Index="2" DataSource="CustomerInfo.Principal_CustomerInfo" />
- <DataColumn Index="3" DataSource="CustomerInfo.Purchase_CustomerInfo" />
- <DataColumn Index="4" DataSource="CustomerInfo.Linkman_CustomerInfo" />
- <DataColumn Index="5" DataSource="CustomerInfo.Tel_CustomerInfo" />
- <DataColumn Index="6" DataSource="CustomerInfo.Fax_CustomerInfo" />
- <DataColumn Index="7" DataSource="CustomerInfo.FromDate_CustomerInfo" />
- <DataColumn Index="8" DataSource="CustomerInfo.Member_CustomerInfo" />
- <DataColumn Index="9" DataSource="CustomerInfo.LastTurnover_CustomerInfo" />
- <DataColumn Index="10" DataSource="CustomerInfo.Turnover_CustomerInfo" />
- <DataColumn Index="11" DataSource="CustomerInfo.Type_CustomerInfo" />
- </IKDataGridEx>
- <IKButton name="btSearchProduct">
- <Events>
- <Click>
- <![CDATA[
- if(dtStartProduct.Checked==true)
- @StartTime = dtStartProduct.CValue;
- else
- @StartTime = DBNull();
-
- if(dtEndProduct.Checked==true)
- @EndTime = dtEndProduct.CValue;
- else
- @EndTime = DBNull();
-
- @tbNearlyProduct=tbNearlyProduct.CValue;
- if(!(ckQueryPriceProduct.Checked||ckSaleProduct.Checked||ckSaleRtnProduct.Checked||ckInventoryProduct.Checked||ckSaleOutDepotProduct.Checked||ckIndentProduct.Checked))
- {
- MessageBox("请选择至少一种单据类型",@Title);
- return;
- }
- if(!Search("SearchExchangeProduct",@StartTime, @EndTime,ckNearlyProduct.Checked,@tbNearlyProduct,ckQueryPriceProduct.Checked,ckSaleProduct.Checked,ckSaleRtnProduct.Checked,ckInventoryProduct.Checked,tbNo.CValue,ckSaleOutDepotProduct.Checked,ckIndentProduct.Checked,txtShortName.CValue,GetFieldRight("订货单","特价单","查看"),GetFieldRight("销货单","特价单","查看"),GetFieldRight("报价单","最低报价","查看")))
- Empty("#ExchangeProduct");
- ]]>
- </Click>
- </Events>
- </IKButton>
- <IKCheckBox name="ckDisplay" DataSource="Customer.IsDisplay">
- <Events>
- <CheckedChanged>
- if(ckDisplay.Checked)
- Search("SearchAllCustomerList",GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID());
- else
- Search("SearchCustomerList",GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID());
- </CheckedChanged>
- </Events>
- </IKCheckBox>
- <IKCheckBox name="ikCheckBox2" DataSource="Customer.IsCustomersCustomer_Customer">
- <Events>
- <CheckedChanged>
- if (ikCheckBox2.Enabled == true)
- {
- tbNo2.IKButton.Enabled = true;
- if (ikCheckBox2.Checked == true)
- {
- tbNo2.ReadOnly = false;
- if(Search("SearchCustomerWithNo2", tbNo.CValue))
- {
- #Customer.IsCustomersCustomer_Customer=1;
- tbNo2.CValue = #Customer2.No2_Customer;
- txtShortName2.CValue = #Customer2.ShortName2_Customer;
- }
- else
- {
- #Customer.IsCustomersCustomer_Customer=0;
- tbNo2.CValue = "";
- txtShortName2.CValue = "";
- }
- }
- else
- {
- tbNo2.ReadOnly = true;
- tbNo2.IKButton.Enabled = false;
- #Customer.IsCustomersCustomer_Customer=0;
- #Customer.CustomerID_Customer = GuidEmpty();
- tbNo2.CValue = "";
- txtShortName2.CValue = "";
- }
- }
- else
- {
- tbNo2.ReadOnly = true;
- tbNo2.IKButton.Enabled = false;
- if(ikCheckBox2.Checked == true)
- if(Search("SearchCustomerWithNo2",tbNo.CValue))
- {
- tbNo2.CValue = #Customer2.No2_Customer;
- txtShortName2.CValue = #Customer2.ShortName2_Customer;
- }
- else
- {
- tbNo2.CValue = "";
- txtShortName2.CValue = "";
- }
- }
- </CheckedChanged>
- </Events>
- </IKCheckBox>
- <IKFormToolBar name="toolBar">
- <Events>
- <ClickFirst>
- cbPayLimitType.SelectedName="";
- if(Search("SearchCustomerFirst", tbNo.CValue,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID(),GetCurrentUser()))
- {
- Empty("#ExchangeProduct");
- Empty("#ExchangeBill");
- ChangeMode("View");
- }
- </ClickFirst>
- <ClickPrev>
- cbPayLimitType.SelectedName="";
- if(Search("SearchCustomerPrevious", tbNo.CValue,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID(),GetCurrentUser()))
- {
- Empty("#ExchangeProduct");
- Empty("#ExchangeBill");
- ChangeMode("View");
- }
- </ClickPrev>
- <ClickNext>
- cbPayLimitType.SelectedName="";
- if(Search("SearchCustomerNext", tbNo.CValue,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID(),GetCurrentUser()))
- {
- Empty("#ExchangeProduct");
- Empty("#ExchangeBill");
- ChangeMode("View");
- }
- </ClickNext>
- <ClickLast>
- cbPayLimitType.SelectedName="";
- if(Search("SearchCustomerLast", tbNo.CValue,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID(),GetCurrentUser()))
- {
- Empty("#ExchangeProduct");
- Empty("#ExchangeBill");
- ChangeMode("View");
- }
- </ClickLast>
- <ClickNew>
- ;
- </ClickNew>
- <ClickEmpty>
- ChangeMode("Search");
- </ClickEmpty>
- <ClickSubmit>
- <Lable name="SubmitButtonClick" />
- </ClickSubmit>
- <ClickModify>
- <!--Search("SearchPrincipal", tbareaNo.CValue);-->
- ChangeMode("Modify");
- </ClickModify>
- <ClickDelete>
- Delete(); ChangeMode("Search");
- </ClickDelete>
- <ClickPrint>
- #Customer.CountryName = cbCountry.Text;
- PrintReport();
- </ClickPrint>
- <ClickAudit>
- ;
- </ClickAudit>
- <ClickUnAudit>
- ;
- </ClickUnAudit>
- <ClickImport>
- ;
- </ClickImport>
- <ClickExport>
- ;
- </ClickExport>
- <ClickClose>
- ;
- </ClickClose>
- <ClickExpand>
- if(toolBar.ExpandForm==true)
- {
- pnRight.Visible=true;<!--PanelRight is not existed-->
- if(!@HaveSearchCustomerList)
- {
- Search("SearchCustomerList",GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID());
- @HaveSearchCustomerList=true;
- }
- }
- else
- {
- pnRight.Visible=false;
- }
- </ClickExpand>
- </Events>
- </IKFormToolBar>
- </Controls>
- <Tables>
- <Table name="Principal">
- <Events>
- <ColumnsChanged>
- <No_Employee>
- if(@SetFlag==0)
- {
- return;
- }
- if(Search("GetEmployeeNameByNo",#Principal.No_Employee))
- {
- #Principal.Name_Employee=#Employee.Name_Employee;
- #Principal.ID_Employee=#Employee.ID_Employee;
- if(!Equals(#Employee.SuspendDate_Employee,DBNull()))
- MessageBox("该员工已停用!",@Title);
- }
- else
- {
- MessageBox("该员工不存在!",@Title);
- #Principal.Name_Employee="";
- #Principal.ID_Employee=GuidEmpty();
- @temp = ShowSearchBox("EmployeeSearch","INFOMATION",#Principal.No_Employee);
- if(@temp != "")
- {
- ResumeColumnEvent("#Principal.No_Employee");
- #Principal.No_Employee = @temp;
- ClearColumnEvent();
- }
- }
- </No_Employee>
- </ColumnsChanged>
- </Events>
- </Table>
- <Table name="Linkman">
- <Events>
- <ColumnsChanged>
- <Name_Linkman>
- <![CDATA[
- if(!Equals(#Linkman.Name_Linkman,"")&&!Equals(#Linkman.Tel_Linkman,""))
- {
- if(RowCount("#Linkman")==1)
- {
- SuspendLayout();
- for(@i=0;@i<RowCount("#Invoice");@i++)
- {
- SetPosition("#Invoice",@i);
- if(Equals(#Invoice.Tel_Invoice,"")&&Equals(#Invoice.Linkman_Invoice,""))
- {
- #Invoice.Tel_Invoice=#Linkman.Tel_Linkman;
- #Invoice.Linkman_Invoice=#Linkman.Name_Linkman;
- }
- }
- ResumeLayout();
- }
- }
- ]]>
- </Name_Linkman>
- <Tel_Linkman>
- <![CDATA[
- if(!Equals(#Linkman.Name_Linkman,"")&&!Equals(#Linkman.Tel_Linkman,""))
- {
- if(RowCount("#Linkman")==1)
- {
- SuspendLayout();
- for(@i=0;@i<RowCount("#Invoice");@i++)
- {
- SetPosition("#Invoice",@i);
- if(Equals(#Invoice.Tel_Invoice,"")&&Equals(#Invoice.Linkman_Invoice,""))
- {
- #Invoice.Tel_Invoice=#Linkman.Tel_Linkman;
- #Invoice.Linkman_Invoice=#Linkman.Name_Linkman;
- }
- }
- ResumeLayout();
- }
- }
- ]]>
- </Tel_Linkman>
- </ColumnsChanged>
- </Events>
- </Table>
- </Tables>
- <LockInfomation LockID="ID_Customer" LockNO="No_Customer" LockSearchFunction="SearchCustomerWithNo"/>
- <ChildForms>
- <ChildForm name="CustomerSearch" DataSource="Customer" SearchFunction="SearchAllCustomer" SearchFunctionCondition="SearchCustomerCondition" SearchFunctionByNo="SearchCustomerWithNo" MappingName="客户">
- <DataColumn Index="0" MappingName="#Customer.No_Customer" HeaderText="客户编号" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="1" MappingName="#Customer.ShortName_Customer" HeaderText="客户简称" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="2" MappingName="#Customer.Zone_Customer" HeaderText="地区" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="3" MappingName="#Customer.SendAddr_Customer" HeaderText="送货地址" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="4" MappingName="#Customer.RegistedAddress_Customer" HeaderText="客户地址" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="5" MappingName="#Customer.Name_Linkman" HeaderText="主要联系人" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="6" MappingName="#Customer.Tel_Linkman" HeaderText="联系人电话" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="7" MappingName="#Customer.No_Telephone" HeaderText="客户电话" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="8" MappingName="#Customer.Type_Customer" HeaderText="客户类别" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="9" MappingName="#Customer.GetMethod_Customer" HeaderText="结款方式" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="10" MappingName="#Customer.Level_Customer" HeaderText="客户等级" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="11" MappingName="#Customer.Name_Employee" HeaderText="负责业务" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="12" MappingName="#Customer.PayLimit_Customer" HeaderText="信用额度" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="13" MappingName="#Customer.LowDiscount_Customer" HeaderText="最低折扣" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="14" MappingName="#Customer.DunDate_Customer" HeaderText="催款日" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="15" MappingName="#Customer.Company_Customer" HeaderText="所属公司" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="16" MappingName="#Customer.No_RegionalLeader" HeaderText="所属区域" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="17" MappingName="#Customer.Comment_Customer" HeaderText="备注" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- </ChildForm>
- <ChildForm name="EmployeeSearch" DataSource="Employee" SearchFunction="SearchAllEmployee" SearchFunctionByNo="SearchEmployeeWithNo" MappingName="员工" >
- <DataColumn Index="0" MappingName="#Employee.No_Employee" HeaderText="员工编号" Width="90" ColumnType="IKDataGridTextBoxColumn" />
- <DataColumn Index="1" MappingName="#Employee.Name_Employee" HeaderText="员工名称" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- </ChildForm>
- <ChildForm name="RegionalLeaderSearch" DataSource="RegionalLeader" SearchFunction="SearchAllRegionalLeader" SearchFunctionByNo="" MappingName="负责人" >
- <DataColumn Index="0" MappingName="#RegionalLeader.No_RegionalLeader" HeaderText="区域编号" Width="90" ColumnType="IKDataGridTextBoxColumn" />
- <DataColumn Index="1" MappingName="#RegionalLeader.Name_RegionalLeader" HeaderText="区域名称" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- </ChildForm>
- </ChildForms>
- <FormatString>
- <Format name="SearchCustomerCondition">
- if(GetRight("客户基本资料","全权查看"))
- {
- FormatString("");
- }
- else
- {
- FormatString(" Customer.ID_Creator='{0}' ",GetLoginUserID());
- }
- </Format>
- </FormatString>
- </Client>
- <Server>
- <Tables>
- <Table name="Customer" Type="Parent">
- <GetSchema CmdType="Text" CmdText=" SELECT Top 0 Customer.*,RegionalLeader.No_RegionalLeader,RegionalLeader.Name_RegionalLeader
- ,convert(nvarchar(64),'') as CountryName
- ,A.Name_User AS CreatorName_Customer,B.Name_User As LastModUser
- ,Convert(bit,1) As IsDisplay,Employee.No_Employee as No_Employee
- ,Employee.Name_Employee as Name_Employee
- ,ct.No_Customer as No2_Customer , ct.ShortName_Customer as ShortName2_Customer
- FROM Customer
- left join Customer ct on Customer.CustomerID_Customer = ct.ID_Customer
- LEFT JOIN RegionalLeader on RegionalLeader.ID_RegionalLeader=Customer.ID_RegionalLeader
- LEFT JOIN AppUser A ON A.ID_User = Customer.ID_Creator
- LEFT Join AppUser B ON B.ID_User=Customer.LastModUser_Customer
- LEFT JOIN Employee on Employee.ID_Employee= Customer.LastPrincipal_Customer"/>
- <New CmdType="Text" CmdText=" INSERT INTO Customer (ID_Customer
- ,No_Customer
- ,ShortName_Customer
- ,Name_Customer
- ,RegistedAddress_Customer
- ,Country_Customer
- ,PostalCode_Customer
- ,Type_Customer
- ,IsGeneric_Customer
- ,PayLimitCurrency
- ,PayLimit_Customer
- ,GetMethod_Customer
- ,CreateDate_Customer
- ,ID_Creator
- ,SendAddr_Customer
- ,Comment_Customer
- ,Industry_Customer
- ,Zone_Customer
- ,Source_Customer
- ,Level_Customer
- ,Bank_Customer
- ,Account_Customer
- ,RevenueRegisterNo_Customer
- ,SuspendDate_Customer
- ,LastModDate_Customer
- ,LastModUser_Customer
- ,DunDate_Customer
- ,LowDiscount_Customer
- ,IsCustomersCustomer_Customer
- ,BeginDate_Customer
- ,Saleroom_Customer
- ,PerValue_Customer
- ,CustomerID_Customer
- ,ID_RegionalLeader
- ,Note_Customer
- ,PrePayValue_Customer
- ,Company_Customer
- ,OpeningBalanceAdjust_Customer
- ,RemarkBalance_Customer)
- VALUES(@ID_Customer
- ,@No_Customer
- ,@ShortName_Customer
- ,@Name_Customer
- ,@RegistedAddress_Customer
- ,@Country_Customer
- ,@PostalCode_Customer
- ,@Type_Customer
- ,@IsGeneric_Customer
- ,@PayLimitCurrency
- ,@PayLimit_Customer
- ,@GetMethod_Customer
- ,@CreateDate_Customer
- ,@ID_Creator
- ,@SendAddr_Customer
- ,@Comment_Customer
- ,@Industry_Customer
- ,@Zone_Customer
- ,@Source_Customer
- ,@Level_Customer
- ,@Bank_Customer
- ,@Account_Customer
- ,@RevenueRegisterNo_Customer
- ,@SuspendDate_Customer
- ,@LastModDate_Customer
- ,@LastModUser_Customer
- ,@DunDate_Customer
- ,@LowDiscount_Customer
- ,@IsCustomersCustomer_Customer
- ,@BeginDate_Customer
- ,@Saleroom_Customer
- ,@PerValue_Customer
- ,@CustomerID_Customer
- ,@ID_RegionalLeader
- ,@Note_Customer
- ,@PrePayValue_Customer
- ,@Company_Customer
- ,@OpeningBalanceAdjust_Customer
- ,@RemarkBalance_Customer)" >
- <Params>
- <Param name="@ID_Customer" type="Customer.ID_Customer" sourceColumn="ID_Customer" />
- <Param name="@No_Customer" type="Customer.No_Customer" sourceColumn="No_Customer" />
- <Param name="@ShortName_Customer" type="Customer.ShortName_Customer" sourceColumn="ShortName_Customer" />
- <Param name="@Name_Customer" type="Customer.Name_Customer" sourceColumn="Name_Customer" />
- <Param name="@RegistedAddress_Customer" type="Customer.RegistedAddress_Customer" sourceColumn="RegistedAddress_Customer" />
- <Param name="@Country_Customer" type="Customer.Country_Customer" sourceColumn="Country_Customer" />
- <Param name="@PostalCode_Customer" type="Customer.PostalCode_Customer" sourceColumn="PostalCode_Customer" />
- <Param name="@Type_Customer" type="Customer.Type_Customer" sourceColumn="Type_Customer" />
- <Param name="@IsGeneric_Customer" type="Customer.IsGeneric_Customer" sourceColumn="IsGeneric_Customer" />
- <Param name="@PayLimitCurrency" type="Customer.PayLimitCurrency" sourceColumn="PayLimitCurrency" />
- <Param name="@PayLimit_Customer" type="Customer.PayLimit_Customer" sourceColumn="PayLimit_Customer" />
- <Param name="@GetMethod_Customer" type="Customer.GetMethod_Customer" sourceColumn="GetMethod_Customer" />
- <Param name="@CreateDate_Customer" type="Customer.CreateDate_Customer" sourceColumn="CreateDate_Customer" />
- <Param name="@ID_Creator" type="Customer.ID_Creator" sourceColumn="ID_Creator" />
- <Param name="@SendAddr_Customer" type="Customer.SendAddr_Customer" sourceColumn="SendAddr_Customer" />
- <Param name="@Comment_Customer" type="Customer.Comment_Customer" sourceColumn="Comment_Customer" />
- <Param name="@Industry_Customer" type="Customer.Industry_Customer" sourceColumn="Industry_Customer" />
- <Param name="@Zone_Customer" type="Customer.Zone_Customer" sourceColumn="Zone_Customer" />
- <Param name="@Source_Customer" type="Customer.Source_Customer" sourceColumn="Source_Customer" />
- <Param name="@Level_Customer" type="Customer.Level_Customer" sourceColumn="Level_Customer" />
- <Param name="@Bank_Customer" type="Customer.Bank_Customer" sourceColumn="Bank_Customer" />
- <Param name="@Account_Customer" type="Customer.Account_Customer" sourceColumn="Account_Customer" />
- <Param name="@RevenueRegisterNo_Customer" type="Customer.RevenueRegisterNo_Customer" sourceColumn="RevenueRegisterNo_Customer" />
- <Param name="@SuspendDate_Customer" type="Customer.SuspendDate_Customer" sourceColumn="SuspendDate_Customer" />
- <Param name="@LastModDate_Customer" type="Customer.LastModDate_Customer" sourceColumn="LastModDate_Customer" />
- <Param name="@LastModUser_Customer" type="Customer.LastModUser_Customer" sourceColumn="LastModUser_Customer" />
- <Param name="@DunDate_Customer" type="Customer.DunDate_Customer" sourceColumn="DunDate_Customer" />
- <Param name="@LowDiscount_Customer" type="Customer.LowDiscount_Customer" sourceColumn="LowDiscount_Customer" />
- <Param name="@IsCustomersCustomer_Customer" type="Customer.IsCustomersCustomer_Customer" sourceColumn="IsCustomersCustomer_Customer" />
- <Param name="@BeginDate_Customer" type="Customer.BeginDate_Customer" sourceColumn="BeginDate_Customer" />
- <Param name="@Saleroom_Customer" type="Customer.Saleroom_Customer" sourceColumn="Saleroom_Customer" />
- <Param name="@PerValue_Customer" type="Customer.PerValue_Customer" sourceColumn="PerValue_Customer" />
- <Param name="@CustomerID_Customer" type="Customer.CustomerID_Customer" sourceColumn="CustomerID_Customer" />
- <Param name="@ID_RegionalLeader" type="Customer.ID_RegionalLeader" sourceColumn="ID_RegionalLeader" />
- <Param name="@Note_Customer" type="Customer.Note_Customer" sourceColumn="Note_Customer" />
- <Param name="@PrePayValue_Customer" type="Customer.PrePayValue_Customer" sourceColumn="PrePayValue_Customer" />
- <Param name="@Company_Customer" type="Customer.Company_Customer" sourceColumn="Company_Customer" />
- <Param name="@OpeningBalanceAdjust_Customer" type="Customer.OpeningBalanceAdjust_Customer" sourceColumn="OpeningBalanceAdjust_Customer" />
- <Param name="@RemarkBalance_Customer" type="Customer.RemarkBalance_Customer" sourceColumn="RemarkBalance_Customer" />
- </Params>
- </New>
- <Update CmdType="Text" CmdText="UPDATE Customer SET GetMethod_Customer = @GetMethod_Customer
- ,ShortName_Customer = @ShortName_Customer
- ,Name_Customer = @Name_Customer
- ,RegistedAddress_Customer = @RegistedAddress_Customer
- ,Country_Customer = @Country_Customer
- ,Type_Customer = @Type_Customer
- ,IsGeneric_Customer =@IsGeneric_Customer
- ,PostalCode_Customer = @PostalCode_Customer
- ,PayLimitCurrency = @PayLimitCurrency
- ,PayLimit_Customer = @PayLimit_Customer
- ,CreateDate_Customer = @CreateDate_Customer
- ,ID_Creator = @ID_Creator
- ,SendAddr_Customer=@SendAddr_Customer
- ,Comment_Customer = @Comment_Customer
- ,Industry_Customer = @Industry_Customer
- ,Zone_Customer = @Zone_Customer
- ,Source_Customer = @Source_Customer
- ,Level_Customer =@Level_Customer
- ,Bank_Customer = @Bank_Customer
- ,Account_Customer = @Account_Customer
- ,RevenueRegisterNo_Customer = @RevenueRegisterNo_Customer
- ,SuspendDate_Customer = @SuspendDate_Customer
- ,LastModDate_Customer=@LastModDate_Customer
- ,LastModUser_Customer=@LastModUser_Customer
- ,DunDate_Customer=@DunDate_Customer
- ,LowDiscount_Customer=@LowDiscount_Customer
- ,IsCustomersCustomer_Customer=@IsCustomersCustomer_Customer
- ,BeginDate_Customer = @BeginDate_Customer
- ,Saleroom_Customer = @Saleroom_Customer
- ,PerValue_Customer=@PerValue_Customer
- ,CustomerID_Customer = @CustomerID_Customer
- ,ID_RegionalLeader = @ID_RegionalLeader
- ,Note_Customer=@Note_Customer
- ,PrePayValue_Customer=@PrePayValue_Customer
- ,Company_Customer=@Company_Customer
- ,OpeningBalanceAdjust_Customer=@OpeningBalanceAdjust_Customer
- ,RemarkBalance_Customer=@RemarkBalance_Customer
- FROM Customer
- WHERE ID_Customer = @ID_Customer
-
- Select Customer.* ,ct.No_Customer as No2_Customer
- ,ct.ShortName_Customer as ShortName2_Customer
- From Customer
- left join Customer ct on Customer.CustomerID_Customer = ct.ID_Customer
- WHERE Customer.ID_Customer = @ID_Customer">
- <Params>
- <Param name="@ID_Customer" type="Customer.ID_Customer" sourceColumn="ID_Customer" />
- <!--<Param name="@No_Customer" type="Customer.No_Customer" sourceColumn="No_Customer" />-->
- <Param name="@ShortName_Customer" type="Customer.ShortName_Customer" sourceColumn="ShortName_Customer" />
- <Param name="@Name_Customer" type="Customer.Name_Customer" sourceColumn="Name_Customer" />
- <Param name="@RegistedAddress_Customer" type="Customer.RegistedAddress_Customer" sourceColumn="RegistedAddress_Customer" />
- <Param name="@Country_Customer" type="Customer.Country_Customer" sourceColumn="Country_Customer" />
- <Param name="@PostalCode_Customer" type="Customer.PostalCode_Customer" sourceColumn="PostalCode_Customer" />
- <Param name="@Type_Customer" type="Customer.Type_Customer" sourceColumn="Type_Customer" />
- <Param name="@IsGeneric_Customer" type="Customer.IsGeneric_Customer" sourceColumn="IsGeneric_Customer" />
- <Param name="@PayLimitCurrency" type="Customer.PayLimitCurrency" sourceColumn="PayLimitCurrency" />
- <Param name="@PayLimit_Customer" type="Customer.PayLimit_Customer" sourceColumn="PayLimit_Customer" />
- <Param name="@GetMethod_Customer" type="Customer.GetMethod_Customer" sourceColumn="GetMethod_Customer" />
- <Param name="@CreateDate_Customer" type="Customer.CreateDate_Customer" sourceColumn="CreateDate_Customer" />
- <Param name="@ID_Creator" type="Customer.ID_Creator" sourceColumn="ID_Creator" />
- <Param name="@SendAddr_Customer" type="Customer.SendAddr_Customer" sourceColumn="SendAddr_Customer" />
- <Param name="@Comment_Customer" type="Customer.Comment_Customer" sourceColumn="Comment_Customer" />
- <Param name="@Industry_Customer" type="Customer.Industry_Customer" sourceColumn="Industry_Customer" />
- <Param name="@Zone_Customer" type="Customer.Zone_Customer" sourceColumn="Zone_Customer" />
- <Param name="@Source_Customer" type="Customer.Source_Customer" sourceColumn="Source_Customer" />
- <Param name="@Level_Customer" type="Customer.Level_Customer" sourceColumn="Level_Customer" />
- <Param name="@Bank_Customer" type="Customer.Bank_Customer" sourceColumn="Bank_Customer" />
- <Param name="@Account_Customer" type="Customer.Account_Customer" sourceColumn="Account_Customer" />
- <Param name="@RevenueRegisterNo_Customer" type="Customer.RevenueRegisterNo_Customer" sourceColumn="RevenueRegisterNo_Customer" />
- <Param name="@SuspendDate_Customer" type="Customer.SuspendDate_Customer" sourceColumn="SuspendDate_Customer" />
- <Param name="@LastModDate_Customer" type="Customer.LastModDate_Customer" sourceColumn="LastModDate_Customer" />
- <Param name="@LastModUser_Customer" type="Customer.LastModUser_Customer" sourceColumn="LastModUser_Customer" />
- <Param name="@DunDate_Customer" type="Customer.DunDate_Customer" sourceColumn="DunDate_Customer" />
- <Param name="@LowDiscount_Customer" type="Customer.LowDiscount_Customer" sourceColumn="LowDiscount_Customer" />
- <Param name="@IsCustomersCustomer_Customer" type="Customer.IsCustomersCustomer_Customer" sourceColumn="IsCustomersCustomer_Customer" />
- <Param name="@BeginDate_Customer" type="Customer.BeginDate_Customer" sourceColumn="BeginDate_Customer" />
- <Param name="@Saleroom_Customer" type="Customer.Saleroom_Customer" sourceColumn="Saleroom_Customer" />
- <Param name="@PerValue_Customer" type="Customer.PerValue_Customer" sourceColumn="PerValue_Customer" />
- <Param name="@CustomerID_Customer" type="Customer.CustomerID_Customer" sourceColumn="CustomerID_Customer" />
- <Param name="@ID_RegionalLeader" type="Customer.ID_RegionalLeader" sourceColumn="ID_RegionalLeader" />
- <Param name="@Note_Customer" type="Customer.Note_Customer" sourceColumn="Note_Customer" />
- <Param name="@PrePayValue_Customer" type="Customer.PrePayValue_Customer" sourceColumn="PrePayValue_Customer" />
- <Param name="@Company_Customer" type="Customer.Company_Customer" sourceColumn="Company_Customer" />
- <Param name="@OpeningBalanceAdjust_Customer" type="Customer.OpeningBalanceAdjust_Customer" sourceColumn="OpeningBalanceAdjust_Customer" />
- <Param name="@RemarkBalance_Customer" type="Customer.RemarkBalance_Customer" sourceColumn="RemarkBalance_Customer" />
- </Params>
- </Update>
- <Delete CmdType="Text" CmdText="if exists (select * from salebill where id_customer =@ID_Customer)
- begin
- RAISERROR('该客户已被引用,删除失败!',16,1)
- RETURN
- end
- DELETE Fax WHERE ID_Person = @ID_Customer
- DELETE Telephone WHERE ID_Person = @ID_Customer
- DELETE Linkman WHERE ID_Person = @ID_Customer
- DELETE Principal WHERE ID_Person = @ID_Customer
- DELETE Invoice WHERE ID_Customer = @ID_Customer
- DELETE BasicComment WHERE ID_Object = @ID_Customer
- DELETE Customer WHERE ID_Customer = @ID_Customer">
- <Params>
- <Param name="@ID_Customer" type="Customer.ID_Customer" sourceColumn="ID_Customer" />
- </Params>
- </Delete>
- <FKErrorReport ErrorMessage="该客户已被引用,删除失败!"/>
- <UNIQUEErrorReport ErrorMessage="该客户编号已存在,提交失败!"/>
- </Table>
- <Table name="CustomerList" Type="Other">
- <GetSchema CmdType="Text" CmdText=" SELECT Top 0 No_Customer,ShortName_Customer From Customer"/>
- </Table>
- <Table name="Linkman" Type="Child">
- <GetSchema CmdType="Text" CmdText="SELECT top 0 Linkman.*,Convert(nvarchar(64),'') As IsMainStr_Linkman FROM Linkman" />
- <New CmdType="Text" CmdText=" INSERT INTO Linkman (ID_Linkman
- ,ID_Person
- ,Name_Linkman
- ,Department_Linkman
- ,Duty_Linkman
- ,Tel_Linkman
- ,Fax_Linkman
- ,Mobile_Linkman
- ,Email_Linkman
- ,IsMain_Linkman
- ,Comment_Linkman)
- VALUES(@ID_Linkman
- ,@ID_Person
- ,@Name_Linkman
- ,@Department_Linkman
- ,@Duty_Linkman
- ,@Tel_Linkman
- ,@Fax_Linkman
- ,@Mobile_Linkman
- ,@Email_Linkman
- ,@IsMain_Linkman
- ,@Comment_Linkman)">
- <Params>
- <Param name="@ID_Linkman" type="Linkman.ID_Linkman" sourceColumn="ID_Linkman" />
- <Param name="@ID_Person" type="Linkman.ID_Person" sourceColumn="ID_Person" />
- <Param name="@Name_Linkman" type="Linkman.Name_Linkman" sourceColumn="Name_Linkman" />
- <Param name="@Department_Linkman" type="Linkman.Department_Linkman" sourceColumn="Department_Linkman" />
- <Param name="@Duty_Linkman" type="Linkman.Duty_Linkman" sourceColumn="Duty_Linkman" />
- <Param name="@Tel_Linkman" type="Linkman.Tel_Linkman" sourceColumn="Tel_Linkman" />
- <Param name="@Fax_Linkman" type="Linkman.Fax_Linkman" sourceColumn="Fax_Linkman" />
- <Param name="@Mobile_Linkman" type="Linkman.Mobile_Linkman" sourceColumn="Mobile_Linkman" />
- <Param name="@Email_Linkman" type="Linkman.Email_Linkman" sourceColumn="Email_Linkman" />
- <Param name="@IsMain_Linkman" type="Linkman.IsMain_Linkman" sourceColumn="IsMain_Linkman" />
- <Param name="@Comment_Linkman" type="Linkman.Comment_Linkman" sourceColumn="Comment_Linkman" />
- </Params>
- </New>
- <Update CmdType="Text" CmdText="UPDATE Linkman SET Name_Linkman = @Name_Linkman
- ,Department_Linkman = @Department_Linkman
- ,Duty_Linkman = @Duty_Linkman
- ,Tel_Linkman = @Tel_Linkman
- ,Fax_Linkman = @Fax_Linkman
- ,Mobile_Linkman = @Mobile_Linkman
- ,Email_Linkman = @Email_Linkman
- ,IsMain_Linkman = @IsMain_Linkman
- ,Comment_Linkman = @Comment_Linkman
- WHERE ID_Linkman = @ID_Linkman">
- <Params>
- <Param name="@ID_Linkman" type="Linkman.ID_Linkman" sourceColumn="ID_Linkman" />
- <Param name="@Name_Linkman" type="Linkman.Name_Linkman" sourceColumn="Name_Linkman" />
- <Param name="@Department_Linkman" type="Linkman.Department_Linkman" sourceColumn="Department_Linkman" />
- <Param name="@Duty_Linkman" type="Linkman.Duty_Linkman" sourceColumn="Duty_Linkman" />
- <Param name="@Tel_Linkman" type="Linkman.Tel_Linkman" sourceColumn="Tel_Linkman" />
- <Param name="@Fax_Linkman" type="Linkman.Fax_Linkman" sourceColumn="Fax_Linkman" />
- <Param name="@Mobile_Linkman" type="Linkman.Mobile_Linkman" sourceColumn="Mobile_Linkman" />
- <Param name="@Email_Linkman" type="Linkman.Email_Linkman" sourceColumn="Email_Linkman" />
- <Param name="@IsMain_Linkman" type="Linkman.IsMain_Linkman" sourceColumn="IsMain_Linkman" />
- <Param name="@Comment_Linkman" type="Linkman.Comment_Linkman" sourceColumn="Comment_Linkman" />
- </Params>
- </Update>
- <Delete CmdType="Text" CmdText="DELETE Linkman WHERE ID_Linkman=@ID_Linkman">
- <Params>
- <Param name="@ID_Linkman" type="Linkman.ID_Linkman" sourceColumn="ID_Linkman" />
- </Params>
- </Delete>
- </Table>
- <Table name="Principal" Type="Child">
- <GetSchema CmdType="Text" CmdText="SELECT top 0 Principal.*,Convert(nvarchar(64),'') As IsMainStr_Principal
- ,Employee.Name_Employee AS Name_Employee, Employee.No_Employee AS No_Employee
- FROM Principal
- INNER JOIN Employee ON Employee.ID_Employee = Principal.ID_Employee" />
- <New CmdType="Text" CmdText=" INSERT INTO Principal (ID_Principal
- ,ID_Person
- ,ID_Employee
- ,IsMain_Principal
- ,Comment_Principal)
- VALUES(@ID_Principal
- ,@ID_Person
- ,@ID_Employee
- ,@IsMain_Principal
- ,@Comment_Principal)" >
- <Params>
- <Param name="@ID_Principal" type="Principal.ID_Principal" sourceColumn="ID_Principal" />
- <Param name="@ID_Person" type="Principal.ID_Person" sourceColumn="ID_Person" />
- <Param name="@ID_Employee" type="Principal.ID_Employee" sourceColumn="ID_Employee" />
- <Param name="@IsMain_Principal" type="Principal.IsMain_Principal" sourceColumn="IsMain_Principal" />
- <Param name="@Comment_Principal" type="Principal.Comment_Principal" sourceColumn="Comment_Principal" />
- </Params>
- </New>
- <Update CmdType="Text" CmdText="UPDATE Principal SET ID_Employee = @ID_Employee
- ,IsMain_Principal = @IsMain_Principal
- ,Comment_Principal = @Comment_Principal
- WHERE ID_Principal = @ID_Principal">
- <Params>
- <Param name="@ID_Principal" type="Principal.ID_Principal" sourceColumn="ID_Principal" />
- <Param name="@ID_Employee" type="Principal.ID_Employee" sourceColumn="ID_Employee" />
- <Param name="@IsMain_Principal" type="Principal.IsMain_Principal" sourceColumn="IsMain_Principal" />
- <Param name="@Comment_Principal" type="Principal.Comment_Principal" sourceColumn="Comment_Principal" />
- </Params>
- </Update>
- <Delete CmdType="Text" CmdText="DELETE Principal WHERE ID_Principal = @ID_Principal">
- <Params>
- <Param name="@ID_Principal" type="Principal.ID_Principal" sourceColumn="ID_Principal" />
- </Params>
- </Delete>
- </Table>
- <Table name="Invoice" Type="Child">
- <GetSchema CmdType="Text" CmdText="SELECT top 0 Invoice.*,'' As IsCommon_Invoice FROM Invoice" />
- <New CmdType="Text" CmdText=" INSERT INTO Invoice (ID_Invoice
- ,ID_Customer
- ,Title_Invoice
- ,Address_Invoice
- ,Common_Invoice
- ,Comment_Invoice
- ,Tel_Invoice
- ,Linkman_Invoice)
- VALUES (@ID_Invoice
- ,@ID_Customer
- ,@Title_Invoice
- ,@Address_Invoice
- ,@Common_Invoice
- ,@Comment_Invoice
- ,@Tel_Invoice
- ,@Linkman_Invoice)" >
- <Params>
- <Param name="@ID_Invoice" type="Invoice.ID_Invoice" sourceColumn="ID_Invoice" />
- <Param name="@ID_Customer" type="Invoice.ID_Customer" sourceColumn="ID_Customer" />
- <Param name="@Title_Invoice" type="Invoice.Title_Invoice" sourceColumn="Title_Invoice" />
- <Param name="@Address_Invoice" type="Invoice.Address_Invoice" sourceColumn="Address_Invoice" />
- <Param name="@Common_Invoice" type="Invoice.Common_Invoice" sourceColumn="Common_Invoice" />
- <Param name="@Comment_Invoice" type="Invoice.Comment_Invoice" sourceColumn="Comment_Invoice" />
- <Param name="@Tel_Invoice" type="Invoice.Tel_Invoice" sourceColumn="Tel_Invoice" />
- <Param name="@Linkman_Invoice" type="Invoice.Linkman_Invoice" sourceColumn="Linkman_Invoice" />
- </Params>
- </New>
- <Update CmdType="Text" CmdText="UPDATE Invoice SET ID_Customer = @ID_Customer
- ,Title_Invoice = @Title_Invoice
- ,Address_Invoice = @Address_Invoice
- ,Common_Invoice = @Common_Invoice
- ,Comment_Invoice = @Comment_Invoice
- ,Tel_Invoice=@Tel_Invoice
- ,Linkman_Invoice=@Linkman_Invoice
- WHERE ID_Invoice = @ID_Invoice">
- <Params>
- <Param name="@ID_Invoice" type="Invoice.ID_Invoice" sourceColumn="ID_Invoice" />
- <Param name="@ID_Customer" type="Invoice.ID_Customer" sourceColumn="ID_Customer" />
- <Param name="@Title_Invoice" type="Invoice.Title_Invoice" sourceColumn="Title_Invoice" />
- <Param name="@Address_Invoice" type="Invoice.Address_Invoice" sourceColumn="Address_Invoice" />
- <Param name="@Common_Invoice" type="Invoice.Common_Invoice" sourceColumn="Common_Invoice" />
- <Param name="@Comment_Invoice" type="Invoice.Comment_Invoice" sourceColumn="Comment_Invoice" />
- <Param name="@Tel_Invoice" type="Invoice.Tel_Invoice" sourceColumn="Tel_Invoice" />
- <Param name="@Linkman_Invoice" type="Invoice.Linkman_Invoice" sourceColumn="Linkman_Invoice" />
- </Params>
- </Update>
- <Delete CmdType="Text" CmdText="DELETE Invoice WHERE ID_Invoice = @ID_Invoice">
- <Params>
- <Param name="@ID_Invoice" type="Invoice.ID_Invoice" sourceColumn="ID_Invoice" />
- </Params>
- </Delete>
- </Table>
- <Table name="Fax" Type="Association">
- <GetSchema CmdType="Text" CmdText="SELECT top 0 * FROM Fax" />
- <New CmdType="Text" CmdText=" INSERT INTO Fax (ID_Fax
- ,ID_Person
- ,Name_Fax
- ,No_Fax
- ,Focus_Fax)
- VALUES(@ID_Fax
- ,@ID_Person
- ,@Name_Fax
- ,@No_Fax
- ,@Focus_Fax)">
- <Params>
- <Param name="@ID_Fax" type="Fax.ID_Fax" sourceColumn="ID_Fax" />
- <Param name="@ID_Person" type="Fax.ID_Person" sourceColumn="ID_Person" />
- <Param name="@Name_Fax" type="Fax.Name_Fax" sourceColumn="Name_Fax" />
- <Param name="@No_Fax" type="Fax.No_Fax" sourceColumn="No_Fax" />
- <Param name="@Focus_Fax" type="Fax.Focus_Fax" sourceColumn="Focus_Fax" />
- </Params>
- </New>
- <Update CmdType="Text" CmdText="UPDATE Fax SET Name_Fax=@Name_Fax
- ,No_Fax=@No_Fax
- ,Focus_Fax=@Focus_Fax
- WHERE ID_Fax=@ID_Fax">
- <Params>
- <Param name="@ID_Fax" type="Fax.ID_Fax" sourceColumn="ID_Fax" />
- <Param name="@Name_Fax" type="Fax.Name_Fax" sourceColumn="Name_Fax" />
- <Param name="@No_Fax" type="Fax.No_Fax" sourceColumn="No_Fax" />
- <Param name="@Focus_Fax" type="Fax.Focus_Fax" sourceColumn="Focus_Fax" />
- </Params>
- </Update>
- <Delete CmdType="Text" CmdText="DELETE Fax WHERE ID_Fax=@ID_Fax">
- <Params>
- <Param name="@ID_Fax" type="Fax.ID_Fax" sourceColumn="ID_Fax" />
- </Params>
- </Delete>
- <FKErrorReport ErrorMessage="本记录被其他单据使用过,不能删除!"/>
- <UNIQUEErrorReport ErrorMessage="传真名称或传真号码已经存在!"/>
- </Table>
- <Table name="Telephone" Type="Association">
- <GetSchema CmdType="Text" CmdText="SELECT top 0 * FROM Telephone" />
- <New CmdType="Text" CmdText=" INSERT INTO Telephone (ID_Telephone
- ,ID_Person
- ,Name_Telephone
- ,No_Telephone
- ,Focus_Telephone)
- VALUES(@ID_Telephone
- ,@ID_Person
- ,@Name_Telephone
- ,@No_Telephone
- ,@Focus_Telephone)">
- <Params>
- <Param name="@ID_Telephone" type="Telephone.ID_Telephone" sourceColumn="ID_Telephone" />
- <Param name="@ID_Person" type="Telephone.ID_Person" sourceColumn="ID_Person" />
- <Param name="@Name_Telephone" type="Telephone.Name_Telephone" sourceColumn="Name_Telephone" />
- <Param name="@No_Telephone" type="Telephone.No_Telephone" sourceColumn="No_Telephone" />
- <Param name="@Focus_Telephone" type="Telephone.Focus_Telephone" sourceColumn="Focus_Telephone" />
- </Params>
- </New>
- <Update CmdType="Text" CmdText="UPDATE Telephone SET Name_Telephone=@Name_Telephone
- ,No_Telephone=@No_Telephone
- ,Focus_Telephone=@Focus_Telephone
- WHERE ID_Telephone=@ID_Telephone">
- <Params>
- <Param name="@ID_Telephone" type="Telephone.ID_Telephone" sourceColumn="ID_Telephone" />
- <Param name="@Name_Telephone" type="Telephone.Name_Telephone" sourceColumn="Name_Telephone" />
- <Param name="@No_Telephone" type="Telephone.No_Telephone" sourceColumn="No_Telephone" />
- <Param name="@Focus_Telephone" type="Telephone.Focus_Telephone" sourceColumn="Focus_Telephone" />
- </Params>
- </Update>
- <Delete CmdType="Text" CmdText="DELETE Telephone WHERE ID_Telephone=@ID_Telephone">
- <Params>
- <Param name="@ID_Telephone" type="Telephone.ID_Telephone" sourceColumn="ID_Telephone" />
- </Params>
- </Delete>
- <FKErrorReport ErrorMessage="本记录被其他单据使用过,不能删除!"/>
- <UNIQUEErrorReport ErrorMessage="电话名称或电话号码已经存在!"/>
- </Table>
- <Table name="Employee" Type="Other">
- <GetSchema CmdType="Text" CmdText="SELECT top 0 * FROM Employee" />
- </Table>
- <Table name="ExchangeBill" Type="Other">
- <GetSchema CmdType="Text" CmdText="SELECT Top 0 Date_SaleBill as Date
- ,convert(nvarchar(64),'') as Name_Bill
- ,convert(nvarchar(64),'') as No_Bill
- ,convert(nvarchar(64),'') as ConsultNo
- ,convert(nvarchar(64),'')as Principal
- ,convert(decimal,0.00) as Money
- ,convert(nvarchar(200),'')as Comment
- FROM SaleBill" />
- </Table>
- <Table name="ExchangeProduct" Type="Other">
- <GetSchema CmdType="Text" CmdText="SELECT Top 0 convert(nvarchar(64),'') as No_Product
- ,convert(nvarchar(64),'') as Name_Product
- ,Date_SaleBill as Date,convert(nvarchar(64),'') as Name_Bill
- ,convert(nvarchar(64),'') as No_Bill
- ,convert(nvarchar(64),'') as TaxCurrency
- ,convert(decimal,0.00) as Num
- ,convert(decimal,0.00) as Price
- ,convert(decimal,0.00) as Moeny
- ,convert(nvarchar(200),'')as Comment
- FROM SaleBill" />
- </Table>
- <Table name="BasicComment" Type="Child">
- <GetSchema CmdType="Text" CmdText=" SELECT TOP 0 BasicComment.* FROM BasicComment"/>
- <New CmdType="Text" CmdText=" INSERT INTO BasicComment (ID_BasicComment
- ,ID_Object
- ,Comment_BasicComment)
- VALUES (@ID_BasicComment
- ,@ID_Object
- ,@Comment_BasicComment)">
- <Params>
- <Param name="@ID_BasicComment" type="BasicComment.ID_BasicComment" sourceColumn="ID_BasicComment" />
- <Param name="@ID_Object" type="BasicComment.ID_Object" sourceColumn="ID_Object" />
- <Param name="@Comment_BasicComment" type="BasicComment.Comment_BasicComment" sourceColumn="Comment_BasicComment" />
- </Params>
- </New>
- <Update CmdType="Text" CmdText=" UPDATE BasicComment SET ID_Object = @ID_Object
- ,Comment_BasicComment = @Comment_BasicComment
- WHERE ID_BasicComment = @ID_BasicComment">
- <Params>
- <Param name="@ID_BasicComment" type="BasicComment.ID_BasicComment" sourceColumn="ID_BasicComment" />
- <Param name="@ID_Object" type="BasicComment.ID_Object" sourceColumn="ID_Object" />
- <Param name="@Comment_BasicComment" type="BasicComment.Comment_BasicComment" sourceColumn="Comment_BasicComment" />
- </Params>
- </Update>
- <Delete CmdType="Text" CmdText=" DELETE BasicComment WHERE ID_BasicComment = @ID_BasicComment">
- <Params>
- <Param name="@ID_BasicComment" type="BasicComment.ID_BasicComment" sourceColumn="ID_BasicComment" />
- </Params>
- </Delete>
- </Table>
- <Table name="CustomerInfo" Type="Child">
- <GetSchema CmdType="Text" CmdText="Select Top 0 CustomerInfo.*
- ,Convert(Nvarchar(64),'') As Type_CustomerInfo
- From CustomerInfo"/>
- <New CmdType="Text" CmdText="">
- </New>
- </Table>
- </Tables>
- <Search>
- <SearchDefaultPhone CmdType="Text" CmdText="Select newid() as ID_Telephone
- ,CAST('{00000000-0000-0000-0000-000000000000}' AS uniqueidentifier) as ID_Person
- ,CAST(Name_TypeDef AS NVARCHAR(64))As Name_Telephone
- ,CAST(''AS NVARCHAR(128)) As No_Telephone
- ,CAST(0 AS bit) As Focus_Telephone
- From TypeDef
- Where Type_TypeDef = 24">
- <Tables>
- <Table name="DefaultTelephone" />
- </Tables>
- </SearchDefaultPhone>
- <SearchDefaultFax CmdType="Text" CmdText="Select newid() as ID_Fax
- ,CAST('{00000000-0000-0000-0000-000000000000}' AS uniqueidentifier) as ID_Person
- ,CAST(Name_TypeDef AS NVARCHAR(64)) As Name_Fax
- ,CAST(''AS NVARCHAR(128)) As No_Fax
- ,CAST(0 AS bit) As Focus_Fax
- From TypeDef
- Where Type_TypeDef = 25
- order by No_TypeDef">
- <Tables>
- <Table name="DefaultFax" />
- </Tables>
- </SearchDefaultFax>
- <SearchAllCustomer CmdType="Text" CmdText=" SELECT Customer.*,RegionalLeader.No_RegionalLeader
- ,RegionalLeader.Name_RegionalLeader,Linkman.Name_Linkman
- ,Linkman.Tel_Linkman,No_Telephone
- ,Employee.No_Employee as No_Employee
- --,Employee.Name_Employee as Name_Employee
- ,case Principal.IsMain_Principal when 1 then Employee.Name_Employee
- else null end as Name_Employee
- FROM
- (
- SELECT Customer.ID_Customer,Customer.No_Customer
- ,Customer.ShortName_Customer,Customer.Zone_Customer
- ,Customer.SendAddr_Customer,RegistedAddress_Customer
- ,SuspendDate_Customer
- ,ID_Linkman=(Select Top 1 ID_Linkman From Linkman Where ID_Person=Customer.ID_Customer And IsMain_Linkman=1 order by name_linkman)
- ,LastPrincipal_Customer,Type_Customer,GetMethod_Customer
- ,Level_Customer
- ,ID_RegionalLeader =(select Top 1 ID_RegionalLeader from RegionalLeader where ID_RegionalLeader = Customer.ID_RegionalLeader)
- ,PayLimit_Customer
- ,LowDiscount_Customer
- ,DunDate_Customer
- ,Company_Customer
- ,Comment_Customer
- From Customer
- )Customer
- LEFT JOIN RegionalLeader on RegionalLeader.ID_RegionalLeader = Customer.ID_RegionalLeader
- Left Join Linkman On Customer.ID_Linkman=Linkman.ID_Linkman
- LEFT JOIN Telephone ON Telephone.ID_Person = Customer.ID_Customer and Focus_Telephone = 1
- --Left Join Employee On Employee.ID_Employee = Customer.LastPrincipal_Customer
- left join Principal on Principal.ID_Person= Customer.ID_Customer and IsMain_Principal = 1
- Left Join Employee On Employee.ID_Employee = Principal.ID_Employee
- ">
- <Tables>
- <Table name="AllCustomer" />
- </Tables>
- </SearchAllCustomer>
- <SearchAllRegionalLeader CmdType="Text" CmdText="SELECT RegionalLeader.*
- FROM
- (
- SELECT RegionalLeader.ID_RegionalLeader
- ,RegionalLeader.No_RegionalLeader
- ,RegionalLeader.Name_RegionalLeader
- From RegionalLeader
- )RegionalLeader
- ">
- <Tables>
- <Table name="AllRegionalLeader" />
- </Tables>
- </SearchAllRegionalLeader>
- <SearchCustomerList CmdType="Text" CmdText=" Select No_Customer,ShortName_Customer
- From Customer
- Where SuspendDate_Customer Is Null
- and Customer.ID_Creator=case IsNull(DataLength(@Right),0) When 0 Then Customer.ID_Creator Else @Right End --added for validating right">
- <Params>
- <Param name="@Right" type="SaleBill.ID_Customer" Index="0" />
- </Params>
- <Tables>
- <Table name="CustomerList"/>
- </Tables>
- </SearchCustomerList>
- <SearchAllCustomerList CmdType="Text" CmdText=" Select No_Customer,ShortName_Customer
- From Customer
- where Customer.ID_Creator=case IsNull(DataLength(@Right),0) When 0 Then Customer.ID_Creator Else @Right End --added for validating right">
- <Params>
- <Param name="@Right" type="SaleBill.ID_Customer" Index="0" />
- </Params>
- <Tables>
- <Table name="CustomerList"/>
- </Tables>
- </SearchAllCustomerList>
- <SearchIsMain CmdType="Text" CmdText=" Create Table #IsMain
- (
- Result nvarchar(64),
- Value bit
- )
- Insert into #IsMain Values('是',1)
- Insert into #IsMain Values('否',0)
- Select * From #IsMain
- Drop Table #IsMain">
- <Tables>
- <Table name="IsMain" />
- </Tables>
- </SearchIsMain>
- <SearchRegionalLeaderWithNo CmdType="Text" CmdText="IF object_id('tempdb..#Principal') IS NOT NULL
- drop table #Principal
- Create table #Principal
- (ID_RegionalLeader Uniqueidentifier
- ,ID_Employee Uniqueidentifier)
- declare @ID_RegionalLeader Uniqueidentifier
- declare @No_RegionalLeader nvarchar(64)
- declare @ID_Employee Uniqueidentifier
- Declare Cur Cursor for Select Distinct ID_RegionalLeader
- From Principal Where IsMain_Principal = 1
- Open Cur
- Fetch Next From Cur Into @ID_RegionalLeader
- While @@FETCH_STATUS = 0
- Begin
- Select Top 1 @ID_Employee = ID_Employee
- From Principal
- Where ID_RegionalLeader = @ID_RegionalLeader
- And IsMain_Principal = 1
- Insert Into #Principal(ID_RegionalLeader,ID_Employee)
- Values(@ID_RegionalLeader,@ID_Employee)
- Fetch Next From Cur Into @ID_RegionalLeader
- End
- Close Cur
- Deallocate Cur
- SELECT RegionalLeader.ID_RegionalLeader, RegionalLeader.No_RegionalLeader
- ,RegionalLeader.Name_RegionalLeader
- ,Employee.Name_Employee,Employee.No_Employee
- ,Employee.ID_Employee As ID_Employee
- FROM RegionalLeader
- Left Join #Principal On #Principal.ID_RegionalLeader = RegionalLeader.ID_RegionalLeader
- Left join Employee On Employee.ID_Employee = #Principal.ID_Employee
- WHERE RegionalLeader.No_RegionalLeader = @No_RegionalLeader
- SELECT @ID_RegionalLeader = RegionalLeader.ID_RegionalLeader
- FROM RegionalLeader WHERE RegionalLeader.No_RegionalLeader = @No_RegionalLeader
- Drop table #Principal
- ">
- <Params>
- <Param name="@No_Regionalleader" type="Regionalleader.No_Regionalleader" Index="0" />
- </Params>
- <Tables>
- <Table name="Regionalleader" />
- </Tables>
- </SearchRegionalLeaderWithNo>
- <SearchPrincipal CmdType="Text" CmdText=" SELECT Employee.No_Employee AS No_Principal
- ,Employee.Name_Employee AS Principal_PriceQueryBill
- FROM Principal
- INNER JOIN Employee ON Employee.ID_Employee = Principal.ID_Employee
- INNER JOIN Customer ON Customer.ID_Customer = Principal.ID_Person
- WHERE Customer.No_Customer = @No_Customer">
- <Params>
- <Param name="@No_Customer" type="Customer.No_Customer" Index="0" />
- </Params>
- <Tables>
- <Table name="Principal" />
- </Tables>
- </SearchPrincipal>
- <SearchCustomerWithNo CmdType="Text" CmdText=" DECLARE @ID_Customer uniqueidentifier
- SELECT Customer.*,RegionalLeader.No_RegionalLeader
- ,RegionalLeader.Name_RegionalLeader
- ,A.Name_User AS CreatorName_Customer
- ,B.Name_User As LastModUser
- ,Employee.No_Employee as No_Employee
- ,Employee.Name_Employee as Name_Employee
- ,ct.No_Customer as No2_Customer
- ,ct.ShortName_Customer as ShortName2_Customer
- FROM Customer
- LEFT JOIN RegionalLeader on RegionalLeader.ID_RegionalLeader = Customer.ID_RegionalLeader
- LEFT JOIN AppUser A ON A.ID_User = Customer.ID_Creator
- LEFT Join AppUser B ON B.ID_User=Customer.LastModUser_Customer
- LEFT JOIN Employee on Employee.ID_Employee = Customer.LastPrincipal_Customer
- left join Customer ct on Customer.CustomerID_Customer = ct.ID_Customer
- Where Customer.No_Customer=@No_Customer
-
- SELECT @ID_Customer = Customer.ID_Customer
- FROM Customer
- WHERE Customer.No_Customer = @No_Customer
-
- SELECT * FROM Telephone
- WHERE Telephone.ID_Person = @ID_Customer
-
- SELECT * FROM Fax
- WHERE Fax.ID_Person = @ID_Customer
-
- SELECT Linkman.*
- ,Case When Linkman.IsMain_Linkman = 1 Then '是' Else '否' End As IsMainStr_Linkman
- FROM Linkman
- WHERE Linkman.ID_Person = @ID_Customer
- order by name_linkman
-
- SELECT Principal.*
- ,Case When Principal.IsMain_Principal = 1 Then '是' Else '否' End As IsMainStr_Principal
- ,Employee.Name_Employee AS Name_Employee
- ,Employee.No_Employee AS No_Employee
- FROM Principal
- INNER JOIN Employee ON Employee.ID_Employee = Principal.ID_Employee
- WHERE Principal.ID_Person = @ID_Customer
- SELECT Invoice.*
- ,Case When Invoice.Common_Invoice = 1 Then '是' Else '否' End As IsCommon_Invoice
- FROM Invoice
- WHERE ID_Customer = @ID_Customer
-
- SELECT BasicComment.* FROM BasicComment
- WHERE BasicComment.ID_Object = @ID_Customer
- order by BasicComment.No_BasicComment
-
- Select CustomerInfo.*,
- Case IsProduct_CustomerInfo When 1 then '生产 ' else '' End +
- Case IsSpecial_CustomerInfo When 1 Then ' 专门代工 ' Else '' End +
- Case IsNormal_CustomerInfo When 1 Then ' 一般代工 ' Else '' End AS Type_CustomerInfo
- From dbo.CustomerInfo Where ID_Customer = @ID_Customer
- Order By No_CustomerInfo">
- <Params>
- <Param name="@No_Customer" type="Customer.No_Customer" Index="0" />
- </Params>
- <Tables>
- <Table name="Customer" />
- <Table name="Telephone" />
- <Table name="Fax"/>
- <Table name="Linkman" />
- <Table name="Principal"/>
- <Table name="Invoice"/>
- <Table name="BasicComment"/>
- <Table name="CustomerInfo"/>
- </Tables>
- </SearchCustomerWithNo>
- <SearchCustomerWithNo2 CmdType="Text" CmdText="SELECT Customer.*,ct.No_Customer as No2_Customer
- ,ct.ShortName_Customer as ShortName2_Customer
- FROM Customer
- left join Customer ct on Customer.CustomerID_Customer = ct.ID_Customer
- WHERE Customer.No_Customer=@No_Customer
- ">
- <Params>
- <Param name="@No_Customer" type="Customer.No_Customer" Index="0" />
- </Params>
- <Tables>
- <Table name="Customer2"></Table>
- </Tables>
- </SearchCustomerWithNo2>
-
- <SearchCustomerWithNo3 CmdType="Text" CmdText=" DECLARE @ID_Customer Uniqueidentifier
- SELECT @ID_Customer=ID_Customer FROM Customer
- where No_Customer=@No_Customer
-
- SELECT No_Customer FROM Customer
- WHERE Customer.ID_Customer in (SELECT ID_Customer FROM PreGet WHERE ID_Customer=@ID_Customer)
- or Customer.ID_Customer in (SELECT ID_Customer FROM SaleInvoice WHERE ID_Customer=@ID_Customer and Disable_SaleInvoice=0)
- ">
- <Params>
- <Param name="@No_Customer" type="Customer.No_Customer" Index="0" />
- </Params>
- <Tables>
- <Table name="Customer3"></Table>
- </Tables>
- </SearchCustomerWithNo3>
- <SearchCustomerWithNo4 CmdType="Text" CmdText="SELECT Customer.No_Customer,Customer.Company_Customer,ct.No_Customer as No2_Customer
- FROM Customer
- left join Customer ct on Customer.CustomerID_Customer = ct.ID_Customer
- WHERE Customer.No_Customer=@No_Customer
- ">
- <Params>
- <Param name="@No_Customer" type="Customer.No_Customer" Index="0" />
- </Params>
- <Tables>
- <Table name="Customer4"></Table>
- </Tables>
- </SearchCustomerWithNo4>
- <SearchCustomerNext CmdType="Text" CmdText=" DECLARE @ID_Customer uniqueidentifier
- DECLARE @NextNo nvarchar(64)
- SET @NextNo = @No_Customer
- SELECT TOP 1 @NextNo = Customer.No_Customer
- FROM Customer
- WHERE Customer.No_Customer > @No_Customer
- and Customer.ID_Creator=case IsNull(DataLength(@Right),0) When 0 Then Customer.ID_Creator Else @Right End --added for validating right
- and Customer.ID_RegionalLeader in
- (Select ID_RegionalLeader From Principal
- Where ID_Employee in(select ID_Employee from Employee where Name_Employee=@Name_Employee)
- )
- ORDER BY Customer.No_Customer
-
- SELECT Customer.*,A.Name_User AS CreatorName_Customer
- ,B.Name_User As LastModUser
- ,No_RegionalLeader As No_RegionalLeader
- ,Name_RegionalLeader As Name_RegionalLeader
- ,Employee.No_Employee AS No_Employee
- ,Employee.Name_Employee as Name_Employee
- ,ct.No_Customer as No2_Customer
- ,ct.ShortName_Customer as ShortName2_Customer
- FROM Customer
- LEFT JOIN AppUser A ON A.ID_User = Customer.ID_Creator
- LEFT Join AppUser B ON B.ID_User=Customer.LastModUser_Customer
- LEFT JOIN RegionalLeader on RegionalLeader.ID_RegionalLeader = Customer.ID_RegionalLeader
- LEFT JOIN Employee on Employee.ID_Employee = Customer.LastPrincipal_Customer
- left join Customer ct on Customer.CustomerID_Customer = ct.ID_Customer
- Where Customer.No_Customer=@NextNo
-
- SELECT @ID_Customer = Customer.ID_Customer
- FROM Customer
- WHERE Customer.No_Customer = @NextNo
-
- SELECT * FROM Telephone
- WHERE Telephone.ID_Person = @ID_Customer
-
- SELECT * FROM Fax
- WHERE Fax.ID_Person = @ID_Customer
-
- SELECT Linkman.*
- ,Case When Linkman.IsMain_Linkman = 1 Then '是' Else '否' End As IsMainStr_Linkman
- FROM Linkman
- WHERE Linkman.ID_Person = @ID_Customer
- order by name_linkman
-
- SELECT Principal.*
- ,Case When Principal.IsMain_Principal = 1 Then '是' Else '否' End As IsMainStr_Principal
- ,Employee.Name_Employee AS Name_Employee
- ,Employee.No_Employee AS No_Employee
- FROM Principal
- INNER JOIN Employee ON Employee.ID_Employee = Principal.ID_Employee
- WHERE Principal.ID_Person = @ID_Customer
-
- SELECT Invoice.*
- ,Case When Invoice.Common_Invoice = 1 Then '是' Else '否' End As IsCommon_Invoice
- FROM Invoice
- WHERE ID_Customer = @ID_Customer
-
- SELECT BasicComment.* FROM BasicComment
- WHERE BasicComment.ID_Object = @ID_Customer
- order by BasicComment.No_BasicComment
-
- Select CustomerInfo.*,
- Case IsProduct_CustomerInfo When 1 then '生产 ' else '' End +
- Case IsSpecial_CustomerInfo When 1 Then ' 专门代工 ' Else '' End +
- Case IsNormal_CustomerInfo When 1 Then ' 一般代工 ' Else '' End AS Type_CustomerInfo
- From dbo.CustomerInfo Where ID_Customer = @ID_Customer
- Order By No_CustomerInfo">
- <Params>
- <Param name="@No_Customer" type="Customer.No_Customer" Index="0" />
- <Param name="@Right" type="SaleBill.ID_Customer" Index="1" />
- <Param name="@Name_Employee" type="Employee.Name_Employee" Index="2" />
- </Params>
- <Tables>
- <Table name="Customer" />
- <Table name="Telephone" />
- <Table name="Fax"/>
- <Table name="Linkman" />
- <Table name="Principal"/>
- <Table name="Invoice"/>
- <Table name="BasicComment"/>
- <Table name="CustomerInfo"/>
- </Tables>
- </SearchCustomerNext>
- <SearchCustomerPrevious CmdType="Text" CmdText=" DECLARE @ID_Customer uniqueidentifier
- DECLARE @NextNo nvarchar(64)
- SET @NextNo = @No_Customer
- SELECT TOP 1 @NextNo = Customer.No_Customer FROM Customer WHERE Customer.No_Customer < @No_Customer and Customer.ID_Creator=case IsNull(DataLength(@Right),0) When 0 Then Customer.ID_Creator Else @Right End --added for validating right
- and Customer.ID_RegionalLeader in
- (Select ID_RegionalLeader From Principal
- Where ID_Employee in(select ID_Employee from Employee where Name_Employee=@Name_Employee)
- )
- ORDER BY Customer.No_Customer Desc
-
- SELECT Customer.*,A.Name_User AS CreatorName_Customer,B.Name_User As LastModUser
- ,No_RegionalLeader As No_RegionalLeader,Name_RegionalLeader As Name_RegionalLeader
- ,Employee.No_Employee AS No_Employee,Employee.Name_Employee as Name_Employee
- ,ct.No_Customer as No2_Customer , ct.ShortName_Customer as ShortName2_Customer
- FROM Customer
-
- LEFT JOIN AppUser A ON A.ID_User = Customer.ID_Creator
- LEFT Join AppUser B ON B.ID_User=Customer.LastModUser_Customer
- LEFT JOIN RegionalLeader on RegionalLeader.ID_RegionalLeader = Customer.ID_RegionalLeader
- LEFT JOIN Employee on Employee.ID_Employee = Customer.LastPrincipal_Customer
- left join Customer ct on Customer.CustomerID_Customer = ct.ID_Customer
- where Customer.No_Customer = @NextNo
-
- SELECT @ID_Customer = Customer.ID_Customer FROM Customer WHERE Customer.No_Customer = @NextNo
- SELECT * FROM Telephone WHERE Telephone.ID_Person = @ID_Customer
- SELECT * FROM Fax WHERE Fax.ID_Person = @ID_Customer
- SELECT Linkman.*,Case When Linkman.IsMain_Linkman = 1 Then '是' Else '否' End As IsMainStr_Linkman FROM Linkman WHERE Linkman.ID_Person = @ID_Customer order by name_linkman
- SELECT Principal.*,Case When Principal.IsMain_Principal = 1 Then '是' Else '否' End As IsMainStr_Principal, Employee.Name_Employee AS Name_Employee, Employee.No_Employee AS No_Employee FROM Principal INNER JOIN Employee ON Employee.ID_Employee = Principal.ID_Employee WHERE Principal.ID_Person = @ID_Customer
- SELECT Invoice.*,Case When Invoice.Common_Invoice = 1 Then '是' Else '否' End As IsCommon_Invoice FROM Invoice WHERE ID_Customer = @ID_Customer
- SELECT BasicComment.* FROM BasicComment WHERE BasicComment.ID_Object = @ID_Customer order by BasicComment.No_BasicComment
- Select CustomerInfo.*,
- Case IsProduct_CustomerInfo When 1 then '生产 ' else '' End +
- Case IsSpecial_CustomerInfo When 1 Then ' 专门代工 ' Else '' End +
- Case IsNormal_CustomerInfo When 1 Then ' 一般代工 ' Else '' End AS Type_CustomerInfo
- From dbo.CustomerInfo Where ID_Customer = @ID_Customer
- Order By No_CustomerInfo">
- <Params>
- <Param name="@No_Customer" type="Customer.No_Customer" Index="0" />
- <Param name="@Right" type="SaleBill.ID_Customer" Index="1" />
- <Param name="@Name_Employee" type="Employee.Name_Employee" Index="2" />
- </Params>
- <Tables>
- <Table name="Customer" />
- <Table name="Telephone" />
- <Table name="Fax"/>
- <Table name="Linkman" />
- <Table name="Principal"/>
- <Table name="Invoice"/>
- <Table name="BasicComment"/>
- <Table name="CustomerInfo"/>
- </Tables>
- </SearchCustomerPrevious>
- <SearchCustomerFirst CmdType="Text" CmdText=" DECLARE @ID_Customer uniqueidentifier
- DECLARE @NextNo nvarchar(64)
- SET @NextNo = @No_Customer
- SELECT TOP 1 @NextNo = Customer.No_Customer FROM Customer where Customer.ID_Creator=case IsNull(DataLength(@Right),0) When 0 Then Customer.ID_Creator Else @Right End --added for validating right
- and Customer.ID_RegionalLeader in
- (Select ID_RegionalLeader From Principal
- Where ID_Employee in(select ID_Employee from Employee where Name_Employee=@Name_Employee)
- )
- ORDER BY Customer.No_Customer
-
- SELECT Customer.*,A.Name_User AS CreatorName_Customer,B.Name_User As LastModUser
- ,No_RegionalLeader As No_RegionalLeader,Name_RegionalLeader As Name_RegionalLeader
- ,Employee.No_Employee AS No_Employee,Employee.Name_Employee as Name_Employee
- ,ct.No_Customer as No2_Customer , ct.ShortName_Customer as ShortName2_Customer
-
- FROM Customer
- LEFT JOIN AppUser A ON A.ID_User = Customer.ID_Creator
- LEFT Join AppUser B ON B.ID_User=Customer.LastModUser_Customer
- LEFT JOIN RegionalLeader on RegionalLeader.ID_RegionalLeader = Customer.ID_RegionalLeader
- LEFT JOIN Employee on Employee.ID_Employee = Customer.LastPrincipal_Customer
- left join Customer ct on Customer.CustomerID_Customer = ct.ID_Customer
- Where Customer.No_Customer=@NextNo
-
- SELECT @ID_Customer = Customer.ID_Customer FROM Customer WHERE Customer.No_Customer = @NextNo
- SELECT * FROM Telephone WHERE Telephone.ID_Person = @ID_Customer
- SELECT * FROM Fax WHERE Fax.ID_Person = @ID_Customer
- SELECT Linkman.*,Case When Linkman.IsMain_Linkman = 1 Then '是' Else '否' End As IsMainStr_Linkman FROM Linkman WHERE Linkman.ID_Person = @ID_Customer order by name_linkman
- SELECT Principal.*,Case When Principal.IsMain_Principal = 1 Then '是' Else '否' End As IsMainStr_Principal, Employee.Name_Employee AS Name_Employee, Employee.No_Employee AS No_Employee FROM Principal INNER JOIN Employee ON Employee.ID_Employee = Principal.ID_Employee WHERE Principal.ID_Person = @ID_Customer
- SELECT Invoice.*,Case When Invoice.Common_Invoice = 1 Then '是' Else '否' End As IsCommon_Invoice FROM Invoice WHERE ID_Customer = @ID_Customer
- SELECT BasicComment.* FROM BasicComment WHERE BasicComment.ID_Object = @ID_Customer order by BasicComment.No_BasicComment
- Select CustomerInfo.*,
- Case IsProduct_CustomerInfo When 1 then '生产 ' else '' End +
- Case IsSpecial_CustomerInfo When 1 Then ' 专门代工 ' Else '' End +
- Case IsNormal_CustomerInfo When 1 Then ' 一般代工 ' Else '' End AS Type_CustomerInfo
- From dbo.CustomerInfo Where ID_Customer = @ID_Customer
- Order By No_CustomerInfo">
- <Params>
- <Param name="@No_Customer" type="Customer.No_Customer" Index="0" />
- <Param name="@Right" type="SaleBill.ID_Customer" Index="1" />
- <Param name="@Name_Employee" type="Employee.Name_Employee" Index="2" />
- </Params>
- <Tables>
- <Table name="Customer" />
- <Table name="Telephone" />
- <Table name="Fax"/>
- <Table name="Linkman" />
- <Table name="Principal"/>
- <Table name="Invoice"/>
- <Table name="BasicComment"/>
- <Table name="CustomerInfo"/>
- </Tables>
- </SearchCustomerFirst>
- <SearchCustomerLast CmdType="Text" CmdText=" DECLARE @ID_Customer uniqueidentifier
- DECLARE @NextNo nvarchar(64)
- SET @NextNo = @No_Customer
- SELECT TOP 1 @NextNo = Customer.No_Customer FROM Customer where Customer.ID_Creator=case IsNull(DataLength(@Right),0) When 0 Then Customer.ID_Creator Else @Right End --added for validating right
- and Customer.ID_RegionalLeader in
- (Select ID_RegionalLeader From Principal
- Where ID_Employee in(select ID_Employee from Employee where Name_Employee=@Name_Employee)
- )
- ORDER BY Customer.No_Customer DESC
-
- SELECT Customer.*,A.Name_User AS CreatorName_Customer,B.Name_User As LastModUser
- ,No_RegionalLeader As No_RegionalLeader,Name_RegionalLeader As Name_RegionalLeader
- ,Employee.No_Employee AS No_Employee,Employee.Name_Employee as Name_Employee
- ,ct.No_Customer as No2_Customer , ct.ShortName_Customer as ShortName2_Customer
- FROM Customer
-
- LEFT JOIN AppUser A ON A.ID_User = Customer.ID_Creator
- LEFT Join AppUser B ON B.ID_User=Customer.LastModUser_Customer
- LEFT JOIN RegionalLeader on RegionalLeader.ID_RegionalLeader = Customer.ID_RegionalLeader
- LEFT JOIN Employee on Employee.ID_Employee = Customer.LastPrincipal_Customer
- left join Customer ct on Customer.CustomerID_Customer = ct.ID_Customer
- Where Customer.No_Customer=@NextNo
-
- SELECT @ID_Customer = Customer.ID_Customer FROM Customer WHERE Customer.No_Customer = @NextNo
- SELECT * FROM Telephone WHERE Telephone.ID_Person = @ID_Customer
- SELECT * FROM Fax WHERE Fax.ID_Person = @ID_Customer
- SELECT Linkman.*,Case When Linkman.IsMain_Linkman = 1 Then '是' Else '否' End As IsMainStr_Linkman FROM Linkman WHERE Linkman.ID_Person = @ID_Customer order by name_linkman
- SELECT Principal.*,Case When Principal.IsMain_Principal = 1 Then '是' Else '否' End As IsMainStr_Principal, Employee.Name_Employee AS Name_Employee, Employee.No_Employee AS No_Employee FROM Principal INNER JOIN Employee ON Employee.ID_Employee = Principal.ID_Employee WHERE Principal.ID_Person = @ID_Customer
- SELECT Invoice.*,Case When Invoice.Common_Invoice = 1 Then '是' Else '否' End As IsCommon_Invoice FROM Invoice WHERE ID_Customer = @ID_Customer
- SELECT BasicComment.* FROM BasicComment WHERE BasicComment.ID_Object = @ID_Customer order by BasicComment.No_BasicComment
- Select CustomerInfo.*,
- Case IsProduct_CustomerInfo When 1 then '生产 ' else '' End +
- Case IsSpecial_CustomerInfo When 1 Then ' 专门代工 ' Else '' End +
- Case IsNormal_CustomerInfo When 1 Then ' 一般代工 ' Else '' End AS Type_CustomerInfo
- From dbo.CustomerInfo Where ID_Customer = @ID_Customer
- Order By No_CustomerInfo">
- <Params>
- <Param name="@No_Customer" type="Customer.No_Customer" Index="0" />
- <Param name="@Right" type="SaleBill.ID_Customer" Index="1" />
- <Param name="@Name_Employee" type="Employee.Name_Employee" Index="2" />
- </Params>
- <Tables>
- <Table name="Customer" />
- <Table name="Telephone" />
- <Table name="Fax"/>
- <Table name="Linkman" />
- <Table name="Principal"/>
- <Table name="Invoice"/>
- <Table name="BasicComment"/>
- <Table name="CustomerInfo"/>
- </Tables>
- </SearchCustomerLast>
- <GetEmployeeNameByNo CmdType="Text" CmdText="SELECT Employee.ID_Employee,Employee.No_Employee,Employee.Name_Employee,Employee.SuspendDate_Employee FROM Employee WHERE No_Employee = @No_Employee">
- <Params>
- <Param name="@No_Employee" type="Employee.No_Employee" Index="0" />
- </Params>
- <Tables>
- <Table name="Employee" />
- </Tables>
- </GetEmployeeNameByNo>
- <SearchAreaType CmdType="Text" CmdText="Select * FROM RegionalLeader">
- <Tables>
- <Table name="RegionalLeader" />
- </Tables>
- </SearchAreaType>
- <SearchIndustryType CmdType="Text" CmdText="SELECT * FROM TypeDef WHERE Type_TypeDef = 13">
- <Tables>
- <Table name="IndustryType" />
- </Tables>
- </SearchIndustryType>
- <SearchZoneType CmdType="Text" CmdText="SELECT * FROM TypeDef WHERE Type_TypeDef = 14">
- <Tables>
- <Table name="ZoneType" />
- </Tables>
- </SearchZoneType>
- <SearchType CmdType="Text" CmdText="SELECT * FROM TypeDef WHERE Type_TypeDef = 12">
- <Tables>
- <Table name="Type" />
- </Tables>
- </SearchType>
- <SearchSourceType CmdType="Text" CmdText="SELECT * FROM TypeDef WHERE Type_TypeDef = 15">
- <Tables>
- <Table name="SourceType" />
- </Tables>
- </SearchSourceType>
- <SearchLevelType CmdType="Text" CmdText="SELECT * FROM TypeDef WHERE Type_TypeDef = 16">
- <Tables>
- <Table name="LevelType" />
- </Tables>
- </SearchLevelType>
- <SearchBankType CmdType="Text" CmdText="SELECT * FROM TypeDef WHERE Type_TypeDef = 6">
- <Tables>
- <Table name="BankType" />
- </Tables>
- </SearchBankType>
- <SearchCompanyType CmdType="Text" CmdText=" Select * From TypeDef Where Type_TypeDef = 30">
- <Tables>
- <Table name="CompanyType" />
- </Tables>
- </SearchCompanyType>
- <SearchSystemSetting CmdType="Text" CmdText="SELECT SysCurrency_SystemSetting From SystemSetting">
- <Tables>
- <Table name="SystemSetting"/>
- </Tables>
- </SearchSystemSetting>
- <SearchGetMethodType CmdType="Text" CmdText="CREATE TABLE #TypeDef( Type nvarchar(64)) DECLARE @i int SET @i = 0
- WHILE @i < 6
- BEGIN
- IF(@i=0)
- BEGIN
- INSERT INTO #TypeDef (Type)VALUES('先款后货')
- END
- IF(@i=1)
- BEGIN
- INSERT INTO #TypeDef (Type)VALUES('票到当月结')
- END
- IF(@i=2)
- BEGIN
- INSERT INTO #TypeDef (Type)VALUES('两月结')
- END
- IF(@i=3)
- BEGIN
- INSERT INTO #TypeDef (Type)VALUES('三月结')
- END
- IF(@i=4)
- BEGIN
- INSERT INTO #TypeDef (Type)VALUES('四月结')
- END
- IF(@i=5)
- BEGIN
- INSERT INTO #TypeDef (Type)VALUES('票到付款')
- END
- SET @i = @i + 1
- END
- SELECT Type AS Name_TypeDef FROM #TypeDef
- DROP TABLE #TypeDef">
- <Tables>
- <Table name="GetMethodType" />
- </Tables>
- </SearchGetMethodType>
- <InsertRecord CmdType="Text" CmdText="Create Table Record
- (
- Title_Invoice nvarchar(64),
- Address_Invoice nvarchar(256)
- )
- Insert Into Record(Title_Invoice,Address_Invoice)
- Values(@Title_Invoice,@Address_Invoice)
- Select * From Record
- Drop Table Record
- ">
- <Params>
- <Param name="@Title_Invoice" type="Invoice.Title_Invoice" Index="0" />
- <Param name="@Address_Invoice" type="Invoice.Address_Invoice" Index="1" />
- </Params>
- <Tables>
- <Table name="TempInvoice"/>
- </Tables>
- </InsertRecord>
- <SearchExchangeBill CmdType="Text" CmdText="declare @cmd nvarchar(4000)
- if(@ckNearlyBill=1)
- begin
- set @cmd = N'set rowcount '+convert(nvarchar,@tbNearlyBill) +N' select * from ( '
- end
- else
- begin
- set @cmd = N' select * from ( '
- end
- set @cmd = @cmd+N' SELECT Top 0 Date_SaleBill as Date,convert(nvarchar(64),'+nchar(39)+nchar(39)+N') as Name_Bill,'
- +N' convert(nvarchar(64),'+nchar(39)+nchar(39)+N') as No_Bill,convert(nvarchar(64),'+nchar(39)+nchar(39)+N') as ConsultNo,convert(nvarchar(64),'+nchar(39)+nchar(39)+N')as Principal,'
- +N' convert(decimal,0.00) as Money,SaleBill.ID_Assessor as ID_Assessor,convert(nvarchar(200),'+nchar(39)+nchar(39)+N')as No_Customer '
- +N' FROM SaleBill '
-
- if(@ckQueryPriceBill = 1)
- begin
- set @cmd = @cmd+N' Union all SELECT A.Date_PriceQueryBill as Date,convert(nvarchar(64),'+nchar(39)+N'报价单'+nchar(39)+N') as Name_Bill,A.No_PriceQueryBill as No_Bill,'
- +N' convert(nvarchar(64),'+nchar(39)+nchar(39)+N') as ConsultNo,Y.Name_Employee as Principal,'
- +N' A.Amount_PriceQueryBill as Money,'
- +N' A.ID_Assessor,X.No_Customer'
- +N' From PriceQueryBill A'
- +N' Left join Employee Y on Y.ID_Employee=A.ID_Principal '
- +N' Left join Customer X on X.ID_Customer = A.ID_Customer '
- if(@RightPriceQueryBill=0)
- set @cmd=@cmd+N' Where Special_PriceQueryBill=0 '
- end
- if(@ckSaleBill = 1)
- begin
- set @cmd = @cmd+N' Union all select A.Date_SaleBill as Date,convert(nvarchar(64),'+nchar(39)+N'销货单'+nchar(39)+N') as Name_Bill,A.No_SaleBill as No_Bill,'
- +N' A.No_OrderBill as ConsultNo,Y.Name_Employee as Principal,'
- +N' A.Amount_SaleBill as Money,'
- +N' A.ID_Assessor,X.No_Customer'
- +N' from SaleBill A'
- +N' Left join Employee Y on Y.ID_Employee=A.ID_Principal '
- +N' Left join Customer X on X.ID_Customer = A.ID_Customer '
- if(@RightSaleBill=0)
- set @cmd=@cmd+N' Where Special_SaleBill=0 '
- end
-
- if(@ckSaleRtnBill = 1)
- begin
- set @cmd = @cmd+N' Union all select A.Date_SaleRtnBill as Date,convert(nvarchar(64),'+nchar(39)+N'销售退货单'+nchar(39)+N') as Name_Bill,A.No_SaleRtnBill as No_Bill,'
- +N' convert(nvarchar(64),'+nchar(39)+nchar(39)+N') as ConsultNo,Y.Name_Employee as Principal,'
- +N' A.Amount_SaleRtnBill as Money,'
- +N' A.ID_Assessor,X.No_Customer'
- +N' from SaleRtnBill A'
- +N' Left join Employee Y on Y.ID_Employee=A.ID_Principal '
- +N' left join Customer X on X.ID_Customer=A.ID_Customer '
- end
-
- if(@ckInventoryBill = 1)
- begin
- set @cmd = @cmd+N' Union all select A.Date_ModifyDepotBill as Date,convert(nvarchar(64),'+nchar(39)+N'库存异动作业'+nchar(39)+N') as Name_Bill,A.No_ModifyDepotBill as No_Bill,'
- +N' convert(nvarchar(64),'+nchar(39)+nchar(39)+N') as ConsultNo,convert(nvarchar(64),'+nchar(39)+nchar(39)+N') as Principal,'
- +N' A.Amount_ModifyDepotBill as Money,'
- +N' A.ID_Assessor,'+nchar(39)+@No_Customer+nchar(39)+N' As No_Customer'
- +N' from ModifyDepotBill A'
- +N' Where Comment_ModifyDepotBill='+nchar(39)+@ShortName_Customer+nchar(39)
- end
- if(@ckSaleOutDepotBill = 1)
- begin
- set @cmd = @cmd+N' Union all select A.Date_SaleOutDepotBill as Date,convert(nvarchar(64),'+nchar(39)+N'销货出库单'+nchar(39)+N') as Name_Bill,A.No_SaleOutDepotBill as No_Bill,'
- +N' convert(nvarchar(64),'+nchar(39)+nchar(39)+N') as ConsultNo,convert(nvarchar(64),'+nchar(39)+nchar(39)+N') as Principal,'
- +N' B.Amount_SaleOutDepotBill as Money,'
- +N' A.ID_Assessor,X.No_Customer'
- +N' from SaleOutDepotBill A'
- +N' Left join Customer X on X.ID_Customer = A.ID_Customer '
- +N' Left join (Select ID_SaleOutDepotBill,Sum(Quantity_SaleOutDepotBillProduct*UnitPrice_SaleOutDepotBillProduct) As Amount_SaleOutDepotBill From SaleOutDepotBillProduct Group By ID_SaleOutDepotBill)B On B.ID_SaleOutDepotBill=A.ID_SaleOutDepotBill '
- end
-
- if(@ckIndentBill = 1)
- begin
- set @cmd = @cmd+N' Union all select A.Date_IndentBill as Date,convert(nvarchar(64),'+nchar(39)+N'订货单'+nchar(39)+N') as Name_Bill,A.No_IndentBill as No_Bill,'
- +N' convert(nvarchar(64),'+nchar(39)+nchar(39)+N') as ConsultNo,Y.Name_Employee as Principal,'
- +N' A.Amount_IndentBill as Money,'
- +N' A.ID_Assessor,X.No_Customer'
- +N' from IndentBill A'
- +N' Left join Employee Y on Y.ID_Employee=A.ID_Principal '
- +N' Left join Customer X on X.ID_Customer = A.ID_Customer '
- if(@RightIndentBill=0)
- set @cmd=@cmd+N' Where Special_IndentBill=0 '
-
- end
-
- set @cmd = @cmd + N' )A where A.ID_Assessor is not null and A.No_Customer = '+nchar(39)+@No_Customer+nchar(39)
- if(@StartTime is not null)
- set @cmd = @cmd + N' and A.Date > DATEADD(day, DATEDIFF(day,0,'+nchar(39)+convert(nvarchar,@StartTime) +nchar(39)+N'), 0) '
- if(@EndTime is not null)
- set @cmd = @cmd + N' and A.Date < DATEADD(day, DATEDIFF(day,0,'+nchar(39)+convert(nvarchar,@EndTime) +nchar(39)+N'), 1) '
-
- set @cmd = @cmd + N' Order By A.Date Desc '
- EXECUTE sp_executesql @cmd
- Return
- ">
- <Params>
- <Param name="@StartTime" type="SaleBill.Date_SaleBill" Index="0" />
- <Param name="@EndTime" type="SaleBill.Date_SaleBill" Index="1" />
- <Param name="@ckNearlyBill" type="SaleBill.Disable_SaleBill" Index="2" />
- <Param name="@tbNearlyBill" type="SaleBill.GoodsAmount_SaleBill" Index="3" />
- <Param name="@ckQueryPriceBill" type="SaleBill.Disable_SaleBill" Index="4" />
- <Param name="@ckSaleBill" type="SaleBill.Disable_SaleBill" Index="5" />
- <Param name="@ckSaleRtnBill" type="SaleBill.Disable_SaleBill" Index="6" />
- <Param name="@ckInventoryBill" type="SaleBill.Disable_SaleBill" Index="7" />
- <Param name="@No_Customer" type="Customer.No_Customer" Index="8" />
- <Param name="@ckSaleOutDepotBill" type="SaleBill.Disable_SaleBill" Index="9" />
- <Param name="@ckIndentBill" type="SaleBill.Disable_SaleBill" Index="10" />
- <Param name="@ShortName_Customer" type="Customer.No_Customer" Index="11" />
- <Param name="@RightIndentBill" type="IndentBill.Special_IndentBill" Index="12" />
- <Param name="@RightSaleBill" type="IndentBill.Special_IndentBill" Index="13" />
- <Param name="@RightPriceQueryBill" type="IndentBill.Special_IndentBill" Index="14" />
- </Params>
- <Tables>
- <Table name="ExchangeBill"/>
- </Tables>
- </SearchExchangeBill>
- <SearchExchangeProduct CmdType="Text" CmdText=" declare @cmd nvarchar(4000)
- declare @first bit
- set @first=1
- if(@ckNearlyProduct=1)
- begin
- set @cmd = N' set rowcount '+convert(nvarchar,@tbNearlyProduct) +N' select * from ( '
- end
- else
- begin
- set @cmd = N' select * from ( '
- end
- /*set @cmd = @cmd+N' SELECT Top 0 '+nchar(39)+nchar(39)+N' as No_Product,'+nchar(39)+nchar(39)+N' as Name_Product, Date_SaleBill as Date,'+nchar(39)+nchar(39)+N' as Name_Bill,'
- +nchar(39)+nchar(39)+N' as No_Bill,convert(decimal,0.00) as Num,convert(decimal,0.00) as Price,
- convert(decimal,0.00) as Money,'+nchar(39)+nchar(39)+N' as Comment,SaleBill.ID_Assessor as ID_Assessor,'+nchar(39)+nchar(39)+N' as No_Customer,'+nchar(39)+nchar(39)+N' as TaxCurrency FROM SaleBill ' */
-
- if(@ckQueryPriceProduct = 1)
- begin
- if(@first!=1)
- set @cmd = @cmd+N' Union all'
- set @first=0
- set @cmd = @cmd +N' select No_Product,Name_Product, Date_PriceQueryBill as Date,Name_Bill='+nchar(39)+N'报价单'+nchar(39)+N',No_PriceQueryBill as No_Bill,'
- +N' Quantity_PriceQueryBillProduct as Num,UnitPrice_PriceQueryBillProduct as price,'
- +N' (Quantity_PriceQueryBillProduct*UnitPrice_PriceQueryBillProduct) as Money,'
- +N' Comment_PriceQueryBillProduct as Comment,'
- +N' ID_Assessor,X.No_Customer,TaxCurrency_PriceQueryBill as TaxCurrency '
- +N' From PriceQueryBill pq'
- +N' join PriceQueryBillProduct pqp on pq.ID_PriceQueryBill = pqp.ID_PriceQueryBill'
- +N' left join Product p on p.ID_Product=pqp.ID_Product left join Customer X on X.ID_Customer = pq.ID_Customer'
- if(@RightPriceQueryBill=0)
- set @cmd=@cmd+N' Where Special_PriceQueryBill=0 '
- end
- if(@ckSaleProduct = 1)
- begin
- if(@first!=1)
- set @cmd = @cmd+N' Union all'
- set @first=0
- set @cmd = @cmd+N' select No_Product,Name_Product,Date_SaleBill as Date,Name_Bill='+nchar(39)+N'销货单'+nchar(39)+N',No_SaleBill as No_Bill,'
- +N' Quantity_SaleBillProduct as Num,UnitPrice_SaleBillProduct as price,'
- +N' (Quantity_SaleBillProduct*UnitPrice_SaleBillProduct) as Money,Comment_SaleBillProduct as Comment,'
- +N' ID_Assessor,X.No_Customer,TaxCurrency_SaleBill as TaxCurrency '
- +N' from SaleBill s'
- +N' join SaleBillProduct sp on s.ID_SaleBill=sp.ID_SaleBill'
- +N' left join Product on Product.ID_Product=sp.ID_Product left join Customer X on X.ID_Customer = s.ID_Customer'
- if(@RightSaleBill=0)
- set @cmd=@cmd+N' Where Special_SaleBill=0 '
-
- end
-
- if(@ckSaleRtnProduct = 1)
- begin
- if(@first!=1)
- set @cmd = @cmd+N' Union all'
- set @first=0
- set @cmd = @cmd+N' select No_Product,Name_Product,Date_SaleRtnBill as Date,Name_Bill='+nchar(39)+N'销售退货单'+nchar(39)+N',No_SaleRtnBill as No_Bill,'
- +N' Quantity_SaleRtnBillProduct as Num,UnitPrice_SaleRtnBillProduct as price,'
- +N' (Quantity_SaleRtnBillProduct*UnitPrice_SaleRtnBillProduct) as Money,Comment_SaleRtnBillProduct as Comment,'
- +N' ID_Assessor,X.No_Customer,TaxCurrency_SaleRtnBill as TaxCurrency '
- +N' from SaleRtnBill'
- +N' join SaleRtnBillProduct on SaleRtnBill.ID_SaleRtnBill=SaleRtnBillProduct.ID_SaleRtnBill'
- +N' left join Product on Product.ID_Product=SaleRtnBillProduct.ID_Product left join Customer X on X.ID_Customer = SaleRtnBill.ID_Customer'
-
- end
-
- if(@ckInventoryProduct = 1)
- begin
- if(@first!=1)
- set @cmd = @cmd+N' Union all'
- set @first=0
- set @cmd = @cmd+N' select No_Product,Name_Product,Date_ModifyDepotBill as Date,Name_Bill='+nchar(39)+N'库存异动作业'+nchar(39)+N',No_ModifyDepotBill as No_Bill,'
- +N' Quantity_ModifyDepotBillProduct as Num,UnitPrice_ModifyDepotBillProduct as price,'
- +N' (Quantity_ModifyDepotBillProduct*UnitPrice_ModifyDepotBillProduct)as Money,Comment_ModifyDepotBillProduct as Comment,'
- +N' ID_Assessor,'+nchar(39)+@No_Customer+nchar(39)+N' As No_Customer,'+nchar(39)+nchar(39)+N' as TaxCurrency'
- +N' from ModifyDepotBill'
- +N' join ModifyDepotBillProduct on ModifyDepotBill.ID_ModifyDepotBill=ModifyDepotBillProduct.ID_ModifyDepotBill'
- +N' left join Product on Product.ID_Product=ModifyDepotBillProduct.ID_Product Where Comment_ModifyDepotBill='+nchar(39)+@ShortName_Customer+nchar(39)
- end
- if(@ckSaleOutDepotProduct = 1)
- begin
- if(@first!=1)
- set @cmd = @cmd+N' Union all'
- set @first=0
- set @cmd = @cmd+N' select No_Product,Name_Product,Date_SaleOutDepotBill as Date,Name_Bill='+nchar(39)+N'销货出库单'+nchar(39)+N',No_SaleOutDepotBill as No_Bill,'
- +N' Quantity_SaleOutDepotBillProduct as Num,UnitPrice_SaleOutDepotBillProduct as price,'
- +N' (Quantity_SaleOutDepotBillProduct*UnitPrice_SaleOutDepotBillProduct) as Money,Comment_SaleOutDepotBillProduct as Comment,'
- +N' ID_Assessor,X.No_Customer,'+nchar(39)+nchar(39)+N' as TaxCurrency '
- +N' from SaleOutDepotBill'
- +N' join SaleOutDepotBillProduct on SaleOutDepotBill.ID_SaleOutDepotBill=SaleOutDepotBillProduct.ID_SaleOutDepotBill'
- +N' left join Product on Product.ID_Product=SaleOutDepotBillProduct.ID_Product left join Customer X on X.ID_Customer = SaleOutDepotBill.ID_Customer'
-
- end
- if(@ckIndentProduct = 1)
- begin
- if(@first!=1)
- set @cmd = @cmd+N' Union all'
- set @first=0
- set @cmd = @cmd+N' select No_Product,Name_Product,Date_IndentBill as Date,Name_Bill='+nchar(39)+N'订货单'+nchar(39)+N',No_IndentBill as No_Bill,'
- +N' Quantity_IndentBillProduct as Num,UnitPrice_IndentBillProduct as price,'
- +N' (Quantity_IndentBillProduct*UnitPrice_IndentBillProduct) as Money,Comment_IndentBillProduct as Comment,'
- +N' ID_Assessor,X.No_Customer,TaxCurrency_IndentBill as TaxCurrency '
- +N' from IndentBill'
- +N' join IndentBillProduct on IndentBill.ID_IndentBill=IndentBillProduct.ID_IndentBill'
- +N' left join Product on Product.ID_Product=IndentBillProduct.ID_Product left join Customer X on X.ID_Customer = IndentBill.ID_Customer'
- if(@RightIndentBill=0)
- set @cmd=@cmd+N' Where Special_IndentBill=0 '
-
- end
- set @cmd = @cmd + N' )A where A.ID_Assessor is not null and A.No_Customer = '+nchar(39)+@No_Customer+nchar(39)
- if(@StartTime is not null)
- set @cmd = @cmd + N' and A.Date > DATEADD(day, DATEDIFF(day,0,'+nchar(39)+convert(nvarchar,@StartTime) +nchar(39)+N'), 0) '
- if(@EndTime is not null)
- set @cmd = @cmd + N' and A.Date < DATEADD(day, DATEDIFF(day,0,'+nchar(39)+convert(nvarchar,@EndTime) +nchar(39)+N'), 1) '
- set @cmd = @cmd + N' Order By A.Date Desc '
- EXECUTE sp_executesql @cmd
- ">
- <Params>
- <Param name="@StartTime" type="SaleBill.Date_SaleBill" Index="0" />
- <Param name="@EndTime" type="SaleBill.Date_SaleBill" Index="1" />
- <Param name="@ckNearlyProduct" type="SaleBill.Disable_SaleBill" Index="2" />
- <Param name="@tbNearlyProduct" type="SaleBill.GoodsAmount_SaleBill" Index="3" />
- <Param name="@ckQueryPriceProduct" type="SaleBill.Disable_SaleBill" Index="4" />
- <Param name="@ckSaleProduct" type="SaleBill.Disable_SaleBill" Index="5" />
- <Param name="@ckSaleRtnProduct" type="SaleBill.Disable_SaleBill" Index="6" />
- <Param name="@ckInventoryProduct" type="SaleBill.Disable_SaleBill" Index="7" />
- <Param name="@No_Customer" type="Customer.No_Customer" Index="8" />
- <Param name="@ckSaleOutDepotProduct" type="SaleBill.Disable_SaleBill" Index="9" />
- <Param name="@ckIndentProduct" type="SaleBill.Disable_SaleBill" Index="10" />
- <Param name="@ShortName_Customer" type="Customer.No_Customer" Index="11" />
- <Param name="@RightIndentBill" type="IndentBill.Special_IndentBill" Index="12" />
- <Param name="@RightSaleBill" type="IndentBill.Special_IndentBill" Index="13" />
- <Param name="@RightPriceQueryBill" type="IndentBill.Special_IndentBill" Index="14" />
- </Params>
- <Tables>
- <Table name="ExchangeProduct"/>
- </Tables>
- </SearchExchangeProduct>
- <SearchAllEmployee CmdType="Text" CmdText="SELECT Employee.No_Employee,Employee.Name_Employee
- FROM Employee ">
- <Tables>
- <Table name="AllEmployee" />
- </Tables>
- </SearchAllEmployee>
- <SearchCustomersIsInRegionalLeader CmdType="Text" CmdText="select * from Employee
- where ID_Employee
- in
- (
- Select ID_Employee from Principal
- where ID_RegionalLeader
- in
- (
- select ID_RegionalLeader from Customer
- where No_Customer = @No_Customer
- )
- )
- and Employee.Name_Employee = @Name_Employee
- ">
- <Params>
- <Param name="@No_Customer" type="Customer.No_Customer" />
- <Param name="@Name_Employee" type="Employee.Name_Employee" />
- </Params>
- <Tables>
- <Table name="IsInRegionalLeader" />
- </Tables>
- </SearchCustomersIsInRegionalLeader>
- <SearchPayLimitType CmdType="Text" CmdText=" CREATE TABLE #TypeDef( Type nvarchar(64)) DECLARE @c int SET @c = 0
- WHILE @c < 2
- BEGIN
- IF(@c=0)
- BEGIN
- INSERT INTO #TypeDef (Type)VALUES('+')
- END
- IF(@c=1)
- BEGIN
- INSERT INTO #TypeDef (Type)VALUES('-')
- END
-
- SET @c = @c + 1
- END
- SELECT Type AS Name_Type FROM #TypeDef
- DROP TABLE #TypeDef
- ">
- <Tables>
- <Table name="GetPayLimitType" />
- </Tables>
- </SearchPayLimitType>
- <SearchOpeningBalanceAdjust CmdType="Text" CmdText=" SELECT OpeningBalanceAdjust_Customer From Customer where No_Customer=@No_Customer">
- <Params>
- <Param name="@No_Customer" type="Customer.No_Customer" />
- </Params>
- <Tables>
- <Table name="SearchOpeningBalanceAdjust" />
- </Tables>
- </SearchOpeningBalanceAdjust>
- </Search>
- <Insert>
- </Insert>
- </Server>
- <Lables>
- <Search>
- Empty();
- Empty("#ExchangeProduct");
- Empty("#ExchangeBill");
- NewInstance();
- tbNo.ReadOnly=false;
- txtShortName.ReadOnly=true;
- txtShortName2.ReadOnly = true;
- txtName.ReadOnly=true;
- txtRegistedAddress.ReadOnly=true;
- cbCountry.Enabled=false;
- txtPostalCode.ReadOnly=true;
- cbPayLimitCurrency.Enabled=false;<!--一直为false-->
- cbPayLimitCurrency.Text=@SysCurrency;
- tbDunDate.ReadOnly=true;
- txtSendAddr.ReadOnly=true;
- dtpIsSuspend.Enabled=false;
- txtComment.ReadOnly=true;
- cbIndustry.Enabled=false;
- cbZone.Enabled=false;
- cbType.Enabled=false;
- comboArea.Enabled=false;
- cbIsGeneric.Enabled=false;
- cbSource.Enabled=false;
- cbLevel.Enabled=false;
- cbBank.Enabled=false;
- cbCompany.Enabled=false;
- txtAccount.ReadOnly=true;
- txtRevenueRegisterNo.ReadOnly=true;
- cbGetMethod.Enabled=false;
- txtPayLimit.Enabled=false;
- cbPayLimitType.Enabled=false;
- txtPayLimit2.Enabled=false;
- tbLowDiscount.Enabled=false;
- ikTextBox1.Enabled=false;
- txtRemark.Enabled=false;
- dgInvoice.ReadOnly=true;
- dgLinkMan.ReadOnly=true;
- dgPrincipal.ReadOnly=true;
- dgRemark.ReadOnly = true;
- dgInfo.ReadOnly = true;
- toolBar.EnableSubmit=false;
- toolBar.EnableModify=false;
- toolBar.EnableDelete=false;
- toolBar.EnablePrint=false;
- tbNo.ReadOnly=false;
- txtShortName.ReadOnly=true;
- txtShortName2.ReadOnly=true;
- txtName.ReadOnly=true;
- txtRegistedAddress.ReadOnly=true;
- cbCountry.Enabled=false;
- txtPostalCode.ReadOnly=true;
- cbPayLimitCurrency.Enabled=false;<!--一直?false-->
- tbDunDate.ReadOnly=true;
- txtSendAddr.ReadOnly=true;
- dtpIsSuspend.Enabled=false;
- txtComment.ReadOnly=true;
- cbIndustry.Enabled=false;
- cbZone.Enabled=false;
- cbType.Enabled=false;
- comboArea.Enabled=false;
- cbIsGeneric.Enabled=false;
- cbSource.Enabled=false;
- cbLevel.Enabled=false;
- cbBank.Enabled=false;
- cbCompany.Enabled=false;
- txtAccount.ReadOnly=true;
- txtRevenueRegisterNo.ReadOnly=true;
- cbGetMethod.Enabled=false;
- txtPayLimit.Enabled=false;
- txtPayLimit2.Enabled=false;
- cbPayLimitType.Enabled=false;
- tbLowDiscount.Enabled=false;
- ikTextBox1.Enabled=false;
- txtRemark.Enabled=false;
- dgInvoice.ReadOnly=true;
- dgLinkMan.ReadOnly=true;
- dgPrincipal.ReadOnly=true;
- dgRemark.ReadOnly = true;
- dgInfo.ReadOnly = true;
- tbNo2.ReadOnly = true;
- tbNo2.IKButton.Enabled = false;
- txtShortName2.Enabled = false;
- ikCheckBox2.Enabled = false;
- dtpBeginDate.Enabled=false;
- toolBar.EnableSubmit=false;
- toolBar.EnableModify=GetRight(@Title,"修改");
- toolBar.EnableDelete=GetRight(@Title,"删除");
- toolBar.EnablePrint=GetRight(@Title,"打印");
- if(ckDisplay.Checked)
- #Customer.IsDisplay=1;
- else
- #Customer.IsDisplay=0;
- UpdateForm(true, "");
- txtLinkMan.CValue="";
- txtLinkTel.CValue="";
- if(RowCount("#Linkman")>0)
- {
- SuspendLayout();
- for(@i=0;@i < RowCount("#Linkman");@i++)
- {
- SetPosition("#Linkman",@i);
- if(#Linkman.IsMain_Linkman==true)
- {
- txtLinkMan.CValue=#Linkman.Name_Linkman;
- txtLinkTel.CValue=#Linkman.Tel_Linkman;
- break;
- }
- }
- ResumeLayout();
- }
- pcPhone.ReadOnly=true;
- pcFax.ReadOnly=true;
- @Status=2;
- dtpBeginDate.Enabled=false;
- #Customer.CreateDate_Customer=DBNull();
- #Customer.SuspendDate_Customer=DBNull();
- #Customer.LastModUser=DBNull();
- #Customer.LastModUser_Customer=DBNull();
- #Customer.LastModDate_Customer=DBNull();
- if(ckDisplay.Checked)
- #Customer.IsDisplay=1;
- else
- #Customer.IsDisplay=0;
- UpdateForm(true, "");
- txtLinkMan.CValue="";
- txtLinkTel.CValue="";
- pcPhone.ReadOnly=true;
- pcFax.ReadOnly=true;
- tbNo.Focus();
- @Status=0;
- </Search>
- <New>
- @tempmoney=0;
- Empty();
- NewInstance();
- tbNo.ReadOnly=true;
- txtShortName.ReadOnly=false;
- txtShortName2.ReadOnly=true;
- txtName.ReadOnly=false;
- txtRegistedAddress.ReadOnly=false;
- cbCountry.Enabled=true;
- txtPostalCode.ReadOnly=false;
- cbPayLimitCurrency.Enabled=false;<!--一直为false-->
- tbDunDate.ReadOnly=false;
- txtSendAddr.ReadOnly=false;
- dtpIsSuspend.Enabled=true;
- txtComment.ReadOnly=false;
- cbIndustry.Enabled=true;
- cbGetMethod.Enabled=GetFieldRight(@Title,"结算方式","修改");
- tbLowDiscount.Enabled=GetFieldRight(@Title,"最低折扣","修改");
- ikTextBox1.Enabled=GetFieldRight(@Title,"帐款备注","修改");
- tbDunDate.Enabled=GetFieldRight(@Title,"催款日期","修改");
- txtPayLimit2.Enabled=GetFieldRight(@Title,"期初余额调整","修改");
- txtRemark.Enabled=GetFieldRight(@Title,"备注","修改");
- cbPayLimitType.Enabled=GetFieldRight(@Title,"期初余额调整","修改");
- cbPayLimitType.SelectedName = "+";
- cbZone.Enabled=true;
- cbType.Enabled=true;
- comboArea.Enabled=true;
- cbIsGeneric.Enabled=true;
- cbSource.Enabled=true;
- cbLevel.Enabled=true;
- cbBank.Enabled=true;
- cbCompany.Enabled=true;
- txtAccount.ReadOnly=false;
- txtRevenueRegisterNo.ReadOnly=false;
- dgInvoice.ReadOnly=false;
- dgLinkMan.ReadOnly=false;
- dgPrincipal.ReadOnly=false;
- dgRemark.ReadOnly = false;
- dgInfo.ReadOnly = true;
- toolBar.EnableSubmit=GetRight(@Title,"新增");
- toolBar.EnableModify=false;
- toolBar.EnableDelete=false;
- toolBar.EnablePrint=false;
- ikCheckBox2.Enabled = true; <!-- NEW -->
- tbNo2.ReadOnly = true;
- tbNo2.IKButton.Enabled = false;
- dtpBeginDate.Enabled=true;
- #Customer.No_Customer=tbNo.CValue;
- #Customer.CreatorName_Customer=GetCurrentUser();
- #Customer.ID_Customer=NewGuid();
- #Customer.ID_Creator=GetLoginUserID();
- #Customer.Country_Customer=40;
- #Customer.CreateDate_Customer=DateTimeNow();
- #Customer.SuspendDate_Customer=DBNull();
- #Customer.GetMethod_Customer = "先款后货";
- if(cbGetMethod.SelectedName=="先款后货")
- {
- txtPayLimit.Enabled=false;
- txtPayLimit.CValue=0;
- }
- else
- {
- txtPayLimit.Enabled=GetFieldRight(@Title,"信用额度","修改");
- }
- Search("SearchDefaultPhone");
- Search("SearchDefaultFax");
- MergeTable("#DefaultFax","#Fax");
- MergeTable("#DefaultTelephone","#Telephone");
- if(ckDisplay.Checked)
- #Customer.IsDisplay=1;
- else
- #Customer.IsDisplay=0;
- UpdateForm(true, "");
- txtLinkMan.CValue="";
- txtLinkTel.CValue="";
- tbLowDiscount.CValue=100.00;
- pcPhone.ReadOnly=false;
- pcFax.ReadOnly=false;
- txtShortName.Focus();
- @Status=1;
- </New>
- <View>
- tbNo.ReadOnly=false;
- txtShortName.ReadOnly=true;
- txtShortName2.ReadOnly=true;
- txtName.ReadOnly=true;
- txtRegistedAddress.ReadOnly=true;
- cbCountry.Enabled=false;
- txtPostalCode.ReadOnly=true;
- cbPayLimitCurrency.Enabled=false;<!--一直?false-->
- tbDunDate.ReadOnly=true;
- txtSendAddr.ReadOnly=true;
- dtpIsSuspend.Enabled=false;
- txtComment.ReadOnly=true;
- cbIndustry.Enabled=false;
- cbGetMethod.Enabled=false;
- txtPayLimit.Enabled=false;
- cbPayLimitType.Enabled=false;
- txtPayLimit2.Enabled=false;
- tbLowDiscount.Enabled=false;
- ikTextBox1.Enabled=false;
- txtRemark.Enabled=false;
- cbZone.Enabled=false;
- cbType.Enabled=false;
- comboArea.Enabled=false;
- cbIsGeneric.Enabled=false;
- cbSource.Enabled=false;
- cbLevel.Enabled=false;
- cbBank.Enabled=false;
- cbCompany.Enabled=false;
- txtAccount.ReadOnly=true;
- txtRevenueRegisterNo.ReadOnly=true;
- dgInvoice.ReadOnly=true;
- dgLinkMan.ReadOnly=true;
- dgPrincipal.ReadOnly=true;
- dgRemark.ReadOnly = true;
- dgInfo.ReadOnly = true;
- tbNo2.ReadOnly = true;
- tbNo2.IKButton.Enabled = false;
- txtShortName2.Enabled = false;
- ikCheckBox2.Enabled = false;
- if(#Customer.OpeningBalanceAdjust_Customer>=0)
- {
- cbPayLimitType.SelectedName ="+";
- }
- else
- {
- cbPayLimitType.SelectedName ="-";
- }
- if(Search("SearchCustomerWithNo2",tbNo.CValue))
- {
- if( #Customer2.IsCustomersCustomer_Customer)
- {
- tbNo2.ReadOnly = true;
- tbNo2.CValue = #Customer2.No_Customer;
- txtShortName2.CValue = #Customer2.ShortName_Customer;
- }
- else
- {
- ikCheckBox2.Checked = false;
- tbNo2.IKButton.Enabled = false;
- tbNo2.CValue = "";
- txtShortName2.CValue = "";
- }
- }
- dtpBeginDate.Enabled=false;
- toolBar.EnableSubmit=false;
- toolBar.EnableModify=GetRight(@Title,"修改");
- toolBar.EnableDelete=GetRight(@Title,"删除");
- toolBar.EnablePrint=GetRight(@Title,"打印");
- if(ckDisplay.Checked)
- #Customer.IsDisplay=1;
- else
- #Customer.IsDisplay=0;
- UpdateForm(true, "");
- txtLinkMan.CValue="";
- txtLinkTel.CValue="";
- if(RowCount("#Linkman")>0)
- {
- SuspendLayout();
- for(@i=0;@i < RowCount("#Linkman");@i++)
- {
- SetPosition("#Linkman",@i);
- if(#Linkman.IsMain_Linkman==true)
- {
- txtLinkMan.CValue=#Linkman.Name_Linkman;
- txtLinkTel.CValue=#Linkman.Tel_Linkman;
- break;
- }
- }
- ResumeLayout();
- }
- pcPhone.ReadOnly=true;
- pcFax.ReadOnly=true;
- @Status=2;
- </View>
- <Modify>
- @tempmoney=0;
- @tempmoney= txtPayLimit2.CValue;
- tbNo.ReadOnly=true;
- txtShortName.ReadOnly=false;
- txtShortName2.ReadOnly=false;
- txtName.ReadOnly=false;
- txtRegistedAddress.ReadOnly=false;
- cbCountry.Enabled=true;
- txtPostalCode.ReadOnly=false;
- cbPayLimitCurrency.Enabled=false;<!--一直为false-->
- tbDunDate.ReadOnly=false;
- txtSendAddr.ReadOnly=false;
- dtpIsSuspend.Enabled=true;
- txtComment.ReadOnly=false;
- cbIndustry.Enabled=true;
- cbGetMethod.Enabled=GetFieldRight(@Title,"结算方式","修改");
- if(cbGetMethod.SelectedName=="先款后货")
- {
- txtPayLimit.Enabled=false;
- txtPayLimit.CValue=0;
- }
- else
- {
- txtPayLimit.Enabled=GetFieldRight(@Title,"信用额度","修改");
- }
- tbLowDiscount.Enabled=GetFieldRight(@Title,"最低折扣","修改");
- ikTextBox1.Enabled=GetFieldRight(@Title,"帐款备注","修改");
- tbDunDate.Enabled=GetFieldRight(@Title,"催款日期","修改");
- txtPayLimit2.Enabled=GetFieldRight(@Title,"期初余额调整","修改");
- txtRemark.Enabled=GetFieldRight(@Title,"备注","修改");
- cbPayLimitType.Enabled=GetFieldRight(@Title,"期初余额调整","修改");
- cbZone.Enabled=true;
- cbType.Enabled=true;
- comboArea.Enabled=true;
- cbIsGeneric.Enabled=true;
- cbSource.Enabled=true;
- cbLevel.Enabled=true;
- cbBank.Enabled=true;
- cbCompany.Enabled=true;
- txtAccount.ReadOnly=false;
- txtRevenueRegisterNo.ReadOnly=false;
- dgInvoice.ReadOnly=false;
- dgLinkMan.ReadOnly=false;
- dgPrincipal.ReadOnly=false;
- dgRemark.ReadOnly = false;
- dgInfo.ReadOnly = true;
- ikCheckBox2.Enabled = true;
- tbNo2.ReadOnly = false;
- if(Search("SearchCustomerWithNo2",tbNo.CValue))
- {
- if( #Customer.IsCustomersCustomer_Customer)
- {
- ikCheckBox2.Checked = true;
- tbNo2.IKButton.Enabled = true;
- tbNo2.ReadOnly = false;
- }
- else
- {
- ikCheckBox2.Checked = false;
- tbNo2.IKButton.Enabled = false;
- tbNo2.ReadOnly = true;
- }
- }
- dtpBeginDate.Enabled=true;
- toolBar.EnableSubmit=GetRight(@Title,"新增");
- toolBar.EnableModify=false;
- toolBar.EnableDelete=GetRight(@Title,"删除");
- toolBar.EnablePrint=false;
- #Customer.LastModUser=GetCurrentUser();
- #Customer.LastModUser_Customer=GetLoginUserID();
- #Customer.LastModDate_Customer=GetCurrentTime();
- if(ckDisplay.Checked)
- #Customer.IsDisplay = 1;
- else
- #Customer.IsDisplay = 0;
- UpdateForm(true, "");
- pcPhone.ReadOnly=false;
- pcFax.ReadOnly=false;
- txtShortName.Focus();
- @Status=3;
- </Modify>
- <SubmitButtonClick>
- <![CDATA[
- @count =0;
- if(txtShortName.CValue=="")
- {
- MessageBox("请输入客户简称!",@Title);
- txtShortName.Focus();
- return;
- }
-
- if (ikCheckBox2.Checked)
- {
- if(!Search("SearchCustomerWithNo2", tbNo2.CValue))
- {
- MessageBox("找不到此客户!",@Title);
- #Customer.CustomerID_Customer = GuidEmpty();
- tbNo2.CValue = "";
- txtShortName2.CValue = "";
- txtShortName2.Focus();
- return;
- }
- else
- {
- if(Search("SearchCustomerWithNo3", tbNo.CValue))
- {
- MessageBox("该客户有销项发票、收款单或所属公司不同,不能做子客户!",@Title);
- return;
- }
- else
- {
- if (tbNo2.CValue.ToUpper() == tbNo.CValue.ToUpper())
- {
- tbNo2.CValue = "";
- txtShortName2.CValue = "";
- #Customer.CustomerID_Customer = GuidEmpty();
- MessageBox("所属客户不可与客户名相同!");
- tbNo2.Focus();
- return;
- }
- else
- {
- if(Search("SearchCustomerWithNo4", tbNo2.CValue))
- {
- if(#Customer4.Company_Customer!=cbCompany.SelectedName)
- {
- MessageBox("该客户有销项发票、收款单或所属公司不同,不能做子客户!",@Title);
- return;
- }
- }
- }
- }
-
- }
- if(txtShortName2.CValue=="")
- {
- MessageBox("请填写所属客户名称!",@Title);
- #Customer.CustomerID_Customer = GuidEmpty();
- tbNo2.CValue = "";
- txtShortName2.CValue = "";
- txtShortName2.Focus();
- return;
- }
- }
- else
- {
- #Customer.CustomerID_Customer = GuidEmpty();
- tbNo2.CValue = "";
- txtShortName2.CValue = "";
- }
-
- if(txtName.CValue=="")
- {
- MessageBox("请输入客户名称!",@Title);
- txtName.Focus();
- return;
- }
-
- if(cbCountry.CValue==0)
- {
- tcOperMan.SelectedIndex=0;
- MessageBox("请输入国家!",@Title);
- cbCountry.Focus();
- return;
- }
-
- if(tbDunDate.CValue=="")
- {
- tcOperMan.SelectedIndex=0;
- MessageBox("请输入催款日期!",@Title);
- tbDunDate.Focus();
- return;
- }
- else if(tbDunDate.CValue<0||tbDunDate.CValue>31)
- {
- tcOperMan.SelectedIndex=0;
- MessageBox("请输入有效的催款日期!",@Title);
- tbDunDate.Focus();
- return;
- }
- if(tbDunDate.CValue<0||tbDunDate.CValue>31)
- {
- tcOperMan.SelectedIndex=0;
- MessageBox("请输入正确的日期范围!",@Title);
- cbGetMethod.Focus();
- return;
- }
-
- if(cbGetMethod.SelectedName=="")
- {
- tcOperMan.SelectedIndex=0;
- MessageBox("请输入结算方式!",@Title);
- cbGetMethod.Focus();
- return;
- }
- if(!cbPayLimitType.CheckSelectedItem())
- {
- MessageBox("请输入有效的期初余额调整方式!",@Title);
- cbPayLimitType.Focus();
- return;
- }
- if(cbType.SelectedName=="")
- {
- tcOperMan.SelectedIndex=1;
- MessageBox("请输入客户类别!",@Title);
- cbType.Focus();
- return;
- }
-
- if((cbIndustry.SelectedName==""))
- {
- tcOperMan.SelectedIndex=1;
- MessageBox("请输入行业!",@Title);
- cbIndustry.Focus();
- return;
- }
-
- if(cbZone.SelectedName=="")
- {
- tcOperMan.SelectedIndex=1;
- MessageBox("请输入地区!",@Title);
- cbZone.Focus();
- return;
- }
-
- if(cbSource.SelectedName=="")
- {
- tcOperMan.SelectedIndex=1;
- MessageBox("请输入客户来源!",@Title);
- cbSource.Focus();
- return;
- }
-
- if(cbCompany.SelectedName=="")
- {
- tcOperMan.SelectedIndex=1;
- MessageBox("请选择所属公司!",@Title);
- cbCompany.Focus();
- return;
- }
- if(comboArea.SelectedName=="")
- {
- MessageBox("请选择所属区域!",@Title);
- comboArea.Focus();
- return;
- }
- #Customer.PayLimitCurrency=cbPayLimitCurrency.Text;
- UpdateForm(false, "");
- if(@Status==1)
- {
- SuspendLayout();
- for(@i=RowCount("#Linkman")-1;@i>=0;@i=@i-1)
- {
- SetPosition("#Linkman", @i);
- if(Equals(#Linkman.ID_Linkman,GuidEmpty()))
- #Linkman.ID_Linkman = NewGuid();
- #Linkman.ID_Person = #Customer.ID_Customer;
- }
- for(@i=RowCount("#Principal")-1;@i>=0;@i=@i-1)
- {
- SetPosition("#Principal", @i);
- if(Equals(#Principal.ID_Principal,GuidEmpty()))
- #Principal.ID_Principal = NewGuid();
- if(Equals(#Principal.ID_Employee, GuidEmpty()))
- {
- dgPrincipal.CurrentRowIndex=@i;
- tcOperMan.SelectedIndex=2;
- MessageBox("该员工不存在!",@Title);
- ResumeLayout();
- return;
- }
-
- #Principal.ID_Person = #Customer.ID_Customer;
- }
- for(@i=RowCount("#Telephone")-1;@i>=0;@i=@i-1)
- {
- SetPosition("#Telephone",@i);
- if(Equals(#Telephone.ID_Telephone,GuidEmpty()))
- #Telephone.ID_Telephone=NewGuid();
- #Telephone.ID_Person=#Customer.ID_Customer;
- }
- for(@i=RowCount("#Fax")-1;@i>=0;@i=@i-1)
- {
- SetPosition("#Fax",@i);
- if(Equals(#Fax.ID_Fax,GuidEmpty()))
- #Fax.ID_Fax=NewGuid();
- #Fax.ID_Person=#Customer.ID_Customer;
- }
- for(@i=0;@i<RowCount("#Invoice");@i=@i+1)
- {
- SetPosition("#Invoice",@i);
- if(Equals(#Invoice.ID_Invoice,GuidEmpty()))
- #Invoice.ID_Invoice=NewGuid();
- #Invoice.ID_Customer=#Customer.ID_Customer;
- }
- for (@i=0;@i<RowCount("#BasicComment");@i=@i+1)
- {
- SetPosition("#BasicComment", @i);
- if (Equals(#BasicComment.ID_BasicComment,GuidEmpty()))
- #BasicComment.ID_BasicComment = NewGuid();
- #BasicComment.ID_Object = #Customer.ID_Customer;
- }
- ResumeLayout();
- #Customer.LastModUser_Customer=DBNull();
- #Customer.LastModDate_Customer=DBNull();
- SuspendLayout();
- for(@y=0;@y<RowCount("#Principal");@y++)
- {
- SetPosition("#Principal", @y);
- if(Equals(#Principal.IsMainStr_Principal,"是"))
- {
- @count++;
- }
- }
- ResumeLayout();
- if(@count > 1)
- {
- MessageBox("只能有一个主要负责人,请检查!",@Title);
- return;
- }
- @tep=0;
- if(cbPayLimitType.SelectedName=="+")
- {
- #Customer.OpeningBalanceAdjust_Customer = txtPayLimit2.CValue;
- }
- if(cbPayLimitType.SelectedName=="-")
- {
- #Customer.OpeningBalanceAdjust_Customer = -txtPayLimit2.CValue;
- }
- New();
- }
- else if(@Status == 3)
- {
- SuspendLayout();
- for(@i=RowCount("#Linkman")-1;@i>=0;@i=@i-1)
- {
- SetPosition("#Linkman", @i);
- if(Equals(#Linkman.ID_Linkman,GuidEmpty()))
- #Linkman.ID_Linkman = NewGuid();
- #Linkman.ID_Person = #Customer.ID_Customer;
- }
- for(@i=RowCount("#Principal")-1;@i>=0;@i=@i-1)
- {
- SetPosition("#Principal", @i);
- if(Equals(#Principal.ID_Principal,GuidEmpty()))
- #Principal.ID_Principal = NewGuid();
- if(Equals(#Principal.ID_Employee, GuidEmpty()))
- {
- dgPrincipal.CurrentRowIndex=@i;
- tcOperMan.SelectedIndex=2;
- MessageBox("该员工不存在!",@Title);
- ResumeLayout();
- return;
- }
- #Principal.ID_Person = #Customer.ID_Customer;
- }
- for(@i=RowCount("#Telephone")-1;@i>=0;@i=@i-1)
- {
- SetPosition("#Telephone",@i);
- if(Equals(#Telephone.ID_Telephone,GuidEmpty()))
- #Telephone.ID_Telephone=NewGuid();
- #Telephone.ID_Person=#Customer.ID_Customer;
- }
- for(@i=RowCount("#Fax")-1;@i>=0;@i=@i-1)
- {
- SetPosition("#Fax",@i);
- if(Equals(#Fax.ID_Fax,GuidEmpty()))
- #Fax.ID_Fax=NewGuid();
- #Fax.ID_Person=#Customer.ID_Customer;
- }
- for(@i=0;@i<RowCount("#Invoice");@i=@i+1)
- {
- SetPosition("#Invoice",@i);
- if(Equals(#Invoice.ID_Invoice,GuidEmpty()))
- #Invoice.ID_Invoice=NewGuid();
- #Invoice.ID_Customer=#Customer.ID_Customer;
- }
- for (@i=0;@i<RowCount("#BasicComment");@i=@i+1)
- {
- SetPosition("#BasicComment", @i);
- if (Equals(#BasicComment.ID_BasicComment,GuidEmpty()))
- #BasicComment.ID_BasicComment = NewGuid();
- #BasicComment.ID_Object = #Customer.ID_Customer;
- }
- ResumeLayout();
- #Customer.LastModUser=GetCurrentUser();
- #Customer.LastModUser_Customer=GetLoginUserID();
- #Customer.LastModDate_Customer=GetCurrentTime();
- tbNo.Focus();
- SuspendLayout();
- for(@y=0;@y<RowCount("#Principal");@y++)
- {
- SetPosition("#Principal", @y);
- if(Equals(#Principal.IsMainStr_Principal,"是"))
- {
- @count++;
- }
- }
- ResumeLayout();
- if(@count > 1)
- {
- MessageBox("只能有一个主要负责人,请检查!",@Title);
- return;
- }
- if(cbPayLimitType.SelectedName=="-")
- {
- if(txtPayLimit2.CValue!=@tempmoney)
- {
- if(txtPayLimit2.CValue!=-@tempmoney)
- {
- if (txtPayLimit2.CValue >=0)
- #Customer.OpeningBalanceAdjust_Customer=-txtPayLimit2.CValue;
- else
- #Customer.OpeningBalanceAdjust_Customer=txtPayLimit2.CValue;
- }
- }
- else
- {
- if(@tempmoney>=0)
- #Customer.OpeningBalanceAdjust_Customer=-@tempmoney;
- else
- #Customer.OpeningBalanceAdjust_Customer=@tempmoney;
- }
- }
- else
- {
- if(txtPayLimit2.CValue!=@tempmoney)
- {
- if(txtPayLimit2.CValue!=-@tempmoney)
- {
- if (txtPayLimit2.CValue >=0)
- #Customer.OpeningBalanceAdjust_Customer=txtPayLimit2.CValue;
- else
- #Customer.OpeningBalanceAdjust_Customer=-txtPayLimit2.CValue;
- }
- }
- else
- {
- if(@tempmoney>=0)
- #Customer.OpeningBalanceAdjust_Customer=@tempmoney;
- else
- #Customer.OpeningBalanceAdjust_Customer=-@tempmoney;
- }
- }
- Update();
- }
- ChangeMode("View");
- ]]>
- </SubmitButtonClick>
- </Lables>
- </Form>
- </Forms>
|