85 lines
2.5 KiB
C#
85 lines
2.5 KiB
C#
using Sarand.BusinessMgr.Net.Standard.Base.App;
|
|
using Sarand.BusinessMgr.Net.Standard.Base.Mgr;
|
|
using Sarand.Net.Standard.Base.CodeTypes;
|
|
using Sarand.Net.Standard.Base.Dbas;
|
|
using Sarand.Net.Standard.Base.Procs;
|
|
|
|
namespace Sarand.BusinessMgr.Net.Standard.Base.Procs
|
|
{
|
|
//=======================================================================
|
|
public abstract class SbmReport_Base : SacsReport
|
|
{
|
|
//-------------------------------------------------------------------
|
|
// Configuration.
|
|
public new class Config : SacsReport.Config
|
|
{
|
|
protected Config(SbmUserContext userContext, DbUpdateInfo dbUpdateInfo)
|
|
{
|
|
UserContext = userContext;
|
|
DbUpdateInfo = dbUpdateInfo;
|
|
}
|
|
public SbmUserContext UserContext { get; }
|
|
public DbUpdateInfo DbUpdateInfo { get; }
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
// Data members.
|
|
private Config config;
|
|
private SbmAccountMgr accountMgr = null;
|
|
private SbmCommodityMgr commodityMgr = null;
|
|
private SbmTransactionMgr transactionMgr = null;
|
|
|
|
//-------------------------------------------------------------------
|
|
// Construction.
|
|
protected SbmReport_Base(Config config) : base(config)
|
|
{
|
|
this.config = config;
|
|
}
|
|
protected override void Dispose(bool disposing)
|
|
{
|
|
if (disposing)
|
|
{
|
|
if (accountMgr != null) accountMgr.Dispose();
|
|
if (commodityMgr != null) commodityMgr.Dispose();
|
|
if (transactionMgr != null) transactionMgr.Dispose();
|
|
}
|
|
base.Dispose(disposing);
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
// Properties.
|
|
protected SaCodeTypeConsole CodeTypeConsole { get { return SbmGlobals.Application.GetCodeTypeConsole(config.UserContext); } }
|
|
protected SbmAccountMgr AccountMgr
|
|
{
|
|
get
|
|
{
|
|
if (accountMgr == null)
|
|
accountMgr = SbmGlobals.System.CreateAccountMgr(config.UserContext);
|
|
return accountMgr;
|
|
}
|
|
}
|
|
protected SbmCommodityMgr CommodityMgr
|
|
{
|
|
get
|
|
{
|
|
if (commodityMgr == null)
|
|
commodityMgr = SbmGlobals.System.CreateCommodityMgr(config.UserContext);
|
|
return commodityMgr;
|
|
}
|
|
}
|
|
protected SbmTransactionMgr TransactionMgr
|
|
{
|
|
get
|
|
{
|
|
if (transactionMgr == null)
|
|
transactionMgr = SbmGlobals.System.CreateTransactionMgr(config.UserContext);
|
|
return transactionMgr;
|
|
}
|
|
}
|
|
protected DbUpdateInfo DbUpdateInfo { get { return config.DbUpdateInfo; } }
|
|
|
|
//-------------------------------------------------------------------
|
|
}
|
|
//=======================================================================
|
|
}
|