66 lines
2.1 KiB
C#
66 lines
2.1 KiB
C#
using Sarand.PatientMgr.Core.App;
|
|
using Sarand.Core.Bus;
|
|
using Sarand.Core.CodeTypes;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
|
|
namespace Sarand.PatientMgr.Core.Mgr
|
|
{
|
|
//=======================================================================
|
|
public abstract class SpmItemMgr : SacsItemMgr
|
|
{
|
|
//-------------------------------------------------------------------
|
|
// Data members.
|
|
private SaCodeTypeConsole codeTypeConsole;
|
|
// Managers.
|
|
private SpmAdmissionMgr admissionMgr;
|
|
|
|
//-------------------------------------------------------------------
|
|
// Static initialisation.
|
|
static SpmItemMgr ()
|
|
{
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
// Construction.
|
|
protected SpmItemMgr (SpmUserContext userContext)
|
|
{
|
|
if (userContext == null)
|
|
throw new NotSupportedException("SpmItemMgr User context must be supplied");
|
|
UserContext = userContext;
|
|
}
|
|
protected override void Dispose (bool disposing)
|
|
{
|
|
if (disposing)
|
|
{
|
|
if (admissionMgr != null) admissionMgr.Dispose();
|
|
}
|
|
base.Dispose(disposing);
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
// Properties.
|
|
public SpmUserContext UserContext { get; }
|
|
public SpmSessionContext SessionContext { get { return UserContext.SessionContext; } }
|
|
public SaCodeTypeConsole CodeTypeConsole { get { if (codeTypeConsole == null) codeTypeConsole = SpmGlobals.GetCodeTypeConsole(UserContext); { return codeTypeConsole; } } }
|
|
// Managers.
|
|
public SpmAdmissionMgr AdmissionMgr { get { if (admissionMgr == null) admissionMgr = SpmGlobals.System.CreateAdmissionMgr(UserContext); return admissionMgr; } }
|
|
|
|
//-------------------------------------------------------------------
|
|
// Utilities.
|
|
/*
|
|
public bool ColumnExists (SpmDbDfn.ColumnIdx columnIdx)
|
|
{
|
|
SpmApplication application = SpmGlobals.Application;
|
|
if (application != null)
|
|
return application.ColumnExists(SessionContext, columnIdx);
|
|
return false;
|
|
}
|
|
*/
|
|
|
|
//-------------------------------------------------------------------
|
|
}
|
|
//=======================================================================
|
|
}
|