static void ShowOrder(AccountBook book, int id) { OrderForm order = book.GetOrder(id); if (order != null) { Console.WriteLine(order); } else { Console.WriteLine("没有找到订单ID " + id); } }
static void ShowOrder(AccountBook book, string name) { List <OrderForm> l = book.GetOrder(name); if (l == null || l.Count == 0) { Console.WriteLine("没有找到订单Name " + name); return; } for (int i = 0; i < l.Count; ++i) { Console.Write(l[i]); Console.Write(" "); } Console.WriteLine(); }