Quintiq file version 2.0
#parent: #root
Method Edit (
  Routing routing,
  internal[GUIComponent] parent
) id:Method_DialogCreateEditRouting_Edit
{
  #keys: '[113694.1.1907338934]'
  Body:
  [*
    // Edit routing step
    data := shadow( routing );
    
    Dialog.Data( data );
    CheckBoxHasStart.Checked( Dialog.Data().Start().IsFinite() );
    CheckBoxHasEnd.Checked( Dialog.Data().End().IsFinite() );
    
    result := this.DoModal( parent );
    
    if( result > 0 )
    {
      routing.Update( EditorID.Text(), // ID is read only, the changes wont be applied
                      EditorName.Text(),
                      ifexpr( CheckBoxHasStart.Checked(), GUIDateTimeSelectorStart.DateTime().Date(), Date::MinDate()),
                      ifexpr( CheckBoxHasEnd.Checked(), GUIDateTimeSelectorEnd.DateTime().Date(), Date::MaxDate()),
                      CheckBoxAllowWIPInventory.Checked(),
                      false
                     );
    }
  *]
}
