Quintiq file version 2.0
#parent: #root
Method OnOK () id:Method_DialogCreateEditQuantityCapacity_OnOK
{
  #keys: '[139394.1.102689468]'
  Body:
  [*
    // On ok
    this.ApplyChanges();
    
    data := DataHolderDialogData.Data();
    isbatchedit := DataHolderDialogDatas.Data().Size() > 1;
    
    UnitCapacity::CreateOrUpdateForUnitPeriodQuantitys( DataHolderDialogDatas.Data(),
                                                        not isbatchedit or CheckboxBatchEditCapacity.Checked(),
                                                        data.TimeUnit(),
                                                        data.MinCapacity(),
                                                        data.MaxCapacity(),
                                                        not isbatchedit or CheckboxBatchEditMaxLoadPercentage.Checked(),
                                                        data.MaximumLoadPercentage(),
                                                        not isbatchedit or CheckboxBatchEditNrOfUnitsOpen.Checked(),
                                                        data.NrOfUnitsOpen(),
                                                        DataHolderFromThisPeriodOnward.Data() /*thisperiodonwards*/ );
    
    this.Close();
  *]
}
