Kevin Kok Khah Whey
2023-11-07 5ae534ab606e6f2ba5ea60914224d665b0447d5a
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 OnOK () id:Method_DialogCreateEditLane_OnOK
{
  #keys: '[139394.0.1497255404]'
  Body:
  [*
    // When the user clicks ok, 
    // we either create or edit the data
    
    this.ApplyChanges();
    /* Since Name declaratively refers to SystemName,
       Set SystemName to EditorName.
       This is not done in the Editor's binding because the name will not appear
       on the editor when editing existing operation */
    data := DataHolderDialogData.Data();
    data.SystemName( EditFieldName.Text() );
    
    if( isnull( data.WrappedInstance() ) )
    {
      data.Commit();
      // Access the form, select the new lane
      DataHolderForm.Data().ListLanes().SelectByKey( data.WrappedInstance().Key() );
    }
    else
    {
      data.WrappedInstance().Update( DropDownListUnit.Data(),
                                     EditFieldID.Text(),
                                     EditFieldName.Text(),
                                     data.IsEnabled(),
                                     data.Start(),
                                     data.End(),
                                     data.UserLeadTime(),
                                     data.StandardDeviationLeadTimeLane(),
                                     false /*isfromdb*/ );
    }                                
                                    
    this.Close();
  *]
}