Exemplo n.º 1
0
 /// <summary>
 /// Adds the request to pick the item to the order. This can be used by other components to see the particular requests' status.
 /// </summary>
 /// <param name="itemDescription">The SKU to add the request for.</param>
 /// <param name="request">The particular request to pick the item.</param>
 public void AddRequest(ItemDescription itemDescription, ExtractRequest request)
 {
     if (!_requests.ContainsKey(itemDescription))
     {
         _requests[itemDescription] = new HashSet <ExtractRequest>();
     }
     _requests[itemDescription].Add(request);
 }
Exemplo n.º 2
0
 /// <summary>
 /// Adds a new line to the order.
 /// </summary>
 /// <param name="itemDescription">The item description of the line.</param>
 /// <param name="count">The quantity.</param>
 public void AddPosition(ItemDescription itemDescription, int count)
 {
     if (!_quantities.ContainsKey(itemDescription))
     {
         _quantities[itemDescription]       = 0;
         _servedQuantities[itemDescription] = 0;
     }
     _quantities[itemDescription] += count;
     _overallQuantity             += count;
 }
Exemplo n.º 3
0
 /// <summary>
 /// Fulfills one unit of this order.
 /// </summary>
 /// <param name="item">The physical unit used to fulfill a part of the order.</param>
 /// <returns>Indicates whether fulfilling one unit of the order was successful.</returns>
 public bool Serve(ItemDescription item)
 {
     _overallServedQuantity++;
     if (_servedQuantities[item] < _quantities[item])
     {
         _servedQuantities[item]++;
         if (_servedQuantities[item] >= _quantities[item])
         {
             _servedPositions++;
         }
         return(true);
     }
     else
     {
         return(false);
     }
 }
Exemplo n.º 4
0
 /// <summary>
 /// Returns the number of units picked so far for the given position.
 /// </summary>
 /// <param name="item">The SKU.</param>
 /// <returns>Number of units picked so far for the position corresponding to the given SKU.</returns>
 public int PositionServedCount(ItemDescription item)
 {
     return(_servedQuantities.ContainsKey(item) ? _servedQuantities[item] : 0);
 }
Exemplo n.º 5
0
 /// <summary>
 /// Returns the number of units needed to fulfill the given position.
 /// </summary>
 /// <param name="item">The SKU.</param>
 /// <returns>Number of units necessary to fulfill the position corresponding to the given SKU.</returns>
 public int PositionOverallCount(ItemDescription item)
 {
     return(_quantities.ContainsKey(item) ? _quantities[item] : 0);
 }
Exemplo n.º 6
0
 /// <summary>
 /// Gets the given lines's demand count.
 /// </summary>
 /// <param name="item">The order line.</param>
 /// <returns>The demand of the line.</returns>
 public int GetDemandCount(ItemDescription item)
 {
     return(_quantities.ContainsKey(item) ? _quantities[item] : 0);
 }