/// <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> /// 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); }
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); }