12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086 |
- <?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>
- </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="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>
- <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>
-
- </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>
- 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,"结算方式","修改");
- 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,"期初余额调整","修改");
- 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 = "先款后贷";
- 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>
- 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,"结算方式","修改");
- 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 (tbNo2.CValue.ToUpper() == tbNo.CValue.ToUpper())
- {
- tbNo2.CValue = "";
- txtShortName2.CValue = "";
- #Customer.CustomerID_Customer = GuidEmpty();
- MessageBox("所属客户不可与客户名相同!");
- tbNo2.Focus();
- 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;
- }
- 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=="+")
- {
- #Customer.OpeningBalanceAdjust_Customer = +txtPayLimit2.CValue;
- }
- if(cbPayLimitType.SelectedName=="-")
- {
- #Customer.OpeningBalanceAdjust_Customer = -txtPayLimit2.CValue;
- }
- Update();
- }
- ChangeMode("View");
- ]]>
- </SubmitButtonClick>
- </Lables>
- </Form>
- </Forms>
|