Quintiq file version 2.0
#parent: #root
Method EditTransportCapacity (
  internal[GUIComponent] parent,
  structured[TransportCapacity] selection
) id:Method_DialogCreateEditTransportCapacity_EditTransportCapacity
{
  #keys: '[113694.0.1533666935]'
  Body:
  [*
    // Edit unit availabilities
    isbatchedit := selection.Size() > 1;
    Dialog.ShowHideComponentForBatchEdit( isbatchedit, true, false ); 
    
    data := shadow( selection.Element( 0 ) );
    Dialog.Data( data );             
    
    result := this.DoModal( parent );
    
    if( result > 0 )
    {
      TransportCapacity::Update( selection,
                                 data.Unit(),
                                 GUIStartDateTimeSelector.DateTime(), // Read-only, apply changes to shadow is not taking place for read-only attribute when editing.
                                 data.TimeUnit(),
                                 CheckBoxBatchEditLotSize.Checked(),
                                 data.LotSize(),
                                 CheckBoxBatchEditCapacity.Checked(),
                                 data.MinimumCapacity(),
                                 data.MaximumCapacity(),
                                 CheckBoxBatchEditSecondaryCapacity.Checked(),
                                 data.HasSecondaryCapacity(),
                                 data.SecondaryLotSize(),
                                 data.SecondaryMaximumCapacity(),
                                 data.SecondaryMinimumCapacity(),
                                 data.SecondaryUnitOfMeasureName()
                                 );
    }
  *]
}
