private void UpdateItemTerminalKey(Item inItem) { // set item status to normal DbOrderItem.UpdateOrderItemStatus(inItem.OrderItemKey, OrderStatus.Normal); // update terminalKey for the item DbOrderItem.UpdateOrderItemTerminalKey(inItem.OrderItemKey, _outputTerminal.TerminalId); }
public void AddRecallOrder(Order inOrder) { lock (_syncRoot) { var order = DbOrder.GetOrder(inOrder.OrderKey, 0, true); AnalyticalData.CurrentOrdersCount++; AnalyticalData.CurrentItems += order.Items.Count; TimeSpan recalledOrderMakeTime = order.BumpTime - order.ArrivalTime; AnalyticalData.TotalMakeTime = new TimeSpan(AnalyticalData.TotalMakeTime.Ticks - recalledOrderMakeTime.Ticks); foreach (var item in order.Items) { DbOrderItem.UpdateOrderItemTerminalKey(item.OrderItemKey, CurrenTerminal.TerminalId); } TotalOrders.Add(order); PublishAddOrder(order); } }
public void BumpOrder(Order inOrder) { var order = ChefmateController.Instance.TotalOrders.FirstOrDefault(s => s.OrderKey == inOrder.OrderKey); foreach (var group in order.DisplayGroups) { if (group.OrderStatus != OrderStatus.Bumped && group.OrderStatus != OrderStatus.Canceled) { BumpGroup(group, true); } } if (ChefmateController.Instance.CurrentSettings.OutputTerminal <= 0) { foreach (var item in order.Items) { if (item.OrderItemKey > 0) { DbOrderItem.UpdateOrderItemTerminalKey(item.OrderItemKey, 0); } } } if (ChefmateController.Instance.CurrentSettings.OutputTime == OutputTime.OrderBumped) { OutputOrder(order); } if (order.OrderState == OrderState.Complete || order.OrderState == OrderState.Runner) { ChefmateController.Instance.AnalyticalData.CurrentItems -= order.Items.Count; ChefmateController.Instance.AnalyticalData.CurrentOrdersCount--; var currentOrderMakeTime = DateTime.Now.Subtract(order.ArrivalTime); ChefmateController.Instance.AnalyticalData.TotalMakeTime = new TimeSpan(ChefmateController.Instance.AnalyticalData.TotalMakeTime.Ticks + currentOrderMakeTime.Ticks); } ChefmateController.Instance.RemoveOrder(order); if (order.OrderKey > 0) { DbOrder.OrderBumped(order.OrderKey, DateTime.Now); } }