Dynamicweb 8 Documentation
UnitExists Method
Example 

The unit ID.
Determines whether unit exists.
Syntax
'Declaration
 
Public Shared Function UnitExists( _ 
   ByVal unitId As String _ 
) As Boolean
public static bool UnitExists( 
   string unitId 
)

Parameters

unitId
The unit ID.
Example
class MyPage : System.Web.UI.Page
{
   private void UpdateStock(Dynamicweb.eCommerce.Orders.Order order)
   {
       foreach (Dynamicweb.eCommerce.Orders.OrderLine orderLine in order.OrderLines)
       {
           if (!string.IsNullOrEmpty(orderLine.UnitID))
           {
               if (Product.UnitExists(orderLine.UnitID))
               {
                   //TODO: insert your code here
               }
           }
       }
   }
}
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

Product Class
Product Members

Send Feedback