コード例 #1
0
        /// <summary>
        /// Purpose: Grabs delivery type information based on ID
        /// Accepts: Int
        /// Returns: Hashtable
        /// </summary>
        public Hashtable GetDeliveryTypeByID(int id)
        {
            DeliveryType obj = new DeliveryType();
            QuickStart_DBEntities dbContext;
            Hashtable hsh = new Hashtable();
            try
            {
                dbContext = new QuickStart_DBEntities();
                obj = dbContext.DeliveryTypes.FirstOrDefault(d => d.DeliveryTypeID == id);
                if (obj != null)
                {
                    hsh["deliverytypeid"] = obj.DeliveryTypeID;
                    hsh["name"] = obj.Name;
                    hsh["description"] = obj.Description;
                    hsh["cost"] = obj.Cost;
                    hsh["created"] = obj.Created;
                    hsh["modified"] = obj.Modified;
                }
            }
            catch (Exception ex)
            {
                ErrorLoggerData.ErrorRoutine(ex, "DeliveryTypeData", "GetDeliveryTypeByID");
            }

            return hsh;
        }
コード例 #2
0
 /// <summary>
 /// Deprecated Method for adding a new object to the DeliveryTypes EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToDeliveryTypes(DeliveryType deliveryType)
 {
     base.AddObject("DeliveryTypes", deliveryType);
 }
コード例 #3
0
 /// <summary>
 /// Create a new DeliveryType object.
 /// </summary>
 /// <param name="deliveryTypeID">Initial value of the DeliveryTypeID property.</param>
 public static DeliveryType CreateDeliveryType(global::System.Int32 deliveryTypeID)
 {
     DeliveryType deliveryType = new DeliveryType();
     deliveryType.DeliveryTypeID = deliveryTypeID;
     return deliveryType;
 }