Table of Contents

Class Rule

Namespace
Dynamicweb.Ecommerce.Orders.Validation.Rules
Assembly
Dynamicweb.Ecommerce.dll
The class Rule represents validation rule.
[Serializable]
public abstract class Rule
Inheritance
Rule
Inherited Members

Properties

Id

Gets or sets the rule id.
public string Id { get; set; }

Property Value

string

Parameters

Gets or sets rule parameters.
public abstract string Parameters { get; set; }

Property Value

string

ValidationId

Gets or sets Validation id.
public string ValidationId { get; set; }

Property Value

string

Methods

Delete()

Deletes this rule.
public void Delete()

Delete(bool)

Deletes this rule.
public void Delete(bool doKillCache)

Parameters

doKillCache bool
Indicates whether to clear the caches after delete.

GetRules(string)

Gets rules for the provided Validation id.
public static RuleCollection GetRules(string ruleValidationId)

Parameters

ruleValidationId string
The validation id.

Returns

RuleCollection

GetRules(string[])

Gets rules by provided ids.
public static RuleCollection GetRules(string[] ids)

Parameters

ids string[]
The rules ids.

Returns

RuleCollection

GetRulesBySql(string)

Gets rules by sql query..
public static RuleCollection GetRulesBySql(string query)

Parameters

query string
The query.

Returns

RuleCollection

GetRuleTypes()

Gets all the rule types.
public static List<Type> GetRuleTypes()

Returns

List<Type>

GetRuleTypes(bool)

Gets all the rule types.
public static List<Type> GetRuleTypes(bool doSort)

Parameters

doSort bool
Indicates whether to sort rules.

Returns

List<Type>

Save()

Saves this rule.
public void Save()

Save(bool)

Saves this rule.
public void Save(bool doKillCache)

Parameters

doKillCache bool
Indicates whether to clear the caches after save.

TryParse(string, ref double)

protected bool TryParse(string value, ref double result)

Parameters

value string
result double

Returns

bool

Validates(string)

Validates value with rule.
public abstract bool Validates(string value)

Parameters

value string
The value to validate.

Returns

bool
Value indicating whether value valid according to rule.
To top