Quintiq file version 2.0
#parent: #root
Method SetAttributesAfterOnApplyData () id:Method_DialogCreateEditLaneLeg_SetAttributesAfterOnApplyData
{
  #keys: '[109478.0.549768960]'
  Body:
  [*
    // Set user attributes based on declarative value binded with the components after on apply data
    
    data := Dialog.Data();
    
    // If the components are disabled, the date time is not updated by the data binding.
    data.Start( GUIDateTimeSelectorStart.DateTime().Date() );
    data.End( GUIDateTimeSelectorEnd.DateTime().Date() );
    
    if( CheckBoxHasUserPreprocessingTime.Checked() )
    {
      data.UserLeadTime( data.LeadTime() );
    }
    
    data.StandardDeviationLeadTimeLaneLeg( GUIDurationSelectorStandardDeviationLeadTimeLaneLeg.Duration() );
    /*
    if( CheckBoxHasStandardDeviationLeadTimeLaneLeg.Checked() )
    {
      data.StandardDeviationLeadTimeLaneLeg( data.StandardDeviationLeadTime() );
    }
    
    // Delete generated costs which belongs to different unit
    traverse( data, LaneLegCost, llc,
              isnull( llc.WrappedInstance() )
              /* There is two sitiuation
                 1) User created an account assignment, we will remove the cost generated for others unit.
                 2) User removed account assignment, we will remove the shadow cost.
                 Guard as:
                 AccountCost.AccountAssignment will be null if the account assignment is being removed,
                 true so the orphan cost will be removed
              and guard( llc.UnitAccount().Unit() <> data.Lane().Unit(), true ) )
    {
      llc.Delete();
    }
    */
  *]
}
