private void SetOrderStatusAsInProgressOrReadyToDelivery(Guid orderId) { var orderLines = _orderApi.GetOrderLinesWithOrderId(orderId); bool flag = false; foreach (var orderLine in orderLines) { if (orderLine.Ready == false) { flag = true; break; } } if (flag == true) { _orderApi.StartProgress(orderId); } else { _orderApi.TransferToDelivery(orderId); } }