Saxonite
This commit is contained in:
@@ -10,8 +10,8 @@ namespace Sarand.Net.Standard.Base.Dbas
|
||||
// Definitions.
|
||||
public enum DbmsType
|
||||
{
|
||||
General,
|
||||
Access,
|
||||
General = 0,
|
||||
Access = 10,
|
||||
MsSql,
|
||||
MySql,
|
||||
Oracle,
|
||||
@@ -20,7 +20,7 @@ namespace Sarand.Net.Standard.Base.Dbas
|
||||
FoxPro,
|
||||
Paradox,
|
||||
Interbase,
|
||||
/// <summary>No 'AS' in table alias, no 'OUTER' in join type.</summary>
|
||||
/// <summary>Sage db - No 'AS' in table alias, no 'OUTER' in join type.</summary>
|
||||
Sage,
|
||||
QBooks,
|
||||
SybaseAdvantage,
|
||||
@@ -73,6 +73,8 @@ namespace Sarand.Net.Standard.Base.Dbas
|
||||
bool TableExists (String tableName);
|
||||
bool ColumnExists (String tableName, String columnName);
|
||||
bool IndexExists (String tableName, String indexName);
|
||||
// Database info - schema summary.
|
||||
IDatabaseInfo CreateDbInfo();
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Query records.
|
||||
|
||||
@@ -10,6 +10,7 @@ using Sarand.Net.Standard.Base.Bus;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Dbas.Data;
|
||||
|
||||
namespace Sarand.Net.Standard.Dbas.Base
|
||||
{
|
||||
@@ -251,6 +252,13 @@ namespace Sarand.Net.Standard.Dbas.Base
|
||||
return false;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Database info - schema summary.
|
||||
public IDatabaseInfo CreateDbInfo()
|
||||
{
|
||||
return new DbDataItem.DatabaseInfo(this);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Logging.
|
||||
public static SaMessageLevel LoggingLevel { get; set; } = SaMessageLevel.None;
|
||||
|
||||
@@ -20,6 +20,8 @@ namespace Sarand.Net.Standard.Dbas.Base
|
||||
public DbmsType dbms = DbmsType.General;
|
||||
public String connectionString; // Raw connection string.
|
||||
public String location, user, pword; // Application properties.
|
||||
/// <summary>Database name populated when connection string is generated if not done previously.</summary>
|
||||
public String DatabaseName { get; set; }
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
@@ -30,29 +32,33 @@ namespace Sarand.Net.Standard.Dbas.Base
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Utilities.
|
||||
private void LogSql (String sql)
|
||||
private void LogSql(String sql)
|
||||
{
|
||||
SaLogger.Debug(GetType().Name + " SQL: " + sql);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// O p e n O D B C D a t a b a s e
|
||||
// Database configuration.
|
||||
//-------------------------------------------------------------------
|
||||
public static SacsDatabase OpenOdbcDatabase (OdbcConfig config)
|
||||
public static DbmsType GetDbmsType(OdbcConfig config)
|
||||
{
|
||||
if (config.dbms == DbmsType.MsSql || config.location.Left(6).EqualsCI("MsSql:"))
|
||||
return DbmsType.MsSql;
|
||||
return config.dbms;
|
||||
}
|
||||
public static String GenerateConnectionString(OdbcConfig config, bool dbmsSpecificConnectionString = false)
|
||||
{
|
||||
// Construct connection string.
|
||||
String databaseName = "";
|
||||
String connectionString = config.connectionString;
|
||||
String sqlConnectionString = String.Empty;
|
||||
DbmsType dbms = DbmsType.General;
|
||||
String connectionString = String.Empty;
|
||||
DbmsType dbms = GetDbmsType(config);
|
||||
|
||||
// SQL connection.
|
||||
if (config.location.Left(6).EqualsCI("MsSql:"))
|
||||
if (dbms == DbmsType.MsSql)
|
||||
{
|
||||
// MsSql:Server:Port\Instance.Database
|
||||
dbms = DbmsType.MsSql;
|
||||
String sqlDriver = OdbcUtil.GetOdbcSqlDriverName();
|
||||
String sqlLocation = config.location.Substring(6);
|
||||
String sqlLocation = config.location.Left(6).EqualsCI("MsSql:") ? config.location.Substring(6) : config.location;
|
||||
String sqlServer = "."; /* Assume local host */
|
||||
String sqlInstance = "";
|
||||
String sqlPort = "";
|
||||
@@ -80,9 +86,10 @@ namespace Sarand.Net.Standard.Dbas.Base
|
||||
}
|
||||
if (!StringUtil.IsEmpty(sqlPort)) sqlServer += "," + sqlPort;
|
||||
if (!StringUtil.IsEmpty(sqlInstance)) sqlServer += "\\" + sqlInstance;
|
||||
databaseName = sqlDatabase;
|
||||
//-----------------------------------------------------------
|
||||
// SQL Server ODBC connection string:
|
||||
|
||||
if (!dbmsSpecificConnectionString)
|
||||
{
|
||||
// ODBC connection string for SQL Server.
|
||||
// Ref. https://docs.microsoft.com/en-us/sql/relational-databases/native-client/applications/using-connection-string-keywords-with-sql-server-native-client
|
||||
// Address Network address of the server running an instance of SQL Server.
|
||||
// Driver=<OdbcDriver>;
|
||||
@@ -109,24 +116,49 @@ namespace Sarand.Net.Standard.Dbas.Base
|
||||
// connectionString += "QueryLogTime="+String(iQueryLogTime)+";";
|
||||
//if (iCommandTimeout > 0)
|
||||
// connectionString += "CommandTimeout=" + String(iCommandTimeout) + ";";
|
||||
//-----------------------------------------------------------
|
||||
}
|
||||
else
|
||||
{
|
||||
// SQL Connection string.
|
||||
sqlConnectionString = "";
|
||||
sqlConnectionString += "Server=" + sqlServer + ";";
|
||||
sqlConnectionString += "Database=" + sqlDatabase + ";";
|
||||
connectionString = "";
|
||||
connectionString += "Server=" + sqlServer + ";";
|
||||
connectionString += "Database=" + sqlDatabase + ";";
|
||||
if (!config.user.IsEmpty())
|
||||
{
|
||||
sqlConnectionString += "User Id=" + config.user + ";";
|
||||
sqlConnectionString += "Password=" + config.pword + ";";
|
||||
connectionString += "User Id=" + config.user + ";";
|
||||
connectionString += "Password=" + config.pword + ";";
|
||||
}
|
||||
sqlConnectionString += (String)"Trusted_Connection=" + (config.user.IsEmpty() ? "Yes" : "No") + ";";
|
||||
//-----------------------------------------------------------
|
||||
SaLogger.Info("DatabaseConsole.OpenOdbcDatabase Driver: " + sqlDriver + ". Server: " + sqlServer + ". Database: " + sqlDatabase + ". Connection: " + connectionString + (!StringUtil.IsEmpty(sqlConnectionString) ? " [SQL: " + sqlConnectionString + "]" : ""));
|
||||
connectionString += (String)"Trusted_Connection=" + (config.user.IsEmpty() ? "Yes" : "No") + ";";
|
||||
}
|
||||
|
||||
// Populate configuration values if blank.
|
||||
if (config.dbms <= 0)
|
||||
config.dbms = dbms;
|
||||
if (StringUtil.IsEmpty(config.DatabaseName))
|
||||
config.DatabaseName = sqlDatabase;
|
||||
|
||||
SaLogger.Info("DatabaseConsole.GenerateConnectionString Driver: " + sqlDriver + ". Server: " + sqlServer + ". Database: " + sqlDatabase + ". Connection: " + connectionString);
|
||||
}
|
||||
return connectionString;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// O p e n O D B C D a t a b a s e
|
||||
//-------------------------------------------------------------------
|
||||
public static SacsDatabase OpenOdbcDatabase(OdbcConfig config)
|
||||
{
|
||||
// Populate configuration.
|
||||
config.dbms = GetDbmsType(config);
|
||||
|
||||
// Connection strings.
|
||||
String connectionString = config.connectionString;
|
||||
if (StringUtil.IsEmpty(connectionString))
|
||||
connectionString = GenerateConnectionString(config);
|
||||
String sqlConnectionString = GenerateConnectionString(config, true);
|
||||
|
||||
// Open database.
|
||||
DbGlobalDbms.Type = dbms;
|
||||
SacsDatabaseOdbc database = new SacsDatabaseOdbc(dbms,databaseName,connectionString);
|
||||
DbGlobalDbms.Type = config.dbms;
|
||||
SacsDatabaseOdbc database = new SacsDatabaseOdbc(config.dbms, config.DatabaseName, connectionString);
|
||||
database.SelectLockMode = SelectLockMode.ReadUncommitted;
|
||||
database.SqlConnectionString = sqlConnectionString;
|
||||
return database;
|
||||
@@ -159,11 +191,11 @@ namespace Sarand.Net.Standard.Dbas.Base
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Drop index.
|
||||
protected bool DropDbIndex (ISacsDatabase database, IndexStats indexStats, String tableName, String indexName)
|
||||
protected bool DropDbIndex(ISacsDatabase database, IndexStats indexStats, String tableName, String indexName)
|
||||
{
|
||||
if (database == null || HasErrorState()) return false;
|
||||
if (!database.TableExists(tableName)) return true;
|
||||
DbDfnTable dfnTbl = database.GetTableDfn(tableName,true);
|
||||
DbDfnTable dfnTbl = database.GetTableDfn(tableName, true);
|
||||
if (!dfnTbl.HasIndexByName(indexName)) // Should also check the columns and their sequence in the index.
|
||||
{
|
||||
// Drop index:
|
||||
@@ -171,7 +203,7 @@ namespace Sarand.Net.Standard.Dbas.Base
|
||||
// MS SQL Server: DROP INDEX table_name.index_name
|
||||
// DB2/Oracle: DROP INDEX index_name
|
||||
// MySQL: ALTER TABLE table_name DROP INDEX index_name
|
||||
String query = "DROP INDEX ["+indexName+"] ON ["+tableName+"]";
|
||||
String query = "DROP INDEX [" + indexName + "] ON [" + tableName + "]";
|
||||
LogSql(query);
|
||||
if (database.DbmsType == DbmsType.MsSql)
|
||||
query = "DROP INDEX [" + tableName + "].[" + indexName + "]";
|
||||
@@ -192,7 +224,7 @@ namespace Sarand.Net.Standard.Dbas.Base
|
||||
else
|
||||
{
|
||||
// Assume this is the Primary Key:
|
||||
String query = "ALTER TABLE ["+tableName+"] DROP CONSTRAINT ["+indexName+"]";
|
||||
String query = "ALTER TABLE [" + tableName + "] DROP CONSTRAINT [" + indexName + "]";
|
||||
LogSql(query);
|
||||
//if (database.DbmsType() == eSaDbmsMsSql)
|
||||
// sQry = "DROP INDEX ["+tableName+"].["+indexName+"]";
|
||||
@@ -215,13 +247,13 @@ namespace Sarand.Net.Standard.Dbas.Base
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Create primary index.
|
||||
protected bool CreatePrimaryDbIndex (ISacsDatabase database, IndexStats indexStats, String tableName, String columnsCsv, bool dropIndicesIfNotExist = true)
|
||||
protected bool CreatePrimaryDbIndex(ISacsDatabase database, IndexStats indexStats, String tableName, String columnsCsv, bool dropIndicesIfNotExist = true)
|
||||
{
|
||||
if (database == null || HasErrorState()) return false;
|
||||
if (!database.TableExists(tableName)) return true;
|
||||
List<String> lColumn = StringListUtil.Split(columnsCsv,",");
|
||||
DbDfnTable dfnTbl = database.GetTableDfn(tableName,true);
|
||||
String indexName = "PK_"+tableName;
|
||||
List<String> lColumn = StringListUtil.Split(columnsCsv, ",");
|
||||
DbDfnTable dfnTbl = database.GetTableDfn(tableName, true);
|
||||
String indexName = "PK_" + tableName;
|
||||
if (!dfnTbl.HasIndexByName(indexName))
|
||||
{
|
||||
if (dropIndicesIfNotExist)
|
||||
@@ -240,7 +272,7 @@ namespace Sarand.Net.Standard.Dbas.Base
|
||||
// ADD CONSTRAINT [PK_Individual_CustomerID]
|
||||
// PRIMARY KEY CLUSTERED
|
||||
// ([CustomerID] ASC)
|
||||
String query = "ALTER TABLE ["+tableName+"] ADD CONSTRAINT ["+indexName+"] PRIMARY KEY ("+lColumn.Concat(",","[","]")+")";
|
||||
String query = "ALTER TABLE [" + tableName + "] ADD CONSTRAINT [" + indexName + "] PRIMARY KEY (" + lColumn.Concat(",", "[", "]") + ")";
|
||||
if (database.DbmsType == DbmsType.MsSql)
|
||||
query = "ALTER TABLE [" + tableName + "] ADD CONSTRAINT [" + indexName + "] PRIMARY KEY CLUSTERED (" + lColumn.Concat(",", "[", "]") + ")";
|
||||
LogSql(query);
|
||||
@@ -264,18 +296,18 @@ namespace Sarand.Net.Standard.Dbas.Base
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Create database index.
|
||||
protected bool CreateDbIndex (ISacsDatabase database, IndexStats indexStats, String tableName, String indexName, String columnsCsv, bool unique = false)
|
||||
protected bool CreateDbIndex(ISacsDatabase database, IndexStats indexStats, String tableName, String indexName, String columnsCsv, bool unique = false)
|
||||
{
|
||||
if (database == null || HasErrorState()) return false;
|
||||
if (!database.TableExists(tableName)) return true;
|
||||
List<String> columns = StringListUtil.Split(columnsCsv,",");
|
||||
DbDfnTable dfnTbl = database.GetTableDfn(tableName,true);
|
||||
List<String> columns = StringListUtil.Split(columnsCsv, ",");
|
||||
DbDfnTable dfnTbl = database.GetTableDfn(tableName, true);
|
||||
// Construct the index name:
|
||||
String indexNamePrefix = "IDX_" + tableName + "_";
|
||||
if (!indexName.StartsWith(indexNamePrefix)) indexName = indexNamePrefix + indexName;
|
||||
if (!dfnTbl.HasIndexByName(indexName)) // Should also check the columns and their sequence in the index.
|
||||
{
|
||||
String query = "CREATE "+(unique?"UNIQUE ":"")+"INDEX ";
|
||||
String query = "CREATE " + (unique ? "UNIQUE " : "") + "INDEX ";
|
||||
query += "[" + indexName + "] ON [" + tableName + "] (" + columns.Concat(",", "[", "]") + ")";
|
||||
LogSql(query);
|
||||
if (!StringUtil.IsEmpty(query))
|
||||
|
||||
@@ -213,11 +213,11 @@ namespace Sarand.Net.Standard.Dbas.CodeTypes
|
||||
{
|
||||
try
|
||||
{
|
||||
// Retrieve codeType.
|
||||
// Retrieve item.
|
||||
dbConnection.Open();
|
||||
SaCodeType_Db dbCodeType = new SaCodeType_Db(DbInfo);
|
||||
dbCodeType.PopulateFrom(dbCommand, aliasCodeType, "Id=" + SysId.ToString(codeType.Id));
|
||||
// Delete codeType.
|
||||
// Delete item.
|
||||
dbCommand.CommandType = System.Data.CommandType.Text;
|
||||
dbCommand.CommandText = "DELETE FROM " + TableName_CodeType + " WHERE Id=" + SysId.ToString(codeType.Id) + ";";
|
||||
dbCommand.ExecuteNonQuery();
|
||||
@@ -732,11 +732,11 @@ namespace Sarand.Net.Standard.Dbas.CodeTypes
|
||||
{
|
||||
try
|
||||
{
|
||||
// Retrieve code.
|
||||
// Retrieve item.
|
||||
dbConnection.Open();
|
||||
SaCode_Db dbCode = new SaCode_Db(DbInfo);
|
||||
dbCode.PopulateFrom(dbCommand, aliasCode, "Id=" + SysId.ToString(code.Id));
|
||||
// Delete code.
|
||||
// Delete item.
|
||||
dbCommand.CommandType = System.Data.CommandType.Text;
|
||||
dbCommand.CommandText = "DELETE FROM " + TableName_Code + " WHERE Id=" + SysId.ToString(code.Id) + ";";
|
||||
dbCommand.ExecuteNonQuery();
|
||||
|
||||
@@ -162,11 +162,11 @@ namespace Sarand.Net.Standard.Dbas.Interfaces
|
||||
{
|
||||
try
|
||||
{
|
||||
// Retrieve interface.
|
||||
// Retrieve item.
|
||||
dbConnection.Open();
|
||||
SaInterfaceDataItem_Db dbInterfaceDataItem = new SaInterfaceDataItem_Db(DbInfo);
|
||||
dbInterfaceDataItem.PopulateFrom(dbCommand, aliasInterfaceDataItem, "Id=" + SysId.ToString(interfaceProcessDataItem.Id));
|
||||
// Delete interface.
|
||||
// Delete item.
|
||||
dbCommand.CommandType = System.Data.CommandType.Text;
|
||||
dbCommand.CommandText = "DELETE FROM " + TableName_InterfaceDataItem + " WHERE Id=" + SysId.ToString(interfaceProcessDataItem.Id) + ";";
|
||||
dbCommand.ExecuteNonQuery();
|
||||
|
||||
@@ -147,7 +147,7 @@ namespace Sarand.Net.Standard.Dbas.Interfaces
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Delete Interface ProcessMessage.
|
||||
// Delete item.
|
||||
public override bool InterfaceProcessMessageCanBeDeleted (SaInterfaceProcessMessage interfaceProcessMessage)
|
||||
{
|
||||
ClearErrorState();
|
||||
@@ -163,11 +163,11 @@ namespace Sarand.Net.Standard.Dbas.Interfaces
|
||||
{
|
||||
try
|
||||
{
|
||||
// Retrieve interface.
|
||||
// Retrieve item.
|
||||
dbConnection.Open();
|
||||
SaInterfaceProcessMessage_Db dbInterfaceProcessMessage = new SaInterfaceProcessMessage_Db(DbInfo);
|
||||
dbInterfaceProcessMessage.PopulateFrom(dbCommand, aliasInterfaceProcessMessage, "Id=" + SysId.ToString(interfaceProcessMessage.Id));
|
||||
// Delete interface.
|
||||
// Delete item.
|
||||
dbCommand.CommandType = System.Data.CommandType.Text;
|
||||
dbCommand.CommandText = "DELETE FROM " + TableName_InterfaceProcessMessage + " WHERE Id=" + SysId.ToString(interfaceProcessMessage.Id) + ";";
|
||||
dbCommand.ExecuteNonQuery();
|
||||
|
||||
@@ -168,7 +168,7 @@ namespace Sarand.Net.Standard.Dbas.Interfaces
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Delete Interface Process.
|
||||
// Delete Item.
|
||||
public override bool InterfaceProcessCanBeDeleted (SaInterfaceProcess interfaceProcess)
|
||||
{
|
||||
ClearErrorState();
|
||||
@@ -236,11 +236,11 @@ namespace Sarand.Net.Standard.Dbas.Interfaces
|
||||
{
|
||||
try
|
||||
{
|
||||
// Retrieve interface.
|
||||
// Retrieve item.
|
||||
dbConnection.Open();
|
||||
SaInterfaceProcess_Db dbInterfaceProcess = new SaInterfaceProcess_Db_Local(DbInfo);
|
||||
dbInterfaceProcess.PopulateFrom(dbCommand, aliasInterfaceProcess, "Id=" + SysId.ToString(interfaceProcess.Id));
|
||||
// Delete interface.
|
||||
// Delete item.
|
||||
dbCommand.CommandType = System.Data.CommandType.Text;
|
||||
dbCommand.CommandText = "DELETE FROM " + TableName_InterfaceProcess + " WHERE Id=" + SysId.ToString(interfaceProcess.Id) + ";";
|
||||
dbCommand.ExecuteNonQuery();
|
||||
|
||||
@@ -171,11 +171,11 @@ namespace Sarand.Net.Standard.Dbas.Interfaces
|
||||
{
|
||||
try
|
||||
{
|
||||
// Retrieve interface.
|
||||
// Retrieve item.
|
||||
dbConnection.Open();
|
||||
SaInterface_Db dbInterface = new SaInterface_Db(DbInfo);
|
||||
dbInterface.PopulateFrom(dbCommand, aliasInterface, "Id=" + SysId.ToString(interfaceObj.Id));
|
||||
// Update properties.
|
||||
// Update item.
|
||||
PopulateTo(dbInterface, interfaceObj, dbUpdateInfo);
|
||||
dbInterface.ExecuteUpdateCommand(dbCommand);
|
||||
}
|
||||
@@ -201,11 +201,11 @@ namespace Sarand.Net.Standard.Dbas.Interfaces
|
||||
{
|
||||
try
|
||||
{
|
||||
// Retrieve interface.
|
||||
// Retrieve item.
|
||||
dbConnection.Open();
|
||||
SaInterface_Db dbInterface = new SaInterface_Db(DbInfo);
|
||||
dbInterface.PopulateFrom(dbCommand, aliasInterface, "Id=" + SysId.ToString(interfaceObj.Id));
|
||||
// Delete interface.
|
||||
// Delete item.
|
||||
dbCommand.CommandType = System.Data.CommandType.Text;
|
||||
dbCommand.CommandText = "DELETE FROM " + TableName_Interface + " WHERE Id=" + SysId.ToString(interfaceObj.Id) + ";";
|
||||
dbCommand.ExecuteNonQuery();
|
||||
|
||||
@@ -202,7 +202,7 @@ namespace Sarand.Net.Standard.Dbas.ItemData
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update ItemData.
|
||||
// Update item.
|
||||
public override bool UpdateItemData (SaItemData itemData, DbUpdateInfo dbUpdateInfo)
|
||||
{
|
||||
ClearErrorState();
|
||||
@@ -213,11 +213,11 @@ namespace Sarand.Net.Standard.Dbas.ItemData
|
||||
{
|
||||
try
|
||||
{
|
||||
// Retrieve itemData.
|
||||
// Retrieve item.
|
||||
dbConnection.Open();
|
||||
SaItemData_Db dbItemData = new SaItemData_Db(DbInfo);
|
||||
dbItemData.PopulateFrom(dbCommand, aliasItemData, aliasItemData + ".Id=" + SysId.ToString(itemData.Id));
|
||||
// Update properties.
|
||||
// Update item.
|
||||
PopulateTo(dbItemData, itemData, dbUpdateInfo);
|
||||
dbItemData.ExecuteUpdateCommand(dbCommand);
|
||||
}
|
||||
@@ -227,7 +227,7 @@ namespace Sarand.Net.Standard.Dbas.ItemData
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Delete ItemData.
|
||||
// Delete item.
|
||||
public override bool ItemDataCanBeDeleted (SaItemData itemData)
|
||||
{
|
||||
ClearErrorState();
|
||||
@@ -243,11 +243,11 @@ namespace Sarand.Net.Standard.Dbas.ItemData
|
||||
{
|
||||
try
|
||||
{
|
||||
// Retrieve itemData.
|
||||
// Retrieve item.
|
||||
dbConnection.Open();
|
||||
SaItemData_Db dbItemData = new SaItemData_Db(DbInfo);
|
||||
dbItemData.PopulateFrom(dbCommand, aliasItemData, aliasItemData + ".Id=" + SysId.ToString(itemData.Id));
|
||||
// Delete itemData.
|
||||
// Delete item.
|
||||
dbCommand.CommandType = System.Data.CommandType.Text;
|
||||
dbCommand.CommandText = "DELETE FROM " + SaItemDataDbDfn.GetTableName(SaItemDataDbDfn.TableIdx.SaItemData) + " WHERE Id=" + SysId.ToString(itemData.Id) + ";";
|
||||
dbCommand.ExecuteNonQuery();
|
||||
|
||||
@@ -180,7 +180,7 @@ namespace Sarand.Net.Standard.Dbas.ItemDocs
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update ItemDoc.
|
||||
// Update item.
|
||||
public override bool UpdateItemDoc (SaItemDoc itemDoc, DbUpdateInfo dbUpdateInfo)
|
||||
{
|
||||
ClearErrorState();
|
||||
@@ -191,11 +191,11 @@ namespace Sarand.Net.Standard.Dbas.ItemDocs
|
||||
{
|
||||
try
|
||||
{
|
||||
// Retrieve itemDoc.
|
||||
// Retrieve item.
|
||||
dbConnection.Open();
|
||||
SaItemDoc_Db dbItemDoc = new SaItemDoc_Db(DbInfo);
|
||||
dbItemDoc.PopulateFrom(dbCommand, aliasItemDoc, aliasItemDoc + ".Id=" + SysId.ToString(itemDoc.Id));
|
||||
// Update properties.
|
||||
// Update item.
|
||||
PopulateTo(dbItemDoc, itemDoc, dbUpdateInfo);
|
||||
dbItemDoc.ExecuteUpdateCommand(dbCommand);
|
||||
}
|
||||
@@ -205,7 +205,7 @@ namespace Sarand.Net.Standard.Dbas.ItemDocs
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Delete ItemDoc.
|
||||
// Delete item.
|
||||
public override bool ItemDocCanBeDeleted (SaItemDoc itemDoc)
|
||||
{
|
||||
ClearErrorState();
|
||||
@@ -221,11 +221,11 @@ namespace Sarand.Net.Standard.Dbas.ItemDocs
|
||||
{
|
||||
try
|
||||
{
|
||||
// Retrieve itemDoc.
|
||||
// Retrieve item.
|
||||
dbConnection.Open();
|
||||
SaItemDoc_Db dbItemDoc = new SaItemDoc_Db(DbInfo);
|
||||
dbItemDoc.PopulateFrom(dbCommand, aliasItemDoc, aliasItemDoc + ".Id=" + SysId.ToString(itemDoc.Id));
|
||||
// Delete itemDoc.
|
||||
// Delete item.
|
||||
dbCommand.CommandType = System.Data.CommandType.Text;
|
||||
dbCommand.CommandText = "DELETE FROM " + SaItemDocsDbDfn.GetTableName(SaItemDocsDbDfn.TableIdx.SaItemDoc) + " WHERE Id=" + SysId.ToString(itemDoc.Id) + ";";
|
||||
dbCommand.ExecuteNonQuery();
|
||||
|
||||
@@ -193,11 +193,11 @@ namespace Sarand.Net.Standard.Dbas.ItemOptions
|
||||
{
|
||||
try
|
||||
{
|
||||
// Retrieve itemOption.
|
||||
// Retrieve item.
|
||||
dbConnection.Open();
|
||||
SaItemOption_Db dbItemOption = new SaItemOption_Db(DbInfo);
|
||||
dbItemOption.PopulateFrom(dbCommand, aliasItemOption, GetItemOptionFilter(itemOption));
|
||||
// Update properties.
|
||||
// Update item.
|
||||
PopulateTo(dbItemOption, itemOption, dbUpdateInfo);
|
||||
dbItemOption.ExecuteUpdateCommand(dbCommand);
|
||||
}
|
||||
@@ -223,11 +223,11 @@ namespace Sarand.Net.Standard.Dbas.ItemOptions
|
||||
{
|
||||
try
|
||||
{
|
||||
// Retrieve itemOption.
|
||||
// Retrieve item.
|
||||
dbConnection.Open();
|
||||
SaItemOption_Db dbItemOption = new SaItemOption_Db(DbInfo);
|
||||
dbItemOption.PopulateFrom(dbCommand, aliasItemOption, GetItemOptionFilter(itemOption));
|
||||
// Delete itemOption.
|
||||
// Delete item.
|
||||
dbCommand.CommandType = System.Data.CommandType.Text;
|
||||
dbCommand.CommandText = "DELETE FROM " + SaItemOptionDbDfn.GetTableName(SaItemOptionDbDfn.TableIdx.SaItemOption) + " WHERE " + GetItemOptionFilter(itemOption) + ";";
|
||||
dbCommand.ExecuteNonQuery();
|
||||
|
||||
@@ -114,7 +114,7 @@ namespace Sarand.Net.Standard.Dbas.ReferenceData
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Insert Currency.
|
||||
// Insert item.
|
||||
public override bool InsertCurrency (SaCurrency currency, DbUpdateInfo dbUpdateInfo)
|
||||
{
|
||||
ClearErrorState();
|
||||
@@ -142,7 +142,7 @@ namespace Sarand.Net.Standard.Dbas.ReferenceData
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update Currency.
|
||||
// Update item.
|
||||
public override bool UpdateCurrency (SaCurrency currency, DbUpdateInfo dbUpdateInfo)
|
||||
{
|
||||
ClearErrorState();
|
||||
@@ -153,12 +153,12 @@ namespace Sarand.Net.Standard.Dbas.ReferenceData
|
||||
{
|
||||
try
|
||||
{
|
||||
// Retrieve currency.
|
||||
// Retrieve item.
|
||||
dbConnection.Open();
|
||||
Currency_Db dbCurrency = new Currency_Db(DbInfo);
|
||||
dbCurrency.PopulateFrom(dbCommand, aliasCurrency, "Id=" + SysId.ToString(currency.Id));
|
||||
SaUpdateLogItemMonitor_Currency updateLogMonitor = new SaUpdateLogItemMonitor_Currency(ReferenceDataConsole, CreateCurrency(dbCurrency), dbUpdateInfo);
|
||||
// Update properties.
|
||||
// Update item.
|
||||
PopulateTo(dbCurrency, currency, dbUpdateInfo);
|
||||
dbCurrency.ExecuteUpdateCommand(dbCommand);
|
||||
// Record updates.
|
||||
@@ -171,7 +171,7 @@ namespace Sarand.Net.Standard.Dbas.ReferenceData
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Delete Currency.
|
||||
// Delete item.
|
||||
public override bool CurrencyCanBeDeleted (SaCurrency currency)
|
||||
{
|
||||
ClearErrorState();
|
||||
@@ -187,11 +187,11 @@ namespace Sarand.Net.Standard.Dbas.ReferenceData
|
||||
{
|
||||
try
|
||||
{
|
||||
// Retrieve currency.
|
||||
// Retrieve item.
|
||||
dbConnection.Open();
|
||||
Currency_Db dbCurrency = new Currency_Db(DbInfo);
|
||||
dbCurrency.PopulateFrom(dbCommand, aliasCurrency, "Id=" + currency.Id.ToString());
|
||||
// Delete currency.
|
||||
// Delete item.
|
||||
dbCommand.CommandType = System.Data.CommandType.Text;
|
||||
dbCommand.CommandText = "DELETE FROM " + ReferenceDataConsole.TableName_Currency + " WHERE Id=" + SysId.ToString(currency.Id) + ";";
|
||||
dbCommand.ExecuteNonQuery();
|
||||
|
||||
@@ -105,7 +105,7 @@ namespace Sarand.Net.Standard.Dbas.ReferenceData
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Validate Language.
|
||||
// Validate item.
|
||||
public override bool IsValidLanguageData (SaLanguage.Data data, SaLanguage.ErrField errField)
|
||||
{
|
||||
ClearErrorState();
|
||||
@@ -114,7 +114,7 @@ namespace Sarand.Net.Standard.Dbas.ReferenceData
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Insert Language.
|
||||
// Insert item.
|
||||
public override bool InsertLanguage (SaLanguage language, DbUpdateInfo dbUpdateInfo)
|
||||
{
|
||||
ClearErrorState();
|
||||
@@ -142,7 +142,7 @@ namespace Sarand.Net.Standard.Dbas.ReferenceData
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update Language.
|
||||
// Update item.
|
||||
public override bool UpdateLanguage (SaLanguage language, DbUpdateInfo dbUpdateInfo)
|
||||
{
|
||||
ClearErrorState();
|
||||
@@ -153,12 +153,12 @@ namespace Sarand.Net.Standard.Dbas.ReferenceData
|
||||
{
|
||||
try
|
||||
{
|
||||
// Retrieve language.
|
||||
// Retrieve item.
|
||||
dbConnection.Open();
|
||||
Language_Db dbLanguage = new Language_Db(DbInfo);
|
||||
dbLanguage.PopulateFrom(dbCommand, aliasLanguage, "Id=" + SysId.ToString(language.Id));
|
||||
SaUpdateLogItemMonitor_Language updateLogMonitor = new SaUpdateLogItemMonitor_Language(ReferenceDataConsole, CreateLanguage(dbLanguage), dbUpdateInfo);
|
||||
// Update properties.
|
||||
// Update item.
|
||||
PopulateTo(dbLanguage, language, dbUpdateInfo);
|
||||
dbLanguage.ExecuteUpdateCommand(dbCommand);
|
||||
// Record updates.
|
||||
@@ -171,7 +171,7 @@ namespace Sarand.Net.Standard.Dbas.ReferenceData
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Delete Language.
|
||||
// Delete item.
|
||||
public override bool LanguageCanBeDeleted (SaLanguage language)
|
||||
{
|
||||
ClearErrorState();
|
||||
@@ -187,11 +187,11 @@ namespace Sarand.Net.Standard.Dbas.ReferenceData
|
||||
{
|
||||
try
|
||||
{
|
||||
// Retrieve language.
|
||||
// Retrieve item.
|
||||
dbConnection.Open();
|
||||
Language_Db dbLanguage = new Language_Db(DbInfo);
|
||||
dbLanguage.PopulateFrom(dbCommand, aliasLanguage, "Id=" + language.Id.ToString());
|
||||
// Delete language.
|
||||
// Delete item.
|
||||
dbCommand.CommandType = System.Data.CommandType.Text;
|
||||
dbCommand.CommandText = "DELETE FROM " + ReferenceDataConsole.TableName_Language + " WHERE Id=" + SysId.ToString(language.Id) + ";";
|
||||
dbCommand.ExecuteNonQuery();
|
||||
|
||||
@@ -105,7 +105,7 @@ namespace Sarand.Net.Standard.Dbas.ReferenceData
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Validate Region.
|
||||
// Validate item.
|
||||
public override bool IsValidRegionData (SaRegion.Data data, SaRegion.ErrField errField)
|
||||
{
|
||||
ClearErrorState();
|
||||
@@ -114,7 +114,7 @@ namespace Sarand.Net.Standard.Dbas.ReferenceData
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Insert Region.
|
||||
// Insert item.
|
||||
public override bool InsertRegion (SaRegion region, DbUpdateInfo dbUpdateInfo)
|
||||
{
|
||||
ClearErrorState();
|
||||
@@ -142,7 +142,7 @@ namespace Sarand.Net.Standard.Dbas.ReferenceData
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update Region.
|
||||
// Update item.
|
||||
public override bool UpdateRegion (SaRegion region, DbUpdateInfo dbUpdateInfo)
|
||||
{
|
||||
ClearErrorState();
|
||||
@@ -153,12 +153,12 @@ namespace Sarand.Net.Standard.Dbas.ReferenceData
|
||||
{
|
||||
try
|
||||
{
|
||||
// Retrieve region.
|
||||
// Retrieve item.
|
||||
dbConnection.Open();
|
||||
Region_Db dbRegion = new Region_Db(DbInfo);
|
||||
dbRegion.PopulateFrom(dbCommand, aliasRegion, "Id=" + SysId.ToString(region.Id));
|
||||
SaUpdateLogItemMonitor_Region updateLogMonitor = new SaUpdateLogItemMonitor_Region(ReferenceDataConsole, CreateRegion(dbRegion), dbUpdateInfo);
|
||||
// Update properties.
|
||||
// Update item.
|
||||
PopulateTo(dbRegion, region, dbUpdateInfo);
|
||||
dbRegion.ExecuteUpdateCommand(dbCommand);
|
||||
// Record updates.
|
||||
@@ -171,7 +171,7 @@ namespace Sarand.Net.Standard.Dbas.ReferenceData
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Delete Region.
|
||||
// Delete item.
|
||||
public override bool RegionCanBeDeleted (SaRegion region)
|
||||
{
|
||||
ClearErrorState();
|
||||
@@ -187,11 +187,11 @@ namespace Sarand.Net.Standard.Dbas.ReferenceData
|
||||
{
|
||||
try
|
||||
{
|
||||
// Retrieve region.
|
||||
// Retrieve item.
|
||||
dbConnection.Open();
|
||||
Region_Db dbRegion = new Region_Db(DbInfo);
|
||||
dbRegion.PopulateFrom(dbCommand, aliasRegion, "Id=" + region.Id.ToString());
|
||||
// Delete region.
|
||||
// Delete item.
|
||||
dbCommand.CommandType = System.Data.CommandType.Text;
|
||||
dbCommand.CommandText = "DELETE FROM " + ReferenceDataConsole.TableName_Region + " WHERE Id=" + SysId.ToString(region.Id) + ";";
|
||||
dbCommand.ExecuteNonQuery();
|
||||
|
||||
@@ -105,7 +105,7 @@ namespace Sarand.Net.Standard.Dbas.ReferenceData
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Validate TaxCode.
|
||||
// Validate item.
|
||||
public override bool IsValidTaxCodeData (SaTaxCode.Data data, SaTaxCode.ErrField errField)
|
||||
{
|
||||
ClearErrorState();
|
||||
@@ -114,7 +114,7 @@ namespace Sarand.Net.Standard.Dbas.ReferenceData
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Insert TaxCode.
|
||||
// Insert item.
|
||||
public override bool InsertTaxCode (SaTaxCode taxCode, DbUpdateInfo dbUpdateInfo)
|
||||
{
|
||||
ClearErrorState();
|
||||
@@ -142,7 +142,7 @@ namespace Sarand.Net.Standard.Dbas.ReferenceData
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update TaxCode.
|
||||
// Update item.
|
||||
public override bool UpdateTaxCode (SaTaxCode taxCode, DbUpdateInfo dbUpdateInfo)
|
||||
{
|
||||
ClearErrorState();
|
||||
@@ -153,12 +153,12 @@ namespace Sarand.Net.Standard.Dbas.ReferenceData
|
||||
{
|
||||
try
|
||||
{
|
||||
// Retrieve taxCode.
|
||||
// Retrieve item.
|
||||
dbConnection.Open();
|
||||
TaxCode_Db dbTaxCode = new TaxCode_Db(DbInfo);
|
||||
dbTaxCode.PopulateFrom(dbCommand, aliasTaxCode, "Id=" + SysId.ToString(taxCode.Id));
|
||||
SaUpdateLogItemMonitor_TaxCode updateLogMonitor = new SaUpdateLogItemMonitor_TaxCode(ReferenceDataConsole, CreateTaxCode(dbTaxCode), dbUpdateInfo);
|
||||
// Update properties.
|
||||
// Update item.
|
||||
PopulateTo(dbTaxCode, taxCode, dbUpdateInfo);
|
||||
dbTaxCode.ExecuteUpdateCommand(dbCommand);
|
||||
// Record updates.
|
||||
@@ -171,7 +171,7 @@ namespace Sarand.Net.Standard.Dbas.ReferenceData
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Delete TaxCode.
|
||||
// Delete item.
|
||||
public override bool TaxCodeCanBeDeleted (SaTaxCode taxCode)
|
||||
{
|
||||
ClearErrorState();
|
||||
@@ -187,11 +187,11 @@ namespace Sarand.Net.Standard.Dbas.ReferenceData
|
||||
{
|
||||
try
|
||||
{
|
||||
// Retrieve taxCode.
|
||||
// Retrieve item.
|
||||
dbConnection.Open();
|
||||
TaxCode_Db dbTaxCode = new TaxCode_Db(DbInfo);
|
||||
dbTaxCode.PopulateFrom(dbCommand, aliasTaxCode, "Id=" + taxCode.Id.ToString());
|
||||
// Delete taxCode.
|
||||
// Delete item.
|
||||
dbCommand.CommandType = System.Data.CommandType.Text;
|
||||
dbCommand.CommandText = "DELETE FROM " + ReferenceDataConsole.TableName_TaxCode + " WHERE Id=" + SysId.ToString(taxCode.Id) + ";";
|
||||
dbCommand.ExecuteNonQuery();
|
||||
|
||||
@@ -105,7 +105,7 @@ namespace Sarand.Net.Standard.Dbas.ReferenceData
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Validate UnitMeasure.
|
||||
// Validate item.
|
||||
public override bool IsValidUnitMeasureData (SaUnitMeasure.Data data, SaUnitMeasure.ErrField errField)
|
||||
{
|
||||
ClearErrorState();
|
||||
@@ -114,7 +114,7 @@ namespace Sarand.Net.Standard.Dbas.ReferenceData
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Insert UnitMeasure.
|
||||
// Insert item.
|
||||
public override bool InsertUnitMeasure (SaUnitMeasure unitMeasure, DbUpdateInfo dbUpdateInfo)
|
||||
{
|
||||
ClearErrorState();
|
||||
@@ -142,7 +142,7 @@ namespace Sarand.Net.Standard.Dbas.ReferenceData
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update UnitMeasure.
|
||||
// Update item.
|
||||
public override bool UpdateUnitMeasure (SaUnitMeasure unitMeasure, DbUpdateInfo dbUpdateInfo)
|
||||
{
|
||||
ClearErrorState();
|
||||
@@ -153,12 +153,12 @@ namespace Sarand.Net.Standard.Dbas.ReferenceData
|
||||
{
|
||||
try
|
||||
{
|
||||
// Retrieve unitMeasure.
|
||||
// Retrieve item.
|
||||
dbConnection.Open();
|
||||
UnitMeasure_Db dbUnitMeasure = new UnitMeasure_Db(DbInfo);
|
||||
dbUnitMeasure.PopulateFrom(dbCommand, aliasUnitMeasure, "Id=" + SysId.ToString(unitMeasure.Id));
|
||||
SaUpdateLogItemMonitor_UnitMeasure updateLogMonitor = new SaUpdateLogItemMonitor_UnitMeasure(ReferenceDataConsole, CreateUnitMeasure(dbUnitMeasure), dbUpdateInfo);
|
||||
// Update properties.
|
||||
// Update item.
|
||||
PopulateTo(dbUnitMeasure, unitMeasure, dbUpdateInfo);
|
||||
dbUnitMeasure.ExecuteUpdateCommand(dbCommand);
|
||||
// Record updates.
|
||||
@@ -171,7 +171,7 @@ namespace Sarand.Net.Standard.Dbas.ReferenceData
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Delete UnitMeasure.
|
||||
// Delete item.
|
||||
public override bool UnitMeasureCanBeDeleted (SaUnitMeasure unitMeasure)
|
||||
{
|
||||
ClearErrorState();
|
||||
@@ -187,11 +187,11 @@ namespace Sarand.Net.Standard.Dbas.ReferenceData
|
||||
{
|
||||
try
|
||||
{
|
||||
// Retrieve unitMeasure.
|
||||
// Retrieve item.
|
||||
dbConnection.Open();
|
||||
UnitMeasure_Db dbUnitMeasure = new UnitMeasure_Db(DbInfo);
|
||||
dbUnitMeasure.PopulateFrom(dbCommand, aliasUnitMeasure, "Id=" + unitMeasure.Id.ToString());
|
||||
// Delete unitMeasure.
|
||||
// Delete item.
|
||||
dbCommand.CommandType = System.Data.CommandType.Text;
|
||||
dbCommand.CommandText = "DELETE FROM " + ReferenceDataConsole.TableName_UnitMeasure + " WHERE Id=" + SysId.ToString(unitMeasure.Id) + ";";
|
||||
dbCommand.ExecuteNonQuery();
|
||||
|
||||
@@ -146,7 +146,7 @@ namespace Sarand.Net.Standard.Dbas.Security
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Validate item properties.
|
||||
// Validate item.
|
||||
public override bool IsValidSecurityItemData(SaSecurityItem.Data securityItemData, SaSecurityItem.ErrField errField)
|
||||
{
|
||||
ClearErrorState();
|
||||
@@ -186,7 +186,7 @@ namespace Sarand.Net.Standard.Dbas.Security
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update SecurityItem.
|
||||
// Update item.
|
||||
public override bool UpdateSecurityItem(SaSecurityItem securityItem, DbUpdateInfo dbUpdateInfo)
|
||||
{
|
||||
String fn = GetType().Name + ".UpdateSecurityItem";
|
||||
@@ -203,12 +203,12 @@ namespace Sarand.Net.Standard.Dbas.Security
|
||||
{
|
||||
try
|
||||
{
|
||||
// Retrieve securityItem.
|
||||
// Retrieve item.
|
||||
dbConnection.Open();
|
||||
SaSecItem_Db dbSecurityItem = new SaSecItem_Db(DbInfo);
|
||||
dbSecurityItem.PopulateFrom(dbCommand, aliasSecurityItem, "Id=" + SysId.ToString(securityItem.Id));
|
||||
SaUpdateLogItemMonitor_SecurityItem updateLogMonitor = new SaUpdateLogItemMonitor_SecurityItem(SecurityConsole, CreateSecurityItem(dbSecurityItem), dbUpdateInfo);
|
||||
// Update properties.
|
||||
// Update item.
|
||||
PopulateTo(dbSecurityItem, securityItem, dbUpdateInfo);
|
||||
dbSecurityItem.ExecuteUpdateCommand(dbCommand);
|
||||
securityItem.Changed = false;
|
||||
@@ -223,7 +223,7 @@ namespace Sarand.Net.Standard.Dbas.Security
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Delete SecurityItem.
|
||||
// Delete item.
|
||||
public override bool SecurityItemCanBeDeleted(SaSecurityItem securityItem)
|
||||
{
|
||||
ClearErrorState();
|
||||
@@ -240,11 +240,11 @@ namespace Sarand.Net.Standard.Dbas.Security
|
||||
{
|
||||
try
|
||||
{
|
||||
// Retrieve securityItem.
|
||||
// Retrieve item.
|
||||
dbConnection.Open();
|
||||
SaSecItem_Db dbSecurityItem = new SaSecItem_Db(DbInfo);
|
||||
dbSecurityItem.PopulateFrom(dbCommand, aliasSecurityItem, "Id=" + SysId.ToString(securityItem.Id));
|
||||
// Delete securityItem.
|
||||
// Delete item.
|
||||
dbCommand.CommandType = System.Data.CommandType.Text;
|
||||
dbCommand.CommandText = "DELETE FROM " + TableName_SecItem + " WHERE Id=" + SysId.ToString(securityItem.Id) + ";";
|
||||
dbCommand.ExecuteNonQuery();
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace Sarand.Net.Standard.Dbas.Security
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Create Security Link.
|
||||
// Create item.
|
||||
public override SaSecurityLink CreateSecurityLink (SysId itemIdOwner, SysId itemIdTarget, SysId itemIdContext)
|
||||
{
|
||||
ClearErrorState();
|
||||
@@ -82,7 +82,7 @@ namespace Sarand.Net.Standard.Dbas.Security
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Validate Security Link.
|
||||
// Validate item.
|
||||
public override bool IsValidSecurityLinkData (SaSecurityLink.Data securityLinkData, SaSecurityLink.ErrField errField)
|
||||
{
|
||||
ClearErrorState();
|
||||
@@ -91,7 +91,7 @@ namespace Sarand.Net.Standard.Dbas.Security
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Insert Security Link.
|
||||
// Insert item.
|
||||
public override bool InsertSecurityLink (SaSecurityLink securityLink, DbUpdateInfo dbUpdateInfo)
|
||||
{
|
||||
ClearErrorState();
|
||||
@@ -112,7 +112,7 @@ namespace Sarand.Net.Standard.Dbas.Security
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update Security Link.
|
||||
// Update item.
|
||||
public override bool UpdateSecurityLink (SaSecurityLink securityLink, DbUpdateInfo dbUpdateInfo)
|
||||
{
|
||||
ClearErrorState();
|
||||
@@ -122,12 +122,12 @@ namespace Sarand.Net.Standard.Dbas.Security
|
||||
{
|
||||
try
|
||||
{
|
||||
// Retrieve securityLink.
|
||||
// Retrieve item.
|
||||
dbConnection.Open();
|
||||
SaSecLink_Db dbSecurityLink = new SaSecLink_Db(DbInfo);
|
||||
dbSecurityLink.PopulateFrom(dbCommand, aliasSecurityLink, GetSecurityLinkFilter(securityLink.ItemIdOwner, securityLink.ItemIdTarget, securityLink.ItemIdContext));
|
||||
// TODO SlmUpdateLogItemMonitor_SecurityLink updateLogMonitor = new SlmUpdateLogItemMonitor_SecurityLink(prsAssMov, dbUpdateInfo);
|
||||
// Update properties.
|
||||
// Update item.
|
||||
PopulateTo(dbSecurityLink, securityLink, dbUpdateInfo);
|
||||
dbSecurityLink.ExecuteUpdateCommand(dbCommand);
|
||||
// TODO updateLogMonitor.RecordUpdatedValues(pAssMov);
|
||||
@@ -139,7 +139,7 @@ namespace Sarand.Net.Standard.Dbas.Security
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Delete Security Link.
|
||||
// Delete item.
|
||||
public override bool SecurityLinkCanBeDeleted (SaSecurityLink securityLink)
|
||||
{
|
||||
ClearErrorState();
|
||||
@@ -154,11 +154,11 @@ namespace Sarand.Net.Standard.Dbas.Security
|
||||
{
|
||||
try
|
||||
{
|
||||
// Retrieve securityLink.
|
||||
// Retrieve item.
|
||||
dbConnection.Open();
|
||||
SaSecLink_Db dbSecurityLink = new SaSecLink_Db(DbInfo);
|
||||
dbSecurityLink.PopulateFrom(dbCommand, aliasSecurityLink, GetSecurityLinkFilter(securityLink.ItemIdOwner, securityLink.ItemIdTarget, securityLink.ItemIdContext));
|
||||
// Delete securityLink.
|
||||
// Delete item.
|
||||
dbCommand.CommandType = System.Data.CommandType.Text;
|
||||
dbCommand.CommandText =
|
||||
"DELETE " + aliasSecurityLink + " FROM " + TableName_SecLink + " AS " + aliasSecurityLink +
|
||||
|
||||
@@ -235,7 +235,7 @@ namespace Sarand.Net.Standard.Dbas.UpdateLog
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Insert UpdateLog.
|
||||
// Insert item.
|
||||
public override bool InsertLogEntry (SaUpdateLogEntry logEntry, DbUpdateInfo dbUpdateInfo)
|
||||
{
|
||||
ClearErrorState();
|
||||
@@ -263,7 +263,7 @@ namespace Sarand.Net.Standard.Dbas.UpdateLog
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update UpdateLog.
|
||||
// Update item.
|
||||
public override bool UpdateLogEntry (SaUpdateLogEntry logEntry, DbUpdateInfo dbUpdateInfo)
|
||||
{
|
||||
ClearErrorState();
|
||||
@@ -274,11 +274,11 @@ namespace Sarand.Net.Standard.Dbas.UpdateLog
|
||||
{
|
||||
try
|
||||
{
|
||||
// Retrieve logEntry.
|
||||
// Retrieve item.
|
||||
dbConnection.Open();
|
||||
SaAttrUpdate_Db dbUpdateLog = new SaAttrUpdate_Db(DbInfo);
|
||||
dbUpdateLog.PopulateFrom(dbCommand, aliasUpdateLog, GetUpdateLogEntryFilter(logEntry));
|
||||
// Update properties.
|
||||
// Update item.
|
||||
PopulateTo(dbUpdateLog, logEntry, dbUpdateInfo);
|
||||
dbUpdateLog.ExecuteUpdateCommand(dbCommand);
|
||||
}
|
||||
@@ -288,7 +288,7 @@ namespace Sarand.Net.Standard.Dbas.UpdateLog
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Delete UpdateLog.
|
||||
// Delete item.
|
||||
public override bool LogEntryCanBeDeleted (SaUpdateLogEntry logEntry)
|
||||
{
|
||||
ClearErrorState();
|
||||
@@ -304,11 +304,11 @@ namespace Sarand.Net.Standard.Dbas.UpdateLog
|
||||
{
|
||||
try
|
||||
{
|
||||
// Retrieve logEntry.
|
||||
// Retrieve item.
|
||||
dbConnection.Open();
|
||||
SaAttrUpdate_Db dbUpdateLog = new SaAttrUpdate_Db(DbInfo);
|
||||
dbUpdateLog.PopulateFrom(dbCommand, aliasUpdateLog, GetUpdateLogEntryFilter(logEntry));
|
||||
// Delete logEntry.
|
||||
// Delete item.
|
||||
dbCommand.CommandType = System.Data.CommandType.Text;
|
||||
dbCommand.CommandText = "DELETE FROM " + SaUpdateLogDbDfn.GetTableName(SaUpdateLogDbDfn.TableIdx.SaAttrUpdate) + " WHERE " + GetUpdateLogEntryFilter(logEntry) + ";";
|
||||
dbCommand.ExecuteNonQuery();
|
||||
|
||||
Reference in New Issue
Block a user