Quintiq file version 2.0
#parent: pnlActions/btnOk
Response OnClick () id:Response_pnlActions_btnOk_OnClick
{
  #keys: '[414702.0.223820978]'
  DefinitionID: 'Responsedef_WebButton_OnClick'
  Precondition:
  [*
    flag := guard( [Real]efPlannedQuantity.Text() > 0.0, false ) or DataHolderDialogDatas.Data().Size() > 1;
    
    if ( not flag ) {
      feedback := "请输入一个大于0的数字";
    }
    
    return flag;
  *]
  QuillAction
  {
    Body:
    [*
      Form.ApplyChanges();
      
      masterPlanReleaseWorkOrderTabulation := guard( DataHolderDialogData.Data().WrappedInstance(), null( MasterPlanReleaseWorkOrderTabulation ) );
      
      //info( "是否为空：", isnull( masterPlanReleaseWorkOrderTabulation ), "    Datas个数：", guard( DataHolderDialogDatas.Data().Size(), 0 ) );
      if ( not isnull( DataHolderDialogDatas.Data() ) and DataHolderDialogDatas.Data().Size() > 1 ) {
        traverse ( DataHolderDialogDatas.Data(), Elements, mprwot ) {
          mprwot.WorkOrderType( ddlWorkOrderType.Data().TypeName() );
        }
      } else if ( not isnull( masterPlanReleaseWorkOrderTabulation ) ) {
        masterPlanReleaseWorkOrderTabulation.PlannedQuantity( [Real]efPlannedQuantity.Text() );
        masterPlanReleaseWorkOrderTabulation.WorkOrderType( ddlWorkOrderType.Data().TypeName() );
      }
      
      Form.Close();
    *]
    GroupServerCalls: false
  }
}
