Table of Contents

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

AdjustmentContextType

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

DateTime

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

DateTime

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

bool

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

bool

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

parameterName string

The name of the parameter.

Returns

string

GetHiddenParameterNames(string, object?)

public IEnumerable<string> GetHiddenParameterNames(string parameterName, object? parameterValue)

Parameters

parameterName string
parameterValue object

Returns

IEnumerable<string>

GetParameterOptions(string)

public IEnumerable<ParameterOption> GetParameterOptions(string parameterName)

Parameters

parameterName string

Returns

IEnumerable<ParameterOption>

IsSatisfied(AdjustmentContext)

Returns whether the condition is satisfied.

public override bool IsSatisfied(AdjustmentContext context)

Parameters

context AdjustmentContext

The current context, either a OrderAdjustmentContext or ProductAdjustmentContext.

Returns

bool
To top