Пример #1
0
        /// <summary>
        /// Purpose: Grabs orderitem information based on ID
        /// Accepts: Int
        /// Returns: Hashtable
        /// </summary>
        public Hashtable GetOrderItemByID(int id)
        {
            OrderItem obj = new OrderItem();
            QuickStart_DBEntities dbContext;
            Hashtable hsh = new Hashtable();
            try
            {
                dbContext = new QuickStart_DBEntities();
                obj = dbContext.OrderItems.FirstOrDefault(o => o.OrderItemID == id);
                if (obj != null)
                {
                    hsh["orderitemid"] = obj.OrderItemID;
                    hsh["orderid"] = obj.OrderID;
                    hsh["productcode"] = obj.ProductCode;
                    hsh["quantity"] = obj.Quantity;
                    hsh["created"] = obj.Created;
                    hsh["modified"] = obj.Modified;
                }
            }
            catch (Exception ex)
            {
                ErrorLoggerData.ErrorRoutine(ex, "OrderItemData", "GetOrderItemByID");
            }

            return hsh;
        }
 /// <summary>
 /// Deprecated Method for adding a new object to the OrderItems EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToOrderItems(OrderItem orderItem)
 {
     base.AddObject("OrderItems", orderItem);
 }
 /// <summary>
 /// Create a new OrderItem object.
 /// </summary>
 /// <param name="orderItemID">Initial value of the OrderItemID property.</param>
 public static OrderItem CreateOrderItem(global::System.Int32 orderItemID)
 {
     OrderItem orderItem = new OrderItem();
     orderItem.OrderItemID = orderItemID;
     return orderItem;
 }