public void RefreshNewOrders() { NewOrders.Clear(); // remove all previous List <NewOrderWPF> NOs = local_lckComm.GetNewOrders(); if (NOs == null) { return; } int idx = 1; foreach (NewOrderWPF no in NOs) { // only add entries added from the other location if (no.StoreOrigin.Id != Globals.SelectedStore.Id) { no.PrintSpecialOrder += PrintSO_Event; no.RemoveNewOrder += RemoveNewOrder; no.ID_UI = idx; NewOrders.Add(no); idx++; } } // notify WCF_CommManager that new orders has changed NewOrder_Event(); }
public void Reload_Orders() { NewOrders.Clear(); foreach (var order in IoC.Application_Work.All_Orders) { if (order.Status == StatusOfProduct.Inpprocessing) { NewOrders.Add(Make_UserProductsViewModel(order)); } } }
/// <summary> /// This is used to update orders that are ready to process by the restaurant /// </summary> /// <returns></returns> private async Task UpdateReadyToProcessOrders() { try { var readyOrders = await GetReadyOrdersAsync(); readyOrders = readyOrders.Where(r => NewOrders.All(o => o.Order.OrderId != r.OrderId)); foreach (var order in readyOrders) { var newOrder = new OrderViewModel(order); newOrder.OrderViewRequested += NewOrder_OrderViewRequested; NewOrders.Add(newOrder); } } catch { // ignored } }
public void Set_Orders() { NewOrders.Clear(); ConfirmOrders.Clear(); CurrentOrders.Clear(); foreach (var order in IoC.Application_Work.All_Orders) { if (order.Status == StatusOfProduct.Inpprocessing || order.Status == StatusOfProduct.HoldDispetcherToDriverAccept) { NewOrders.Add(Make_UserProductsViewModel(order)); } else if (order.Status == StatusOfProduct.Current) { CurrentOrders.Add(Make_UserProductsViewModel(order)); } else if (order.Status == StatusOfProduct.Completed) { ConfirmOrders.Add(Make_UserProductsViewModel(order)); } } }
public void Add_New_Order(UserProductsViewModel userProductsViewModel) { NewOrders.Add(userProductsViewModel); }