RecordHistoryWrite("FrmProduct","dtStart","dtEnd","ckNearly","tbNearly" ,"ckPriceQuery","ckIndent","ckSaleBill","ckSaleRtn","ckPQuery","ckpurchase","ckInventory","ckSaleOut","ckPurchIn"); ; @Temp = ShowSearchBox("ProductSearch","INFOMATION",tbNo.CValue); if(@Temp != StringEmpty()) { tbNo.CValue = @Temp; UpdateForm(false, ""); Empty("#ExchangeHistory"); if(Search("SearchProductWithNo", tbNo.CValue)) { ChangeMode("View"); } } UpdateForm(false, "cbUnit"); Search("SearchUnit"); UpdateForm(true, "cbUnit"); UpdateForm(false, "cbType"); Search("SearchType"); UpdateForm(true, "cbType"); UpdateForm(false, "txtProperty"); Search("SearchProperty"); UpdateForm(true, "txtProperty"); UpdateForm(false, "txtSource"); Search("SearchSource"); UpdateForm(true, "txtSource"); UpdateForm(false, "cbOperationPrincipal"); Search("SearchOperationPrincipal"); UpdateForm(true, "cbOperationPrincipal"); UpdateForm(false, "cbPurchasePrincipal"); Search("SearchPurchasePrincipal"); UpdateForm(true, "cbPurchasePrincipal"); @temp = ShowSearchBox("SupplierSearch","INFOMATION",#ProductSupplier.No_Supplier); if (@temp != "") { #ProductSupplier.No_Supplier = @temp; } Search("SearchIsMain"); SetDataGridColumnDataSource(2,"dgSupplier"); DgDoubleClick(#ExchangeHistory.Name_Bill,#ExchangeHistory.No_Bill); if(Search("SearchProductWithNo",#ProductList.No_Product)) { ChangeMode("View"); } if(ckDisplay.Checked) Search("SearchAllProductList"); else Search("SearchProductList"); if(Search("SearchProductFirst", tbNo.CValue)) { Empty("#ExchangeHistory"); ChangeMode("View"); } if(Search("SearchProductPrevious", tbNo.CValue)) { Empty("#ExchangeHistory"); ChangeMode("View"); } if(Search("SearchProductNext", tbNo.CValue)) { Empty("#ExchangeHistory"); ChangeMode("View"); } if(Search("SearchProductLast", tbNo.CValue)) { Empty("#ExchangeHistory"); ChangeMode("View"); } ; ChangeMode("Search"); ChangeMode("Modify"); Delete(); ChangeMode("Search"); PrintReport(); ; ; ; ; ; PrintBarCode("BarCodeProductSearch",#Product.No_Product,#Product.No_Product); if(toolBar.ExpandForm==true) { pnRight.Visible=true; if(!@HaveSearchProductList) { Search("SearchProductList"); @HaveSearchProductList=true; } } else { pnRight.Visible=false; } 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; } }
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; 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; 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; 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; 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"); ]]>