Dynamicweb 8 Documentation
GetSqlConditionPartForIDs Method
Example 

The ID or IDs. Multiple IDs must be separated by ', ' or ','.
Gets the condition part of a SQL statement.
Syntax
'Declaration
 
Public Shared Function GetSqlConditionPartForIDs( _ 
   ByVal idList As String _ 
) As String
public static string GetSqlConditionPartForIDs( 
   string idList 
)

Parameters

idList
The ID or IDs. Multiple IDs must be separated by ', ' or ','.

Return Value

The condition part of a SQL statement based on the given ID or IDs
Example
class MyPage : System.Web.UI.Page
{
   public string DeleteAll(GroupCollection groups, bool run)
   {
       string grps = Group.WhereClauseBuilder(groups);
       System.Text.StringBuilder SQL = new System.Text.StringBuilder();

       //01) Delete group releations
       SQL.Append("DELETE FROM EcomGroupRelations WHERE GroupRelationsGroupID " + Product.GetSqlConditionPartForIDs(grps) + "; ");
       //02) Delete group to shop releations
       SQL.Append("DELETE FROM EcomShopGroupRelation WHERE ShopGroupGroupID " + Product.GetSqlConditionPartForIDs(grps) + "; ");
       //03) Delete the items (BOM) groups from products
       SQL.Append("DELETE FROM EcomProductItems WHERE ProductItemBomGroupID " + Product.GetSqlConditionPartForIDs(grps) + "; ");
       //04) Delete the groups
       SQL.Append("DELETE FROM EcomGroups WHERE GroupID " + Product.GetSqlConditionPartForIDs(grps) + "; ");

       if (run)
       {
           Database.ExecuteNonQuery(SQL.ToString(), "Ecom.mdb");

           // Sending out notifications
           Dynamicweb.Extensibility.NotificationManager.Notify(Dynamicweb.Notifications.eCommerce.Group.Deleted, new Dynamicweb.Notifications.eCommerce.Group.GroupModifiedEventArgs(groups));
       }
       return SQL.ToString();
   }
}
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