Config - Departments - in progress
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
namespace Sarand.PatientMgr.Win.Forms.Config
|
||||
{
|
||||
partial class SpmForm_Config
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent ()
|
||||
{
|
||||
this.splitContainer = new System.Windows.Forms.SplitContainer();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
|
||||
this.splitContainer.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// splitContainer
|
||||
//
|
||||
this.splitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.splitContainer.Location = new System.Drawing.Point(0, 0);
|
||||
this.splitContainer.Name = "splitContainer";
|
||||
this.splitContainer.Size = new System.Drawing.Size(747, 493);
|
||||
this.splitContainer.SplitterDistance = 179;
|
||||
this.splitContainer.TabIndex = 0;
|
||||
//
|
||||
// SpmForm_Config
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(747, 493);
|
||||
this.Controls.Add(this.splitContainer);
|
||||
this.MinimizeBox = false;
|
||||
this.MinimumSize = new System.Drawing.Size(720, 480);
|
||||
this.Name = "SpmForm_Config";
|
||||
this.ShowIcon = false;
|
||||
this.Text = "Sarand Patient Manager - Configuration";
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit();
|
||||
this.splitContainer.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.SplitContainer splitContainer;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,204 @@
|
||||
using Sarand.PatientMgr.Win.Forms.Base;
|
||||
using Sarand.PatientMgr.Win.Forms.Panels;
|
||||
using Sarand.Win.Forms.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Sarand.PatientMgr.Win.Forms.Config
|
||||
{
|
||||
//=======================================================================
|
||||
public partial class SpmForm_Config : SpmForm
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Configuration.
|
||||
public new class Config : SpmForm.Config
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Definitions.
|
||||
public enum ConfigPanelType
|
||||
{
|
||||
Unknown = 0,
|
||||
Departments,
|
||||
Operations,
|
||||
Employees,
|
||||
Patients,
|
||||
Procedures,
|
||||
EmployeeRoles,
|
||||
FacilityTemplates
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
private Config config = null;
|
||||
private SpmPanel_Config_Menu panelMenu = null;
|
||||
private ConfigPanelType panelType = ConfigPanelType.Unknown;
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
private SpmForm_Config () : this(new Config()) { }
|
||||
public SpmForm_Config (Config config) : base(config)
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
protected override void Dispose (bool disposing)
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
if (components != null) components.Dispose();
|
||||
if (panelMenu != null) panelMenu.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
[Browsable(false), ReadOnly(true), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||
public ConfigPanelType PanelType
|
||||
{
|
||||
get { return panelType; }
|
||||
set
|
||||
{
|
||||
SwitchPanel(value);
|
||||
}
|
||||
}
|
||||
private void SwitchPanel (ConfigPanelType panelType)
|
||||
{
|
||||
if (this.panelType == panelType) return;
|
||||
|
||||
SpmPanel panel = null;
|
||||
switch (panelType)
|
||||
{
|
||||
case ConfigPanelType.Departments:
|
||||
{
|
||||
SpmPanel_Departments.Config panelConfig = new SpmPanel_Departments.Config(SpmPanel_Departments.PanelMode.Maintain);
|
||||
panel = new SpmPanel_Departments(panelConfig);
|
||||
break;
|
||||
}
|
||||
case ConfigPanelType.FacilityTemplates:
|
||||
{
|
||||
SpmPanel_FacilityTemplates.Config panelConfig = new SpmPanel_FacilityTemplates.Config();
|
||||
panelConfig.Mode = SpmPanel_FacilityTemplates.PanelMode.Maintain;
|
||||
panel = new SpmPanel_FacilityTemplates(panelConfig);
|
||||
break;
|
||||
}
|
||||
case ConfigPanelType.Operations:
|
||||
{
|
||||
/* ToDo Operations panel
|
||||
SpmPanel_Operations.Config panelConfig = new SpmPanel_Operations.Config();
|
||||
panelConfig.Mode = SpmPanel_Operations.PanelMode.Maintain;
|
||||
panel = new SpmPanel_Operations(panelConfig);
|
||||
*/
|
||||
break;
|
||||
}
|
||||
case ConfigPanelType.Procedures:
|
||||
{
|
||||
SpmPanel_Procedures.Config panelConfig = new SpmPanel_Procedures.Config();
|
||||
panelConfig.Mode = SpmPanel_Procedures.PanelMode.Maintain;
|
||||
panel = new SpmPanel_Procedures(panelConfig);
|
||||
break;
|
||||
}
|
||||
case ConfigPanelType.Patients:
|
||||
{
|
||||
/* ToDo Patients panel
|
||||
SpmPanel_Patients.Config panelConfig = new SpmPanel_Patients.Config();
|
||||
panelConfig.Mode = SpmPanel_Patients.PanelMode.Maintain;
|
||||
panel = new SpmPanel_Patients(panelConfig);
|
||||
*/
|
||||
break;
|
||||
}
|
||||
case ConfigPanelType.Employees:
|
||||
{
|
||||
/* ToDo Employees panel
|
||||
SpmPanel_Employees.Config panelConfig = new SpmPanel_Employees.Config();
|
||||
panelConfig.Mode = SpmPanel_Employees.PanelMode.Maintain;
|
||||
panel = new SpmPanel_Employees(panelConfig);
|
||||
*/
|
||||
break;
|
||||
}
|
||||
case ConfigPanelType.EmployeeRoles:
|
||||
{
|
||||
SpmPanel_EmployeeRoles.Config panelConfig = new SpmPanel_EmployeeRoles.Config();
|
||||
panelConfig.Mode = SpmPanel_EmployeeRoles.PanelMode.Maintain;
|
||||
panel = new SpmPanel_EmployeeRoles(panelConfig);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (panel == null) return;
|
||||
|
||||
// Clear existing view.
|
||||
while (splitContainer.Panel2.Controls.Count > 0)
|
||||
{
|
||||
Control control = splitContainer.Panel2.Controls[0];
|
||||
splitContainer.Panel2.Controls.RemoveAt(0);
|
||||
control.Dispose();
|
||||
}
|
||||
// Add new view.
|
||||
splitContainer.Panel2.Controls.Add(panel);
|
||||
panel.Dock = DockStyle.Fill;
|
||||
|
||||
this.panelType = panelType;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// I n i t i a l i s a t i o n
|
||||
//-------------------------------------------------------------------
|
||||
protected override void OnCreateControl ()
|
||||
{
|
||||
base.OnCreateControl();
|
||||
if (this.IsDesignerHosted()) return;
|
||||
|
||||
// Spliter.
|
||||
splitContainer.SplitterDistance = 200;
|
||||
splitContainer.FixedPanel = FixedPanel.Panel1;
|
||||
splitContainer.IsSplitterFixed = true;
|
||||
|
||||
// Menu panel.
|
||||
SpmPanel_Config_Menu.Config menuConfig = new SpmPanel_Config_Menu.Config();
|
||||
menuConfig.ConfigForm = this;
|
||||
panelMenu = new SpmPanel_Config_Menu(menuConfig);
|
||||
splitContainer.Panel1.Controls.Add(panelMenu);
|
||||
panelMenu.Dock = DockStyle.Fill;
|
||||
panelMenu.RefreshPanel();
|
||||
|
||||
SetControlActivity();
|
||||
}
|
||||
protected override void OnShown (EventArgs e)
|
||||
{
|
||||
base.OnShown(e);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// C o n t r o l A c t i v i t y
|
||||
//-------------------------------------------------------------------
|
||||
protected override void SetControlActivity ()
|
||||
{
|
||||
SetControlsReadOnly();
|
||||
}
|
||||
protected override void SetControlsReadOnly ()
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// F o r m A c t i o n s
|
||||
//-------------------------------------------------------------------
|
||||
public void RefreshView()
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// F o r m E v e n t s
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -0,0 +1,23 @@
|
||||
namespace Sarand.PatientMgr.Win.Forms.Config
|
||||
{
|
||||
partial class SpmPanel_Config_Menu
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent ()
|
||||
{
|
||||
components = new System.ComponentModel.Container();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,311 @@
|
||||
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.Win.Forms.Utils;
|
||||
using Sarand.Core.Base;
|
||||
using Sarand.Core.App;
|
||||
using Sarand.PatientMgr.Core.Bus;
|
||||
using Sarand.PatientMgr.Core.App;
|
||||
using Sarand.PatientMgr.Win.Forms.Base;
|
||||
using Sarand.Core.Dbas.Base;
|
||||
using Sarand.Core.Security;
|
||||
using Sarand.PatientMgr.Win.Forms.App;
|
||||
|
||||
namespace Sarand.PatientMgr.Win.Forms.Config
|
||||
{
|
||||
//=======================================================================
|
||||
public partial class SpmPanel_Config_Menu : SacsHtmlPanel
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Configuration.
|
||||
public new class Config : SacsHtmlPanel.Config
|
||||
{
|
||||
public SpmForm_Config ConfigForm { get; set; }
|
||||
public SpmForm AdmissionListForm { get; set; }
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
private Config config = null;
|
||||
private bool appCmdInProgress = false;
|
||||
private static String AppCmd_AdmClose = "AdmClose";
|
||||
private static String AppCmd_AdmRefresh = "AdmRefresh";
|
||||
private static String AppCmd_AdmSecurity = "AdmSecurity";
|
||||
private static String AppCmd_AdmCodeTypes = "AdmCodeTypes";
|
||||
private static String AppCmd_AdmExport = "AdmExport";
|
||||
private static String AppCmd_AdmStatistics = "AdmStatistics";
|
||||
private static String AppCmd_AdmDatabase = "AdmDatabase";
|
||||
private static String AppCmd_Departments = "Departments";
|
||||
private static String AppCmd_Operations = "Operations";
|
||||
private static String AppCmd_Employees = "Employees";
|
||||
private static String AppCmd_Patients = "Patients";
|
||||
private static String AppCmd_Procedures = "Procedures";
|
||||
private static String AppCmd_EmployeeRoles = "EmployeeRoles";
|
||||
private static String AppCmd_FacilityTemplates = "FacilityTemplates";
|
||||
private static String AppCmd_PatientSearch = "PatientSearch";
|
||||
private static String AppCmd_WaitingList = "WaitingList";
|
||||
private static String AppCmd_RequiredActions = "RequiredActions";
|
||||
private static String AppCmd_CancelTimeLimit = "CancelTimeLimit";
|
||||
private static String AppCmd_CancelOther = "CancelOther";
|
||||
private static String AppCmd_Deletions = "Deletions";
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
private SpmPanel_Config_Menu () : this(new Config()) { }
|
||||
public SpmPanel_Config_Menu (Config config) : base(config)
|
||||
{
|
||||
this.config = config;
|
||||
InitializeComponent();
|
||||
}
|
||||
protected override void Dispose (bool disposing)
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
if (components != null) components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
public bool HasActiveProcess { get { return appCmdInProgress; } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// I n i t i a l i s a t i o n
|
||||
//-------------------------------------------------------------------
|
||||
protected override void OnCreateControl ()
|
||||
{
|
||||
base.OnCreateControl();
|
||||
if (this.IsDesignerHosted()) return;
|
||||
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// R e f r e s h P a n e l
|
||||
//-------------------------------------------------------------------
|
||||
public void RefreshPanel ()
|
||||
{
|
||||
List<String> body = new List<string>();
|
||||
body.Add("<div class='Title'>Sarand<br/>Patient Manager</div>");
|
||||
|
||||
// Institution.
|
||||
SpmInstitution institution = config.ConfigForm.InstitutionMgr.GetInstitution();
|
||||
if (institution != null)
|
||||
{
|
||||
body.Add("<div class='Caption'>Institution</div>");
|
||||
body.Add("<div class='Institution'>" + institution.Name + "</div>");
|
||||
institution.Dispose(); institution = null;
|
||||
}
|
||||
|
||||
if (config.ConfigForm != null)
|
||||
{
|
||||
// Configuration options:
|
||||
body.Add("<div class='Caption'>Configuration</div>");
|
||||
body.Add(BuildMenuOpt(AppCmd_Departments, "Departments"));
|
||||
body.Add(BuildMenuOpt(AppCmd_FacilityTemplates, "Session templates"));
|
||||
body.Add(BuildMenuOpt(AppCmd_Operations, "Operations"));
|
||||
body.Add(BuildMenuOpt(AppCmd_Procedures, "Procedures"));
|
||||
body.Add(BuildMenuOpt(AppCmd_Patients, "Patients"));
|
||||
body.Add(BuildMenuOpt(AppCmd_Employees, "Employees"));
|
||||
body.Add(BuildMenuOpt(AppCmd_EmployeeRoles, "Employee roles"));
|
||||
|
||||
// Application options.
|
||||
body.Add("<div class='Caption'>Application</div>");
|
||||
body.Add(BuildMenuOpt(AppCmd_AdmRefresh, "Refresh", false));
|
||||
if (config.ConfigForm.SecurityProfile.Admin.CanManageSecurity())
|
||||
body.Add(BuildMenuOpt(AppCmd_AdmSecurity, "Security", false));
|
||||
body.Add(BuildMenuOpt(AppCmd_AdmExport, "Export", false));
|
||||
body.Add(BuildMenuOpt(AppCmd_AdmStatistics, "Statistics", false));
|
||||
if (config.ConfigForm.SecurityProfile.Admin.CanManageDatabase())
|
||||
{
|
||||
ISacsDatabase database = SpmGlobals.Application.GetDatabase(config.ConfigForm.SessionContext);
|
||||
if (database != null && database.DbmsType == DbmsType.Access)
|
||||
body.Add(BuildMenuOpt(AppCmd_AdmDatabase, "Db housekeeping", false));
|
||||
}
|
||||
if (config.ConfigForm.SecurityProfile.Admin.CanManageConfig() && config.ConfigForm.CodeTypeConsole != null)
|
||||
body.Add(BuildMenuOpt(AppCmd_AdmCodeTypes, "Codes", false));
|
||||
}
|
||||
else if (config.AdmissionListForm != null)
|
||||
{
|
||||
// Admission Lists options.
|
||||
body.Add("<div class='Caption'>Admission Lists</div>");
|
||||
body.Add(BuildMenuOpt(AppCmd_PatientSearch, "Patient Search"));
|
||||
body.Add(BuildMenuOpt(AppCmd_WaitingList, "Waiting List"));
|
||||
body.Add(BuildMenuOpt(AppCmd_RequiredActions, "Required Actions"));
|
||||
body.Add(BuildMenuOpt(AppCmd_CancelTimeLimit, "Cancellations - 28 day"));
|
||||
body.Add(BuildMenuOpt(AppCmd_CancelOther, "Cancellations - other"));
|
||||
body.Add(BuildMenuOpt(AppCmd_Deletions, "Deletions"));
|
||||
|
||||
// Action options:
|
||||
body.Add("<div class='Caption'>Actions</div>");
|
||||
foreach (SacsCommand item in new List<SacsCommand>()) //config.AdmissionListForm.GetMenuItems())
|
||||
body.Add(BuildMenuOpt(item.CommandId, item.Caption, false));
|
||||
}
|
||||
body.Add(BuildMenuOpt(AppCmd_AdmClose, "Close", false));
|
||||
|
||||
if (DocumentPopulated)
|
||||
{
|
||||
SetDocumentBody(body.Concat("\n"));
|
||||
}
|
||||
else
|
||||
{
|
||||
List<String> html = new List<string>();
|
||||
html.Add("<html><head>" + GetMenuStyle() + GetMenuScript() + "</head><body>");
|
||||
html.AddRange(body);
|
||||
html.Add("</body></html>");
|
||||
|
||||
SetDocumentHtml(html.Concat("\n"));
|
||||
DocumentPopulated = true;
|
||||
}
|
||||
}
|
||||
private String BuildMenuOpt (String command, String display, bool panelOption = true)
|
||||
{
|
||||
// Is this the currently selected option:
|
||||
bool currentOption = false;
|
||||
if (panelOption)
|
||||
{
|
||||
if (config.ConfigForm != null) currentOption = GetConfigPanelType(command) == config.ConfigForm.PanelType;
|
||||
else if (config.AdmissionListForm != null) currentOption = false; // GetAdmissionsPanelType(command) == config.AdmissionListForm.PanelType;
|
||||
}
|
||||
// Build the menu option:
|
||||
String option = "";
|
||||
option += currentOption ? "<b>" : "<a class='Mnu' href='" + AppHrefPrefix + command + "'>";
|
||||
option += display;
|
||||
option += currentOption ? "</b>" : "</a>";
|
||||
option += "<br>";
|
||||
return option;
|
||||
}
|
||||
private String GetMenuStyle ()
|
||||
{
|
||||
List<String> style = new List<string>();
|
||||
style.Add("<style>" + SacsResourceConsole.GetTextResource(SacsResourceConsole.TextResource.SaBaseCss) + "</style>");
|
||||
style.Add("<style>");
|
||||
style.Add("*{font-size:14px;font-family:'sans-serif';color:#303080;background-color:#A0D0A0;scrollbar-base-color:#A0D0A0;}");
|
||||
style.Add("body{padding:4;margin:0;background-color:#A0D0A0;overflow-y:auto;}");
|
||||
style.Add("p{font-size:14px;margin-top:15px;margin-bottom:5px;}");
|
||||
style.Add("td{font-size:14px;vertical-align:top;}");
|
||||
style.Add(".Title{margin:4px 0;padding-left:32px;font-weight:bold;font-size:20px;background-image:url('" + GetImageUri(SpmResourceConsole.GetImageResource(SpmResourceConsole.ImageResource.PatientMgr_Icon_gif), "png") + "');background-position:left top;background-repeat:no-repeat;}");
|
||||
style.Add(".Caption{margin-top:5px;margin-bottom:5px;padding:3px;font-size:16px;font-weight:bold;text-align:center;color:#E0E0FF;background-color:#6060E0;}");
|
||||
style.Add(".Institution{margin-top:2px;margin-bottom:2px;font-weight:bold;font-size:14px;text-align:center;}");
|
||||
style.Add(".SuperScript{font-size:66%;position:relative;top:-5px;}");
|
||||
style.Add(".Body{text-align:left;padding-left:5%;}");
|
||||
style.Add("A:link,A:visited,A:active{line-height:150%;font-weight:normal;text-decoration:none;padding:3px;}");
|
||||
style.Add("A.Mnu:link,A.Mnu:visited,A.Mnu:active{font-size:13px;text-align:center;}");
|
||||
style.Add("A:hover,A.Mnu:hover{font-weight:bold;padding-left:0px;padding-right:0px;}");
|
||||
style.Add("</style>");
|
||||
return style.Concat("\n");
|
||||
}
|
||||
private String GetMenuScript ()
|
||||
{
|
||||
List<String> script = new List<string>();
|
||||
return script.Concat("\n");
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// P a n e l E v e n t s
|
||||
//-------------------------------------------------------------------
|
||||
protected override void OnAppAction (string action)
|
||||
{
|
||||
Logger.Debug("OnAppAction Action: " + action);
|
||||
bool optionProcessed = false;
|
||||
if (action.EqualsCI(AppCmd_AdmClose))
|
||||
{
|
||||
if (config.ConfigForm != null) config.ConfigForm.Close();
|
||||
else if (config.AdmissionListForm != null) config.AdmissionListForm.Close();
|
||||
optionProcessed = true;
|
||||
}
|
||||
else if (action.EqualsCI(AppCmd_AdmRefresh))
|
||||
{
|
||||
if (config.ConfigForm != null) config.ConfigForm.RefreshView();
|
||||
//else if (config.AdmissionListForm != null) config.AdmissionListForm.RefreshView();
|
||||
optionProcessed = true;
|
||||
}
|
||||
else if (action.EqualsCI(AppCmd_AdmSecurity))
|
||||
{
|
||||
SaSecurityConsole securityConsole = config.ConfigForm?.SecurityConsole ?? config.AdmissionListForm?.SecurityConsole ?? null;
|
||||
SpmSecurityProfile securityProfile = config.ConfigForm?.SecurityProfile ?? config.AdmissionListForm?.SecurityProfile ?? null;
|
||||
if (securityConsole == null || securityProfile == null) return;
|
||||
securityConsole.ManageSecurity(securityProfile.Admin.CanManageSecurity(), SpmGlobals_Win.UserContext.DbUpdateInfo);
|
||||
optionProcessed = true;
|
||||
}
|
||||
else if (action.EqualsCI(AppCmd_AdmCodeTypes))
|
||||
{
|
||||
// ToDo Code Types options.
|
||||
optionProcessed = true;
|
||||
}
|
||||
else if (action.EqualsCI(AppCmd_AdmExport))
|
||||
{
|
||||
// ToDo Export options.
|
||||
optionProcessed = true;
|
||||
}
|
||||
else if (action.EqualsCI(AppCmd_AdmStatistics))
|
||||
{
|
||||
// ToDo Export options.
|
||||
optionProcessed = true;
|
||||
}
|
||||
else if (action.EqualsCI(AppCmd_AdmDatabase))
|
||||
{
|
||||
// No longer required - database now SQL rather than Access.
|
||||
// Unless SQL database housekeeping could be invoked.
|
||||
optionProcessed = true;
|
||||
}
|
||||
else if (config.ConfigForm != null)
|
||||
{
|
||||
// Flag to avoid other commands during length processing:
|
||||
appCmdInProgress = true;
|
||||
SpmForm_Config.ConfigPanelType panelType = GetConfigPanelType (action);
|
||||
if (panelType != SpmForm_Config.ConfigPanelType.Unknown)
|
||||
{
|
||||
config.ConfigForm.PanelType = panelType;
|
||||
RefreshPanel();
|
||||
}
|
||||
optionProcessed = true;
|
||||
}
|
||||
else if (config.AdmissionListForm != null)
|
||||
{
|
||||
// Flag to avoid other commands during length processing (eg. multiple deletions):
|
||||
appCmdInProgress = true;
|
||||
// ToDo Admission List actions.
|
||||
/*
|
||||
SwmDlgAdmissionLists::eSwmAdmissionsPanel ePanel = SwmPanelMenu::PanelForAdmissionsCmd (sCmd);
|
||||
if (ePanel != SwmDlgAdmissionLists::ePanelUnknown)
|
||||
{
|
||||
pDlgAdmLists->SetAdmissionsPanel(ePanel);
|
||||
Refresh();
|
||||
optionProcessed = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
bOptionProcessed = pDlgAdmLists->DoMenuOption(String(sCmd).AsLong());
|
||||
SetFocus();
|
||||
}
|
||||
*/
|
||||
optionProcessed = true;
|
||||
}
|
||||
appCmdInProgress = false;
|
||||
//base.OnAppAction(action);
|
||||
}
|
||||
private SpmForm_Config.ConfigPanelType GetConfigPanelType (String command)
|
||||
{
|
||||
if (config.ConfigForm == null) return SpmForm_Config.ConfigPanelType.Unknown;
|
||||
if (command.EqualsCI(AppCmd_Departments)) return SpmForm_Config.ConfigPanelType.Departments;
|
||||
if (command.EqualsCI(AppCmd_Operations)) return SpmForm_Config.ConfigPanelType.Operations;
|
||||
if (command.EqualsCI(AppCmd_Employees)) return SpmForm_Config.ConfigPanelType.Employees;
|
||||
if (command.EqualsCI(AppCmd_Patients)) return SpmForm_Config.ConfigPanelType.Patients;
|
||||
if (command.EqualsCI(AppCmd_Procedures)) return SpmForm_Config.ConfigPanelType.Procedures;
|
||||
if (command.EqualsCI(AppCmd_EmployeeRoles)) return SpmForm_Config.ConfigPanelType.EmployeeRoles;
|
||||
if (command.EqualsCI(AppCmd_FacilityTemplates)) return SpmForm_Config.ConfigPanelType.FacilityTemplates;
|
||||
return SpmForm_Config.ConfigPanelType.Unknown;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
Reference in New Issue
Block a user