Class DateTimeCondition
- Namespace
- Dynamicweb.Ecommerce.Orders.Adjustments.Conditions
- Assembly
- Dynamicweb.Ecommerce.dll
Condition that checks if the current date and time is within a specified range.
[Experimental("DWEX100001")]
[AddInLabel("Date time")]
[AddInUseParameterSectioning(true)]
public sealed class DateTimeCondition : Condition, IParameterOptions, IParameterVisibility
- Inheritance
-
DateTimeCondition
- Implements
- Inherited Members
Constructors
DateTimeCondition()
public DateTimeCondition()
Properties
ContextType
The type of context the condition is applied to.
public override AdjustmentContextType ContextType { get; }
Property Value
EndDate
The end date and time to check against the current date and time. Defaults to MaxValue.
[AddInParameterGroup("Condition")]
[AddInParameter("EndDate")]
[AddInLabel("")]
[AddInParameterEditor(typeof(DateTimeParameterEditor), "")]
public DateTime EndDate { get; set; }
Property Value
StartDate
The start date and time to check against the current date and time. Defaults to MinValue.
[AddInParameterGroup("Condition")]
[AddInParameter("StartDate")]
[AddInLabel("")]
[AddInParameterEditor(typeof(DateTimeParameterEditor), "")]
public DateTime StartDate { get; set; }
Property Value
UseEndDate
If UseEndDate is true, the condition will check if the current date and time is before the EndDate.
[AddInParameterGroup("Condition")]
[AddInParameter("UseEndDate")]
[AddInLabel("Ends")]
[AddInParameterEditor(typeof(RadioParameterEditor), "reloadOnChange=true;sortBy=key")]
public bool UseEndDate { get; set; }
Property Value
UseStartDate
If UseStartDate is true, the condition will check if the current date and time is after the StartDate.
[AddInParameterGroup("Condition")]
[AddInParameter("UseStartDate")]
[AddInLabel("Starts")]
[AddInParameterEditor(typeof(RadioParameterEditor), "reloadOnChange=true;sortBy=key")]
public bool UseStartDate { get; set; }
Property Value
Methods
GetDisplayValue(string)
Returns the UI display format for the condition, visible in the overview screens where conditions are used.
public override string? GetDisplayValue(string parameterName)
Parameters
parameterNamestringThe name of the parameter.
Returns
GetHiddenParameterNames(string, object?)
public IEnumerable<string> GetHiddenParameterNames(string parameterName, object? parameterValue)
Parameters
Returns
GetParameterOptions(string)
public IEnumerable<ParameterOption> GetParameterOptions(string parameterName)
Parameters
parameterNamestring
Returns
IsSatisfied(AdjustmentContext)
Returns whether the condition is satisfied.
public override bool IsSatisfied(AdjustmentContext context)
Parameters
contextAdjustmentContextThe current context, either a OrderAdjustmentContext or ProductAdjustmentContext.