yypsybs
2023-10-10 550ebcf02217f8a0c6fe9001fcfa8e42e9cd6b83
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Quintiq file version 2.0
#parent: #root
Method EditUnitCapacity (
  internal[GUIComponent] parent,
  structured[UnitCapacity] selection
) id:Method_DialogCreateEditUnitCapacity_EditUnitCapacity
{
  #keys: '[107528.0.125617869]'
  Body:
  [*
    // Edit unit capacities
    
    isbatchedit := selection.Size() > 1;
    Dialog.ShowHideComponentForBatchEdit( isbatchedit, true, false );
    
    data := shadow( selection.Element( 0 ) );
    Dialog.Data( data );
    
    result := this.DoModal( parent );
    
    if( result > 0 )
    {
      UnitCapacity::Update( selection,
                            data.Unit(),
                            GUIStartDateTimeSelector.DateTime(), // Read-only, apply changes to shadow is not taking place for read-only attribute when editing.
                            CheckBoxBatchEditCapacity.Checked(),
                            data.TimeUnit(),
                            data.MinCapacity(),
                            data.MaxCapacity(),
                            CheckBoxBatchEditMaxLoadPercentage.Checked(),
                            data.MaximumLoadPercentage(),
                            CheckBoxBatchEditNrOfUnitsOpen.Checked(),
                            data.NrOfUnitsOpen() );
    }
  *]
}