// Send the order to be updated in the database public void SendOrder(int waiterID) { DeleteCurrentOrder(); currentOrder.OrderItems = GetOrderLines(); // call function in the logic layer // This function passes: // 1. OrderId, which is a unique ID for this order // 2. A list of items // Each item in this list has an item id and a quantity // Create a unique order ID by using the current time(stamp) // PS we know this is not 100% guranateed, but will do for now //int orderID = random.Next(); //SaveOrder(currentOrder,waiterID); foreach (OrderItem item in currentOrder.OrderItems) { for (int i = 0; i < item.quantity; i++) { order_db.Db_Insert_Order_Item(currentOrder.id, item.itemID); } } }