public bool CheckCurrentOrder() { var temp = CurrentOrder.IsEmpty(); if (temp) { AllOrders.Remove(CurrentOrder); CurrentOrder = new Order(CurrentUser); AllOrders.Add(CurrentOrder); } return(temp); }
public void GetNewDay() { Today = Today.AddDays(1); for (int i = 0; i < Clients.Count; ++i) { for (int j = 0; j < Clients[i].Orders.Count; ++j) { if (Clients[i].Orders[j].End.Date == Today.Date) { AllOrders.Remove(Clients[i].Orders[j]); Clients[i].Orders[j].Status = "Готово. Заберите заказ."; } } } for (int i = 0; i < Masters.Count; ++i) { if (Masters[i].Busy > 0) { Masters[i].Busy--; AllMasters[i].Busy--; } } }
public void CheckOrders(object obj, EventArgs args) { var temp = new List <Order>(AllOrders.ToArray()); foreach (var item in temp) { if (item.IsEmpty()) { if (item == CurrentOrder) { CurrentOrder = new Order(CurrentUser); AllOrders.Remove(item); AllOrders.Add(CurrentOrder); } else { AllOrders.Remove(item); var order = new Order(item.CurrentUser); AllOrders.Add(order); } } } }