Table of Contents

Class Period

Namespace
Dynamicweb.Ecommerce.Products
Assembly
Dynamicweb.Ecommerce.dll
General-purpose Period class, used, for example, for prices
[Serializable]
public class Period
Inheritance
Period
Inherited Members

Constructors

Period()

Empty constructor
public Period()

Period(IDataReader)

Create new period using properties from provided data reader
[Obsolete("Services.Periods instead.")]
public Period(IDataReader dataReader)

Parameters

dataReader IDataReader
Data reader with loaded period properties

Period(string)

Create new period by given ID
[Obsolete("Use Services.Periods.GetPeriodById instead.")]
public Period(string periodId)

Parameters

periodId string
Period ID

Properties

Active

Is this period active
public bool Active { get; set; }

Property Value

bool

ActiveNow

Determines if the period is active according to todays date.
public bool ActiveNow { get; }

Property Value

bool
true if period active now; otherwise, false

Always

Is this period always valid
public bool Always { get; set; }

Property Value

bool

CreatedDate

Period created date
[Obsolete("Not used")]
public DateTime CreatedDate { get; set; }

Property Value

DateTime

EndDate

Period end date
public DateTime EndDate { get; set; }

Property Value

DateTime

EndDateForGrid

Period end date for grid
[Obsolete("Use EndDate and Always instead.")]
public DateTime? EndDateForGrid { get; }

Property Value

DateTime?

Hidden

Is this period hidden
public bool Hidden { get; set; }

Property Value

bool

Id

Period id
public string Id { get; set; }

Property Value

string

Name

Period name
public string Name { get; set; }

Property Value

string

ShowProductsAfterExpiration

Gets or sets a value indicating whether products are shown after period expiration. Price will not be affected by Period after expiration.
public bool ShowProductsAfterExpiration { get; set; }

Property Value

bool
true if products are shown after Period expires; otherwise, false.

StartDate

Period start date
public DateTime StartDate { get; set; }

Property Value

DateTime

Methods

Clone()

Create in-memory copy of current period
[Obsolete("Do not use")]
public Period Clone()

Returns

Period
Copied period

Copy()

Create and save to database a copy of period
[Obsolete("Do not use")]
public Period Copy()

Returns

Period
Copied period

Delete()

Delete period
[Obsolete("Use Services.Periods.Delete instead.")]
public void Delete()

Delete(string)

Delete period by ID
[Obsolete("Use Services.Periods.Delete instead.")]
public void Delete(string periodId)

Parameters

periodId string
Period ID

Fill(IDataReader)

Fill Period with properties from provided data reader
[Obsolete("Services.Periods instead.")]
public void Fill(IDataReader dataReader)

Parameters

dataReader IDataReader
Data reader with loaded properties

GetAllPeriods()

Load all periods from database
[Obsolete("Use Services.Periods.GetAllPeriods instead.")]
public static IEnumerable<Period> GetAllPeriods()

Returns

IEnumerable<Period>
Periods collection

GetHiddenPeriods()

Load all hidden periods from database
[Obsolete("Use Services.Periods.GetHiddenPeriods instead.")]
public static IEnumerable<Period> GetHiddenPeriods()

Returns

IEnumerable<Period>
Periods collection

GetPeriods()

Load all not hidden periods from database
[Obsolete("Use Services.Periods.GetPeriods instead.")]
public static IEnumerable<Period> GetPeriods()

Returns

IEnumerable<Period>
Periods collection

GetPeriods(bool)

Get all periods from database by active/inactive flag
[Obsolete("Use Services.Periods.GetPeriods(bool) instead.")]
public static IEnumerable<Period> GetPeriods(bool active)

Parameters

active bool
Load active or inactive

Returns

IEnumerable<Period>
Periods collection

GetPeriods(string)

Load period to collection using period ID
[Obsolete("Use Services.Periods.GetPeriodById instead.")]
public static IEnumerable<Period> GetPeriods(string periodId)

Parameters

periodId string
Period ID

Returns

IEnumerable<Period>
Collection with loaded object

Remarks

If this ID is not found in database, return empty collection

IsPeriodActive(string)

Is period with given ID active
[Obsolete("Use Services.Periods.GetPeriodById instead.")]
public static bool IsPeriodActive(string periodId)

Parameters

periodId string
Period ID

Returns

bool
Active or not active flag

Lock()

Makes this object read-only
[Obsolete("Do not use")]
public void Lock()

Save(string)

Save period using period ID
[Obsolete("Use Services.Periods.Save instead.")]
public void Save(string periodId)

Parameters

periodId string
Period ID

Remarks

If period with this ID is not found, new period created with auto-generated ID

ToTimeSpanString()

Get string with Start\End dates
[Obsolete("Do not use")]
public string ToTimeSpanString()

Returns

string
To top