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
fieldNamestring
Returns
GetAddLink()
public abstract string GetAddLink()
Returns
GetAddLink(string)
public abstract string GetAddLink(string presetNameValueList)
Parameters
presetNameValueListstring
Returns
GetAddLink(string, bool)
Returns an icon linked to the add function in the admin site for this content
public abstract string GetAddLink(string presetNameValueList, bool allowPaste)
Parameters
Returns
GetBoolean(string)
Returns the field value cast as a boolean
public abstract bool GetBoolean(string fieldName)
Parameters
fieldNamestring
Returns
GetDate(string)
Returns the field value cast as a date
public abstract DateTime GetDate(string fieldName)
Parameters
fieldNamestring
Returns
GetEditLink()
get a system edit link
public abstract string GetEditLink()
Returns
GetEditLink(bool)
get a system edit link
public abstract string GetEditLink(bool allowCut)
Parameters
allowCutbool
Returns
GetEditWrapper(string)
wrap content in system editing region style with an edit link
public abstract string GetEditWrapper(string innerHtml)
Parameters
innerHtmlstring
Returns
GetFilename(string)
public abstract string GetFilename(string fieldName)
Parameters
fieldNamestring
Returns
GetFilename(string, string)
public abstract string GetFilename(string fieldName, string originalFilename)
Parameters
Returns
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
Returns
GetFormInput(string, string)
public abstract object GetFormInput(string contentName, string fieldName)
Parameters
Returns
GetFormInput(string, string, int)
public abstract object GetFormInput(string contentName, string fieldName, int height)
Parameters
Returns
GetFormInput(string, string, int, int)
public abstract object GetFormInput(string contentName, string fieldName, int height, int width)
Parameters
Returns
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
Returns
GetFormInput(string, string, string)
[Obsolete("Use GetFormInput(string,string,int)", false)]
public abstract object GetFormInput(string contentName, string fieldName, string height)
Parameters
Returns
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
Returns
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
Returns
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
fieldNamestring
Returns
GetInteger(string)
Returns the field value cast as an integer
public abstract int GetInteger(string fieldName)
Parameters
fieldNamestring
Returns
GetNumber(string)
Returns the field value cast as a number (double)
public abstract double GetNumber(string fieldName)
Parameters
fieldNamestring
Returns
GetRowCount()
Returns the number of rows in the result.
public abstract int GetRowCount()
Returns
GetSQL()
returns the query used to generate the results
public abstract string GetSQL()
Returns
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
fieldNamestring
Returns
GetTextFile(string)
[Obsolete("Use getText to get copy, getFilename to get file.", false)]
public abstract string GetTextFile(string FieldName)
Parameters
FieldNamestring
Returns
GetValue(string)
Return the value directly from the field, without the conversions associated with GetText().
public abstract string GetValue(string fieldName)
Parameters
fieldNamestring
Returns
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
contentNamestring
Returns
NextOK()
Move to the next record in a result set and return true if the row is valid.
public abstract bool NextOK()
Returns
OK()
Returns true if there is valid data in the current row of the result set.
public abstract bool OK()
Returns
Open(string)
Opens a record set
public abstract bool Open(string contentName)
Parameters
contentNamestring
Returns
Open(string, string)
Opens a record set with the records specified by the sqlCriteria
public abstract bool Open(string contentName, string sqlCriteria)
Parameters
Returns
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
Returns
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
Returns
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
Returns
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
contentNamestringsqlCriteriastringsortFieldListstringactiveOnlyboolselectFieldListstringpageSizeint
Returns
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
contentNamestringsqlCriteriastringsortFieldListstringactiveOnlyboolselectFieldListstringpageSizeintpageNumberint1-based page number
Returns
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
GroupCommaListstring
Returns
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
Returns
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
Returns
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
Returns
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
Returns
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
GroupCommaListstringSQLCriteriastringSortFieldListstringActiveOnlyboolPageSizeintPageNumberint
Returns
OpenGroupUsers(List<string>)
Opens a record set with user records that are in a Group
public abstract bool OpenGroupUsers(List<string> groupList)
Parameters
Returns
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
Returns
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
Returns
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
Returns
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
Returns
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
groupListList<string>sqlCriteriastringsortFieldListstringactiveOnlyboolpageSizeintpageNumberint1-based page number
Returns
OpenGroupUsers(string)
Opens a record set with user records that are in a Group
public abstract bool OpenGroupUsers(string groupName)
Parameters
groupNamestring
Returns
OpenGroupUsers(string, string)
Opens a record set with user records that are in a Group
public abstract bool OpenGroupUsers(string groupName, string sqlCriteria)
Parameters
Returns
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
Returns
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
Returns
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
Returns
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
groupNamestringsqlCriteriastringsortFieldListstringactiveOnlyboolpageSizeintpageNumberint1-based page number
Returns
OpenRecord(string, int)
Opens a record set with the record specified by the recordId
public abstract bool OpenRecord(string contentName, int recordId)
Parameters
Returns
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
Returns
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
Returns
OpenRecord(string, string)
Opens a record set with the record specified by the recordGuid
public abstract bool OpenRecord(string contentName, string recordGuid)
Parameters
Returns
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
Returns
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
Returns
OpenSQL(string)
Opens a record set based on an sql statement
public abstract bool OpenSQL(string sql)
Parameters
sqlstring
Returns
OpenSQL(string, string)
Opens a record set based on an sql statement
public abstract bool OpenSQL(string sql, string dataSourcename)
Parameters
Returns
OpenSQL(string, string, int)
Opens a record set based on an sql statement
public abstract bool OpenSQL(string sql, string dataSourcename, int pageSize)
Parameters
Returns
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
Returns
OpenSQL2(string)
[Obsolete("Use OpenSql", false)]
public abstract bool OpenSQL2(string SQL)
Parameters
SQLstring
Returns
OpenSQL2(string, string)
[Obsolete("Use OpenSql", false)]
public abstract bool OpenSQL2(string SQL, string DataSourcename)
Parameters
Returns
OpenSQL2(string, string, int)
[Obsolete("Use OpenSql", false)]
public abstract bool OpenSQL2(string SQL, string DataSourcename, int PageSize)
Parameters
Returns
OpenSQL2(string, string, int, int)
[Obsolete("Use OpenSql", false)]
public abstract bool OpenSQL2(string SQL, string DataSourcename, int PageSize, int PageNumber)
Parameters
Returns
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
SetField(string, DateTime)
Sets a value in a field of the current row.
public abstract void SetField(string fieldName, DateTime fieldValue)
Parameters
SetField(string, int)
Sets a value in a field of the current row.
public abstract void SetField(string fieldName, int fieldValue)
Parameters
SetField(string, object)
Sets a value in a field of the current row.
public abstract void SetField(string fieldName, object fieldValue)
Parameters
SetField(string, string)
Sets a value in a field of the current row.
public abstract void SetField(string fieldName, string fieldValue)
Parameters
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
SetFormInput(string)
public abstract void SetFormInput(string fieldName)
Parameters
fieldNamestring
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)