Quintiq file version 2.0
#parent: #root
Method OnOK () id:Method_DialogCreateEditTransportCapacity_OnOK
{
  #keys: '[139394.1.44054407]'
  Body:
  [*
    // On ok
    this.ApplyChanges();
    
    data := DataHolderDialogData.Data();
    isbatchedit := DataHolderDialogDatas.Data().Size() > 1;
    TransportCapacity::CreateOrUpdateForUnitPeriodTransports( DataHolderDialogDatas.Data(),
                                                              data.TimeUnit(),
                                                              not isbatchedit or CheckboxBatchEditLotSize.Checked(),
                                                              data.LotSize(),
                                                              not isbatchedit or CheckboxBatchEditCapacity.Checked(),
                                                              data.MinimumCapacity(),
                                                              data.MaximumCapacity(),
                                                              not isbatchedit or CheckboxHasSecondaryCapacity.Checked() ,
                                                              data.HasSecondaryCapacity(),
                                                              data.SecondaryLotSize(),
                                                              data.SecondaryMaximumCapacity(),
                                                              data.SecondaryMinimumCapacity(),
                                                              guard( DropDownListSecondaryUOM.Data().Name(), '' ),
                                                              DataHolderFromThisPeriodOnward.Data() /*thisperiodonwards*/
                                                            );
    
    this.Close();
  *]
}
