Esempio n. 1
0
        /// <summary>
        /// Purpose: Grabs order item information based on ID
        /// Accepts: Int
        /// Returns: Nothing
        /// </summary>
        public void GetOrderItemByID(int id)
        {
            try
            {
                OrderItemData data = new OrderItemData();
                Hashtable hsh = new Hashtable();

                hsh = data.GetOrderItemByID(id);

                OrderItemID = id;
                OrderID = hsh["orderid"];
                ProductCode = hsh["productcode"];
                Created = hsh["created"];
                Modified = hsh["modified"];
            }
            catch (Exception ex)
            {
                ErrorRoutine(ex, "OrderItem", "GetOrderItemByID");
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Purpose: Grabs all order items
        /// Accepts: Nothing
        /// Returns: List<OrderItem>
        /// </summary>
        public List<OrderItem> GetAllOrderItems()
        {
            List<OrderItem> orderitems = new List<OrderItem>();
            try
            {
                OrderItemData data = new OrderItemData();
                List<QSRDataObjects.OrderItem> dataOrderItems = data.GetAllOrderItems();

                foreach (QSRDataObjects.OrderItem oi in dataOrderItems)
                {
                    OrderItem order = new OrderItem();
                    order.OrderItemID = oi.OrderItemID;
                    order.OrderID = oi.OrderID;
                    order.ProductCode = oi.ProductCode;
                    order.Created = oi.Created;
                    order.Modified = oi.Modified;
                    orderitems.Add(order);
                }
            }
            catch (Exception ex)
            {
                ErrorRoutine(ex, "OrderItem", "GetAllOrderItems");
            }
            return orderitems;
        }