public void viewOrder(String name) { Order order = orderDatabase.getOrder(name); if (order == null) { lblNotification.ForeColor = Color.Red; lblNotification.Text = "Đơn hàng không tồn tại!"; } else { lblNotification.Text = ""; for (int i = 0; i < order.getFoodList().Count; i++) { Food food = order.getFoodList().ElementAt <Food>(i); string[] arr = new string[3]; arr[0] = food.id.ToString(); arr[1] = food.name; arr[2] = food.amount.ToString(); ListViewItem l1 = new ListViewItem(arr); vbOrderInfo.Items.Add(l1); } } }
public String checkOrderState(int id) { Order order = orderDatabase.getOrder(id); if (order == null) { return("Bạn không có đơn hàng nào cả!"); } switch (order.getState()) { case State.WAITING: return("Đang chờ để xử lý!"); case State.DOING: return("Đang được xử lý!"); default: return("Đã xong. Vui lòng \nđến quầy hàng để nhận hàng!"); } }