Dynamicweb 8 Documentation
GetPropertyValue Method
Example 

Name of the property.
Gets the property value.
Syntax
'Declaration
 
Public Function GetPropertyValue( _ 
   ByVal PropertyName As String _ 
) As Object
public object GetPropertyValue( 
   string PropertyName 
)

Parameters

PropertyName
Name of the property.
Example
class MyPage : System.Web.UI.Page
{
   private Dynamicweb.eCommerce.Orders.OrderCollection.SortOrderType _sortOrder;
   private string _fieldName;
   public int Compare(object x, object y)
   {
       Dynamicweb.eCommerce.Orders.Order order1 = (Dynamicweb.eCommerce.Orders.Order)x;
       Dynamicweb.eCommerce.Orders.Order order2 = (Dynamicweb.eCommerce.Orders.Order)y;

       string fieldType = null;
       try
       {
           fieldType = order1.GetPropertyType(_fieldName);
       }
       catch
       {
           return 0;
       }

       try
       {
           switch (fieldType.ToLower())
           {
               case "boolean":
                   bool order1bool = false;
                   order1bool = (bool)order1.GetPropertyValue(_fieldName);

                   bool order2bool = false;
                   order2bool = (bool)order2.GetPropertyValue(_fieldName);

                   return (order1bool.CompareTo(order2bool) * (int)_sortOrder);
               case "integer":
                  int order1int = 0;
                  order1int = (int)order1.GetPropertyValue(_fieldName);

                  int order2int = 0;
                  order2int = (int)order2.GetPropertyValue(_fieldName);

                  return (order1int.CompareTo(order2int) * (int)_sortOrder);
              case "string":
                  string order1string = null;
                  order1string = (string)order1.GetPropertyValue(_fieldName);

                  string order2string = null;
                  order2string = (string)order2.GetPropertyValue(_fieldName);

                  return (order1string.CompareTo(order2string) * (int)_sortOrder);
              default:
                  return 0;
          }
      }
      catch
      {
          return 0;
      }
   }
}
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

Order Class
Order Members

Send Feedback