Click or drag to resize

ConnectorDataItemClass Class

Base class for data access
Inheritance Hierarchy
SystemObject
  SOWIData.DatabaseConnectorDataItemClass
    More...

Namespace:  SOWIData.Database
Assembly:  SOWIData (in SOWIData.dll) Version: 19.1.23.1 (19.1.23.622)
Syntax
public abstract class Connector<DataItemClass> : IConnector<DataItemClass>

Type Parameters

DataItemClass

[Missing <typeparam name="DataItemClass"/> documentation for "T:SOWIData.Database.Connector`1"]

The ConnectorDataItemClass type exposes the following members.

Constructors
Properties
  NameDescription
Public propertyConnectionString
Gives database connection string of the app used
Protected propertyDB
Database object. Sets with method SetDB.
Public propertyNameUnchanged
Flag no change value in field Name Default: false
Public propertyNameUnique
Flag whether Name unique Default: false
Protected propertyProvider
Gives data provider type back.
Public propertyRecordStandard
Which data items read from database? All, active or archived records.
Public propertySortDirectionStandard
Standard sort direction by sort field for example method GeAll
Public propertySortFieldStandard
Standard sort field for example method GeAll
Public propertyUserName
Gives user name of the app used
Protected propertyXML
XML object. Sets with method SetDB
Top
Methods
  NameDescription
Public methodCount(Records)
Gives the count by all, active or archive data records
Public methodCount(String, Records)
Gives the count by all, active or archive data records and filtering by Name
Public methodCode exampleDelete(ListInt32)
Delete all data items
Public methodDelete(Int32)
Delete a data item - set Status = Delete (except XML provider)
Public methodDelete(String)
Delete data item by Name
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodExist(Int32)
Check exist data item by ID (hits can be multiple)
Public methodExist(String)
Check exist data item by Name (can be multiple)
Public methodExistOne
Check exist one data item by Name
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetAll
Get data list by standards value without parameter.
Public methodGetAll(Records)
Get data list by Records (all, active, archived)
Public methodGetAll(String, SortDirections)
Get data list details with sort parameters
Public methodGetAll(String, Operators, Object)
Get data list by search parameter.
Public methodGetAll(String, SortDirections, String, Operators, Object, Records)
Get data list with all parameters.
Public methodGetByID
Gives one data item by ID
Public methodGetByName
Data item search by field Name
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Protected methodCode exampleGetList
Gives raw data list and is basis for all data processing (example for method GetAll)
Public methodStatic memberCode exampleGetProperty
Gives a property from object properties
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodInsert(ListDataItemClass)
Insert list of data items
Public methodInsert(DataItemClass)
Insert data item
Public methodInsertOrUpdateByName
If not exists data record by Name then call method Insert. If exists data record unique then call method Update. If more data records then trigger an exception DataFoundMoreAsOne
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodCode exampleSetDB
Sets database
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodUpdate(ListDataItemClass)
Data list update
Public methodUpdate(DataItemClass)
Data item update
Public methodValidate
Validate data item
Top
Fields
  NameDescription
Public fieldDBActionAfter
Triggered by methods Get*, Insert, Update and Delete
Public fieldDBActionBefore
Triggered by methods Get*, Insert, Update and Delete
Protected fieldDBActionDone
Triggered by methods Get*, Insert, Update and Delete
Protected fieldDBActionPermission
Triggered by methods Get*, Insert, Update and Delete
Protected fieldCode exampleDBActionPrepare
Triggered by methods Get*, Insert, Update and Delete
Protected fieldValidating
Triggered by method Validate
Top
Extension Methods
  NameDescription
Public Extension MethodCode exampleDatabaseIsChangedDataItemClass
Check is object pApp null, is parameter pConnectionString no equal to App property, is parameter pUserName no equal to App property
(Defined by Helper.)
Public Extension MethodGetObjectToBytes
Convert an object to byte array
(Defined by Extensions.)
Public Extension MethodIsNumber
Check is value a number
(Defined by Convert.)
Public Extension MethodToHTMLDisplay(DataGrid, TempDataDictionary)Overloaded. (Defined by Extensions.)
Public Extension MethodCode exampleToHTMLDisplay(String, DataGridDataTypes, String, String, String, String, TempDataDictionary)Overloaded.
Gives HTML code for display.
(Defined by Extensions.)
Public Extension MethodToHTMLEditor(DataGrid, TempDataDictionary, String)Overloaded. (Defined by Extensions.)
Public Extension MethodToHTMLEditor(String, DataGridDataTypes, String, String, String, TempDataDictionary, Boolean, String, DataPlacements, String, String)Overloaded.
Gives HTML code for Input field
(Defined by Extensions.)
Public Extension MethodCode exampleToHTMLHidden(String)Overloaded.
Gives HTML code for hidden data
(Defined by Extensions.)
Public Extension MethodToHTMLHidden(DataGrid)Overloaded.
Gives HTML code for hidden data
(Defined by Extensions.)
Public Extension MethodXMLWrite
Gives XML string from data item
(Defined by Helper.)
Top
Remarks

Initialize which data source in method SetDB and method GetList

Type parameter DataItemClass must based on type IDataStandard

XML Provider

Values of ConnectionString properties:

DataSource puts value XML (SOWIData.Providers.XML).

InitialCatalog value it XML file

Examples
This example creates a SOWI Data Database Connector with a XML file
//* declaration SOWI Data Connector object for XML file (based on SOWIData.Database.Connector)*
SOWIDataConnectorXML lSOWIDataConnectorXML = null;

//* declaration and initialize the Connection String Builder *
SqlConnectionStringBuilder lConnectionStringBuilder = new SqlConnectionStringBuilder();

//* puts XML provider to property DataSource *
lConnectionStringBuilder.DataSource = SOWIData.Providers.XML.ToString();

//* puts XML file name to property InitialCatalog *
lConnectionStringBuilder.InitialCatalog = "XMLFileName.xml";

//* initialize user *
string lUserName = "TestCaseUser";

//* create SOWI Data Connector for XML file *
lSOWIDataConnectorXML = new SOWIDataConnectorXML(lConnectionStringBuilder.ConnectionString.ToString(), lUserName);
SetDB
See Also
Inheritance Hierarchy
SystemObject
  SOWIData.DatabaseConnectorDataItemClass
    SOWIApp.FoundationAppStandardDataItemClass
    SOWIApp.Management.DataAddress
    SOWIApp.Management.DataAppOption
    SOWIApp.Management.DataClient
    SOWIApp.Management.DataClientModule
    SOWIApp.Management.DataClientOption
    SOWIApp.Management.DataDataGrid
    SOWIApp.Management.DataDictionaryUI
    SOWIApp.Management.DataLanguageUI
    SOWIApp.Management.DataListViewConfig
    SOWIApp.Management.DataModule
    SOWIApp.Management.DataPermission
    SOWIApp.Management.DataRole
    SOWIApp.Management.DataRoleGroup
    SOWIApp.Management.DataSession
    SOWIApp.Management.DataSetup
    SOWIApp.Management.DataUser
    SOWIApp.Management.DataUserRole