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( cbAllProductInStockingPoint.Checked() ){
          // 锁定全部产品
          traverse( MacroPlan,Product_MP,product ){
            traverse( product,ProductInStockingPoint_MP,productInStockingPoint ){
              LockPeriod::Create( productInStockingPoint,dsLockDate.Date() );
            }
          }
        }else{
          // 锁定指定产品下的全部库存点
          product := ddlProductInStockingPoint.Data().Product_MP();
          traverse( product,ProductInStockingPoint_MP,productInStockingPoint){
            LockPeriod::Create( productInStockingPoint,dsLockDate.Date() );
          }
        }
      }else{
        if( cbAllProductInStockingPoint.Checked() ){
          // 锁定指定库存点下的全部产品
          stockingPoint := ddlStockingPoint.Data();
          traverse( stockingPoint,ProductInStockingPoint_MP,productInStockingPoint ){
            LockPeriod::Create( productInStockingPoint,dsLockDate.Date() );
          }
        }else{
          // 锁定指定库存点的指定产品
          LockPeriod::Create( ddlProductInStockingPoint.Data(),dsLockDate.Date() );
        } 
      }
      Form.Close();
    *]
  }
}
