Dynamicweb 8 Documentation
PriceInfo Class
Members  Example 

Gives to work with qualified prices.
Object Model
PriceInfo ClassCurrency Class
Syntax
'Declaration
 
<SerializableAttribute()> 
Public Class PriceInfo 
   Implements IPriceInfo 
[SerializableAttribute()] 
public class PriceInfo : 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 double VAT
   {
       get { return _VAT; }
       set { _VAT = value; }
   }

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

   public 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;
   }
}
Inheritance Hierarchy

System.Object
   Dynamicweb.eCommerce.Prices.PriceInfo
      Dynamicweb.eCommerce.Prices.PriceCalculated

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

PriceInfo Members
Dynamicweb.eCommerce.Prices Namespace

Send Feedback