Пример #1
0
  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;
  }
Пример #2
0
 public void update() {
   for (Order o : PendingOrders) {
     if (o.getClient().getStateConstant() == CCState.Approved) {
       ApprovedOrders.add(PendingOrders.get(PendingOrders.indexOf(o)));
     }
   }
 }
Пример #3
0
 public void add(Order order) {
   if (order.getClient().getStateConstant() == CCState.Pending) PendingOrders.add(order);
   else ApprovedOrders.add(order);
 }