1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321 |
- <?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"/>
- </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 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>
|