Table of Contents

Class CPCSBaseClass

Namespace
Contensive.BaseClasses
Assembly
CPBase.dll

CP.CS - The secondary interface to execute queries on a sql database. Use dbModels when possible (does not use cdef metadata). To run queries, use executeQuery, executeNonQuery and executeNonQueryAsync.

public abstract class CPCSBaseClass : IDisposable
Inheritance
CPCSBaseClass
Implements
Inherited Members

Methods

Close()

Closes an open record set

public abstract void Close()

Delete()

Deletes the current row

public abstract void Delete()

Dispose()

support IDisposable

public abstract void Dispose()

FieldOK(string)

Returns true if the given field is valid for this record set

public abstract bool FieldOK(string fieldName)

Parameters

fieldName string

Returns

bool
public abstract string GetAddLink()

Returns

string
public abstract string GetAddLink(string presetNameValueList)

Parameters

presetNameValueList string

Returns

string

Returns an icon linked to the add function in the admin site for this content

public abstract string GetAddLink(string presetNameValueList, bool allowPaste)

Parameters

presetNameValueList string
allowPaste bool

Returns

string

GetBoolean(string)

Returns the field value cast as a boolean

public abstract bool GetBoolean(string fieldName)

Parameters

fieldName string

Returns

bool

GetDate(string)

Returns the field value cast as a date

public abstract DateTime GetDate(string fieldName)

Parameters

fieldName string

Returns

DateTime

get a system edit link

public abstract string GetEditLink()

Returns

string

get a system edit link

public abstract string GetEditLink(bool allowCut)

Parameters

allowCut bool

Returns

string

GetEditWrapper(string)

wrap content in system editing region style with an edit link

public abstract string GetEditWrapper(string innerHtml)

Parameters

innerHtml string

Returns

string

GetFilename(string)

public abstract string GetFilename(string fieldName)

Parameters

fieldName string

Returns

string

GetFilename(string, string)

public abstract string GetFilename(string fieldName, string originalFilename)

Parameters

fieldName string
originalFilename string

Returns

string

GetFilename(string, string, string)

Returns the filename for the field, if a filename is related to the field type. Use this call to create the appropriate filename when a new file is added. The filename with the appropriate path is created or returned. This file and path is relative to the site's content file path and does not include a leading slash. To use this file in a URL, prefix with cp.Http.CdnFilePathPrefix.

public abstract string GetFilename(string fieldName, string originalFilename, string contentName)

Parameters

fieldName string
originalFilename string
contentName string

Returns

string

GetFormInput(string, string)

public abstract object GetFormInput(string contentName, string fieldName)

Parameters

contentName string
fieldName string

Returns

object

GetFormInput(string, string, int)

public abstract object GetFormInput(string contentName, string fieldName, int height)

Parameters

contentName string
fieldName string
height int

Returns

object

GetFormInput(string, string, int, int)

public abstract object GetFormInput(string contentName, string fieldName, int height, int width)

Parameters

contentName string
fieldName string
height int
width int

Returns

object

GetFormInput(string, string, int, int, string)

Returns a form input element based on a content field definition

public abstract object GetFormInput(string contentName, string fieldName, int height, int width, string htmlId)

Parameters

contentName string
fieldName string
height int
width int
htmlId string

Returns

object

GetFormInput(string, string, string)

[Obsolete("Use GetFormInput(string,string,int)", false)]
public abstract object GetFormInput(string contentName, string fieldName, string height)

Parameters

contentName string
fieldName string
height string

Returns

object

GetFormInput(string, string, string, string)

[Obsolete("Use GetFormInput(string,string,int,int)", false)]
public abstract object GetFormInput(string contentName, string fieldName, string height, string width)

Parameters

contentName string
fieldName string
height string
width string

Returns

object

GetFormInput(string, string, string, string, string)

[Obsolete("Use GetFormInput(string,string,int,int,string)", false)]
public abstract object GetFormInput(string contentName, string fieldName, string height, string width, string htmlId)

Parameters

contentName string
fieldName string
height string
width string
htmlId string

Returns

object

GetHtml(string)

Returns the result of getText() after verifying it's content is valid for use in Html content. If the field is a fieldTypeHtml the content is returned without conversion. If the field is any other type, the content is HtmlEncoded first (> converted to >, etc)

public abstract string GetHtml(string fieldName)

Parameters

fieldName string

Returns

string

GetInteger(string)

Returns the field value cast as an integer

public abstract int GetInteger(string fieldName)

Parameters

fieldName string

Returns

int

GetNumber(string)

Returns the field value cast as a number (double)

public abstract double GetNumber(string fieldName)

Parameters

fieldName string

Returns

double

GetRowCount()

Returns the number of rows in the result.

public abstract int GetRowCount()

Returns

int

GetSQL()

returns the query used to generate the results

public abstract string GetSQL()

Returns

string

GetText(string)

Returns the result and converts it to a text type. For field types that store text in files, the text is returned instead of the filename. These include textfile, cssfile, javascriptfile. For file types that do not contain text, the filename is returned. These include filetype and imagefiletype.

public abstract string GetText(string fieldName)

Parameters

fieldName string

Returns

string

GetTextFile(string)

[Obsolete("Use getText to get copy, getFilename to get file.", false)]
public abstract string GetTextFile(string FieldName)

Parameters

FieldName string

Returns

string

GetValue(string)

Return the value directly from the field, without the conversions associated with GetText().

public abstract string GetValue(string fieldName)

Parameters

fieldName string

Returns

string

GoFirst()

Move to the first record in the current record set

public abstract void GoFirst()

GoNext()

Move to the next record in a result set.

public abstract void GoNext()

Insert(string)

Insert a record, leaving the dataset open in this object. Call cs.close() to close the data

public abstract bool Insert(string contentName)

Parameters

contentName string

Returns

bool

NextOK()

Move to the next record in a result set and return true if the row is valid.

public abstract bool NextOK()

Returns

bool

OK()

Returns true if there is valid data in the current row of the result set.

public abstract bool OK()

Returns

bool

Open(string)

Opens a record set

public abstract bool Open(string contentName)

Parameters

contentName string

Returns

bool

Open(string, string)

Opens a record set with the records specified by the sqlCriteria

public abstract bool Open(string contentName, string sqlCriteria)

Parameters

contentName string
sqlCriteria string

Returns

bool

Open(string, string, string)

Opens a record set with the records specified by the sqlCriteria

public abstract bool Open(string contentName, string sqlCriteria, string sortFieldList)

Parameters

contentName string
sqlCriteria string
sortFieldList string

Returns

bool

Open(string, string, string, bool)

Opens a record set with the records specified by the sqlCriteria

public abstract bool Open(string contentName, string sqlCriteria, string sortFieldList, bool activeOnly)

Parameters

contentName string
sqlCriteria string
sortFieldList string
activeOnly bool

Returns

bool

Open(string, string, string, bool, string)

Opens a record set with the records specified by the sqlCriteria

public abstract bool Open(string contentName, string sqlCriteria, string sortFieldList, bool activeOnly, string selectFieldList)

Parameters

contentName string
sqlCriteria string
sortFieldList string
activeOnly bool
selectFieldList string

Returns

bool

Open(string, string, string, bool, string, int)

Opens a record set with the records specified by the sqlCriteria

public abstract bool Open(string contentName, string sqlCriteria, string sortFieldList, bool activeOnly, string selectFieldList, int pageSize)

Parameters

contentName string
sqlCriteria string
sortFieldList string
activeOnly bool
selectFieldList string
pageSize int

Returns

bool

Open(string, string, string, bool, string, int, int)

Opens a record set with the records specified by the sqlCriteria

public abstract bool Open(string contentName, string sqlCriteria, string sortFieldList, bool activeOnly, string selectFieldList, int pageSize, int pageNumber)

Parameters

contentName string
sqlCriteria string
sortFieldList string
activeOnly bool
selectFieldList string
pageSize int
pageNumber int

1-based page number

Returns

bool

OpenGroupListUsers(string)

[Obsolete("Use OpenGroupUsers instead. The GroupCommaList is a comma delimited list of groups and cannot handle group names that include a comma.", false)]
public abstract bool OpenGroupListUsers(string GroupCommaList)

Parameters

GroupCommaList string

Returns

bool

OpenGroupListUsers(string, string)

[Obsolete("Use OpenGroupUsers instead. The GroupCommaList is a comma delimited list of groups and cannot handle group names that include a comma.", false)]
public abstract bool OpenGroupListUsers(string GroupCommaList, string SQLCriteria)

Parameters

GroupCommaList string
SQLCriteria string

Returns

bool

OpenGroupListUsers(string, string, string)

[Obsolete("Use OpenGroupUsers instead. The GroupCommaList is a comma delimited list of groups and cannot handle group names that include a comma.", false)]
public abstract bool OpenGroupListUsers(string GroupCommaList, string SQLCriteria, string SortFieldList)

Parameters

GroupCommaList string
SQLCriteria string
SortFieldList string

Returns

bool

OpenGroupListUsers(string, string, string, bool)

[Obsolete("Use OpenGroupUsers instead. The GroupCommaList is a comma delimited list of groups and cannot handle group names that include a comma.", false)]
public abstract bool OpenGroupListUsers(string GroupCommaList, string SQLCriteria, string SortFieldList, bool ActiveOnly)

Parameters

GroupCommaList string
SQLCriteria string
SortFieldList string
ActiveOnly bool

Returns

bool

OpenGroupListUsers(string, string, string, bool, int)

[Obsolete("Use OpenGroupUsers instead. The GroupCommaList is a comma delimited list of groups and cannot handle group names that include a comma.", false)]
public abstract bool OpenGroupListUsers(string GroupCommaList, string SQLCriteria, string SortFieldList, bool ActiveOnly, int PageSize)

Parameters

GroupCommaList string
SQLCriteria string
SortFieldList string
ActiveOnly bool
PageSize int

Returns

bool

OpenGroupListUsers(string, string, string, bool, int, int)

[Obsolete("Use OpenGroupUsers instead. The GroupCommaList is a comma delimited list of groups and cannot handle group names that include a comma.", false)]
public abstract bool OpenGroupListUsers(string GroupCommaList, string SQLCriteria, string SortFieldList, bool ActiveOnly, int PageSize, int PageNumber)

Parameters

GroupCommaList string
SQLCriteria string
SortFieldList string
ActiveOnly bool
PageSize int
PageNumber int

Returns

bool

OpenGroupUsers(List<string>)

Opens a record set with user records that are in a Group

public abstract bool OpenGroupUsers(List<string> groupList)

Parameters

groupList List<string>

Returns

bool

OpenGroupUsers(List<string>, string)

Opens a record set with user records that are in a Group

public abstract bool OpenGroupUsers(List<string> groupList, string sqlCriteria)

Parameters

groupList List<string>
sqlCriteria string

Returns

bool

OpenGroupUsers(List<string>, string, string)

Opens a record set with user records that are in a Group

public abstract bool OpenGroupUsers(List<string> groupList, string sqlCriteria, string sortFieldList)

Parameters

groupList List<string>
sqlCriteria string
sortFieldList string

Returns

bool

OpenGroupUsers(List<string>, string, string, bool)

Opens a record set with user records that are in a Group

public abstract bool OpenGroupUsers(List<string> groupList, string sqlCriteria, string sortFieldList, bool activeOnly)

Parameters

groupList List<string>
sqlCriteria string
sortFieldList string
activeOnly bool

Returns

bool

OpenGroupUsers(List<string>, string, string, bool, int)

Opens a record set with user records that are in a Group

public abstract bool OpenGroupUsers(List<string> groupList, string sqlCriteria, string sortFieldList, bool activeOnly, int pageSize)

Parameters

groupList List<string>
sqlCriteria string
sortFieldList string
activeOnly bool
pageSize int

Returns

bool

OpenGroupUsers(List<string>, string, string, bool, int, int)

Opens a record set with user records that are in a Group

public abstract bool OpenGroupUsers(List<string> groupList, string sqlCriteria, string sortFieldList, bool activeOnly, int pageSize, int pageNumber)

Parameters

groupList List<string>
sqlCriteria string
sortFieldList string
activeOnly bool
pageSize int
pageNumber int

1-based page number

Returns

bool

OpenGroupUsers(string)

Opens a record set with user records that are in a Group

public abstract bool OpenGroupUsers(string groupName)

Parameters

groupName string

Returns

bool

OpenGroupUsers(string, string)

Opens a record set with user records that are in a Group

public abstract bool OpenGroupUsers(string groupName, string sqlCriteria)

Parameters

groupName string
sqlCriteria string

Returns

bool

OpenGroupUsers(string, string, string)

Opens a record set with user records that are in a Group

public abstract bool OpenGroupUsers(string groupName, string sqlCriteria, string sortFieldList)

Parameters

groupName string
sqlCriteria string
sortFieldList string

Returns

bool

OpenGroupUsers(string, string, string, bool)

Opens a record set with user records that are in a Group

public abstract bool OpenGroupUsers(string groupName, string sqlCriteria, string sortFieldList, bool activeOnly)

Parameters

groupName string
sqlCriteria string
sortFieldList string
activeOnly bool

Returns

bool

OpenGroupUsers(string, string, string, bool, int)

Opens a record set with user records that are in a Group

public abstract bool OpenGroupUsers(string groupName, string sqlCriteria, string sortFieldList, bool activeOnly, int pageSize)

Parameters

groupName string
sqlCriteria string
sortFieldList string
activeOnly bool
pageSize int

Returns

bool

OpenGroupUsers(string, string, string, bool, int, int)

Opens a record set with user records that are in a Group

public abstract bool OpenGroupUsers(string groupName, string sqlCriteria, string sortFieldList, bool activeOnly, int pageSize, int pageNumber)

Parameters

groupName string
sqlCriteria string
sortFieldList string
activeOnly bool
pageSize int
pageNumber int

1-based page number

Returns

bool

OpenRecord(string, int)

Opens a record set with the record specified by the recordId

public abstract bool OpenRecord(string contentName, int recordId)

Parameters

contentName string
recordId int

Returns

bool

OpenRecord(string, int, string)

Opens a record set with the record specified by the recordId

public abstract bool OpenRecord(string contentName, int recordId, string selectFieldList)

Parameters

contentName string
recordId int
selectFieldList string

Returns

bool

OpenRecord(string, int, string, bool)

Opens a record set with the record specified by the recordId

public abstract bool OpenRecord(string contentName, int recordId, string selectFieldList, bool activeOnly)

Parameters

contentName string
recordId int
selectFieldList string
activeOnly bool

Returns

bool

OpenRecord(string, string)

Opens a record set with the record specified by the recordGuid

public abstract bool OpenRecord(string contentName, string recordGuid)

Parameters

contentName string
recordGuid string

Returns

bool

OpenRecord(string, string, string)

Opens a record set with the record specified by the recordGuid

public abstract bool OpenRecord(string contentName, string recordGuid, string selectFieldList)

Parameters

contentName string
recordGuid string
selectFieldList string

Returns

bool

OpenRecord(string, string, string, bool)

Opens a record set with the record specified by the recordGuid

public abstract bool OpenRecord(string contentName, string recordGuid, string selectFieldList, bool activeOnly)

Parameters

contentName string
recordGuid string
selectFieldList string
activeOnly bool

Returns

bool

OpenSQL(string)

Opens a record set based on an sql statement

public abstract bool OpenSQL(string sql)

Parameters

sql string

Returns

bool

OpenSQL(string, string)

Opens a record set based on an sql statement

public abstract bool OpenSQL(string sql, string dataSourcename)

Parameters

sql string
dataSourcename string

Returns

bool

OpenSQL(string, string, int)

Opens a record set based on an sql statement

public abstract bool OpenSQL(string sql, string dataSourcename, int pageSize)

Parameters

sql string
dataSourcename string
pageSize int

Returns

bool

OpenSQL(string, string, int, int)

Opens a record set based on an sql statement. The result is paged based on the pageSize and pageNumber parameters. The pageNumber is 1-based.

public abstract bool OpenSQL(string sql, string dataSourcename, int pageSize, int pageNumber)

Parameters

sql string
dataSourcename string
pageSize int
pageNumber int

1-based page number

Returns

bool

OpenSQL2(string)

[Obsolete("Use OpenSql", false)]
public abstract bool OpenSQL2(string SQL)

Parameters

SQL string

Returns

bool

OpenSQL2(string, string)

[Obsolete("Use OpenSql", false)]
public abstract bool OpenSQL2(string SQL, string DataSourcename)

Parameters

SQL string
DataSourcename string

Returns

bool

OpenSQL2(string, string, int)

[Obsolete("Use OpenSql", false)]
public abstract bool OpenSQL2(string SQL, string DataSourcename, int PageSize)

Parameters

SQL string
DataSourcename string
PageSize int

Returns

bool

OpenSQL2(string, string, int, int)

[Obsolete("Use OpenSql", false)]
public abstract bool OpenSQL2(string SQL, string DataSourcename, int PageSize, int PageNumber)

Parameters

SQL string
DataSourcename string
PageSize int
PageNumber int

Returns

bool

Save()

Forces a save of any changes made to the current row. A save occurs automatically when the content set is closed or when it moves to another row.

public abstract void Save()

SetField(string, bool)

Sets a value in a field of the current row.

public abstract void SetField(string fieldName, bool fieldValue)

Parameters

fieldName string
fieldValue bool

SetField(string, DateTime)

Sets a value in a field of the current row.

public abstract void SetField(string fieldName, DateTime fieldValue)

Parameters

fieldName string
fieldValue DateTime

SetField(string, int)

Sets a value in a field of the current row.

public abstract void SetField(string fieldName, int fieldValue)

Parameters

fieldName string
fieldValue int

SetField(string, object)

Sets a value in a field of the current row.

public abstract void SetField(string fieldName, object fieldValue)

Parameters

fieldName string
fieldValue object

SetField(string, string)

Sets a value in a field of the current row.

public abstract void SetField(string fieldName, string fieldValue)

Parameters

fieldName string
fieldValue string

SetFile(string, string, string)

[Obsolete("Use SetField for all field types that store data in files (textfile, cssfile, etc)", true)]
public abstract void SetFile(string FieldName, string Copy, string ContentName)

Parameters

FieldName string
Copy string
ContentName string

SetFormInput(string)

public abstract void SetFormInput(string fieldName)

Parameters

fieldName string

SetFormInput(string, string)

Processes a value from the incoming request to a field in the current row.

public abstract void SetFormInput(string fieldName, string requestName)

Parameters

fieldName string
requestName string