Class Reward
- Namespace
- Dynamicweb.Ecommerce.Loyalty
- Assembly
- Dynamicweb.Ecommerce.dll
Represents information about an reward.
public class Reward
- Inheritance
-
Reward
- Inherited Members
Constructors
Reward()
Initializes a new instance of the class.
public Reward()
Reward(RewardType)
Initializes a new instance of the class and sets the Type.
public Reward(RewardType newReward)
Parameters
newReward
RewardType- The RewardType.
Reward(IDataReader)
Initializes a new instance of the class from the data reader.
[Obsolete("This method is no longer used.")]
public Reward(IDataReader dataReader)
Parameters
dataReader
IDataReader- The data reader.
Properties
Active
Gets or sets the value indicating whether the state of reward is active.
public bool Active { get; set; }
Property Value
CurrencyCode
Gets or sets the Currency code.
public string CurrencyCode { get; set; }
Property Value
DefaultName
Gets or sets the default name.
public string DefaultName { get; set; }
Property Value
Id
Gets or sets the reward id.
public int Id { get; set; }
Property Value
IsArchived
Gets or sets the value indicating when the reward is archived.
public bool IsArchived { get; set; }
Property Value
IsLocalized
Gets the value indicating whether reward is localized.
[Obsolete("Use Translations instead.")]
public bool IsLocalized { get; }
Property Value
IsNew
Indicates whether the instance is new (not saved).
public bool IsNew { get; }
Property Value
Language
Gets the language for this reward.
[Obsolete("Use Translations instead.")]
public Language Language { get; }
Property Value
Name
Gets or sets the reward name.
[Obsolete("Use GetName or SetName instead.")]
public string Name { get; set; }
Property Value
Percentage
Gets or sets percentage.
public double Percentage { get; set; }
Property Value
Points
Gets or sets the number of pounts for reward.
public double Points { get; set; }
Property Value
RoundingId
Gets or sets id of rounding object.
public string RoundingId { get; set; }
Property Value
Rules
Gets or sets collection of the rules for reward.
[Obsolete("Use Services.Loyalty.GetRulesForReward() instead.")]
public RewardRuleCollection Rules { get; set; }
Property Value
Translations
Gets the reward translations.
public TranslationCollection<RewardTranslation> Translations { get; }
Property Value
Type
Gets or sets the type of the reward.
public RewardType Type { get; set; }
Property Value
Methods
ClearCache()
Remove all rewards from cache.
[Obsolete("Use Services.Loyalty.ClearRewardCache() instead.")]
public static void ClearCache()
Delete()
Deletes the current reward.
[Obsolete("Use Services.Loyalty.DeleteReward() instead.")]
public void Delete()
Delete(int)
[Obsolete("Use Services.Loyalty.DeleteReward instead.")]
public void Delete(int id)
Parameters
id
int
Fill(IDataReader)
Fills the reward properties from the specified data reader.
[Obsolete("This method is no longer used.")]
public void Fill(IDataReader dataReader)
Parameters
dataReader
IDataReader- The data reader.
FillRow(DataRow)
Fills the given System.Data.DataRow object with property values of the current object.
[Obsolete("This method is no longer used.")]
protected void FillRow(DataRow row)
Parameters
row
DataRow- An instance of the System.Data.DataRow object to write data to.
get_ID()
[Obsolete("Use Id")]
public int get_ID()
Returns
GetName(string)
Gets the translated name in specified language
public string GetName(string languageId)
Parameters
languageId
string
Returns
GetRewardById(int)
Gets reward by ID.
[Obsolete("Use Services.Loyalty.GetRewardById() instead.")]
public static Reward GetRewardById(int rewardId)
Parameters
rewardId
int- The reward id.
Returns
- Reward
- The reward.
GetRewardById(int, string)
Gets the reward by reward id and language Id.
[Obsolete("Use Services.Loyalty.GetRewardById() instead.")]
public static Reward GetRewardById(int rewardId, string languageId)
Parameters
Returns
- Reward
- The reward.
GetRewards(bool)
Return all rewards.
[Obsolete("Use Services.Loyalty.GetRewards() instead.")]
public static RewardCollection GetRewards(bool force)
Parameters
force
bool- Force cahce update.
Returns
GetRewards(bool, string, bool?, RewardCollectionSortDirection, RewardCollectionSortBy)
Return all rewards.
[Obsolete("Use Services.Loyalty.GetRewards() instead.")]
public static RewardCollection GetRewards(bool force, string languageId, bool? archiveMode = null, RewardCollectionSortDirection sortDirection = RewardCollectionSortDirection.Ascending, RewardCollectionSortBy SortBy = RewardCollectionSortBy.Name)
Parameters
force
bool- Force cahce update.
languageId
string- The language id.
archiveMode
bool?- The archive mode. Nothing - all, true - archived only, false - unarchived only.
sortDirection
RewardCollectionSortDirectionSortBy
RewardCollectionSortBy
Returns
GetTotalPoints(double, double, double)
Gets the total points.
[Obsolete("Use Services.Loyalty.GetTotalPoints() instead.")]
public double GetTotalPoints(double productsPrice, double productsCount, double divisor)
Parameters
productsPrice
double- The products price.
productsCount
double- The products count.
divisor
double- The divisor.
Returns
- double
- The total points.
Load(int)
[Obsolete("Use Services.Loyalty.GetRewardById instead.")]
public void Load(int id)
Parameters
id
int
LoadRewardsFromUserTransaction(UserTransactionCollection)
Loads the rewards from the user transaction collection.
[Obsolete("Use Services.Loyalty.LoadRewardsFromUserTransaction() instead.")]
public static void LoadRewardsFromUserTransaction(UserTransactionCollection userTransactions)
Parameters
userTransactions
UserTransactionCollection- The collection of user transactions.
RewardUsageCount()
Gets the count of the reward usage.
[Obsolete("Use Services.Loyalty.GetRewardUsageCount() instead.")]
public int RewardUsageCount()
Returns
- int
- Number of the reward usage.
Save()
Saves current reward to the database.
[Obsolete("Use Services.Loyalty.SaveReward() instead.")]
public void Save()
set_ID(int)
[Obsolete("Use Id")]
public void set_ID(int value)
Parameters
value
int
SetName(string, string)
Sets the translated name in specified language
public void SetName(string languageId, string name)
Parameters
SetNewCurrency(Currency)
Sets new currency code and recalculates points count.
[Obsolete("Don't use this.")]
public void SetNewCurrency(Currency currency)
Parameters
currency
Currency- New currency.