Dynamicweb 8 Documentation
IPriceInfo Interface
Members  Example 

PriceInfo interface.
Object Model
IPriceInfo InterfaceCurrency Class
Syntax
'Declaration
 
Public Interface IPriceInfo 
public interface IPriceInfo 
Example
class MyPage : System.Web.UI.Page
{
   private double _VAT;
   private double _VATPercent = 0.0;
   private double _PriceWithVAT = 0.0;
   private double _PriceWithoutVAT = 0.0;
   private Dynamicweb.eCommerce.International.Currency _Currency = Dynamicweb.eCommerce.Common.Context.Currency;

   public virtual double VAT
   {
       get { return _VAT; }
       set { _VAT = value; }
   }

   public virtual double PriceWithoutVAT
   {
       get { return _PriceWithoutVAT; }
       set { _PriceWithoutVAT = value; }
   }

   public virtual double PriceWithVAT
   {
       get { return _PriceWithVAT; }
       set { _PriceWithVAT = value; }
   }

   public Dynamicweb.eCommerce.International.Currency Currency
   {
       get { return _Currency; }
       set { _Currency = value; }
   }


   public Dynamicweb.eCommerce.Prices.PriceInfo Substract(Dynamicweb.eCommerce.Prices.IPriceInfo info)
   {
       if (Currency.Code != info.Currency.Code)
       {
           throw new Dynamicweb.eCommerce.Prices.PriceInfoCurrencyException();
       }
       Dynamicweb.eCommerce.Prices.PriceInfo resinfo = new Dynamicweb.eCommerce.Prices.PriceInfo();
       resinfo.PriceWithVAT = _PriceWithVAT - info.PriceWithVAT;
       resinfo.PriceWithoutVAT = _PriceWithoutVAT - info.PriceWithoutVAT;
       resinfo.VAT = _VAT - info.VAT;
       resinfo.VATPercent = (resinfo.VAT / resinfo.PriceWithoutVAT) * 100;
       resinfo.Currency = Currency;
       return resinfo;
   }
}
Requirements

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

See Also

Reference

IPriceInfo Members
Dynamicweb.eCommerce.Prices Namespace

Send Feedback