public bool isDeliver(ClientOrder clientOrder) { if (clientOrder.getStatus().Equals("Доставлено")) { return(true); } else { return(false); } }
public void deleteOrder(ClientOrder clientOrder) { if (clientOrder.getStatus().Equals("Доставлено") || clientOrder.getStatus().Equals("Заказ отклонен")) { ClientOrderList.getInstance().Orders.Remove(clientOrder); return; } if (clientOrder.getIsFull()) { int count = 0; Store.getInstance().Products.TryGetValue(clientOrder.Product, out count); Store.getInstance().Products.Remove(clientOrder.Product); Store.getInstance().Products.Add(clientOrder.Product, count + clientOrder.getQuantity()); } else { int count = 0; Store.getInstance().Products.TryGetValue(clientOrder.Product, out count); Store.getInstance().Products.Remove(clientOrder.Product); Store.getInstance().Products.Add(clientOrder.Product, count + clientOrder.getQuantity() - clientOrder.getCountToEnd()); } ClientOrderList.getInstance().Orders.Remove(clientOrder); }