Exemplo n.º 1
0
 /// <summary>
 /// checks if order has the same stack already. <br/>
 /// does not check if the stack is from the same location. <br/>
 /// so must check that first
 /// </summary>
 /// <param name="stack"></param>
 /// <param name="order"></param>
 /// <returns></returns>
 private bool _checkIfStackIsInOrder(SellableStack stack, Order order)
 {
     if (order == null || order.cart == null || order.cart.Count <= 0 || order.cart.ToList()[0] == null)
     {
         return(true);
     }
     return(!order.cart.Any(s => s.Item.SellableId == stack.Item.SellableId && s.location.LocationId == stack.location.LocationId));
 }
Exemplo n.º 2
0
 /// <summary>
 /// checks if stack is from the same location as the order
 /// </summary>
 /// <param name="stack"></param>
 /// <param name="order"></param>
 /// <returns></returns>
 private bool _checkIfCanAddToOrder(SellableStack stack, Order order)
 {
     if (order == null || order.OrderLocation == null)
     {
         return(true);
     }
     return(stack.location.LocationId == order.OrderLocation.LocationId);
 }