12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322 |
- <?xml version="1.0" encoding="utf-8" ?>
- <Forms>
- <Form Name="FrmProduct">
- <Client>
- <Events>
- <Load>
- <![CDATA[
- @Title="产品基本资料";
- @HaveSearchProductList=false;
- GetSchema();
- Search("SearchSystemSetting");
- @SysCurrency=#SystemSetting.SysCurrency_SystemSetting;
- Search("SearchCessOut");
- @cessout = #System.CessOut_SystemSetting;
- ChangeMode("Search");
- RecordHistoryRead("FrmProduct");
- ikLabel2.Visible = GetFieldRight(@Title,"成本","查看");
- cbCostCurrency.Visible = ikLabel2.Visible;
- txtCost.Visible = ikLabel2.Visible;
- Search("SearchIsMain");
- ]]>
- </Load>
- <Closing>
- RecordHistoryWrite("FrmProduct","dtStart","dtEnd","ckNearly","tbNearly"
- ,"ckPriceQuery","ckIndent","ckSaleBill","ckSaleRtn","ckPQuery","ckpurchase","ckInventory","ckSaleOut","ckPurchIn");
- </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="Product.No_Product">
- <Events>
- <Enter>
- <![CDATA[
- if(tbNo.ReadOnly == false)
- {
- if(tbNo.CValue != StringEmpty())
- {
- UpdateForm(false, "");
- Empty("#ExchangeHistory");
- if(Search("SearchProductWithNo", tbNo.CValue))
- {
- ChangeMode("View");
- }
- else
- {
- if(GetRight(@Title,"新增"))
- {
- #Product.CostCurrency_Product = "RMB";
- ChangeMode("New");
- txtBarCode.CValue = tbNo.CValue;
- }
- else
- MessageBox("您没有新增产品基本资料的权限!",@Title);
- }
- }
- else
- {
- MessageBox("请输入产品编号!",@Title);
- }
- }
- ]]>
- </Enter>
- <Click>
- @Temp = ShowSearchBox("ProductSearch","INFOMATION",tbNo.CValue);
- if(@Temp != StringEmpty())
- {
- tbNo.CValue = @Temp;
- UpdateForm(false, "");
- Empty("#ExchangeHistory");
- if(Search("SearchProductWithNo", tbNo.CValue))
- {
- ChangeMode("View");
- }
- }
- </Click>
- </Events>
- </IKTextButton>
- <IKTextBox name="txtName" DataSource="Product.Name_Product">
- <Events>
- <Enter>
- <![CDATA[
- if(txtInvoiceName.CValue=="")
- {
- txtInvoiceName.CValue=txtName.CValue;
- }
- ]]>
- </Enter>
- <Leave>
- <![CDATA[
- if(txtInvoiceName.CValue=="")
- {
- txtInvoiceName.CValue=txtName.CValue;
- }
- ]]>
- </Leave>
- </Events>
- </IKTextBox>
- <IKTextBox name="txtBarCode" DataSource="Product.BarCode_Product"></IKTextBox>
- <IKTextBox name="txtInvoiceName" DataSource="Product.InvoiceName_Product"></IKTextBox>
- <IKTextBox name="txtLowSalePriceCurrency" DataSource="Product.LowSalePriceCurrency_Product"></IKTextBox>
- <IKTextBox name="txtCreator" DataSource="Product.CreatorName_Product"></IKTextBox><!--CreatorName_Product isn't DB's Field-->
- <IKTextBox name="txtComment" DataSource="Product.Comment_Product"></IKTextBox>
- <IKComboBoxEx name="cbUnit" DisplaySource="Product.Unit_Product"
- DataSource="Unit" DisplayMember="Result" >
- <Events>
- <Reload>
- UpdateForm(false, "cbUnit");
- Search("SearchUnit");
- UpdateForm(true, "cbUnit");
- </Reload>
- </Events>
- </IKComboBoxEx>
- <IKComboBoxEx name="cbType" DisplaySource="Product.Type_Product" DataSource="Type" DisplayMember="Result">
- <Events>
- <Reload>
- UpdateForm(false, "cbType");
- Search("SearchType");
- UpdateForm(true, "cbType");
- </Reload>
- </Events>
- </IKComboBoxEx>
- <IKComboBoxEx name="txtProperty" DisplaySource="Product.Property_Product" DataSource="Property" DisplayMember="Result">
- <Events>
- <Reload>
- UpdateForm(false, "txtProperty");
- Search("SearchProperty");
- UpdateForm(true, "txtProperty");
- </Reload>
- </Events>
- </IKComboBoxEx>
- <IKComboBoxEx name="txtSource" DisplaySource="Product.Source_Product" DataSource="Source" DisplayMember="Result">
- <Events>
- <Reload>
- UpdateForm(false, "txtSource");
- Search("SearchSource");
- UpdateForm(true, "txtSource");
- </Reload>
- </Events>
- </IKComboBoxEx>
- <IKComboBoxEx name="cbOperationPrincipal" ValueSource="Product.ID_OperationPrincipal" DisplaySource="Product.OperationPrincipal_Product" NoSource="Product.OperationPrincipalNo_Product"
- ValueMember="ID_Employee" DataSource="OperationPrincipal" DisplayMember="Result" NoMember="No_Employee">
- <Events>
- <Reload>
- UpdateForm(false, "cbOperationPrincipal");
- Search("SearchOperationPrincipal");
- UpdateForm(true, "cbOperationPrincipal");
- </Reload>
- </Events>
- </IKComboBoxEx>
- <IKComboBoxEx name="cbPurchasePrincipal" ValueSource="Product.ID_PurchasePrincipal" DisplaySource="Product.PurchasePrincipal_Product" NoSource="Product.PurchasePrincipalNo_Product"
- ValueMember="ID_Employee" DataSource="PurchasePrincipal" DisplayMember="Result" NoMember="No_Employee">
- <Events>
- <Reload>
- UpdateForm(false, "cbPurchasePrincipal");
- Search("SearchPurchasePrincipal");
- UpdateForm(true, "cbPurchasePrincipal");
- </Reload>
- </Events>
- </IKComboBoxEx>
- <IKComboBoxEx name="cbCurrency" DisplaySource="Product.Currency_Product" DataSource="Product">
- </IKComboBoxEx>
- <IKNumericTextBox name="txtPrice" DataSource="Product.Price_Product">
- <Events>
- <Leave>
- <![CDATA[
- if(txtPrice.ReadOnly==false)
- {
- if(txtPrice.CValue==TypeConvert("Decimal","0.00"))
- txtMaxDiscount.CValue=TypeConvert("Decimal","0.00");
- else
- txtMaxDiscount.CValue=txtLowSalePrice.CValue/txtPrice.CValue*100;
- }
- ]]>
- </Leave>
- </Events>
- </IKNumericTextBox>
- <IKNumericTextBox name="txtLowSalePrice" DataSource="Product.LowSalePrice_Product">
- <Events>
- <Leave>
- <![CDATA[
- if(txtLowSalePrice.ReadOnly==false)
- {
- if(txtPrice.CValue==TypeConvert("Decimal","0.00"))
- txtMaxDiscount.CValue=TypeConvert("Decimal","0.00");
- else
- txtMaxDiscount.CValue=txtLowSalePrice.CValue/txtPrice.CValue*100;
- }
- ]]>
- </Leave>
- </Events>
- </IKNumericTextBox>
- <IKNumericTextBox name="txtMaxStocks" DataSource="Product.MaxStocks_Product"></IKNumericTextBox>
- <IKNumericTextBox name="txtSafetyStocks" DataSource="Product.SafetyQty_Product"></IKNumericTextBox>
- <IKDateTimeText name="dttCreateDate" DataSource="Product.CreateDate_Product"></IKDateTimeText>
-
- <IKComboBoxEx name="cbCostCurrency" ValueSource="Product.CostCurrency_Product" DisplaySource="Product.CostCurrency_Product"></IKComboBoxEx>
- <IKNumericTextBox name="txtCost" DataSource="Product.Cost_Product"></IKNumericTextBox>
-
- <IKTextBox name="txtMender" DataSource="Product.LastModUser_ProductName"></IKTextBox>
- <IKDateTimeText name="dttMendeDate" DataSource="Product.LastModDate_Product"></IKDateTimeText>
-
- <IKDateTimePause name="dtpSuspend" DataSource="Product.SuspendDate_Product"></IKDateTimePause>
- <IKDataGridEx name="dgSupplier" DataSource="ProductSupplier" TableStyleIndex="0">
- <DataColumn Index="0" DataSource="ProductSupplier.No_Supplier">
- <IKDataGridTextButtonColumn>
- <Events>
- <Click>
- @temp = ShowSearchBox("SupplierSearch","INFOMATION",#ProductSupplier.No_Supplier);
- if (@temp != "")
- {
- #ProductSupplier.No_Supplier = @temp;
- }
- </Click>
- </Events>
- </IKDataGridTextButtonColumn>
- </DataColumn>
- <DataColumn Index="1" DataSource="ProductSupplier.ShortName_Supplier" />
- <DataColumn Index="2" DataSource="ProductSupplier.IsMainStr_ProductSupplier" >
- <IKDataGridComboBoxColumn DisplaySourceEx="ProductSupplier.IsMainStr_ProductSupplier" ValueSourceEx="ProductSupplier.IsMain_ProductSupplier" DataSourceEx="IsMain" DisplayMemberEx="Result" ValueMemberEx="Value">
- <Events>
- <Reload>
- Search("SearchIsMain");
- SetDataGridColumnDataSource(2,"dgSupplier");
- </Reload>
- </Events>
- </IKDataGridComboBoxColumn>
- </DataColumn>
- <DataColumn Index="3" DataSource="ProductSupplier.Comment_ProductSupplier" />
- </IKDataGridEx>
- <IKDataGridEx name="dgSpecification" DataSource="ProductSpecification" TableStyleIndex="0">
- <DataColumn Index="0" DataSource="ProductSpecification.Comment_ProductSpecification" />
- </IKDataGridEx>
-
- <IKDataGridEx name="dgHistory" DataSource="ExchangeHistory" TableStyleIndex="0">
- <DataColumn Index="0" DataSource="ExchangeHistory.Date" />
- <DataColumn Index="1" DataSource="ExchangeHistory.Name_Bill" />
- <DataColumn Index="2" DataSource="ExchangeHistory.No_Bill" />
- <DataColumn Index="3" DataSource="ExchangeHistory.No_CustomerOrSupprier" />
- <DataColumn Index="4" DataSource="ExchangeHistory.shortname" />
- <DataColumn Index="5" DataSource="ExchangeHistory.num" />
- <DataColumn Index="6" DataSource="ExchangeHistory.price" />
- <DataColumn Index="7" DataSource="ExchangeHistory.TaxCurrency" />
- <DataColumn Index="8" DataSource="ExchangeHistory.Comment" />
- <Events>
- <RowHeaderDoubleClick>
- DgDoubleClick(#ExchangeHistory.Name_Bill,#ExchangeHistory.No_Bill);
- </RowHeaderDoubleClick>
- </Events>
- </IKDataGridEx>
-
- <IKButton name="btSearch">
- <Events>
- <Click>
- <![CDATA[
-
- Empty("#ExchangeHistory");
- @cktn = 0;
- @Right=TypeConvert("String",GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID());
- @RightIndentBill=GetFieldRight("订货单","特价单","查看");
- @RightSaleBill=GetFieldRight("销货单","特价单","查看");
-
- @StartTime = DBNull();
- @EndTime = DBNull();
-
- if(dtStart.Checked==true)
- @StartTime = dtStart.CValue;
-
- if(dtEnd.Checked==true)
- @EndTime = dtEnd.CValue;
-
- if(ckNearly.Checked==true)
- {
- @tbNearly=tbNearly.CValue;
- }
- if(ckPriceQuery.Checked == true)
- {
- @cktn = 1;
- if(Search("searchAllBill",tbNo.CValue,GetCurrentUser(),@cktn,@StartTime,@EndTime))
- {
- MergeTable("#searchAllBill","#ExchangeHistory");
- }
- }
- if(ckIndent.Checked == true)
- {
- @cktn = 2;
- if(Search("searchAllBill",tbNo.CValue,GetCurrentUser(),@cktn,@StartTime,@EndTime))
- {
- MergeTable("#searchAllBill","#ExchangeHistory");
- }
- }
- if(ckSaleBill.Checked == true)
- {
- @cktn = 3;
- if(Search("searchAllBill",tbNo.CValue,GetCurrentUser(),@cktn,@StartTime,@EndTime))
- {
- MergeTable("#searchAllBill","#ExchangeHistory");
- }
- }
- if(ckSaleRtn.Checked==true)
- {
- @cktn = 4;
- if(Search("searchAllBill",tbNo.CValue,GetCurrentUser(),@cktn,@StartTime,@EndTime))
- {
- MergeTable("#searchAllBill","#ExchangeHistory");
- }
- }
- if(ckSaleOut.Checked==true)
- {
- @cktn = 5;
- if(Search("searchAllBill",tbNo.CValue,GetCurrentUser(),@cktn,@StartTime,@EndTime))
- {
- MergeTable("#searchAllBill","#ExchangeHistory");
- }
- }
- if(ckPQuery.Checked==true)
- {
- @cktn = 6;
- if(Search("searchAllBill",tbNo.CValue,GetCurrentUser(),@cktn,@StartTime,@EndTime))
- {
- MergeTable("#searchAllBill","#ExchangeHistory");
- }
- }
- if(ckpurchase.Checked==true)
- {
- @cktn = 7;
- if(Search("searchAllBill",tbNo.CValue,GetCurrentUser(),@cktn,@StartTime,@EndTime))
- {
- MergeTable("#searchAllBill","#ExchangeHistory");
- }
- }
- if(ckInventory.Checked==true)
- {
- @cktn = 8;
- if(Search("searchAllBill",tbNo.CValue,GetCurrentUser(),@cktn,@StartTime,@EndTime))
- {
- MergeTable("#searchAllBill","#ExchangeHistory");
- }
- }
- if(ckPurchIn.Checked==true)
- {
- @cktn = 9;
- if(Search("searchAllBill",tbNo.CValue,GetCurrentUser(),@cktn,@StartTime,@EndTime))
- {
- MergeTable("#searchAllBill","#ExchangeHistory");
- }
- }
- if(RowCount("#ExchangeHistory") == 0)
- MessageBox("不存在符合查询条件的记录!");
-
- ]]></Click>
- </Events>
- </IKButton>
-
- <IKDataGridEx name="dgProduct" DataSource="ProductList" TableStyleIndex="0">
- <DataColumn Index="0" DataSource="ProductList.No_Product" />
- <DataColumn Index="1" DataSource="ProductList.Name_Product" />
- <Events>
- <RowHeaderDoubleClick>
- if(Search("SearchProductWithNo",#ProductList.No_Product))
- {
- ChangeMode("View");
- }
- </RowHeaderDoubleClick>
- </Events>
- </IKDataGridEx>
- <IKCheckBox name="ckDisplay" DataSource="Product.IsDisplay">
- <Events>
- <CheckedChanged>
- if(ckDisplay.Checked)
- Search("SearchAllProductList");
- else
- Search("SearchProductList");
- </CheckedChanged>
- </Events>
- </IKCheckBox>
- <IKFormToolBar name="toolBar">
- <Events>
- <ClickFirst>
- if(Search("SearchProductFirst", tbNo.CValue))
- {
- Empty("#ExchangeHistory");
- ChangeMode("View");
- }
- </ClickFirst>
- <ClickPrev>
- if(Search("SearchProductPrevious", tbNo.CValue))
- {
- Empty("#ExchangeHistory");
- ChangeMode("View");
- }
- </ClickPrev>
- <ClickNext>
- if(Search("SearchProductNext", tbNo.CValue))
- {
- Empty("#ExchangeHistory");
- ChangeMode("View");
- }
- </ClickNext>
- <ClickLast>
- if(Search("SearchProductLast", tbNo.CValue))
- {
- Empty("#ExchangeHistory");
- ChangeMode("View");
- }
- </ClickLast>
- <ClickNew>
- ;
- </ClickNew>
- <ClickEmpty>
- ChangeMode("Search");
- </ClickEmpty>
- <ClickSubmit>
- <Lable name="SubmitButtonClick" />
- </ClickSubmit>
- <ClickModify>
- ChangeMode("Modify");
- </ClickModify>
- <ClickDelete>
- Delete(); ChangeMode("Search");
- </ClickDelete>
- <ClickPrint>
- PrintReport();
- </ClickPrint>
-
- <ClickAudit>
- ;
- </ClickAudit>
- <ClickUnAudit>
- ;
- </ClickUnAudit>
- <ClickImport>
- ;
- </ClickImport>
- <ClickExport>
- ;
- </ClickExport>
- <ClickClose>
- ;
- </ClickClose>
- <ClickPrintBarCode>
- PrintBarCode("BarCodeProductSearch",#Product.No_Product,#Product.No_Product);
- </ClickPrintBarCode>
- <ClickExpand>
- if(toolBar.ExpandForm==true)
- {
- pnRight.Visible=true;<!--PanelRight is not existed-->
- if(!@HaveSearchProductList)
- {
- Search("SearchProductList");
- @HaveSearchProductList=true;
- }
- }
- else
- {
- pnRight.Visible=false;
- }
- </ClickExpand>
- </Events>
- </IKFormToolBar>
- </Controls>
- <Tables>
- <Table name="ProductSupplier">
- <Events>
- <ColumnsChanged>
- <No_Supplier>
- if(Search("GetSupplierNameByNo",#ProductSupplier.No_Supplier))
- {
- #ProductSupplier.ShortName_Supplier=#Supplier.ShortName_Supplier;
- #ProductSupplier.ID_Supplier=#Supplier.ID_Supplier;
- if(!Equals(#Supplier.SuspendDate_Supplier,DBNull()))
- MessageBox("该供应商已停用!",@Title);
- }
- else
- {
- MessageBox("该供应商不存在!",@Title);
- #ProductSupplier.ShortName_Supplier="";
- #ProductSupplier.ID_Supplier=GuidEmpty();
- @temp = ShowSearchBox("SupplierSearch","INFOMATION",#ProductSupplier.No_Supplier);
- if(@temp != "")
- {
- #ProductSupplier.No_Supplier = @temp;
- }
- }
- </No_Supplier>
- </ColumnsChanged>
- </Events>
- </Table>
- </Tables>
- <LockInfomation LockID="ID_Product" LockNO="No_Product" LockSearchFunction="SearchProductWithNo"/>
- <ChildForms>
- <ChildForm name="ProductSearch" DataSource="Product" SearchFunction="SearchAllProduct" SearchFunctionByNo="SearchProductWithNo" MappingName="基本资料">
- <DataColumn Index="0" MappingName="#Product.No_Product" HeaderText="产品编号" Width="120" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="1" MappingName="#Product.Name_Product" HeaderText="产品名称" Width="120" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="2" MappingName="#Product.Type_Product" HeaderText="产品类型" Width="120" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="3" MappingName="#Product.Price_Product" HeaderText="标准售价" Width="120" ColumnType="IKDataGridTextBoxColumn" Format="F2"/>
- <DataColumn Index="4" MappingName="#Product.LowSalePrice_Product" HeaderText="最低售价" Width="120" ColumnType="IKDataGridTextBoxColumn" Format="F2"/>
- <DataColumn Index="5" MappingName="#Product.SafetyQty_Product" HeaderText="安全存量" Width="120" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="6" MappingName="#Product.Comment_Product" HeaderText="备注" Width="120" ColumnType="IKDataGridTextBoxColumn"/>
- </ChildForm>
- <ChildForm name="SupplierSearch" DataSource="Supplier" SearchFunction="SearchAllSupplier" SearchFunctionByNo="" MappingName="供应商">
- <DataColumn Index="0" MappingName="#Supplier.No_Supplier" HeaderText="供应商编号" Width="90" ColumnType="IKDataGridTextButtonColumn"/>
- <DataColumn Index="1" MappingName="#Supplier.ShortName_Supplier" HeaderText="供应商简称" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- </ChildForm>
- <ChildForm name="BarCodeProductSearch" DataSource="Product" SearchFunction="SearchAllProduct" SearchFunctionByNo="" MappingName="基本资料">
- <DataColumn Index="0" MappingName="#Product.BarCode_Product" HeaderText="产品条码" Width="120" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="1" MappingName="#Product.No_Product" HeaderText="产品编号" Width="120" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="2" MappingName="#Product.Name_Product" HeaderText="产品名称" Width="120" ColumnType="IKDataGridTextBoxColumn"/>
- </ChildForm>
- </ChildForms>
- </Client>
- <Server>
- <Tables>
- <Table name="Product" Type="Parent">
- <GetSchema CmdType="Text" CmdText=" SELECT TOP 0 Product.*,'' as OperationPrincipalNo_Product,'' as OperationPrincipal_Product,'' as PurchasePrincipal_Product,'' as PurchasePrincipalNo_Product,A.Name_User AS CreatorName_Product,B.Name_User as LastModUser_ProductName,Convert(bit,1) As IsDisplay
- FROM Product
- LEFT JOIN AppUser A ON A.ID_User = Product.ID_Creator
- LEFT JOIN AppUser B ON B.ID_User = Product.LastModUser_Product"/>
- <New CmdType="Text" CmdText="INSERT INTO Product (ID_Product, No_Product, Name_Product, Unit_Product, InvoiceName_Product, Type_Product, Currency_Product, Price_Product, LowSalePriceCurrency_Product, LowSalePrice_Product, SafetyQty_Product, MaxStocks_Product, CostCurrency_Product, Cost_Product, Property_Product, Source_Product, ID_OperationPrincipal, ID_PurchasePrincipal, CreateDate_Product, ID_Creator, Comment_Product, SuspendDate_Product,LastModDate_Product,LastModUser_Product,BarCode_Product)
- VALUES(@ID_Product, @No_Product, @Name_Product, @Unit_Product, @InvoiceName_Product, @Type_Product, @Currency_Product, @Price_Product, @LowSalePriceCurrency_Product, @LowSalePrice_Product, @SafetyQty_Product, @MaxStocks_Product, @CostCurrency_Product, @Cost_Product, @Property_Product, @Source_Product, @ID_OperationPrincipal, @ID_PurchasePrincipal, @CreateDate_Product, @ID_Creator, @Comment_Product, @SuspendDate_Product,@LastModDate_Product,@LastModUser_Product,@BarCode_Product)">
- <Params>
- <Param name="@ID_Product" type="Product.ID_Product" sourceColumn="ID_Product" />
- <Param name="@No_Product" type="Product.No_Product" sourceColumn="No_Product" />
- <Param name="@Name_Product" type="Product.Name_Product" sourceColumn="Name_Product" />
- <Param name="@Unit_Product" type="Product.Unit_Product" sourceColumn="Unit_Product" />
- <Param name="@InvoiceName_Product" type="Product.InvoiceName_Product" sourceColumn="InvoiceName_Product" />
- <Param name="@Type_Product" type="Product.Type_Product" sourceColumn="Type_Product" />
- <Param name="@Currency_Product" type="Product.Currency_Product" sourceColumn="Currency_Product" />
- <Param name="@Price_Product" type="Product.Price_Product" sourceColumn="Price_Product" />
- <Param name="@LowSalePriceCurrency_Product" type="Product.LowSalePriceCurrency_Product" sourceColumn="LowSalePriceCurrency_Product" />
- <Param name="@LowSalePrice_Product" type="Product.LowSalePrice_Product" sourceColumn="LowSalePrice_Product" />
- <Param name="@SafetyQty_Product" type="Product.SafetyQty_Product" sourceColumn="SafetyQty_Product" />
- <Param name="@MaxStocks_Product" type="Product.MaxStocks_Product" sourceColumn="MaxStocks_Product" />
- <Param name="@CostCurrency_Product" type="Product.CostCurrency_Product" sourceColumn="CostCurrency_Product" />
- <Param name="@Cost_Product" type="Product.Cost_Product" sourceColumn="Cost_Product" />
- <Param name="@Property_Product" type="Product.Property_Product" sourceColumn="Property_Product" />
- <Param name="@Source_Product" type="Product.Source_Product" sourceColumn="Source_Product" />
- <Param name="@ID_OperationPrincipal" type="Product.ID_OperationPrincipal" sourceColumn="ID_OperationPrincipal" />
- <Param name="@ID_PurchasePrincipal" type="Product.ID_PurchasePrincipal" sourceColumn="ID_PurchasePrincipal" />
- <Param name="@CreateDate_Product" type="Product.CreateDate_Product" sourceColumn="CreateDate_Product" />
- <Param name="@ID_Creator" type="Product.ID_Creator" sourceColumn="ID_Creator" />
- <Param name="@Comment_Product" type="Product.Comment_Product" sourceColumn="Comment_Product" />
- <Param name="@SuspendDate_Product" type="Product.SuspendDate_Product" sourceColumn="SuspendDate_Product" />
- <Param name="@LastModDate_Product" type="Product.LastModDate_Product" sourceColumn="LastModDate_Product" />
- <Param name="@LastModUser_Product" type="Product.LastModUser_Product" sourceColumn="LastModUser_Product" />
- <Param name="@BarCode_Product" type="Product.BarCode_Product" sourceColumn="BarCode_Product" />
- </Params>
- </New>
- <Update CmdType="Text" CmdText="UPDATE Product SET LastModDate_Product=@LastModDate_Product,LastModUser_Product=@LastModUser_Product,Name_Product = @Name_Product, Unit_Product = @Unit_Product, InvoiceName_Product = @InvoiceName_Product, Type_Product = @Type_Product, Currency_Product = @Currency_Product, Price_Product = @Price_Product, LowSalePriceCurrency_Product = @LowSalePriceCurrency_Product, LowSalePrice_Product = @LowSalePrice_Product, SafetyQty_Product = @SafetyQty_Product, MaxStocks_Product = @MaxStocks_Product, CostCurrency_Product = @CostCurrency_Product, Cost_Product = @Cost_Product, Property_Product = @Property_Product, Source_Product = @Source_Product, ID_OperationPrincipal = @ID_OperationPrincipal, ID_PurchasePrincipal = @ID_PurchasePrincipal, CreateDate_Product = @CreateDate_Product, ID_Creator = @ID_Creator, Comment_Product = @Comment_Product, SuspendDate_Product = @SuspendDate_Product,BarCode_Product = @BarCode_Product WHERE ID_Product = @ID_Product">
- <Params>
- <Param name="@ID_Product" type="Product.ID_Product" sourceColumn="ID_Product" />
- <Param name="@Name_Product" type="Product.Name_Product" sourceColumn="Name_Product" />
- <Param name="@Unit_Product" type="Product.Unit_Product" sourceColumn="Unit_Product" />
- <Param name="@InvoiceName_Product" type="Product.InvoiceName_Product" sourceColumn="InvoiceName_Product" />
- <Param name="@Type_Product" type="Product.Type_Product" sourceColumn="Type_Product" />
- <Param name="@Currency_Product" type="Product.Currency_Product" sourceColumn="Currency_Product" />
- <Param name="@Price_Product" type="Product.Price_Product" sourceColumn="Price_Product" />
- <Param name="@LowSalePriceCurrency_Product" type="Product.LowSalePriceCurrency_Product" sourceColumn="LowSalePriceCurrency_Product" />
- <Param name="@LowSalePrice_Product" type="Product.LowSalePrice_Product" sourceColumn="LowSalePrice_Product" />
- <Param name="@SafetyQty_Product" type="Product.SafetyQty_Product" sourceColumn="SafetyQty_Product" />
- <Param name="@MaxStocks_Product" type="Product.MaxStocks_Product" sourceColumn="MaxStocks_Product" />
- <Param name="@CostCurrency_Product" type="Product.CostCurrency_Product" sourceColumn="CostCurrency_Product" />
- <Param name="@Cost_Product" type="Product.Cost_Product" sourceColumn="Cost_Product" />
- <Param name="@Property_Product" type="Product.Property_Product" sourceColumn="Property_Product" />
- <Param name="@Source_Product" type="Product.Source_Product" sourceColumn="Source_Product" />
- <Param name="@ID_OperationPrincipal" type="Product.ID_OperationPrincipal" sourceColumn="ID_OperationPrincipal" />
- <Param name="@ID_PurchasePrincipal" type="Product.ID_PurchasePrincipal" sourceColumn="ID_PurchasePrincipal" />
- <Param name="@CreateDate_Product" type="Product.CreateDate_Product" sourceColumn="CreateDate_Product" />
- <Param name="@ID_Creator" type="Product.ID_Creator" sourceColumn="ID_Creator" />
- <Param name="@Comment_Product" type="Product.Comment_Product" sourceColumn="Comment_Product" />
- <Param name="@SuspendDate_Product" type="Product.SuspendDate_Product" sourceColumn="SuspendDate_Product" />
- <Param name="@LastModDate_Product" type="Product.LastModDate_Product" sourceColumn="LastModDate_Product" />
- <Param name="@LastModUser_Product" type="Product.LastModUser_Product" sourceColumn="LastModUser_Product" />
- <Param name="@BarCode_Product" type="Product.BarCode_Product" sourceColumn="BarCode_Product" />
- </Params>
- </Update>
- <Delete CmdType="Text" CmdText="DELETE ProductSupplier WHERE ProductSupplier.ID_Product = @ID_Product
- DELETE ProductSpecification WHERE ProductSpecification.ID_Product = @ID_Product
- DELETE Product WHERE Product.ID_Product = @ID_Product">
- <Params>
- <Param name="@ID_Product" type="Product.ID_Product" sourceColumn="ID_Product" />
- </Params>
- </Delete>
- <FKErrorReport ErrorMessage="该产品已被引用,删除失败!" />
- <UNIQUEErrorReport ErrorMessage="该产品编号或条码已存在,提交失败!" />
- </Table>
- <Table name="ProductSupplier" Type="Child">
- <GetSchema CmdType="Text" CmdText="SELECT TOP 0 ProductSupplier.*, Supplier.No_Supplier AS No_Supplier,Supplier.ShortName_Supplier AS ShortName_Supplier,'' As IsMainStr_ProductSupplier FROM ProductSupplier INNER JOIN Supplier ON ProductSupplier.ID_Supplier = Supplier.ID_Supplier"/>
- <New CmdType="Text" CmdText=" INSERT INTO ProductSupplier (ID_ProductSupplier, ID_Product, ID_Supplier, IsMain_ProductSupplier, Comment_ProductSupplier)
- VALUES (@ID_ProductSupplier, @ID_Product, @ID_Supplier, @IsMain_ProductSupplier, @Comment_ProductSupplier)">
- <Params>
- <Param name="@ID_ProductSupplier" type="ProductSupplier.ID_ProductSupplier" sourceColumn="ID_ProductSupplier" />
- <Param name="@ID_Product" type="ProductSupplier.ID_Product" sourceColumn="ID_Product" />
- <Param name="@ID_Supplier" type="ProductSupplier.ID_Supplier" sourceColumn="ID_Supplier" />
- <Param name="@IsMain_ProductSupplier" type="ProductSupplier.IsMain_ProductSupplier" sourceColumn="IsMain_ProductSupplier" />
- <Param name="@Comment_ProductSupplier" type="ProductSupplier.Comment_ProductSupplier" sourceColumn="Comment_ProductSupplier" />
- </Params>
- </New>
- <Update CmdType="Text" CmdText="UPDATE ProductSupplier SET ID_Supplier = @ID_Supplier, IsMain_ProductSupplier = @IsMain_ProductSupplier, Comment_ProductSupplier = @Comment_ProductSupplier WHERE ID_ProductSupplier = @ID_ProductSupplier">
- <Params>
- <Param name="@ID_ProductSupplier" type="ProductSupplier.ID_ProductSupplier" sourceColumn="ID_ProductSupplier" />
- <Param name="@ID_Supplier" type="ProductSupplier.ID_Supplier" sourceColumn="ID_Supplier" />
- <Param name="@IsMain_ProductSupplier" type="ProductSupplier.IsMain_ProductSupplier" sourceColumn="IsMain_ProductSupplier" />
- <Param name="@Comment_ProductSupplier" type="ProductSupplier.Comment_ProductSupplier" sourceColumn="Comment_ProductSupplier" />
- </Params>
- </Update>
- <Delete CmdType="Text" CmdText="DELETE ProductSupplier WHERE ProductSupplier.ID_ProductSupplier = @ID_ProductSupplier">
- <Params>
- <Param name="@ID_ProductSupplier" type="ProductSupplier.ID_ProductSupplier" sourceColumn="ID_ProductSupplier" />
- </Params>
- </Delete>
- </Table>
- <Table name="ProductSpecification" Type="Child">
- <GetSchema CmdType="Text" CmdText="SELECT TOP 0 * FROM ProductSpecification"/>
- <New CmdType="Text" CmdText=" INSERT INTO ProductSpecification (ID_ProductSpecification, ID_Product, No_ProductSpecification, Comment_ProductSpecification)
- VALUES(@ID_ProductSpecification, @ID_Product,@No_ProductSpecification, @Comment_ProductSpecification)">
- <Params>
- <Param name="@ID_ProductSpecification" type="ProductSpecification.ID_ProductSpecification" sourceColumn="ID_ProductSpecification" />
- <Param name="@ID_Product" type="ProductSpecification.ID_Product" sourceColumn="ID_Product" />
- <Param name="@No_ProductSpecification" type="ProductSpecification.No_ProductSpecification" sourceColumn="No_ProductSpecification" />
- <Param name="@Comment_ProductSpecification" type="ProductSpecification.Comment_ProductSpecification" sourceColumn="Comment_ProductSpecification" />
- </Params>
- </New>
- <Update CmdType="Text" CmdText="UPDATE ProductSpecification SET No_ProductSpecification = @No_ProductSpecification, Comment_ProductSpecification = @Comment_ProductSpecification WHERE ID_ProductSpecification = @ID_ProductSpecification">
- <Params>
- <Param name="@ID_ProductSpecification" type="ProductSpecification.ID_ProductSpecification" sourceColumn="ID_ProductSpecification" />
- <Param name="@No_ProductSpecification" type="ProductSpecification.No_ProductSpecification" sourceColumn="No_ProductSpecification" />
- <Param name="@Comment_ProductSpecification" type="ProductSpecification.Comment_ProductSpecification" sourceColumn="Comment_ProductSpecification" />
- </Params>
- </Update>
- <Delete CmdType="Text" CmdText="DELETE ProductSpecification WHERE ProductSpecification.ID_ProductSpecification = @ID_ProductSpecification">
- <Params>
- <Param name="@ID_ProductSpecification" type="ProductSpecification.ID_ProductSpecification" sourceColumn="ID_ProductSpecification" />
- </Params>
- </Delete>
- </Table>
- <Table name="Supplier" Type="Other">
- <GetSchema CmdType="Text" CmdText="SELECT top 0 Supplier.ID_Supplier,Supplier.No_Supplier, Supplier.ShortName_Supplier FROM Supplier" />
- </Table>
- <Table name="ProductList" Type="Other">
- <GetSchema CmdType="Text" CmdText="SELECT Top 0 Product.No_Product,Product.Name_Product FROM Product" />
- </Table>
- <Table name="ExchangeHistory" 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 No_CustomerOrSupprier,convert(nvarchar(64),'')as shortname,
- convert(decimal,0.00) as num,convert(decimal,0.00)as price,convert(nvarchar(64),'') as TaxCurrency,convert(nvarchar(200),'')as Comment
- FROM SaleBill" />
- </Table>
- </Tables>
- <Search>
- <SearchAllProduct CmdType="Text" CmdText="SELECT Product.No_Product,Product.Name_Product,BarCode_Product,Type_Product, Price_Product, LowSalePrice_Product, SafetyQty_Product, Comment_Product FROM Product ">
- <Tables>
- <Table name="AllProduct" />
- </Tables>
- </SearchAllProduct>
-
- <SearchProductList CmdType="Text" CmdText="SELECT Product.No_Product,Product.Name_Product FROM Product Where SuspendDate_Product Is Null">
- <Tables>
- <Table name="ProductList" />
- </Tables>
- </SearchProductList>
- <SearchAllProductList CmdType="Text" CmdText="SELECT Product.No_Product,Product.Name_Product FROM Product">
- <Tables>
- <Table name="ProductList" />
- </Tables>
- </SearchAllProductList>
- <SearchAllSupplier CmdType="Text" CmdText="SELECT Supplier.No_Supplier,Supplier.ShortName_Supplier FROM Supplier ">
- <Tables>
- <Table name="AllSupplier" />
- </Tables>
- </SearchAllSupplier>
- <SearchProductWithNo CmdType="Text" CmdText="DECLARE @ID_Product uniqueidentifier
- SELECT Product.*,C.Name_Employee as OperationPrincipal_Product,A.Name_User AS CreatorName_Product,B.Name_User as LastModUser_ProductName
- ,D.Name_Employee as PurchasePrincipal_Product,D.No_Employee as PurchasePrincipalNo_Product,C.No_Employee as OperationPrincipalNo_Product
- FROM Product
- Left Join Employee D On D.ID_Employee=Product.ID_PurchasePrincipal
- LEFT JOIN AppUser A ON A.ID_User = Product.ID_Creator
- LEFT JOIN AppUser B ON B.ID_User = Product.LastModUser_Product
- Left Join Employee C On C.ID_Employee=Product.ID_OperationPrincipal
- where Product.No_Product = @No_Product
- SELECT @ID_Product = Product.ID_Product FROM Product WHERE Product.No_Product = @No_Product
- SELECT ProductSupplier.*, Supplier.No_Supplier AS No_Supplier,Supplier.ShortName_Supplier AS ShortName_Supplier,Case When ProductSupplier.IsMain_ProductSupplier = 1 Then '是' Else '否' End As IsMainStr_ProductSupplier FROM ProductSupplier INNER JOIN Supplier ON ProductSupplier.ID_Supplier = Supplier.ID_Supplier WHERE ProductSupplier.ID_Product = @ID_Product
- SELECT * FROM ProductSpecification WHERE ProductSpecification.ID_Product = @ID_Product">
- <Params>
- <Param name="@No_Product" type="Product.No_Product" Index="0" />
- </Params>
- <Tables>
- <Table name="Product" />
- <Table name="ProductSupplier" />
- <Table name="ProductSpecification" />
- </Tables>
- </SearchProductWithNo>
- <SearchUnit CmdType="Text" CmdText="SELECT TypeDef.Name_TypeDef AS Result FROM TypeDef WHERE Type_TypeDef = 7">
- <Tables>
- <Table name="Unit" />
- </Tables>
- </SearchUnit>
- <SearchType CmdType="Text" CmdText="SELECT TypeDef.Name_TypeDef AS Result FROM TypeDef WHERE Type_TypeDef = 8">
- <Tables>
- <Table name="Type" />
- </Tables>
- </SearchType>
- <SearchProperty CmdType="Text" CmdText="SELECT TypeDef.Name_TypeDef AS Result FROM TypeDef WHERE Type_TypeDef = 10">
- <Tables>
- <Table name="Property" />
- </Tables>
- </SearchProperty>
- <SearchSource CmdType="Text" CmdText="SELECT TypeDef.Name_TypeDef AS Result FROM TypeDef WHERE Type_TypeDef = 11">
- <Tables>
- <Table name="Source" />
- </Tables>
- </SearchSource>
- <SearchOperationPrincipal CmdType="Text" CmdText="SELECT Employee.ID_Employee,Employee.Name_Employee AS Result,No_Employee FROM Employee order by No_Employee">
- <Tables>
- <Table name="OperationPrincipal" />
- </Tables>
- </SearchOperationPrincipal>
- <SearchSystemSetting CmdType="Text" CmdText="SELECT SysCurrency_SystemSetting From SystemSetting">
- <Tables>
- <Table name="SystemSetting"/>
- </Tables>
- </SearchSystemSetting>
- <SearchPurchasePrincipal CmdType="Text" CmdText="SELECT Employee.ID_Employee,Employee.Name_Employee AS Result,No_Employee FROM Employee order by No_Employee">
- <Tables>
- <Table name="PurchasePrincipal" />
- </Tables>
- </SearchPurchasePrincipal>
- <GetSupplierNameByNo CmdType="Text" CmdText="SELECT Supplier.ID_Supplier, Supplier.No_Supplier, Supplier.ShortName_Supplier, Supplier.SuspendDate_Supplier FROM Supplier WHERE No_Supplier = @No_Supplier">
- <Params>
- <Param name="@No_Supplier" type="Supplier.No_Supplier" Index="0" />
- </Params>
- <Tables>
- <Table name="Supplier" />
- </Tables>
- </GetSupplierNameByNo>
- <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>
- <SearchProductFirst CmdType="Text" CmdText=" DECLARE @ID_Product uniqueidentifier
- DECLARE @NextNo nvarchar(64)
- SET @NextNo = @No_Product
- SELECT TOP 1 @NextNo = Product.No_Product FROM Product ORDER BY Product.No_Product
- SELECT Product.*,C.Name_Employee as OperationPrincipal_Product, A.Name_User AS CreatorName_Product,B.Name_User as LastModUser_ProductName
- ,D.Name_Employee as PurchasePrincipal_Product,D.No_Employee as PurchasePrincipalNo_Product,C.No_Employee as OperationPrincipalNo_Product
- FROM Product
- Left Join Employee D On D.ID_Employee=Product.ID_PurchasePrincipal
- LEFT JOIN AppUser A ON A.ID_User = Product.ID_Creator
- LEFT JOIN AppUser B ON B.ID_User = Product.LastModUser_Product
- Left Join Employee C On C.ID_Employee=Product.ID_OperationPrincipal
- where Product.No_Product = @NextNo
- SELECT @ID_Product = Product.ID_Product FROM Product WHERE Product.No_Product = @NextNo
- SELECT ProductSupplier.*, Supplier.No_Supplier AS No_Supplier,Supplier.ShortName_Supplier AS ShortName_Supplier,Case When ProductSupplier.IsMain_ProductSupplier = 1 Then '是' Else '否' End As IsMainStr_ProductSupplier FROM ProductSupplier INNER JOIN Supplier ON ProductSupplier.ID_Supplier = Supplier.ID_Supplier WHERE ProductSupplier.ID_Product = @ID_Product
- SELECT * FROM ProductSpecification WHERE ProductSpecification.ID_Product = @ID_Product">
- <Params>
- <Param name="@No_Product" type="Product.No_Product" Index="0" />
- </Params>
- <Tables>
- <Table name="Product" />
- <Table name="ProductSupplier" />
- <Table name="ProductSpecification" />
- </Tables>
- </SearchProductFirst>
- <SearchProductPrevious CmdType="Text" CmdText="DECLARE @ID_Product uniqueidentifier
- DECLARE @NextNo nvarchar(64)
- SET @NextNo = @No_Product
- SELECT TOP 1 @NextNo = Product.No_Product FROM Product WHERE Product.No_Product < @No_Product ORDER BY Product.No_Product Desc
- SELECT Product.*,C.Name_Employee as OperationPrincipal_Product, A.Name_User AS CreatorName_Product,B.Name_User as LastModUser_ProductName
- ,D.Name_Employee as PurchasePrincipal_Product,D.No_Employee as PurchasePrincipalNo_Product,C.No_Employee as OperationPrincipalNo_Product
- FROM Product
- Left Join Employee D On D.ID_Employee=Product.ID_PurchasePrincipal
- LEFT JOIN AppUser A ON A.ID_User = Product.ID_Creator
- Left Join Employee C On C.ID_Employee=Product.ID_OperationPrincipal
- LEFT JOIN AppUser B ON B.ID_User = Product.LastModUser_Product
- where Product.No_Product = @NextNo
- SELECT @ID_Product = Product.ID_Product FROM Product WHERE Product.No_Product = @NextNo
- SELECT ProductSupplier.*, Supplier.No_Supplier AS No_Supplier,Supplier.ShortName_Supplier AS ShortName_Supplier,Case When ProductSupplier.IsMain_ProductSupplier = 1 Then '是' Else '否' End As IsMainStr_ProductSupplier FROM ProductSupplier INNER JOIN Supplier ON ProductSupplier.ID_Supplier = Supplier.ID_Supplier WHERE ProductSupplier.ID_Product = @ID_Product
- SELECT * FROM ProductSpecification WHERE ProductSpecification.ID_Product = @ID_Product">
- <Params>
- <Param name="@No_Product" type="Product.No_Product" Index="0" />
- </Params>
- <Tables>
- <Table name="Product" />
- <Table name="ProductSupplier" />
- <Table name="ProductSpecification" />
- </Tables>
- </SearchProductPrevious>
- <SearchProductNext CmdType="Text" CmdText="DECLARE @ID_Product uniqueidentifier
- DECLARE @NextNo nvarchar(64)
- SET @NextNo = @No_Product
- SELECT TOP 1 @NextNo = Product.No_Product FROM Product WHERE Product.No_Product > @No_Product ORDER BY Product.No_Product
- SELECT Product.*,C.Name_Employee as OperationPrincipal_Product, A.Name_User AS CreatorName_Product,B.Name_User as LastModUser_ProductName
- ,D.Name_Employee as PurchasePrincipal_Product,D.No_Employee as PurchasePrincipalNo_Product,C.No_Employee as OperationPrincipalNo_Product
- FROM Product
- Left Join Employee D On D.ID_Employee=Product.ID_PurchasePrincipal
- LEFT JOIN AppUser A ON A.ID_User = Product.ID_Creator
- Left Join Employee C On C.ID_Employee=Product.ID_OperationPrincipal
- LEFT JOIN AppUser B ON B.ID_User = Product.LastModUser_Product
- where Product.No_Product = @NextNo
- SELECT @ID_Product = Product.ID_Product FROM Product WHERE Product.No_Product = @NextNo
- SELECT ProductSupplier.*, Supplier.No_Supplier AS No_Supplier,Supplier.ShortName_Supplier AS ShortName_Supplier,Case When ProductSupplier.IsMain_ProductSupplier = 1 Then '是' Else '否' End As IsMainStr_ProductSupplier FROM ProductSupplier INNER JOIN Supplier ON ProductSupplier.ID_Supplier = Supplier.ID_Supplier WHERE ProductSupplier.ID_Product = @ID_Product
- SELECT * FROM ProductSpecification WHERE ProductSpecification.ID_Product = @ID_Product">
- <Params>
- <Param name="@No_Product" type="Product.No_Product" Index="0" />
- </Params>
- <Tables>
- <Table name="Product" />
- <Table name="ProductSupplier" />
- <Table name="ProductSpecification" />
- </Tables>
- </SearchProductNext>
- <SearchProductLast CmdType="Text" CmdText="DECLARE @ID_Product uniqueidentifier
- DECLARE @NextNo nvarchar(64)
- SET @NextNo = @No_Product
- SELECT TOP 1 @NextNo = Product.No_Product FROM Product ORDER BY Product.No_Product DESC
- SELECT Product.*,C.Name_Employee as OperationPrincipal_Product, A.Name_User AS CreatorName_Product,B.Name_User as LastModUser_ProductName
- ,D.Name_Employee as PurchasePrincipal_Product,D.No_Employee as PurchasePrincipalNo_Product,C.No_Employee as OperationPrincipalNo_Product
- FROM Product
- Left Join Employee D On D.ID_Employee=Product.ID_PurchasePrincipal
- LEFT JOIN AppUser A ON A.ID_User = Product.ID_Creator
- LEFT JOIN AppUser B ON B.ID_User = Product.LastModUser_Product
- Left Join Employee C On C.ID_Employee=Product.ID_OperationPrincipal
- where Product.No_Product = @NextNo
- SELECT @ID_Product = Product.ID_Product FROM Product WHERE Product.No_Product = @NextNo
- SELECT ProductSupplier.*, Supplier.No_Supplier AS No_Supplier,Supplier.ShortName_Supplier AS ShortName_Supplier,Case When ProductSupplier.IsMain_ProductSupplier = 1 Then '是' Else '否' End As IsMainStr_ProductSupplier FROM ProductSupplier INNER JOIN Supplier ON ProductSupplier.ID_Supplier = Supplier.ID_Supplier WHERE ProductSupplier.ID_Product = @ID_Product
- SELECT * FROM ProductSpecification WHERE ProductSpecification.ID_Product = @ID_Product">
- <Params>
- <Param name="@No_Product" type="Product.No_Product" Index="0" />
- </Params>
- <Tables>
- <Table name="Product" />
- <Table name="ProductSupplier" />
- <Table name="ProductSpecification" />
- </Tables>
- </SearchProductLast>
- <SearchCessOut CmdType="Text" CmdText=" SELECT SystemSetting.CessOut_SystemSetting FROM SystemSetting">
- <Tables>
- <Table name="System" />
- </Tables>
- </SearchCessOut>
- <searchAllBill CmdType="Text" CmdText=" Declare @ID_Product Uniqueidentifier
- Select @ID_Product = ID_Product From Product Where No_Product =@No_Product
- SELECT * FROM
- (SELECT Top 0 convert(datetime,'') as Date,convert(nvarchar(64),'') as Name_Bill,
- convert(nvarchar(64),'') as No_Bill,convert(nvarchar(64),'') as No_CustomerOrSupprier,convert(nvarchar(64),'')as shortname,
- convert(decimal,0.00) as num,convert(decimal,0.00)as price,convert(nvarchar(200),'')as Comment,SaleBill.ID_Assessor as ID_Assessor,convert(nvarchar(64),'') as No_Product,convert(nvarchar(64),'') as TaxCurrency
- FROM SaleBill
- Union all
- select PriceQueryBill.Date_PriceQueryBill as Date
- ,convert(nvarchar(64),'报价单') as Name_Bill
- ,PriceQueryBill.No_PriceQueryBill as No_Bill
- ,Customer.No_Customer as No_CustomerOrSupprier
- ,Customer.ShortName_Customer as shortname
- ,PriceQueryBillProduct.Quantity_PriceQueryBillProduct as num,
- PriceQueryBillProduct.UnitPrice_PriceQueryBillProduct as price,
- PriceQueryBillProduct.Comment_PriceQueryBillProduct as Comment,
- PriceQueryBill.ID_Assessor as ID_Assessor,Product.No_Product as No_Product
- ,PriceQueryBill.TaxCurrency_PriceQueryBill as TaxCurrency
- From PriceQueryBill
- join PriceQueryBillProduct on PriceQueryBill.ID_PriceQueryBill = PriceQueryBillProduct.ID_PriceQueryBill
- left join Customer on Customer.ID_Customer=PriceQueryBill.ID_Customer
- left join Product on PriceQueryBillProduct.ID_Product = Product.ID_Product
- where Customer.ID_Creator IS NOT NULL
- AND Customer.No_Customer in ( Select No_Customer From Customer Where ID_RegionalLeader in(Select ID_RegionalLeader From Principal Left join Employee on Employee.ID_Employee = Principal.ID_Employee Where Name_Employee = @Name_Employee))
- and PriceQueryBill.ID_Assessor is not null
- And @cktn =1
- union all
- select IndentBill.Date_IndentBill as Date,convert(nvarchar(64),'订货单') as Name_Bill,IndentBill.No_IndentBill as No_Bill,
- Customer.No_Customer as No_CustomerOrSupprier,Customer.ShortName_Customer as shortname,
- IndentBillProduct.Quantity_IndentBillProduct as num,
- IndentBillProduct.UnitPrice_IndentBillProduct as price,
- IndentBillProduct.Comment_IndentBillProduct as Comment,
- IndentBill.ID_Assessor as ID_Assessor,Product.No_Product as No_Product,IndentBill.TaxCurrency_IndentBill as TaxCurrency
- from IndentBill
- join IndentBillProduct on IndentBill.ID_IndentBill=IndentBillProduct.ID_IndentBill
- left join Customer on Customer.ID_Customer=IndentBill.ID_Customer
- left join Product on IndentBillProduct.ID_Product = Product.ID_Product
- where Customer.ID_Creator is not null
- and IndentBill.ID_Assessor is not null
- AND Customer.No_Customer in ( Select No_Customer From Customer Where ID_RegionalLeader in(Select ID_RegionalLeader From Principal Left join Employee on Employee.ID_Employee = Principal.ID_Employee Where Name_Employee = @Name_Employee))
- And @cktn =2
-
- Union all
- select SaleBill.Date_SaleBill as Date,convert(nvarchar(64),'销货单') as Name_Bill,SaleBill.No_SaleBill as No_Bill,
- Customer.No_Customer as No_CustomerOrSupprier,Customer.ShortName_Customer as shortname,
- SaleBillProduct.Quantity_SaleBillProduct as num,
- SaleBillProduct.UnitPrice_SaleBillProduct as price,
- SaleBillProduct.Comment_SaleBillProduct as Comment,
- SaleBill.ID_Assessor as ID_Assessor,Product.No_Product as No_Product,SaleBill.TaxCurrency_SaleBill as TaxCurrency
- from SaleBill
- join SaleBillProduct on SaleBill.ID_SaleBill=SaleBillProduct.ID_SaleBill
- left join Customer on Customer.ID_Customer=SaleBill.ID_Customer
- left join Product on SaleBillProduct.ID_Product = Product.ID_Product
- where Customer.ID_Creator is not null
- AND Customer.No_Customer in ( Select No_Customer From Customer Where ID_RegionalLeader in(Select ID_RegionalLeader From Principal Left join Employee on Employee.ID_Employee = Principal.ID_Employee Where Name_Employee = @Name_Employee))
- And SaleBill.ID_Assessor is not null
- And @cktn =3
- Union all
- select SaleRtnBill.Date_SaleRtnBill as Date,convert(nvarchar(64),'销售退货单') as Name_Bill,SaleRtnBill.No_SaleRtnBill as No_Bill,
- Customer.No_Customer as No_CustomerOrSupprier,Customer.ShortName_Customer as shortname,
- SaleRtnBillProduct.Quantity_SaleRtnBillProduct as num,
- SaleRtnBillProduct.UnitPrice_SaleRtnBillProduct as price,
- SaleRtnBillProduct.Comment_SaleRtnBillProduct as Comment,
- SaleRtnBill.ID_Assessor as ID_Assessor,Product.No_Product as No_Product,SaleRtnBill.TaxCurrency_SaleRtnBill as TaxCurrency
- from SaleRtnBill
- join SaleRtnBillProduct on SaleRtnBill.ID_SaleRtnBill=SaleRtnBillProduct.ID_SaleRtnBill
- left join Customer on Customer.ID_Customer=SaleRtnBill.ID_Customer
- left join Product on SaleRtnBillProduct.ID_Product = Product.ID_Product
- where Customer.ID_Creator is not null
- AND Customer.No_Customer in ( Select No_Customer From Customer Where ID_RegionalLeader in(Select ID_RegionalLeader From Principal Left join Employee on Employee.ID_Employee = Principal.ID_Employee Where Name_Employee = @Name_Employee))
- and SaleRtnBill.ID_Assessor is not null
- And @cktn =4
- Union all
- select SaleOutDepotBill.Date_SaleOutDepotBill as Date,convert(nvarchar(64),'销货出库单') as Name_Bill,SaleOutDepotBill.No_SaleOutDepotBill as No_Bill,
- Customer.No_Customer as No_CustomerOrSupprier,Customer.ShortName_Customer as shortname,
- SaleOutDepotBillProduct.Quantity_SaleOutDepotBillProduct as num,
- isnull(SaleBillProduct.UnitPrice_SaleBillProduct,0.00) as price,
- SaleOutDepotBillProduct.Comment_SaleOutDepotBillProduct as Comment,
- SaleOutDepotBill.ID_Assessor as ID_Assessor,Product.No_Product as No_Product,'' as TaxCurrency
- from SaleOutDepotBill
- join SaleOutDepotBillProduct on SaleOutDepotBill.ID_SaleOutDepotBill=SaleOutDepotBillProduct.ID_SaleOutDepotBill And SaleOutDepotBillProduct.ID_Product = @ID_Product
- left join Customer on Customer.ID_Customer=SaleOutDepotBill.ID_Customer
- left join Product on SaleOutDepotBillProduct.ID_Product = Product.ID_Product And SaleOutDepotBillProduct.ID_Product = @ID_Product
- left join SaleBillProduct on SaleBillProduct.ID_Product = @ID_Product And SaleOutDepotBillProduct.Type_FromBill=21
- and SaleOutDepotBillProduct.No_FromBill=(select SaleBill.No_SaleBill from SaleBill where SaleBill.ID_SaleBill=SaleBillProduct.ID_SaleBill)
- and SaleOutDepotBillProduct.No_FromBillProduct=SaleBillProduct.No_SaleBillProduct
- where Customer.No_Customer in ( Select No_Customer From Customer Where ID_RegionalLeader in(Select ID_RegionalLeader From Principal Left join Employee on Employee.ID_Employee = Principal.ID_Employee Where Name_Employee = @Name_Employee))
- and SaleOutDepotBill.ID_Assessor is not null
- And @cktn =5
- Union all
- select PurchaseQueryBill.Date_PurchaseQueryBill as Date,convert(nvarchar(64),'询价单') as Name_Bill,PurchaseQueryBill.No_PurchaseQueryBill as No_Bill,
- Supplier.No_Supplier as No_CustomerOrSupprier,Supplier.ShortName_Supplier as shortname,
- PurchaseQueryBillProduct.Quantity_PurchaseQueryBillProduct as num,
- PurchaseQueryBillProduct.UnitPrice_PurchaseQueryBillProduct as price,
- PurchaseQueryBillProduct.Comment_PurchaseQueryBillProduct as Comment,
- PurchaseQueryBill.ID_Assessor as ID_Assessor,Product.No_Product as No_Product,PurchaseQueryBill.TaxCurrency_PurchaseQueryBill as TaxCurrency
- from PurchaseQueryBill
- join PurchaseQueryBillProduct on PurchaseQueryBill.ID_PurchaseQueryBill=PurchaseQueryBillProduct.ID_PurchaseQueryBill
- left join Supplier on Supplier.ID_Supplier=PurchaseQueryBill.ID_Supplier
- left join Product on PurchaseQueryBillProduct.ID_Product = Product.ID_Product
- Where PurchaseQueryBill.ID_Assessor is not null
- And @cktn =6
-
- Union all
- select PurchaseOrderBill.Date_PurchaseOrderBill as Date,convert(nvarchar(64),'采购订单') as Name_Bill,PurchaseOrderBill.No_PurchaseOrderBill as No_Bill,
- Supplier.No_Supplier as No_CustomerOrSupprier,Supplier.ShortName_Supplier as shortname,
- PurchaseOrderBillProduct.Quantity_PurchaseOrderBillProduct as num,
- PurchaseOrderBillProduct.UnitPrice_PurchaseOrderBillProduct as price,
- PurchaseOrderBillProduct.Comment_PurchaseOrderBillProduct as Comment,
- PurchaseOrderBill.ID_Assessor as ID_Assessor,Product.No_Product as No_Product,PurchaseOrderBill.TaxCurrency_PurchaseOrderBill as TaxCurrency
- from PurchaseOrderBill
- join PurchaseOrderBillProduct on PurchaseOrderBill.ID_PurchaseOrderBill=PurchaseOrderBillProduct.ID_PurchaseOrderBill
- left join Supplier on Supplier.ID_Supplier=PurchaseOrderBill.ID_Supplier
- left join Product on PurchaseOrderBillProduct.ID_Product = Product.ID_Product
- Where PurchaseOrderBill.ID_Assessor is not null
- And @cktn =7
- Union all
- select ModifyDepotBill.Date_ModifyDepotBill as Date,convert(nvarchar(64),('库存异动作业'+'('+ModName_ModifyTypeSettings+')')) as Name_Bill,ModifyDepotBill.No_ModifyDepotBill as No_Bill,'' as No_CustomerOrSupprier,
- shortname= case when ModName_ModifyTypeSettings='销退入库' or ModName_ModifyTypeSettings='借出' or ModName_ModifyTypeSettings='借出归还' or ModName_ModifyTypeSettings='借入' or ModName_ModifyTypeSettings='借入归还' then ModifyDepotBill.Comment_ModifyDepotBill else '' end,
- ModifyDepotBillProduct.Quantity_ModifyDepotBillProduct as num,0 as price,ModifyDepotBillProduct.Comment_ModifyDepotBillProduct as Comment,
- ModifyDepotBill.ID_Assessor as ID_Assessor,Product.No_Product as No_Product,'' as TaxCurrency
- from ModifyDepotBill
- join ModifyDepotBillProduct on ModifyDepotBill.ID_ModifyDepotBill=ModifyDepotBillProduct.ID_ModifyDepotBill
- left join Product on ModifyDepotBillProduct.ID_Product = Product.ID_Product
- LEFT JOIN ModifyTypeSettings ON ModifyTypeSettings.ID_ModifyTypeSettings = ModifyDepotBill.Style_ModifyDepotBill
- Where ModifyDepotBill.ID_Assessor is not null
- And @cktn =8
- Union all
- select PurchaseInDepotBill.Date_PurchaseInDepotBill as Date,convert(nvarchar(64),'采购入库单') as Name_Bill,PurchaseInDepotBill.No_PurchaseInDepotBill as No_Bill,
- Supplier.No_Supplier as No_CustomerOrSupprier,Supplier.ShortName_Supplier as shortname,
- PurchaseInDepotBillProduct.Quantity_PurchaseInDepotBillProduct as num,
- isnull(PurchaseOrderBillProduct.UnitPrice_PurchaseOrderBillProduct,0.00) as price,
- PurchaseInDepotBillProduct.Comment_PurchaseInDepotBillProduct as Comment,
- PurchaseInDepotBill.ID_Assessor as ID_Assessor,Product.No_Product as No_Product,'' as TaxCurrency
- from PurchaseInDepotBill
- join PurchaseInDepotBillProduct on PurchaseInDepotBill.ID_PurchaseInDepotBill=PurchaseInDepotBillProduct.ID_PurchaseInDepotBill
- left join Supplier on Supplier.ID_Supplier=PurchaseInDepotBill.ID_Supplier
- left join Product on PurchaseInDepotBillProduct.ID_Product = Product.ID_Product
- left join PurchaseOrderBillProduct on PurchaseInDepotBillProduct.Type_FromBill=41
- and PurchaseInDepotBillProduct.No_FromBill=(select PurchaseOrderBill.No_PurchaseOrderBill from PurchaseOrderBill where PurchaseOrderBill.ID_PurchaseOrderBill=PurchaseOrderBillProduct.ID_PurchaseOrderBill)
- and PurchaseInDepotBillProduct.No_FromBillProduct=PurchaseOrderBillProduct.No_PurchaseOrderBillProduct
- Where PurchaseInDepotBill.ID_Assessor is not null
- And @cktn =9
- )A
- where A.No_Product = @No_Product
- AND A.Date Between isnull(DateAdd(day,DateDiff(day,0,@StartTime),0),A.Date)
- AND Isnull(DateAdd(day,DateDiff(day,0,@EndTime),1),A.Date)
- Order By Date desc
- ">
- <Params>
- <Param name="@No_Product" type="Customer.No_Customer" />
- <Param name="@Name_Employee" type="Employee.Name_Employee" />
- <Param name="@cktn" type="Customer.DunDate_Customer" />
- <Param name="@StartTime" type="PurchaseInDepotBill.Date_PurchaseInDepotBill" />
- <Param name="@EndTime" type="PurchaseInDepotBill.Date_PurchaseInDepotBill" />
- </Params>
- <Tables>
- <Table name="searchAllBill" />
- </Tables>
- </searchAllBill>
- </Search>
- </Server>
- <Lables>
- <Search>
- Empty();
- Empty("#ExchangeHistory");
- NewInstance();
- tbNo.ReadOnly=false;
- txtName.ReadOnly=true;
- txtBarCode.ReadOnly=true;
- cbUnit.Enabled=false;
- txtInvoiceName.ReadOnly=true;
- cbType.Enabled=false;
- cbCurrency.Enabled=false;
- #Product.Currency_Product=@SysCurrency;
- #Product.LowSalePriceCurrency_Product=#Product.Currency_Product;
- txtPrice.ReadOnly=true;
- txtLowSalePrice.ReadOnly=true;
- txtProperty.Enabled=false;
- txtSource.Enabled=false;
- cbOperationPrincipal.Enabled=false;
- cbPurchasePrincipal.Enabled=false;
- txtMaxStocks.ReadOnly=true;
- txtSafetyStocks.ReadOnly=true;
- txtComment.ReadOnly=true;
- dtpSuspend.Enabled=false;
- dgSupplier.ReadOnly=true;
- dgSpecification.ReadOnly=true;
- cbCostCurrency.Enabled=false;
- txtCost.ReadOnly=true;
- toolBar.EnableSubmit=false;
- toolBar.EnableModify=false;
- toolBar.EnableDelete=false;
- toolBar.EnablePrint=false;
- toolBar.EnablePrintBarCode=true;
- #Product.CreateDate_Product=DBNull();
- #Product.SuspendDate_Product=DBNull();
- #Product.LastModUser_Product=DBNull();
- #Product.LastModDate_Product=DBNull();
- txtMaxDiscount.CValue=TypeConvert("Decimal","0.00");
- if(ckDisplay.Checked)
- #Product.IsDisplay=1;
- else
- #Product.IsDisplay=0;
- UpdateForm(true, "");
- tbNo.Focus();
- @Status=0;
- </Search>
- <New>
- tbNo.ReadOnly=true;
- txtName.ReadOnly=false;
- txtBarCode.ReadOnly=false;
- cbUnit.Enabled=true;
- txtInvoiceName.ReadOnly=false;
- cbType.Enabled=true;
- txtPrice.ReadOnly=false;
- txtLowSalePrice.ReadOnly=false;
- txtProperty.Enabled=true;
- txtSource.Enabled=true;
- cbOperationPrincipal.Enabled=true;
- cbPurchasePrincipal.Enabled=true;
- txtMaxStocks.ReadOnly=false;
- txtSafetyStocks.ReadOnly=false;
- txtComment.ReadOnly=false;
- dtpSuspend.Enabled=true;
- dgSupplier.ReadOnly=false;
- dgSpecification.ReadOnly=false;
- cbCostCurrency.Enabled=false;
- txtCost.ReadOnly=true;
- toolBar.EnableSubmit=GetRight(@Title,"新增");
- toolBar.EnableModify=false;
- toolBar.EnableDelete=false;
- toolBar.EnablePrint=false;
- toolBar.EnablePrintBarCode=false;
- #Product.No_Product=tbNo.CValue;
- #Product.CreatorName_Product=GetCurrentUser();
- #Product.ID_Product=NewGuid();
- #Product.ID_Creator=GetLoginUserID();
- #Product.CreateDate_Product=DateTimeNow();
- #Product.SuspendDate_Product=DBNull();
- #Product.LastModUser_Product=DBNull();
- #Product.LastModDate_Product=DBNull();
- #Product.ID_OperationPrincipal=DBNull();
- #Product.ID_PurchasePrincipal=DBNull();
- if(ckDisplay.Checked)
- #Product.IsDisplay=1;
- else
- #Product.IsDisplay=0;
- UpdateForm(true, "");
- txtName.Focus();
- @Status=1;
- </New>
- <View>
- tbNo.ReadOnly=false;
- txtName.ReadOnly=true;
- txtBarCode.ReadOnly=true;
- cbUnit.Enabled=false;
- txtInvoiceName.ReadOnly=true;
- cbType.Enabled=false;
- txtPrice.ReadOnly=true;
- txtLowSalePrice.ReadOnly=true;
- txtProperty.Enabled=false;
- txtSource.Enabled=false;
- cbOperationPrincipal.Enabled=false;
- cbPurchasePrincipal.Enabled=false;
- txtMaxStocks.ReadOnly=true;
- txtSafetyStocks.ReadOnly=true;
- txtComment.ReadOnly=true;
- dtpSuspend.Enabled=false;
- dgSupplier.ReadOnly=true;
- dgSpecification.ReadOnly=true;
- cbCostCurrency.Enabled=false;
- txtCost.ReadOnly=true;
- toolBar.EnableSubmit=false;
- toolBar.EnableModify=GetRight(@Title,"修改");
- toolBar.EnableDelete=GetRight(@Title,"删除");
- toolBar.EnablePrint=GetRight(@Title,"打印");
- toolBar.EnablePrintBarCode=true;
- if(#Product.Price_Product!=TypeConvert("Decimal","0.00"))
- txtMaxDiscount.CValue=#Product.LowSalePrice_Product/#Product.Price_Product*100;
- else
- txtMaxDiscount.CValue=TypeConvert("Decimal","0.00");
- if(ckDisplay.Checked)
- #Product.IsDisplay=1;
- else
- #Product.IsDisplay=0;
- UpdateForm(true, "");
- @Status=2;
- </View>
- <Modify>
- tbNo.ReadOnly=true;
- txtName.ReadOnly=false;
- txtBarCode.ReadOnly=false;
- cbUnit.Enabled=true;
- txtInvoiceName.ReadOnly=false;
- cbType.Enabled=true;
- txtPrice.ReadOnly=false;
- txtLowSalePrice.ReadOnly=false;
- txtProperty.Enabled=true;
- txtSource.Enabled=true;
- cbOperationPrincipal.Enabled=true;
- cbPurchasePrincipal.Enabled=true;
- txtMaxStocks.ReadOnly=false;
- txtSafetyStocks.ReadOnly=false;
- txtComment.ReadOnly=false;
- dtpSuspend.Enabled=true;
- dgSupplier.ReadOnly=false;
- dgSpecification.ReadOnly=false;
- cbCostCurrency.Enabled=false;
- txtCost.ReadOnly=true;
- toolBar.EnableSubmit=GetRight(@Title,"新增");
- toolBar.EnableModify=false;
- toolBar.EnableDelete=GetRight(@Title,"删除");
- toolBar.EnablePrint=false;
- toolBar.EnablePrintBarCode=false;
- #Product.LastModUser_ProductName=GetCurrentUser();
- #Product.LastModUser_Product=GetLoginUserID();
- #Product.LastModDate_Product=DateTimeNow();
- if(ckDisplay.Checked)
- #Product.IsDisplay=1;
- else
- #Product.IsDisplay=0;
- UpdateForm(true, "");
- txtName.Focus();
- @Status=3;
- </Modify>
- <SubmitButtonClick>
- <![CDATA[
- if(txtName.CValue=="")
- {
- MessageBox("请输入产品名称!",@Title);
- txtName.Focus();
- return;
- }
- if(StringLength(txtBarCode.CValue) > 27)
- {
- MessageBox("条码长度不得超过27!",@Title);
- txtBarCode.Focus();
- return;
- }
- if(cbUnit.SelectedName=="")
- {
- tbDetail.SelectedIndex=0;
- MessageBox("请输入基本单位!",@Title);
- cbUnit.Focus();
- return;
- }
- if(txtInvoiceName.CValue=="")
- {
- tbDetail.SelectedIndex=0;
- MessageBox("请输入发票名称!",@Title);
- txtInvoiceName.Focus();
- return;
- }
- if(cbType.SelectedName=="")
- {
- tbDetail.SelectedIndex=0;
- MessageBox("请输入产品大类!",@Title);
- cbType.Focus();
- return;
- }
- if(txtProperty.SelectedName=="")
- {
- tbDetail.SelectedIndex=0;
- MessageBox("请输入产品性质!",@Title);
- txtProperty.Focus();
- return;
- }
- if(txtPrice.CValue>TypeConvert("Decimal","100000000000.00"))
- {
- MessageBox("标准售价不可以高于100000000000.00!",@Title);
- txtPrice.Focus();
- return;
- }
- if(txtLowSalePrice.CValue>txtPrice.CValue)
- {
- MessageBox("最低售价不可以高于标准售价!",@Title);
- txtLowSalePrice.Focus();
- return;
- }
- if(txtSafetyStocks.CValue>txtMaxStocks.CValue)
- {
- MessageBox("安全存量不可以高于最大库存量!",@Title);
- txtSafetyStocks.Focus();
- return;
- }
- UpdateForm(false, "");
- if(@Status==1)
- {
- SuspendLayout();
- for(@i=RowCount("#ProductSupplier")-1;@i>=0;@i=@i-1)
- {
- SetPosition("#ProductSupplier", @i);
- if(Equals(#ProductSupplier.ID_ProductSupplier,GuidEmpty()))
- #ProductSupplier.ID_ProductSupplier = NewGuid();
- if(Equals(#ProductSupplier.ID_Supplier, GuidEmpty()))
- {
- dgSupplier.CurrentRowIndex=@i;
- tbDetail.SelectedIndex=1;
- MessageBox("该供应商不存在",@Title);
- ResumeLayout();
- return;
- }
- #ProductSupplier.ID_Product = #Product.ID_Product;
- }
- for(@i=RowCount("#ProductSpecification")-1;@i>=0;@i=@i-1)
- {
- SetPosition("#ProductSpecification", @i);
- if(Equals(#ProductSpecification.ID_ProductSpecification,GuidEmpty()))
- #ProductSpecification.ID_ProductSpecification = NewGuid();
- #ProductSpecification.ID_Product = #Product.ID_Product;
- }
- ResumeLayout();
- New();
- }
- else if(@Status == 3)
- {
- SuspendLayout();
- for(@i=RowCount("#ProductSupplier")-1;@i>=0;@i=@i-1)
- {
- SetPosition("#ProductSupplier", @i);
- if(Equals(#ProductSupplier.ID_ProductSupplier,GuidEmpty()))
- #ProductSupplier.ID_ProductSupplier = NewGuid();
- if(Equals(#ProductSupplier.ID_Supplier, GuidEmpty()))
- {
- dgSupplier.CurrentRowIndex=@i;
- tbDetail.SelectedIndex=1;
- MessageBox("该供应商不存在",@Title);
- ResumeLayout();
- return;
- }
- #ProductSupplier.ID_Product = #Product.ID_Product;
- }
- for(@i=RowCount("#ProductSpecification")-1;@i>=0;@i=@i-1)
- {
- SetPosition("#ProductSpecification", @i);
- if(Equals(#ProductSpecification.ID_ProductSpecification,GuidEmpty()))
- #ProductSpecification.ID_ProductSpecification = NewGuid();
- #ProductSpecification.ID_Product = #Product.ID_Product;
- }
- ResumeLayout();
- #Product.LastModDate_Product=DateTimeNow();
- Update();
- }
- ChangeMode("View");
- ]]>
- </SubmitButtonClick>
- </Lables>
- </Form>
- </Forms>
|