lazhen
2025-01-07 b3987122cbbc46c5c59d3173f37fca3170b6dc5a
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
Quintiq file version 2.0
#parent: #root
Method OnOK () id:Method_DialogCreateEditStockingPoint_OnOK
{
  #keys: '[135040.0.219519607]'
  Body:
  [*
    // When the user clicks ok,       
    // we either create or edit the data
    this.ApplyChanges();
    this.SetAttributeAfterApplyData();
    
    data := DataHolderDialogData.Data();
    
    if( isnull( data.WrappedInstance() ) )
    { //new
      data.Commit();
      
      // Access the form, select the new SP
      DataHolderForm.Data().ListEntity().SelectByKey( data.WrappedInstance().Key() );
    } 
    else
    { 
      //edit & batch edit
      StockingPoint_MP::Update( DataHolderDialogDatas.Data()
                               ,CheckBoxBatchEditInfinite.Checked()
                               ,CheckBoxBatchEditValidity.Checked()
                               ,false //CheckBoxBatchEditGIS.Checked()
                               ,CheckBoxBatchEditNote.Checked()                
                               ,EditFieldID.Text()
                               ,data.Name()
                               ,data.Unit()
                               ,data.UnitOfMeasure_MP()
                               ,data.Currency_MP()
                               ,data.IconName()              
                               ,data.IsPlannedInfinite() 
                               ,data.Start()
                               ,data.End()
                               ,data.Group()
                               ,data.GISCountryCode()
                               ,data.GISCity()
                               ,data.GISPostalCode()
                               ,data.Notes()
                               ,false );
    }
    
    this.Close();
  *]
}