public Order search(String name) { Order _order = null; for (Order o : PendingOrders) { if (o.getClient().getName().equalsIgnoreCase(name)) _order = o; } if (_order == null) { for (Order o : ApprovedOrders) { if (o.getClient().getName().equalsIgnoreCase(name)) _order = o; } } return _order; }
public void update() { for (Order o : PendingOrders) { if (o.getClient().getStateConstant() == CCState.Approved) { ApprovedOrders.add(PendingOrders.get(PendingOrders.indexOf(o))); } } }
public void add(Order order) { if (order.getClient().getStateConstant() == CCState.Pending) PendingOrders.add(order); else ApprovedOrders.add(order); }