Session Console and Internals.
This commit is contained in:
@@ -36,7 +36,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
public override bool CanManageCommoditySuppliers()
|
||||
{
|
||||
if (SessionConsole == null || !AllowConfigOption(Sbm.ConfigOption.CommoditySuppliers)) return false;
|
||||
return db != null && db.TableExists(SbmDbDfn.GetTableName(SbmDbDfn.TableIdx.CommoditySupplier));
|
||||
return Database != null && Database.TableExists(SbmDbDfn.GetTableName(SbmDbDfn.TableIdx.CommoditySupplier));
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
@@ -57,7 +57,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
}
|
||||
SbmCommoditySupplier commoditySupplier = null;
|
||||
// Query data.
|
||||
using (var dbConnection = db.CreateConnection())
|
||||
using (var dbConnection = Database.CreateConnection())
|
||||
using (var dbCommand = dbConnection.CreateCommand())
|
||||
{
|
||||
try
|
||||
@@ -104,7 +104,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
public override bool StoreCommoditySuppliers(List<SbmCommoditySupplier> commoditySuppliers)
|
||||
{
|
||||
ClearErrorState();
|
||||
if (db != null && db.TableExists(SbmDbDfn.GetTableName(SbmDbDfn.TableIdx.CommoditySupplier)))
|
||||
if (Database != null && Database.TableExists(SbmDbDfn.GetTableName(SbmDbDfn.TableIdx.CommoditySupplier)))
|
||||
foreach (SbmCommoditySupplier commoditySupplier in commoditySuppliers)
|
||||
{
|
||||
}
|
||||
@@ -115,7 +115,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
{
|
||||
ClearErrorState();
|
||||
commoditySupplier = null;
|
||||
if (db != null && db.TableExists(SbmDbDfn.GetTableName(SbmDbDfn.TableIdx.CommoditySupplier)))
|
||||
if (Database != null && Database.TableExists(SbmDbDfn.GetTableName(SbmDbDfn.TableIdx.CommoditySupplier)))
|
||||
{
|
||||
}
|
||||
return !HasErrorState();
|
||||
@@ -128,7 +128,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
ClearErrorState();
|
||||
if (!IsValidCommoditySupplier(commoditySupplier)) return false;
|
||||
if (SysId.IsValid(commoditySupplier.Id)) return SetErrorState(ErrorMessage.ValiditemId);
|
||||
using (var dbConnection = db.CreateConnection())
|
||||
using (var dbConnection = Database.CreateConnection())
|
||||
using (var dbCommand = dbConnection.CreateCommand())
|
||||
{
|
||||
try
|
||||
@@ -139,7 +139,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
if (CommoditySupplier_Db.FieldsNonId.Contains("Id"))
|
||||
{
|
||||
// Generate next Id.
|
||||
dbCommoditySupplier._CommodityId = SysId.ToInt(db.GetNextId("CommoditySupplier", dbUpdateInfo));
|
||||
dbCommoditySupplier._CommodityId = SysId.ToInt(Database.GetNextId("CommoditySupplier", dbUpdateInfo));
|
||||
}
|
||||
dbCommoditySupplier.ExecuteInsertCommand(dbCommand);
|
||||
commoditySupplier.Id = new SysId(dbCommoditySupplier._CommodityId);
|
||||
@@ -163,7 +163,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
if (DebugMode) SaLogger.Debug($"{SysUtil.Fn} Data not changed. " + GetLogProperties(commoditySupplier).Concat(": ").Concat("", "\n\t"));
|
||||
return true;
|
||||
}
|
||||
using (var dbConnection = db.CreateConnection())
|
||||
using (var dbConnection = Database.CreateConnection())
|
||||
using (var dbCommand = dbConnection.CreateCommand())
|
||||
{
|
||||
try
|
||||
@@ -201,7 +201,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
{
|
||||
ClearErrorState();
|
||||
if (!CommoditySupplierCanBeDeleted(commoditySupplier)) return false;
|
||||
using (var dbConnection = db.CreateConnection())
|
||||
using (var dbConnection = Database.CreateConnection())
|
||||
using (var dbCommand = dbConnection.CreateCommand())
|
||||
{
|
||||
try
|
||||
@@ -481,7 +481,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
private long GetCommoditySupplierCount(String filter)
|
||||
{
|
||||
ClearErrorState();
|
||||
return db.GetRowCount(SbmDbDfn.GetTableName(SbmDbDfn.TableIdx.CommoditySupplier) + " As " + aliasCommoditySupplier, filter);
|
||||
return Database.GetRowCount(SbmDbDfn.GetTableName(SbmDbDfn.TableIdx.CommoditySupplier) + " As " + aliasCommoditySupplier, filter);
|
||||
}
|
||||
public override long GetCommoditySupplierCount(SbmCommoditySupplier.Params prm)
|
||||
{
|
||||
@@ -495,14 +495,14 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
{
|
||||
ClearErrorState();
|
||||
List<SbmCommoditySupplier> commoditySuppliers = new List<SbmCommoditySupplier>();
|
||||
DbQuery qry = new DbQuery(db.DbmsType);
|
||||
DbQuery qry = new DbQuery(Database.DbmsType);
|
||||
qry.Tables.Add(SbmDbDfn.GetTableName(SbmDbDfn.TableIdx.CommoditySupplier), aliasCommoditySupplier);
|
||||
CommoditySupplier_Db dbCommoditySupplier = new CommoditySupplier_Db(DbInfo);
|
||||
qry.Columns.AddRange(dbCommoditySupplier.ExistingColumnNames);
|
||||
qry.Filters.AddRange(GetCommoditySupplierQueryFilter(prm));
|
||||
qry.OrderBy.AddRange(GetCommoditySupplierSortColumns(prm));
|
||||
// Query data.
|
||||
using (var dbConnection = db.CreateConnection())
|
||||
using (var dbConnection = Database.CreateConnection())
|
||||
using (var dbCommand = dbConnection.CreateCommand())
|
||||
{
|
||||
try
|
||||
@@ -536,7 +536,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
|
||||
//---------------------------------------------------------------
|
||||
// Construct query.
|
||||
DbQuery query = new DbQuery(db.DbmsType);
|
||||
DbQuery query = new DbQuery(Database.DbmsType);
|
||||
query.Tables.Add(SbmDbDfn.GetTableName(SbmDbDfn.TableIdx.CommoditySupplier), aliasCommoditySupplier);
|
||||
|
||||
// Columns to query.
|
||||
@@ -611,8 +611,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
query.OrderBy.Add(sortColumn);
|
||||
}
|
||||
|
||||
//return new DbResultSet_DataTableReader(db, query.BuildQuery());
|
||||
return DbResultSet_DataReader.ExecuteQuery(db, query.BuildQuery(prm.ResultsPaging));
|
||||
//return new DbResultSet_DataTableReader(Database, query.BuildQuery());
|
||||
return DbResultSet_DataReader.ExecuteQuery(Database, query.BuildQuery(prm.ResultsPaging));
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user