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
Parameters
Gets or sets rule parameters.
  
  public abstract string Parameters { get; set; }
  Property Value
ValidationId
Gets or sets Validation id.
  
  public string ValidationId { get; set; }
  Property Value
Methods
Delete()
Deletes this rule.
  
  public void Delete()
  Delete(bool)
Deletes this rule.
  
  public void Delete(bool doKillCache)
  Parameters
doKillCachebool- Indicates whether to clear the caches after delete.
 
GetRules(string)
Gets rules for the provided Validation id.
  
  public static RuleCollection GetRules(string ruleValidationId)
  Parameters
ruleValidationIdstring- The validation id.
 
Returns
GetRules(string[])
Gets rules by provided ids.
  
  public static RuleCollection GetRules(string[] ids)
  Parameters
idsstring[]- The rules ids.
 
Returns
GetRulesBySql(string)
Gets rules by sql query..
  
  public static RuleCollection GetRulesBySql(string query)
  Parameters
querystring- The query.
 
Returns
GetRuleTypes()
Gets all the rule types.
  
  public static List<Type> GetRuleTypes()
  Returns
GetRuleTypes(bool)
Gets all the rule types.
  
  public static List<Type> GetRuleTypes(bool doSort)
  Parameters
doSortbool- Indicates whether to sort rules.
 
Returns
Save()
Saves this rule.
  
  public void Save()
  Save(bool)
Saves this rule.
  
  public void Save(bool doKillCache)
  Parameters
doKillCachebool- Indicates whether to clear the caches after save.
 
TryParse(string, ref double)
protected bool TryParse(string value, ref double result)
  Parameters
Returns
Validates(string)
Validates value with rule.
  
  public abstract bool Validates(string value)
  Parameters
valuestring- The value to validate.
 
Returns
- bool
 - Value indicating whether value valid according to rule.