Class RecurringOrder
- Namespace
- Dynamicweb.Ecommerce.Orders
- Assembly
- Dynamicweb.Ecommerce.dll
The class RecurringOrder represents recurring order.
public class RecurringOrder : DbObject
- Inheritance
-
RecurringOrder
- Inherited Members
Constructors
RecurringOrder()
Initializes a new instance of the RecurringOrder class.
public RecurringOrder()
RecurringOrder(IDataReader)
Initializes a new instance of the RecurringOrder class from data reader.
public RecurringOrder(IDataReader dataReader)
Parameters
dataReader
IDataReader- The data reader.
Properties
BaseOrderId
Gets or sets recurring order base order ID.
public string BaseOrderId { get; set; }
Property Value
CanceledDeliveries
Gets or sets recurring order canceled deliveries as comma-separated string of serial numbers of deliveries counted from start date.
public string CanceledDeliveries { get; set; }
Property Value
EndDate
Gets or sets recurring orders end date.
public DateTime? EndDate { get; set; }
Property Value
Frequency
Returns frequency as string in format "Every (Interval) (IntervalUnit)"
[Obsolete("Use Interval instead")]
public string Frequency { get; }
Property Value
Interval
Gets or sets recurring orders interval.
public int Interval { get; set; }
Property Value
IntervalUnit
Gets or sets recurring orders interval unit(day, week, month).
public RecurringIntervalUnitType IntervalUnit { get; set; }
Property Value
LastDelivery
Gets or sets previous date of recurring.
public DateTime? LastDelivery { get; set; }
Property Value
NextDelivery
Gets next date of recurring.
public DateTime? NextDelivery { get; }
Property Value
StartDate
Gets or sets recurring orders start date.
public DateTime? StartDate { get; set; }
Property Value
TotalPrice
Gets or sets recurring order base order ID.
public PriceInfo TotalPrice { get; set; }
Property Value
UserId
Gets the recurring order related user ID.
public int UserId { get; set; }
Property Value
Methods
EndRecurring(int)
Update recurring order end date to now
public static void EndRecurring(int recurringOrderId)
Parameters
recurringOrderId
int- The id recurring order
Fill(IDataReader)
Fills the Card token properties from the specified data reader.
public override void Fill(IDataReader reader)
Parameters
reader
IDataReader- The data reader.
FillRow(DataRow)
Fills the given System.Data.DataRow object with property values of the current object.
protected override void FillRow(DataRow row)
Parameters
row
DataRow- An instance of the System.Data.DataRow object to write data to.
GetEvents()
Retrieve recurring order events occurred during scheduler
public IEnumerable<OrderDebuggingInfo> GetEvents()
Returns
GetFutureDeliveriesList()
Gets information about the future deliveries
public IEnumerable<RecurringOrderFutureDelivery> GetFutureDeliveriesList()
Returns
GetNextDeliveryIndex(bool)
Gets index of next delivery.
public int GetNextDeliveryIndex(bool checkForCanceled)
Parameters
checkForCanceled
bool
Returns
GetPreviousOrdersIds()
Retrieve previous recurring orders IDs
public IEnumerable<string> GetPreviousOrdersIds()
Returns
GetRecurringOrderById(int)
Retrieve recurring order by ID
public static RecurringOrder GetRecurringOrderById(int id)
Parameters
id
int- The id of recurring order
Returns
GetRecurringOrderByTemplateId(string)
Retrieve recurring order by ID
public static RecurringOrder GetRecurringOrderByTemplateId(string id)
Parameters
id
string- The id of recurring order
Returns
GetRecurringOrderTotalPrice()
Retrieve recurring orders total
public PriceInfo GetRecurringOrderTotalPrice()
Returns
GetUserRecurringOrders(int)
Retrieve recurring orders for an user
public static IEnumerable<RecurringOrder> GetUserRecurringOrders(int userId)
Parameters
userId
int- The id of user
Returns
GetUserRecurringOrders(int, bool)
Retrieve recurring orders for an user
public static IEnumerable<RecurringOrder> GetUserRecurringOrders(int userId, bool useCustomerNumber)
Parameters
userId
int- The id of user
useCustomerNumber
bool- The indicator whether to use customer number instead of user id.
Returns
GetUserRecurringOrders(int, bool, DateTime)
Retrieve recurring orders for an user
public static IEnumerable<RecurringOrder> GetUserRecurringOrders(int userId, bool useCustomerNumber, DateTime fromDate)
Parameters
userId
int- The id of user
useCustomerNumber
bool- The indicator whether to use customer number instead of user id.
fromDate
DateTime- The minimum order date.
Returns
HasErros()
Retrieve recurring order errors occurred during scheduler
public bool HasErros()