Dynamicweb.eCommerce.Prices Namespace > PriceInfo Class > Add Method : Add(IPriceInfo) Method |
'Declaration
Public Overloads Overridable Function Add( _ ByVal info As IPriceInfo _ ) As PriceInfo
public virtual PriceInfo Add( IPriceInfo info )
class MyPage : System.Web.UI.Page { private Dynamicweb.eCommerce.Prices.PriceInfo GetPriceInfo(double priceWithVAT, double priceWithoutVAT, double VATPercent) { Dynamicweb.eCommerce.Prices.PriceInfo info = new Dynamicweb.eCommerce.Prices.PriceInfo(); info.Currency = Dynamicweb.eCommerce.Common.Context.Currency; Dynamicweb.eCommerce.Prices.PriceRaw rp = new Dynamicweb.eCommerce.Prices.PriceRaw(); rp.Price = priceWithoutVAT; rp.Currency = Dynamicweb.eCommerce.Common.Context.Currency; Dynamicweb.eCommerce.Prices.PriceCalculated cp = new Dynamicweb.eCommerce.Prices.PriceCalculated(); cp.PriceRaw = rp; cp.PriceWithoutVAT = priceWithoutVAT; cp.PriceWithVAT = priceWithVAT; cp.VATPercent = VATPercent; cp.VAT = priceWithVAT - priceWithoutVAT; return info.Add(cp); } }
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2