Dynamicweb 8 Documentation
OrderFieldCollection Class
Members  Example 

Represents a collection of the OrderField objects.
Object Model
OrderFieldCollection ClassOrderField Class
Syntax
Example
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;
   }
Inheritance Hierarchy

System.Object
   System.Collections.ObjectModel.Collection<T>
      Dynamicweb.eCommerce.Orders.OrderFieldCollection

Requirements

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

See Also

Reference

OrderFieldCollection Members
Dynamicweb.eCommerce.Orders Namespace

Send Feedback