Dynamicweb 8 Documentation
GetDoublePriceStatement Method
Example 

The product price.
Gets the double price statement.
Syntax
'Declaration
 
Public Shared Function GetDoublePriceStatement( _ 
   ByVal prodPrice As String _ 
) As String
public static string GetDoublePriceStatement( 
   string prodPrice 
)

Parameters

prodPrice
The product price.
Example
class MyPage : System.Web.UI.Page
{
    private Dynamicweb.eCommerce.Products.Product product;

    private void Page_Load(System.Object sender, System.EventArgs e)
    {
        product = (Dynamicweb.eCommerce.Products.Product)Session["Ecom.Backend.Product"];
    }

    private int UpdateDoublePrice(UpdateType updateType)
    {
         System.Text.StringBuilder SQL = new System.Text.StringBuilder();

         int updCnt = 0;
         string GetPrice = Dynamicweb.eCommerce.Prices.Price.GetDoublePriceStatement(product.ProductPriceString);

         if (!string.IsNullOrEmpty(GetPrice))
         {
             SQL.Append("UPDATE EcomProducts SET ProductPrice = " + GetPrice + " ");

             string whereStatement = null;

             switch (updateType)
             {
                 case Dynamicweb.eCommerce.Products.UpdateType.LanguageDependent:
                     whereStatement = string.Format("ProductID = '{0}' AND ProductLanguageID = '{1}'", product.ID, product.LanguageID);
                     break;
                 case Dynamicweb.eCommerce.Products.UpdateType.VariantDependent:
                     whereStatement = string.Format("ProductID = '{0}' AND ProductVariantID = '{1}'", product.ID, product.VariantID);
                     break;
                 case Dynamicweb.eCommerce.Products.UpdateType.NoDependencies:
                     whereStatement = string.Format("ProductID = '{0}'", product.ID);
                     break;
                 default:
                     whereStatement = string.Format("ProductID = '{0}' AND ProductLanguageID = '{1}' AND ProductVariantID = '{2}'", product.ID, product.LanguageID, product.VariantID);
                     break;
             }

             SQL.Append("WHERE " + whereStatement);

             if (Database.ExecuteNonQuery(SQL.ToString(), "Ecom.mdb") > 0)
             {
                 updCnt += 1;
             }
         }
      return updCnt;
   }
}
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

Price Class
Price Members

Send Feedback