yypsybs
2023-09-09 3cb5a54def670d97301f07170fcaad213bfc54f2
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
Quintiq file version 2.0
#parent: #root
Method Edit (
  structured[BaseRecipeIngredient] selection,
  internal[GUIComponent] parent
) id:Method_DialogCreateEditBaseRecipeIngredient_Edit
{
  #keys: '[110994.0.979712521]'
  Body:
  [*
    // Edit recipe ingredient
    isbatchedit := selection.Size() > 1;
    data := shadow( selection.Element( 0 ) );
    Dialog.Data( data );
    
    Dialog.ShowHideComponentForBatchEdit( isbatchedit );
    Dialog.EnableDisableComponents();
    
    result := Dialog.DoModal( parent );
    
    if( result > 0 )
    {
      if( isbatchedit )
      {
        BaseRecipeIngredient::Update( selection,
                                      CheckBoxBatchEditMin.Checked(),
                                      data.Minimum(),
                                      CheckBoxBatchEditMax.Checked(),
                                      data.Maximum(),
                                      CheckBoxBatchEditNom.Checked(),
                                      data.Nominal(),
                                      false );
      }
      else
      {
        data.Commit();
      }    
    }
  *]
}