Class PriceInfo
- Namespace
- Dynamicweb.Ecommerce.Prices
- Assembly
- Dynamicweb.Ecommerce.dll
Gives to work with qualified prices.
[Serializable]
public class PriceInfo : IPriceReferenceInfo, IInformativePriceInfo, IPriceInfo, IPriceSourceInfo
- Inheritance
-
PriceInfo
- Implements
- Inherited Members
Constructors
PriceInfo()
Initializes a new instance of the PriceInfo class.
[Obsolete("Use overload with currency instead.")]
public PriceInfo()
PriceInfo(Currency)
Initializes a new instance of the PriceInfo class.
public PriceInfo(Currency currency)
Parameters
currency
Currency
Fields
_vatPercent
protected double _vatPercent
Field Value
Properties
Currency
Gets or sets the currency.
public virtual Currency Currency { get; set; }
Property Value
IsInformative
Gets or sets whether the price is informative.
public virtual bool IsInformative { get; set; }
Property Value
- bool
True
if the price is informative; otherwisefalse
.
Price
Gets the price.
public virtual double Price { get; }
Property Value
PriceFormatted
Gets the formatted price.
public virtual string PriceFormatted { get; }
Property Value
PriceFormattedNoSymbol
Gets the formatted price without symbol.
public virtual string PriceFormattedNoSymbol { get; }
Property Value
PricePIP
Minimum fluctuation or smallest increment of price movement.
public virtual long PricePIP { get; }
Property Value
PriceReference
Gets or sets the price reference.
public virtual string PriceReference { get; set; }
Property Value
PriceSource
Gets or sets a value indicating what price provider generate price.
public PriceSource? PriceSource { get; set; }
Property Value
PriceWithoutVAT
Gets or sets the price without VAT.
public virtual double PriceWithoutVAT { get; set; }
Property Value
PriceWithoutVATFormatted
Gets the price without VAT formatted.
public virtual string PriceWithoutVATFormatted { get; }
Property Value
PriceWithoutVATFormattedNoSymbol
Gets the price without VAT formatted no symbol.
public virtual string PriceWithoutVATFormattedNoSymbol { get; }
Property Value
PriceWithVAT
Gets or sets the price with VAT.
public virtual double PriceWithVAT { get; set; }
Property Value
PriceWithVATFormatted
Gets the price with formatted VAT.
public virtual string PriceWithVATFormatted { get; }
Property Value
PriceWithVATFormattedNoSymbol
Gets the price with formatted VAT without symbol.
public virtual string PriceWithVATFormattedNoSymbol { get; }
Property Value
ReverseChargeForVat
Gets or sets a value indicating whether this PriceInfo has reverse charge for VAT.
public bool ReverseChargeForVat { get; set; }
Property Value
- bool
true
if the price has reverse charge for VAT; otherwise,false
.
VAT
Gets or sets the VAT.
public virtual double VAT { get; set; }
Property Value
VATFormatted
Gets the formatted VAT
public virtual string VATFormatted { get; }
Property Value
VATFormattedNoSymbol
Gets the formatted VAT without symbol.
public virtual string VATFormattedNoSymbol { get; }
Property Value
VATPercent
Gets or sets the VAT percent.
public virtual double VATPercent { get; set; }
Property Value
VATPercentFormatted
Gets the VAT percent as string with percent symbol.
public virtual string VATPercentFormatted { get; }
Property Value
Methods
Add(IPriceInfo)
Adds the specified price information.
public virtual PriceInfo Add(IPriceInfo info)
Parameters
info
IPriceInfo- The price information.
Returns
Add(IPriceReferenceInfo)
Adds the specified price information from IPriceReferenceInfo.
public virtual PriceInfo Add(IPriceReferenceInfo info)
Parameters
info
IPriceReferenceInfo- The price reference information.
Returns
Add(IWithPrice)
Adds the specified priceholder.
[Obsolete("Use overload without IWithPrice instead.")]
public virtual PriceInfo Add(IWithPrice priceHolder)
Parameters
priceHolder
IWithPrice- The priceholder.
Returns
ConvertToPIP(double)
Gets the PIP.
[Obsolete("Use PriceHelper.ConvertToPIP(Currency, Double) instead.")]
public static long ConvertToPIP(double amount)
Parameters
amount
double- The amount.
Returns
- long
- The PIP.
Divide(double)
Divides the specified factor.
public virtual PriceInfo Divide(double factor)
Parameters
factor
double- The factor.
Returns
HasSamePrice(PriceInfo)
Determines that the prices are same.
public virtual bool HasSamePrice(PriceInfo priceInfo)
Parameters
Returns
- bool
true
if prices are same, otherwise -false
.
Multiply(double)
Multiplies the specified factor.
public virtual PriceInfo Multiply(double factor)
Parameters
factor
double- The factor.
Returns
Multiply(double, int)
public virtual PriceInfo Multiply(double factor, int roundingDecimals)
Parameters
Returns
Substract(IPriceInfo)
Substracts the specified info.
public virtual PriceInfo Substract(IPriceInfo info)
Parameters
info
IPriceInfo- The price info.
Returns
Substract(IPriceReferenceInfo)
Substracts the specified info from IPriceReferenceInfo.
public virtual PriceInfo Substract(IPriceReferenceInfo info)
Parameters
info
IPriceReferenceInfo- The price reference info.
Returns
Substract(IWithPrice)
Substracts the specified priceholder.
[Obsolete("Use overload without IWithPrice instead.")]
public virtual PriceInfo Substract(IWithPrice priceHolder)
Parameters
priceHolder
IWithPrice- The priceholder.
Returns
ToPrice(Currency)
Convert current price to price with new currency.
public PriceInfo ToPrice(Currency toCurrency)
Parameters
toCurrency
Currency- New currency.
Returns
- PriceInfo
- Returns new PriceInfo class if succefull, otherwise Nothing.
ToString()
Returns a string that represents this instance.
public override string ToString()