Dynamicweb.eCommerce.Orders Namespace : OrderFieldCollection Class |
'Declaration
<SerializableAttribute()> Public Class OrderFieldCollection Inherits System.Collections.ObjectModel.Collection(Of OrderField)
[SerializableAttribute()] public class OrderFieldCollection : System.Collections.ObjectModel.Collection<OrderField>
class MyPage : System.Web.UI.Page { public OrderFieldCollection GetOrderFields() { if (HttpContext.Current.Application["Ecom:OrderFields"] == null) { OrderFieldCollection ofc = OrderField.getOrderFields(); foreach (OrderField of in ofc) { of.Lock(); } HttpContext.Current.Application.Lock(); HttpContext.Current.Application.Set("Ecom:OrderFields", ofc); HttpContext.Current.Application.UnLock(); return ofc; } else { return (OrderFieldCollection)HttpContext.Current.Application["Ecom:OrderFields"]; } } }
public static OrderFieldCollection GetOrderFields() { string sql = "SELECT * FROM EcomOrderField ORDER BY OrderFieldSort"; OrderFieldCollection orderFields = new OrderFieldCollection(); using (IDataReader dataReader = Database.CreateDataReader(sql, "Ecom.mdb")) { while (dataReader.Read()) { orderFields.Add(new OrderField(dataReader)); } } return orderFields; }
System.Object
System.Collections.ObjectModel.Collection<T>
Dynamicweb.eCommerce.Orders.OrderFieldCollection
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2