admin
2025-01-22 7e31442f0e9b07764e9c6a9680d3d4aeba5fe1de
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
Quintiq file version 2.0
#parent: #root
Method EditOperation (
  internal[GUIComponent] parent,
  structured[Operation] selection
) id:Method_DialogCreateEditOperation_EditOperation
{
  #keys: '[109478.0.549376948]'
  Body:
  [*
    // Edit operation
    isbatchedit := selection.Size() > 1;
    
    data := shadow( selection.Element( 0 ) );
    
    Dialog.SetFilterForEdit( selection.Element( 0 ) );
    Dialog.Data( data );
    
    //moved here, dialog.data is referenced in this method
    Dialog.ShowHideComponentForBatchEdit( isbatchedit );
    Dialog.SetTooltips();
    
    result := this.DoModal( parent );
    
    if( result > 0 )
    {
      /* TWO Transaction is expected in editing single operation
         1. Update cost, we need to call Commit to commit the shadow costs
         2. Update operation, we need to call Update to updated the TypeIndex
      */
    
      if( not isbatchedit )
      {
        selection.Element( 0 ).UpdateTypeIndex( EditorID.Text() );      // Read-only, apply changes to shadow is not taking place for read-only attribute when editing.
        data.Commit();
      }
      else
      {
        Operation::Update( selection,
                           data.Unit(),
                           EditorID.Text(),
                           data.Name(),
                           CheckBoxBatchEditPreprocessingTime.Checked(),
                           data.UserLeadTime(),             
                           CheckBoxBatchEditStandardDeviation.Checked(),
                           data.StandardDeviationLeadTimeOperation(),
                           CheckBoxBatchEditThroughput.Checked(),
                           data.Throughput(),
                           CheckBoxBatchEditHasUserLotSize.Checked(),
                           data.HasUserLotSize(),
                           data.UserMinimumQuantity(),
                           data.HasUserMaximumQuantity(),
                           data.UserMaximumQuantity(),
                           data.UserLotSize(),
                           CheckBoxBatchEditCO2Emission.Checked(),
                           data.CO2Emission()
                         );
      }
    }
  *]
}