Quintiq file version 2.0 #parent: pnlActions/btnOk Response OnClick () id:Response_pnlActions_btnOk_OnClick { #keys: '[414996.1.206961980]' DefinitionID: 'Responsedef_WebButton_OnClick' GroupServerCalls: true QuillAction { Body: [* if( cbAllStockingPoint.Checked() ){ if( cbAllProduct.Checked() ){ // 锁定全部产品 traverse( MacroPlan,Product_MP,product ){ traverse( product,ProductInStockingPoint_MP,productInStockingPoint ){ LockPeriod::Create( productInStockingPoint,dsLockDate.Date(),InterfaceDataset ); } } }else{ // 锁定指定产品下的全部库存点 product := ddlProduct.Data(); traverse( product,ProductInStockingPoint_MP,productInStockingPoint){ LockPeriod::Create( productInStockingPoint,dsLockDate.Date(), InterfaceDataset ); } } }else{ if( cbAllProduct.Checked() ){ // 锁定指定库存点下的全部产品 stockingPoint := ddlStockingPoint.Data(); traverse( stockingPoint,ProductInStockingPoint_MP,productInStockingPoint ){ LockPeriod::Create( productInStockingPoint,dsLockDate.Date(), InterfaceDataset ); } }else{ // 锁定指定库存点的指定产品 productInStockingPoint := select( ddlProduct.Data(),ProductInStockingPoint_MP,pisp,pisp.StockingPoint_MP() = ddlStockingPoint.Data() ); if( not isnull( productInStockingPoint )){ LockPeriod::Create( productInStockingPoint,dsLockDate.Date(),InterfaceDataset ); } } } Form.Close(); *] } }