Dynamicweb 8 Documentation
Lock Method (OrderState)
Example 

Locks this instance.
Syntax
'Declaration
 
Public Sub Lock() 
public void Lock()
Example
class MyPage : System.Web.UI.Page
{
   public OrderStatesCollection GetOrderStates()
   {
       if (HttpContext.Current.Application["Ecom:OrderStates"] == null)
       {
           OrderStateCollection osc = OrderState.getAllOrderstates();
           foreach (OrderState os in osc)
           {
               os.Lock();
           }
           HttpContext.Current.Application.Lock();
           HttpContext.Current.Application.Set("Ecom:OrderStates", ofc);
           HttpContext.Current.Application.UnLock();
           return ofc;
       }
       else
       {
           return (OrderStatesCollection)HttpContext.Current.Application["Ecom:OrderStates"];
       }
   }
}
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

OrderState Class
OrderState Members

Send Feedback