| Quintiq file version 2.0 | 
| #parent: #root | 
| StaticMethod Update ( | 
|   UnitAvailabilitys unitavailabilitys, | 
|   Unit unit, | 
|   DateTime start, | 
|   Boolean isbatcheditmaintenance, | 
|   String timeunit, | 
|   Duration maintenance, | 
|   Boolean isbatcheditefficiency, | 
|   Real efficiency, | 
|   Boolean isbatcheditallocation, | 
|   Real allocation, | 
|   Boolean isbatcheditshiftpattern, | 
|   ShiftPattern shiftpattern, | 
|   Boolean isbatcheditmaxloadpercentage, | 
|   Real maxloadpercentage, | 
|   Boolean isbatcheditnrofunitsopen, | 
|   Number nrofunitsopen, | 
|   Boolean isbatcheditminimumloadthreshold, | 
|   Real minimumloadthreshold | 
| ) | 
| { | 
|   Description: 'Batch edit unit availability, data get from UI.' | 
|   TextBody: | 
|   [* | 
|     // Soh Yee Jul-19-2012 (created) | 
|      | 
|     traverse( unitavailabilitys, Elements, ua ) | 
|     { | 
|       // Case related to batch edit. | 
|       if( unitavailabilitys.Size() > 1 ) | 
|       { | 
|         // The selectors are disabled if batch edit. So, it is incorrect to take the input from UI. | 
|         unit := ua.Unit(); | 
|         start := ua.Start(); | 
|      | 
|         // Get back the unit availability value if the batch edit check boxes are not checked, instead of from UI. | 
|         if( not isbatcheditmaintenance ) | 
|         { | 
|           timeunit := ua.TimeUnit(); | 
|           maintenance := ua.Maintenance(); | 
|         } | 
|      | 
|         if( not isbatcheditefficiency ) | 
|         { | 
|           efficiency := ua.Efficiency(); | 
|         } | 
|      | 
|         if( not isbatcheditallocation ) | 
|         { | 
|           allocation := ua.Allocation(); | 
|         } | 
|      | 
|         if( not isbatcheditshiftpattern ) | 
|         { | 
|           shiftpattern := ua.ShiftPattern(); | 
|         } | 
|      | 
|         if( not isbatcheditmaxloadpercentage ) | 
|         { | 
|           maxloadpercentage := ua.MaximumLoadPercentage(); | 
|         } | 
|      | 
|         if( not isbatcheditnrofunitsopen ) | 
|         { | 
|           nrofunitsopen := ua.NrOfUnitsOpen(); | 
|         } | 
|          | 
|         if( not isbatcheditminimumloadthreshold ) | 
|         { | 
|           minimumloadthreshold := ua.MinimumLoadThreshold(); | 
|         }     | 
|       } | 
|      | 
|       ua.Update( unit, | 
|                  start, | 
|                  timeunit, | 
|                  maintenance, | 
|                  efficiency, | 
|                  allocation, | 
|                  shiftpattern, | 
|                  maxloadpercentage, | 
|                  nrofunitsopen, | 
|                  minimumloadthreshold, | 
|                  false // action from UI is Manual | 
|                ); | 
|     } | 
|   *] | 
| } |