Files
PatientMgr-CSharp/SaPatMgrWinForms/Win/Forms/Base/SpmPanel.cs
T
2019-06-20 14:49:34 +01:00

91 lines
3.1 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Sarand.Win.Forms.Controls;
using Sarand.PatientMgr.Core.App;
using Sarand.PatientMgr.Win.Forms.App;
using Sarand.PatientMgr.Core.Mgr;
using Sarand.Core.Security;
using Sarand.Core.CodeTypes;
using Sarand.Core.ItemOptions;
using Sarand.Core.UpdateLog;
using Sarand.Core.Dbas.Base;
namespace Sarand.PatientMgr.Win.Forms.Base
{
//=======================================================================
public partial class SpmPanel : SacsPanel
{
//-------------------------------------------------------------------
// Configuration.
public new class Config : SacsPanel.Config
{
}
//-------------------------------------------------------------------
// Data members.
private Config config = new Config();
private readonly SpmInternals internals;
//-------------------------------------------------------------------
// Construction.
public SpmPanel() : this(new Config()) { }
public SpmPanel(Config config) : base()
{
SetConfig(config);
InitializeComponent();
internals = new SpmInternals(SessionProfile != null ? SessionProfile.UserContext : null);
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (components != null) components.Dispose();
if (internals != null) internals.Dispose();
}
base.Dispose(disposing);
}
//-------------------------------------------------------------------
// Properties.
// 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); } }
protected DbUpdateInfo DbUpdateInfo { get { return internals.DbUpdateInfo; } }
// Security.
protected 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; } }
// 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; } }
//-------------------------------------------------------------------
// Configure.
protected void SetConfig(Config config)
{
base.SetConfig(config);
this.config = config;
}
//-------------------------------------------------------------------
}
//=======================================================================
}