MagicData - class DataManager: IDataManager
Data Manager for easy interact with SqlServer Database using Repository pattern
[Constructor] public DataManager()
Description : Use credential stored in a crypted file (not available in free version)
Parameters
[Constructor] public DataManager(string dbName, string catalog, string username, string password)
Description : set credential for SqlServer Authentication
Parameters
dbName: Database Name (SqlServer name instance)
catalog: Catalog Name
username: Username to access Database (you need of full right on db)
password: Passoword to access Database
[Constructor] public DataManager(string ConnectionName)
Description : Give SqlServer Authentication credential from encrypted file that corresponde to ConnectionName (not available in free version)
Parameters
ConnectionName: Connection Name
[Constructor] public DataManager(IResponse Response, ICredential Credential, IDataAccess DataAccess)
Description : Get a DataManager instance using your custom instance of parameter
Parameters
Response: IResponse custom instance
Credential: Credential custom instance
DataAccess: DataAccess custom instance
[Method] public DataTable getRecord(string IdField, string IdFieldValue, string TableName)
Description : get record from Table where value stored in IdField match with IdFieldValue
Parameters
IdField: Name of table field used as primary key
IdFieldValue: Value to select
TableName: Table from which to take the record
Return
DataTable: contain a single record
[Method] public int insRecord(string TableName, object data)
Description : Insert record in Table named TableName
Parameters
TableName: Table to which insert the record
data: Instance of class that represent a table row
Return
int: (record id, if==-1 there's an error)
[Method] public int delRecord(string IdField, string IdFieldValue, string TableName)
Description : Delete record from Table named TableName
Parameters
IdField: Name of table field used as primary key
IdFieldValue: Value to select
TableName: Table to which insert the record
Return
int: (if==-1 there's an error)
[Method] public int updRecord(string TableName, object data)
Description : Update a record in table named TableName using an instance of class that represent table row. The record that will be updated will be the one that has the primary key corresponding to that contained in the past object
Parameters
TableName: Table to which insert the record
data: Instance of class that represent a table row
Return
int: (if==-1 there's an error)
[Method] public int updRecord(string IdField, string IdFieldValue, string FieldToUpdate, string UpdateValue, string TableName)
Description : Update a single field of record where IdFieldValue match with value stored in IdField using UpdateValue for table named TableName
Parameters
IdField: Name of table field used as primary key
IdFieldValue: Value to select
FieldToUpdate: Field name to update
UpdateValue: Value to update Field name
TableName: Table to which update the record
Return
int: (if==-1 there's an error)
[Method] public DataTable getAllRecords(string TableName)
Description : get all record of table named TableName
Parameters
TableName: Table to which get the records
Return
DataTable: contain all record of TableName
[Method] public IResponse getRecordM(string IdField, string IdFieldValue, string TableName)
Description : get record from Table where value stored in IdField match with IdFieldValue (this method manage database exception with IResponse return type interface)
Parameters
IdField: Name of table field used as primary key
IdFieldValue: Value to select
TableName: Table from which to take the record
Return
IResponse: contain command status and record requested stored in data object and accessible via .data() method of IResponse instance
[Method] public IResponse insRecordM(string TableName, object data)
Description : Insert record in Table named TableName this method manage database exception with IResponse return type interface
Parameters
TableName: Table to which insert the record
data: Instance of class that represent a table row
Return
IResponse: contain command status and new Id value of record inserted stored in data object and accessible via .data() method of IResponse instance
[Method] public IResponse delRecordM(string IdField, string IdFieldValue, string TableName)
Description : Delete record from Table named TableName this method manage database exception with IResponse return type interface
Parameters
IdField: Name of table field used as primary key
IdFieldValue: Value to select
TableName: Table to which insert the record
Return
IResponse: contain command status
[Method] public IResponse updRecordM(string TableName, object data)
Description : Update a record in table named TableName using an instance of class that represent table row. The record that will be updated will be the one that has the primary key corresponding to that contained in the past object this method manage database exception with IResponse return type interface
Parameters
TableName: Table to which insert the record
data: Instance of class that represent a table row
Return
IResponse: contain command status
[Method] public IResponse updRecordM(string IdField, string IdFieldValue, string FieldToUpdate, string UpdateValue, string TableName)
Description : Update a single field of record where IdFieldValue match with value stored in IdField using UpdateValue for table named TableName this method manage database exception with IResponse return type interface
Parameters
IdField: Name of table field used as primary key
IdFieldValue: Value to select
FieldToUpdate: Field name to update
UpdateValue: Value to update Field name
TableName: Table to which update the record
Return
IResponse: contain command status
[Method] public IResponse getAllRecordsM(string TableName)
Description : get all record of table named TableName this method manage database exception with IResponse return type interface
Parameters
TableName: Table to which get the records
Return
contain command status and all records requested stored in data object and accessible via .data() method of IResponse instance
Questo sito o gli strumenti terzi da questo utilizzati si avvalgono di cookie necessari al funzionamento ed utili alle finalità illustrate nella cookie policy. Se vuoi saperne di più o negare il consenso a tutti o ad alcuni cookie, consulta settaggio cookie. Chiudendo questo banner, scorrendo questa pagina, cliccando su un link o proseguendo la navigazione in altra maniera, acconsenti all’uso dei cookie. Cookies Policy