57 lines
2.1 KiB
C#
57 lines
2.1 KiB
C#
using Sarand.BusinessMgr.Net.Standard.Base.App;
|
|
using Sarand.BusinessMgr.Net.Standard.Base.Core;
|
|
using Sarand.BusinessMgr.Net.Standard.Base.Mgr;
|
|
using Sarand.BusinessMgr.Net.Standard.Dbas.Data;
|
|
using Sarand.Net.Standard.Base.Dbas;
|
|
using Sarand.Net.Standard.Dbas.Base;
|
|
using System;
|
|
|
|
namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|
{
|
|
//=======================================================================
|
|
internal partial class SbmCommodityMgr_Dbas : SbmCommodityMgr
|
|
{
|
|
//-------------------------------------------------------------------
|
|
// Data members.
|
|
private SacsDatabase db = null;
|
|
private readonly SbmDbDataItem.SbmDatabaseInfo dbInfo;
|
|
private readonly DateTime today = DateTime.Today;
|
|
|
|
//-------------------------------------------------------------------
|
|
// Construction.
|
|
public SbmCommodityMgr_Dbas(ISbmUserContext userContext) :
|
|
base(userContext)
|
|
{
|
|
db = (SbmGlobals.Application.GetBusMgrDatabase(SessionContext) as SacsDatabase);
|
|
dbInfo = new SbmDbDataItem.SbmDatabaseInfo(db.DatabaseName, db.GetTableDfns());
|
|
OrderQuantityDecimals = UserContext.GetOwnerOption_NumericDecimals(Sbm.OrgOption_NumericDecimals.OrderQuantity);
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
// Database properties.
|
|
protected ISacsDatabase Database { get { return db; } }
|
|
protected SbmDbDataItem.SbmDatabaseInfo DbInfo { get { return dbInfo; } }
|
|
public override bool ContainerDatabaseIsValid
|
|
{
|
|
get
|
|
{
|
|
if (!Database.TableExists(SbmDbDfn.GetTableName(SbmDbDfn.TableIdx.Container))) return false;
|
|
if (!Database.TableExists(SbmDbDfn.GetTableName(SbmDbDfn.TableIdx.ContainerItem))) return false;
|
|
return true;
|
|
}
|
|
}
|
|
public override bool PortfolioDatabaseIsValid
|
|
{
|
|
get
|
|
{
|
|
if (!Database.TableExists(TableName_PortfolioItem)) return false;
|
|
return true;
|
|
}
|
|
}
|
|
public String TableName_PortfolioItem { get { return SbmDbDfn.GetTableName(SbmDbDfn.TableIdx.ContainerItem); } }
|
|
|
|
//-------------------------------------------------------------------
|
|
}
|
|
//=======================================================================
|
|
}
|