Config - Departments - in progress

This commit is contained in:
2019-12-04 13:59:00 +00:00
parent 15541b77aa
commit 114aa49535
90 changed files with 3430 additions and 660 deletions
+28 -20
View File
@@ -26,26 +26,29 @@ namespace Sarand.PatientMgr.Win.Forms.Base
[Browsable(false)]
public new class Config : SacsForm.Config
{
/// <summary>Pass Internals via Config to share cached data.</summary>
public SpmInternals Internals { get; set; } = null;
}
//-------------------------------------------------------------------
// Data members.
private readonly Config config;
private readonly SpmInternals internals;
private SpmInternals internals = null;
//-------------------------------------------------------------------
// Construction.
private SpmForm() : this(new Config()) { }
protected SpmForm(Config config) : base(config)
private SpmForm () : this(new Config()) { }
protected SpmForm (Config config) : base(config)
{
this.config = config;
InitializeComponent();
}
protected override void Dispose(bool disposing)
protected override void Dispose (bool disposing)
{
if (disposing && (components != null))
if (disposing)
{
components.Dispose();
if (components != null) components.Dispose();
if (internals != null) internals.Dispose();
}
base.Dispose(disposing);
}
@@ -55,23 +58,28 @@ namespace Sarand.PatientMgr.Win.Forms.Base
// Session.
protected SpmSessionProfile_Win SessionProfile { get; } = SpmGlobals_Win.SessionProfile;
protected SpmUserContext UserContext { get { return (SessionProfile != null ? SessionProfile.UserContext : null); } }
protected SpmSessionContext SessionContext { get { return (UserContext != null ? UserContext.SessionContext : null); } }
public SpmUserContext UserContext { get { return (SessionProfile != null ? SessionProfile.UserContext : null); } }
public SpmSessionContext SessionContext { get { return (UserContext != null ? UserContext.SessionContext : null); } }
protected SpmInternals Internals
{
get
{
if (config.Internals != null) return config.Internals;
if (internals == null) internals = new SpmInternals(UserContext);
return internals;
}
}
// Security.
protected SpmSecurityProfile SecurityProfile { get { return internals.SecurityProfile; } }
public SpmSecurityProfile SecurityProfile { get { return Internals.SecurityProfile; } }
// Managers.
protected SpmAdmissionMgr AdmissionMgr { get { return internals.AdmissionMgr; } }
protected SpmDepartmentMgr DepartmentMgr { get { return internals.DepartmentMgr; } }
protected SpmInstitutionMgr InstitutionMgr { get { return internals.InstitutionMgr; } }
public SpmInstitutionMgr InstitutionMgr { get { return Internals.InstitutionMgr; } }
public SpmDepartmentMgr DepartmentMgr { get { return Internals.DepartmentMgr; } }
public SpmAdmissionMgr AdmissionMgr { get { return Internals.AdmissionMgr; } }
// Consoles.
protected SaSecurityConsole SecurityConsole { get { return internals.SecurityConsole; } }
protected SaCodeTypeConsole CodeTypeConsole { get { return internals.CodeTypeConsole; } }
protected SaUpdateLogConsole UpdateLogConsole { get { return internals.UpdateLogConsole; } }
protected SaItemOptionConsole ItemOptionConsole { get { return internals.ItemOptionConsole; } }
public SaSecurityConsole SecurityConsole { get { return Internals.SecurityConsole; } }
public SaCodeTypeConsole CodeTypeConsole { get { return Internals.CodeTypeConsole; } }
public SaUpdateLogConsole UpdateLogConsole { get { return Internals.UpdateLogConsole; } }
public SaItemOptionConsole ItemOptionConsole { get { return Internals.ItemOptionConsole; } }
//-------------------------------------------------------------------
}