public List <OrderItem> GetById(int order_id) { try { return(orderItemDAO.GetOrderItemsById(order_id)); } catch { ErrorHandler error = new ErrorHandler("Couldn't read the Order Item from the Database!"); return(null); } }
public List <Table> GetAllTables() { List <Table> tables = null; try { tables = tableDAO.Db_Get_AllTables(); foreach (Table t in tables) //loop through all the tables { if (t.order != null) //if the order is not null, read the orderItems for that order { t.order.ListOrderItems = orderItemDAO.GetOrderItemsById(t.order.OrderID); } } } catch { new ErrorHandler("Couldn't read the Tables from the Database!"); } return(tables); }