Dynamicweb.eCommerce.Orders Namespace > OrderState Class : Lock Method |
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"]; } } }
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