Example #1
0
        private BestelItem Readitem(SqlDataReader reader)
        {
            MenuItem_DAO get_menu_item = new MenuItem_DAO();

            int id = (int)reader["order_id"];
            MenuItem menu_item = get_menu_item.GetForID((int)reader["item_id"]);            // Haal item id op uit database, geef deze aan DALMenuItem.GetForID en krijg return
            int aantal = (int)reader["aantal"];
            string opmerking = (string)reader["opmerking"];
            Status status_item = (Status)(int)reader["status"];

            return new BestelItem(id, menu_item, aantal, opmerking, status_item);
        }
Example #2
0
        private OrderItem ReadOrderItem(SqlDataReader reader)
        {
            MenuItem_DAO menuItem_DAO = new MenuItem_DAO();
            Table_DAO    table_DAO    = new Table_DAO();

            int        orderItemID     = (int)reader["oderItemID"];
            int        orderID         = (int)reader["orderID"];
            MenuItem   menuItem        = menuItem_DAO.DB_GetMenuItemByID((int)reader["menuItemID"]);
            int        quantity        = (int)reader["quantity"];
            string     requests        = (string)reader["requests"];
            OrderState orderState      = (OrderState)reader["orderState"];
            TimeSpan   lastStateChange = (TimeSpan)reader["lastStateChange"];
            Table      table           = table_DAO.DB_GetTableByID((int)reader["tableID"]);

            return(new OrderItem(orderItemID, orderID, menuItem, quantity, requests, orderState, table, lastStateChange));;
        }