Class RewardRule
- Namespace
- Dynamicweb.Ecommerce.Loyalty
- Assembly
- Dynamicweb.Ecommerce.dll
Represents information about an reward rule.
public class RewardRule
- Inheritance
-
RewardRule
- Inherited Members
Constructors
RewardRule()
Initializes a new instance of the class.
public RewardRule()
RewardRule(Reward)
Initializes a new instance of the class.
[Obsolete("Use other constructor instead.")]
public RewardRule(Reward sourceReward)
Parameters
sourceReward
Reward- The reward.
RewardRule(IDataReader)
Initializes a new instance of the class.
[Obsolete("This method is no longer used.")]
public RewardRule(IDataReader dataReader)
Parameters
dataReader
IDataReader- The data reader.
Properties
Active
Gets or sets the value indicating whether the rule is active.
public bool Active { get; set; }
Property Value
Country
Gets or sets the country of the rule.
[Obsolete("Use GetCountry or SetCountry instead.")]
public Country Country { get; set; }
Property Value
CountryCode2
Gets or sets the country code of the country.
public string CountryCode2 { get; set; }
Property Value
Remarks
The rule is valid for
null
is all countries.Id
Gets or sets the reward rule id.
public int Id { get; set; }
Property Value
IsNew
Indicates whether the instance is new (not saved).
public bool IsNew { get; }
Property Value
Language
Gets or sets the language of the rule.
[Obsolete("Use GetLanguage or SetLanguage instead.")]
public Language Language { get; set; }
Property Value
LanguageId
Gets or sets the Id of the language.
public string LanguageId { get; set; }
Property Value
Remarks
The reward rule is valid for
null
is all languages.Name
Gets or sets the name.
public string Name { get; set; }
Property Value
OrderFieldName
Gets or sets the name of order field of the rule.
public string OrderFieldName { get; set; }
Property Value
OrderFieldValue
Gets or sets the required value of the order field specified in the OrderFieldName property.
public string OrderFieldValue { get; set; }
Property Value
OrderLineFieldName
Gets or sets the name of order field of the rule.
public string OrderLineFieldName { get; set; }
Property Value
OrderTotalPrice
Gets or sets the order total price condition.
public double OrderTotalPrice { get; set; }
Property Value
Remarks
Default value is 0.00
OrderTotalPriceCondition
Gets or sets the conditional operator for comparing the order total price.
public OrderTotalPriceCondition OrderTotalPriceCondition { get; set; }
Property Value
Payment
Gets or sets the payment of the rule.
[Obsolete("Use GetPayment or SetPayment instead.")]
public Payment Payment { get; set; }
Property Value
PaymentId
Gets or sets the Id of the payment.
public string PaymentId { get; set; }
Property Value
Remarks
The rule is valid for
null
is all payments.ProductQuantification
Gets or sets the product quantification.
public ProductQuantification ProductQuantification { get; set; }
Property Value
Remarks
The rule uses when validating product quantities.
ProductQuantity
Gets or sets the product quantity required for the rule to be valid.
public double ProductQuantity { get; set; }
Property Value
ProductsAndGroupsIds
Gets or sets the ids for products and the groups.
public string ProductsAndGroupsIds { get; set; }
Property Value
Reward
[Obsolete("Use GetReward or SetReward instead.")]
public Reward Reward { get; set; }
Property Value
RewardId
Gets or sets the reward id.
public int RewardId { get; set; }
Property Value
Shipping
Gets or sets the shipping of the rule.
[Obsolete("Use GetShipping or SetShipping instead.")]
public Shipping Shipping { get; set; }
Property Value
ShippingId
Gets or set the Id of the shipping.
public string ShippingId { get; set; }
Property Value
Remarks
The rule is valid for
null
is all shipping.Shop
Gets or sets the shop of the rule.
[Obsolete("Use GetShop or SetShop instead.")]
public Shop Shop { get; set; }
Property Value
ShopId
Gets or sets the Id of the shop.
public string ShopId { get; set; }
Property Value
Remarks
The reward rule is valid for
null
is all shops.User
Gets or sets the user of the rule.
[Obsolete("Use GetUser or SetUser instead.")]
public User User { get; set; }
Property Value
UserCustomerNumber
Gets or sets the customer number.
public string UserCustomerNumber { get; set; }
Property Value
Remarks
The rule is valid for
null
is all customer numbers.UserGroup
Gets or sets the user group of the rule.
[Obsolete("Use GetUserGroup or SetUserGroup instead.")]
public Group UserGroup { get; set; }
Property Value
UserGroupId
Gets or sets the Id of the user group.
public int? UserGroupId { get; set; }
Property Value
- int?
Remarks
The rule is valid for
null
is all user groups.UserId
Gets or sets the Id of the user.
public int? UserId { get; set; }
Property Value
- int?
Remarks
The rule is valid for
null
is all users.ValidFrom
Gets or sets start publication date.
public DateTime? ValidFrom { get; set; }
Property Value
ValidTo
Gets or sets end publication date.
public DateTime? ValidTo { get; set; }
Property Value
VoucherList
Gets or sets the voucher list.
[Obsolete("Use GetVoucherList or SetVoucherList instead.")]
public VoucherList VoucherList { get; set; }
Property Value
Exceptions
- Exception
- If not the OrderFieldName property is set to "OrderVoucherCode" and the value is not set to null an exception will be thrown.
VoucherListId
Gets or sets the voucher list id.
public int? VoucherListId { get; set; }
Property Value
- int?
Methods
Delete()
Deletes the current instance.
[Obsolete("Use Services.Loyalty.DeleteRewardRule() instead.")]
public void Delete()
Delete(int)
[Obsolete("Use Services.Loyalty.DeleteRewardRule instead.")]
public void Delete(int id)
Parameters
id
int
Fill(IDataReader)
Fills the reward rules properties.
[Obsolete("This method is no longer used.")]
public void Fill(IDataReader reader)
Parameters
reader
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
GetCountry()
Gets the country of the rule.
public Country GetCountry()
Returns
GetLanguage()
Gets the language of the rule.
public Language GetLanguage()
Returns
GetPayment()
Gets the payment of the rule.
public Payment GetPayment()
Returns
GetReward()
Gets the reward of the rule.
public Reward GetReward()
Returns
GetRewardRuleById(int)
Gets the reward rule by id.
[Obsolete("Use Services.Loyalty.GetRewardRuleById() instead.")]
public static RewardRule GetRewardRuleById(int id)
Parameters
id
int- The reward id.
Returns
- RewardRule
- The RewardRule.
GetRulesForReward(int)
Gets rules for the reward id.
[Obsolete("Use Services.Loyalty.GetRulesForReward() instead.")]
public static RewardRuleCollection GetRulesForReward(int rewardId)
Parameters
rewardId
int- The reward id.
Returns
GetShipping()
Gets the shipping of the rule.
public Shipping GetShipping()
Returns
GetShop()
Gets the shop of the rule.
public Shop GetShop()
Returns
GetUser()
Gets the user of the rule.
public User GetUser()
Returns
GetUserGroup()
Gets the user group of the rule.
public Group GetUserGroup()
Returns
GetVoucherList()
Gets the voucher list of the rule.
public VoucherList GetVoucherList()
Returns
Load(int)
[Obsolete("Services.Loyalty.GetRewardRuleById instead.")]
public void Load(int id)
Parameters
id
int
LoadRulesForRewards(RewardCollection)
Loads rules for specified rewards.
[Obsolete("Use Services.Loyalty.LoadRulesForRewards() instead.")]
public static void LoadRulesForRewards(RewardCollection rewards)
Parameters
rewards
RewardCollection- The RewardCollection.
Save()
Saves current instance to the data base.
[Obsolete("Use Services.Loyalty.SaveRewardRule() instead.")]
public void Save()
set_ID(int)
[Obsolete("Use Id")]
public void set_ID(int value)
Parameters
value
int
SetCountry(Country)
Sets the country of the rule.
public void SetCountry(Country value)
Parameters
value
Country
SetLanguage(Language)
Sets the language of the rule.
public void SetLanguage(Language value)
Parameters
value
Language
SetPayment(Payment)
Sets the payment of the rule.
public void SetPayment(Payment value)
Parameters
value
Payment
SetReward(Reward)
Sets the reward of the rule.
public void SetReward(Reward value)
Parameters
value
Reward
SetShipping(Shipping)
Sets the shipping of the rule.
public void SetShipping(Shipping value)
Parameters
value
Shipping
SetShop(Shop)
Sets the shop of the rule.
public void SetShop(Shop value)
Parameters
value
Shop
SetUser(User)
Sets the user of the rule.
public void SetUser(User value)
Parameters
value
User
SetUserGroup(Group)
Sets the user group of the rule.
public void SetUserGroup(Group value)
Parameters
value
Group
SetVoucherList(VoucherList)
Sets the voucher list of the rule.
public void SetVoucherList(VoucherList voucherList)
Parameters
voucherList
VoucherList