/// <summary> /// Updates the ShippingByTotal /// </summary> /// <param name="ShippingByTotalID">The ShippingByTotal identifier</param> /// <param name="ShippingMethodID">The shipping method identifier</param> /// <param name="From">The "from" value</param> /// <param name="To">The "to" value</param> /// <param name="UsePercentage">A value indicating whether to use percentage</param> /// <param name="ShippingChargePercentage">The shipping charge percentage</param> /// <param name="ShippingChargeAmount">The shipping charge amount</param> /// <returns>ShippingByTotal</returns> public static ShippingByTotal UpdateShippingByTotal(int ShippingByTotalID, int ShippingMethodID, decimal From, decimal To, bool UsePercentage, decimal ShippingChargePercentage, decimal ShippingChargeAmount) { DBShippingByTotal dbItem = DBProviderManager <DBShippingByTotalProvider> .Provider.UpdateShippingByTotal(ShippingByTotalID, ShippingMethodID, From, To, UsePercentage, ShippingChargePercentage, ShippingChargeAmount); ShippingByTotal shippingByTotal = DBMapping(dbItem); return(shippingByTotal); }
/// <summary> /// Inserts a ShippingByTotal /// </summary> /// <param name="shippingByTotal">ShippingByTotal</param> public void InsertShippingByTotal(ShippingByTotal shippingByTotal) { if (shippingByTotal == null) { throw new ArgumentNullException("shippingByTotal"); } _context.ShippingByTotal.AddObject(shippingByTotal); _context.SaveChanges(); }
/// <summary> /// Get a ShippingByTotal /// </summary> /// <param name="ShippingByTotalID">ShippingByTotal identifier</param> /// <returns>ShippingByTotal</returns> public static ShippingByTotal GetByID(int ShippingByTotalID) { if (ShippingByTotalID == 0) { return(null); } DBShippingByTotal dbItem = DBProviderManager <DBShippingByTotalProvider> .Provider.GetByID(ShippingByTotalID); ShippingByTotal shippingByTotal = DBMapping(dbItem); return(shippingByTotal); }
/// <summary> /// Updates the ShippingByTotal /// </summary> /// <param name="shippingByTotal">ShippingByTotal</param> public void UpdateShippingByTotal(ShippingByTotal shippingByTotal) { if (shippingByTotal == null) { throw new ArgumentNullException("shippingByTotal"); } if (!_context.IsAttached(shippingByTotal)) { _context.ShippingByTotal.Attach(shippingByTotal); } _context.SaveChanges(); }
private static ShippingByTotalCollection DBMapping(DBShippingByTotalCollection dbCollection) { if (dbCollection == null) { return(null); } ShippingByTotalCollection collection = new ShippingByTotalCollection(); foreach (DBShippingByTotal dbItem in dbCollection) { ShippingByTotal item = DBMapping(dbItem); collection.Add(item); } return(collection); }
private static ShippingByTotal DBMapping(DBShippingByTotal dbItem) { if (dbItem == null) { return(null); } var item = new ShippingByTotal(); item.ShippingByTotalId = dbItem.ShippingByTotalId; item.ShippingMethodId = dbItem.ShippingMethodId; item.From = dbItem.From; item.To = dbItem.To; item.UsePercentage = dbItem.UsePercentage; item.ShippingChargePercentage = dbItem.ShippingChargePercentage; item.ShippingChargeAmount = dbItem.ShippingChargeAmount; return(item); }
/// <summary> /// Updates the ShippingByTotal /// </summary> /// <param name="shippingByTotal">ShippingByTotal</param> public void UpdateShippingByTotal(ShippingByTotal shippingByTotal) { if (shippingByTotal == null) throw new ArgumentNullException("shippingByTotal"); if (!_context.IsAttached(shippingByTotal)) _context.ShippingByTotal.Attach(shippingByTotal); _context.SaveChanges(); }
/// <summary> /// Inserts a ShippingByTotal /// </summary> /// <param name="shippingByTotal">ShippingByTotal</param> public void InsertShippingByTotal(ShippingByTotal shippingByTotal) { if (shippingByTotal == null) throw new ArgumentNullException("shippingByTotal"); _context.ShippingByTotal.AddObject(shippingByTotal); _context.SaveChanges(); }