Table of Contents

Class SmartSearchSqlQueryHelper

Namespace
Dynamicweb.SmartSearch
Assembly
Dynamicweb.SmartSearch.dll
Represents smart search Sql query helper
public class SmartSearchSqlQueryHelper
Inheritance
SmartSearchSqlQueryHelper
Inherited Members

Methods

ConvertToDate(string)

Returns date value of given object
public static DateTime ConvertToDate(string value)

Parameters

value string
Value to be converted to string

Returns

DateTime

ConvertToString(object)

Returns string version of given object
public static string ConvertToString(object value)

Parameters

value object
Value to be converted to string

Returns

string

EscapeValue(string)

Returns value ready for query
public static string EscapeValue(string value)

Parameters

value string

Returns

string

EscapeValueForLike(string, char)

Returns value ready for query with like operator
public static string EscapeValueForLike(string value, char escapeCharacter = '\\')

Parameters

value string
escapeCharacter char

Returns

string

Format(DateTime)

Returns formated date value as string
public static string Format(DateTime dt)

Parameters

dt DateTime
DateTime value to be converted to string

Returns

string

GetAuditFilter(SmartSearchRule)

Builds filter with conditions based on user audit information into sql query string for given property
public static string GetAuditFilter(SmartSearchRule rule)

Parameters

rule SmartSearchRule
SmartSearch rule as base for query

Returns

string

GetBooleanFilter(PropertyInfo, SmartSearchRule)

Builds boolean filter into sql query string for given property
public static string GetBooleanFilter(PropertyInfo pi, SmartSearchRule rule)

Parameters

pi PropertyInfo
User property information
rule SmartSearchRule
SmartSearch rule as base for query

Returns

string

GetBooleanWherePart(string, SmartSearchRule)

Returns where part based on rule with boolean values
public static string GetBooleanWherePart(string fieldName, SmartSearchRule rule)

Parameters

fieldName string
Sql field name
rule SmartSearchRule
SmartSearch rule as base for query

Returns

string

GetCustomFilter(CustomField, SmartSearchRule)

Returns where part based on rule with custom fields
public static string GetCustomFilter(CustomField customField, SmartSearchRule rule)

Parameters

customField CustomField
User custom field
rule SmartSearchRule
SmartSearch rule as base for query

Returns

string

GetDateTimeFilter(PropertyInfo, SmartSearchRule)

Builds string filter into sql query string for given property
public static string GetDateTimeFilter(PropertyInfo pi, SmartSearchRule rule)

Parameters

pi PropertyInfo
User property information
rule SmartSearchRule
SmartSearch rule as base for query

Returns

string

GetDateWherePart(string, SmartSearchRule)

Returns where part based on rule with date values
public static string GetDateWherePart(string fieldName, SmartSearchRule rule)

Parameters

fieldName string
Sql field name
rule SmartSearchRule
SmartSearch rule as base for query

Returns

string

GetDateWherePart(string, string, SmartSearchRule)

Returns where part based on rule with date values
public static string GetDateWherePart(string tableName, string fieldName, SmartSearchRule rule)

Parameters

tableName string
Sql table name
fieldName string
Sql field name
rule SmartSearchRule
SmartSearch rule as base for query

Returns

string

GetFloatWherePart(string, SmartSearchRule)

Returns where part based on rule with float values
public static string GetFloatWherePart(string fieldName, SmartSearchRule rule)

Parameters

fieldName string
Sql field name
rule SmartSearchRule
SmartSearch rule as base for query

Returns

string

GetFloatWherePart(string, string, SmartSearchRule)

Returns where part based on rule with float values
public static string GetFloatWherePart(string tableName, string fieldName, SmartSearchRule rule)

Parameters

tableName string
Sql table name
fieldName string
Sql field name
rule SmartSearchRule
SmartSearch rule as base for query

Returns

string

GetGroupFilter(PropertyInfo, SmartSearchRule)

Builds filter with conditions based on user groups into sql query string for given property
public static string GetGroupFilter(PropertyInfo pi, SmartSearchRule rule)

Parameters

pi PropertyInfo
User property information
rule SmartSearchRule
SmartSearch rule as base for query

Returns

string

GetIntegerFilter(PropertyInfo, SmartSearchRule)

Builds integer filter into sql query string for given property
public static string GetIntegerFilter(PropertyInfo pi, SmartSearchRule rule)

Parameters

pi PropertyInfo
User property information
rule SmartSearchRule
SmartSearch rule as base for query

Returns

string

GetIntegerWherePart(string, SmartSearchRule)

Returns where part based on rule with integer values
public static string GetIntegerWherePart(string fieldName, SmartSearchRule rule)

Parameters

fieldName string
Sql field name
rule SmartSearchRule
SmartSearch rule as base for query

Returns

string

GetIntegerWherePart(string, string, SmartSearchRule)

Returns where part based on rule with integer values
public static string GetIntegerWherePart(string tableName, string fieldName, SmartSearchRule rule)

Parameters

tableName string
Sql table name
fieldName string
Sql field name
rule SmartSearchRule
SmartSearch rule as base for query

Returns

string

GetIsAdminFilter(SmartSearchRule)

Builds filter with conditions based on is user type is admin into sql query string for given property
public static string GetIsAdminFilter(SmartSearchRule rule)

Parameters

rule SmartSearchRule
SmartSearch rule as base for query

Returns

string

GetStringFilter(PropertyInfo, SmartSearchRule)

Builds string filter into sql query string for given property
public static string GetStringFilter(PropertyInfo pi, SmartSearchRule rule)

Parameters

pi PropertyInfo
User property information
rule SmartSearchRule
SmartSearch rule as base for query

Returns

string

GetStringWherePart(string, SmartSearchRule)

Returns where part based on rule with string values
public static string GetStringWherePart(string fieldName, SmartSearchRule rule)

Parameters

fieldName string
Sql field name
rule SmartSearchRule
SmartSearch rule as base for query

Returns

string

GetUserIdWherePart(string, SmartSearchRule)

Returns where part based on rule with User id conditions
public static string GetUserIdWherePart(string fieldName, SmartSearchRule rule)

Parameters

fieldName string
Sql field name
rule SmartSearchRule
SmartSearch rule as base for query

Returns

string

GetUserTypeFilter(PropertyInfo, SmartSearchRule)

Builds string filter into sql query string for given property
public static string GetUserTypeFilter(PropertyInfo pi, SmartSearchRule rule)

Parameters

pi PropertyInfo
User property information
rule SmartSearchRule
SmartSearch rule as base for query

Returns

string

RenderOperator(SmartSearchRuleOperator)

Render SmartSerach rule operator into string for sql query
public static string RenderOperator(SmartSearchRuleOperator op)

Parameters

op SmartSearchRuleOperator

Returns

string

RenderValue(IEnumerable<int>)

Render IEnumerable(Of Integer) into string for sql query
public static string RenderValue(IEnumerable<int> value)

Parameters

value IEnumerable<int>

Returns

string

RenderValue(IEnumerable<string>)

Render IEnumerable(Of String) into string for sql query
public static string RenderValue(IEnumerable<string> value)

Parameters

value IEnumerable<string>

Returns

string

RenderValue(DateTime)

Render DateTime value into string for sql query
public static string RenderValue(DateTime value)

Parameters

value DateTime

Returns

string

RenderValue(int)

Render Integer value into string for sql query
public static string RenderValue(int value)

Parameters

value int

Returns

string

RenderValue(object)

Render Object value into string for sql query
public static string RenderValue(object value)

Parameters

value object

Returns

string

RenderValue(string)

Render String value into string for sql query
public static string RenderValue(string value)

Parameters

value string

Returns

string
To top