Quintiq file version 2.0
#parent: #root
Method OnOK () id:Method_DialogCreateEditUnitAvailability_OnOK
{
  #keys: '[136682.1.1069788188]'
  Body:
  [*
    data := DataHolderDialogData.Data();
    isbatchedit := DataHolderUnitPeriodTime.Data().Size() >1;
    
    UnitAvailability::CreateOrUpdateForUnitPeriodTimes( DataHolderUnitPeriodTime.Data(),
                                                        not isbatchedit or CheckBoxBatchEditMaintenance.Checked(),
                                                        data.TimeUnit(),
                                                        data.Maintenance(),
                                                        not isbatchedit or CheckBoxBatchEditEfficiency.Checked(),
                                                        data.Efficiency(),
                                                        false,
                                                        data.Allocation(),
                                                        not isbatchedit or CheckBoxBatchEditShiftPattern.Checked(),
                                                        data.ShiftPattern(),
                                                        not isbatchedit or CheckBoxBatchEditMaxLoadPercentage.Checked(),
                                                        data.MaximumLoadPercentage(),
                                                        not isbatchedit or CheckBoxBatchEditNrOfUnitsOpen.Checked(),
                                                        data.NrOfUnitsOpen(),
                                                        DataHolderFromThisPeriodOnward.Data(),
                                                        not isbatchedit or CheckBoxBatchEditMinimumLoadThreshold.Checked(),
                                                        data.MinimumLoadThreshold()
                                                       );
  *]
}
