示例#1
0
        private Order ReadOrder(SqlDataReader reader)
        {
            Table_DAO    table_DAO    = new Table_DAO();
            Employee_DAO employee_DAO = new Employee_DAO();
            Order        order        = new Order();

            int      orderID   = (int)reader["orderID"];
            Table    table     = table_DAO.DB_GetTableByID((int)reader["tableID"]);
            int      billID    = (int)reader["billID"];
            Employee employee  = employee_DAO.DB_GetEmployeeByID((int)reader["employeeID"]);
            bool     completed = (bool)reader["completed"];
            string   comment   = (string)reader["comment"];

            return(new Order(orderID, table, billID, employee, completed, comment));
        }
示例#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));;
        }