chenqinghong
2024-05-07 3ec06a830367465068963156dcc1d8e522571c13
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
Quintiq file version 2.0
#parent: #root
Method NewProduct (
  internal[GUIComponent] parent,
  Product_MP product
) as Product_MP id:Method_DialogCreateEditProduct_NewProduct
{
  #keys: '[11660.0.54834723]'
  Body:
  [*
    // New product
    data := MacroPlan.Product_MP( relshadow, ID := "" );// ID set to empty, will be defined by user in the interface
    Dialog.Data( data );
    
    this.SetCheckBoxVisibility( false );
    
    // Set default values
    CheckBoxHasParentProduct.Checked( not isnull( product ) );
    SelectionParentProduct.BoundValue( guard( product.Name(), '' ));
    DataHolderParentProduct.Data( product );
    
    EditorProductName.SetFocus();
    
    result := this.DoModal( parent );
    
    if ( result > 0 )
    {
      data.Commit();
    }
    
    
    return data.WrappedInstance();
  *]
}