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
@@ -1,4 +1,5 @@
using Sarand.Core.Bus;
using Sarand.Core.UpdateLog;
using Sarand.PatientMgr.Core.App;
using Sarand.PatientMgr.Win.Dbas.Consoles;
using Sarand.PatientMgr.Win.Forms.App;
@@ -25,6 +26,10 @@ namespace Sarand.PatientMgr.App.Consoles
{
}
//-------------------------------------------------------------------
// Properties.
public override SaUpdateLogConsole UpdateLogConsole { get { return SpmGlobals.Application.GetUpdateLogConsole(SessionContext); } }
//-------------------------------------------------------------------
// Security events.
protected override bool OnLogin (SysId userId)
+18 -3
View File
@@ -16,11 +16,12 @@
private void InitializeComponent ()
{
this.buttonGenerateDbDfn = new System.Windows.Forms.Button();
this.panelScheduleControl = new Sarand.PatientMgr.App.Panels.SpmPanel_ScheduleControl();
this.SuspendLayout();
//
// buttonGenerateDbDfn
//
this.buttonGenerateDbDfn.Location = new System.Drawing.Point(58, 63);
this.buttonGenerateDbDfn.Location = new System.Drawing.Point(271, 104);
this.buttonGenerateDbDfn.Name = "buttonGenerateDbDfn";
this.buttonGenerateDbDfn.Size = new System.Drawing.Size(100, 23);
this.buttonGenerateDbDfn.TabIndex = 0;
@@ -28,14 +29,27 @@
this.buttonGenerateDbDfn.UseVisualStyleBackColor = true;
this.buttonGenerateDbDfn.Click += new System.EventHandler(this.buttonGenerateDbDfn_Click);
//
// panelScheduleControl
//
this.panelScheduleControl.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.panelScheduleControl.Location = new System.Drawing.Point(9, 9);
this.panelScheduleControl.MainForm = null;
this.panelScheduleControl.Margin = new System.Windows.Forms.Padding(0);
this.panelScheduleControl.Name = "panelScheduleControl";
this.panelScheduleControl.Size = new System.Drawing.Size(147, 543);
this.panelScheduleControl.TabIndex = 1;
//
// SaPatientMgrForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450);
this.ClientSize = new System.Drawing.Size(784, 561);
this.Controls.Add(this.panelScheduleControl);
this.Controls.Add(this.buttonGenerateDbDfn);
this.MinimumSize = new System.Drawing.Size(800, 600);
this.Name = "SaPatientMgrForm";
this.Text = "Form1";
this.Text = "Sarand Patient Manager";
this.ResumeLayout(false);
}
@@ -43,6 +57,7 @@
#endregion
private System.Windows.Forms.Button buttonGenerateDbDfn;
private Panels.SpmPanel_ScheduleControl panelScheduleControl;
}
}
@@ -64,6 +64,10 @@ namespace Sarand.PatientMgr.App.Forms
base.OnCreateControl();
if (this.IsDesignerHosted()) return;
// Configure schedule control panel.
panelScheduleControl.MainForm = this;
SetControlActivity();
}
protected override void OnShown (EventArgs e)
{
@@ -92,6 +96,11 @@ namespace Sarand.PatientMgr.App.Forms
else MessageBox.Show("Database definition not generated.\n\n"+result.ErrorMessage, "Database Definition", MessageBoxButtons.OK, MessageBoxIcon.Stop);
}
private void spmPanel_ScheduleControl1_Load (object sender, EventArgs e)
{
}
//-------------------------------------------------------------------
}
//=======================================================================
@@ -0,0 +1,84 @@
namespace Sarand.PatientMgr.App.Panels
{
partial class SpmPanel_ScheduleControl
{
/// <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 ()
{
this.buttonConfig = new Sarand.Win.Forms.Controls.SacsButton();
this.buttonMinimise = new Sarand.Win.Forms.Controls.SacsButton();
this.buttonExit = new Sarand.Win.Forms.Controls.SacsButton();
this.buttonSetup = new Sarand.Win.Forms.Controls.SacsButton();
this.SuspendLayout();
//
// buttonConfig
//
this.buttonConfig.Location = new System.Drawing.Point(42, 195);
this.buttonConfig.Name = "buttonConfig";
this.buttonConfig.Size = new System.Drawing.Size(75, 23);
this.buttonConfig.TabIndex = 0;
this.buttonConfig.Text = "Config";
this.buttonConfig.UseVisualStyleBackColor = true;
this.buttonConfig.Click += new System.EventHandler(this.buttonConfig_Click);
//
// buttonMinimise
//
this.buttonMinimise.Location = new System.Drawing.Point(42, 253);
this.buttonMinimise.Name = "buttonMinimise";
this.buttonMinimise.Size = new System.Drawing.Size(75, 23);
this.buttonMinimise.TabIndex = 1;
this.buttonMinimise.Text = "Minimise";
this.buttonMinimise.UseVisualStyleBackColor = true;
//
// buttonExit
//
this.buttonExit.Location = new System.Drawing.Point(42, 282);
this.buttonExit.Name = "buttonExit";
this.buttonExit.Size = new System.Drawing.Size(75, 23);
this.buttonExit.TabIndex = 2;
this.buttonExit.Text = "Exit";
this.buttonExit.UseVisualStyleBackColor = true;
this.buttonExit.Click += new System.EventHandler(this.buttonExit_Click);
//
// buttonSetup
//
this.buttonSetup.Location = new System.Drawing.Point(42, 3);
this.buttonSetup.Name = "buttonSetup";
this.buttonSetup.Size = new System.Drawing.Size(75, 23);
this.buttonSetup.TabIndex = 3;
this.buttonSetup.Text = "Setup";
this.buttonSetup.UseVisualStyleBackColor = true;
//
// SpmPanel_ScheduleControl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.buttonSetup);
this.Controls.Add(this.buttonExit);
this.Controls.Add(this.buttonMinimise);
this.Controls.Add(this.buttonConfig);
this.Margin = new System.Windows.Forms.Padding(0);
this.Name = "SpmPanel_ScheduleControl";
this.Size = new System.Drawing.Size(151, 358);
this.ResumeLayout(false);
}
#endregion
private Sarand.Win.Forms.Controls.SacsButton buttonConfig;
private Sarand.Win.Forms.Controls.SacsButton buttonMinimise;
private Sarand.Win.Forms.Controls.SacsButton buttonExit;
private Sarand.Win.Forms.Controls.SacsButton buttonSetup;
}
}
@@ -0,0 +1,94 @@
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.Utils;
using Sarand.PatientMgr.Win.Forms.Base;
using Sarand.PatientMgr.App.Forms;
using Sarand.PatientMgr.Win.Forms.App;
using Sarand.PatientMgr.Win.Forms.Config;
namespace Sarand.PatientMgr.App.Panels
{
//=======================================================================
public partial class SpmPanel_ScheduleControl : SpmPanel
{
//-------------------------------------------------------------------
// Configuration.
public new class Config : SpmPanel.Config
{
}
//-------------------------------------------------------------------
// Data members.
private Config config = null;
//-------------------------------------------------------------------
// Construction.
public SpmPanel_ScheduleControl ()
{
InitializeComponent();
}
protected override void Dispose (bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
//-------------------------------------------------------------------
// Properties.
public SaPatientMgrForm MainForm { get; set; }
//-------------------------------------------------------------------
// I n i t i a l i s a t i o n
//-------------------------------------------------------------------
protected override void OnCreateControl ()
{
base.OnCreateControl();
if (this.IsDesignerHosted()) return;
SetControlActivity();
}
//-------------------------------------------------------------------
// C o n t r o l A c t i v i t y
//-------------------------------------------------------------------
protected override void SetControlActivity ()
{
SetControlsReadOnly();
}
protected override void SetControlsReadOnly ()
{
}
//-------------------------------------------------------------------
// P a n e l E v e n t s
//-------------------------------------------------------------------
private void buttonConfig_Click (object sender, EventArgs e)
{
SpmForm_Config.Config formConfig = new SpmForm_Config.Config();
using (SpmForm_Config form = new SpmForm_Config(formConfig))
{
if (form.ShowDialog() == DialogResult.OK)
{
// ToDo Refresh schedule view.
}
}
}
private void buttonExit_Click (object sender, EventArgs e)
{
MainForm.Close();
}
//-------------------------------------------------------------------
}
//=======================================================================
}
@@ -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>
+5
View File
@@ -57,6 +57,9 @@ namespace Sarand.PatientMgr.App
SessionContext = new SpmSessionContext_Desktop(0, Site);
InitGlobals();
//SpmGlobals.DbConsole.VerifyDatabaseSchema();
// Login the current windows user.
SpmGlobals.Application.GetSecurityConsole(SessionContext).LoginAuthenticatedUser();
}
public void Dispose ()
{
@@ -120,6 +123,8 @@ namespace Sarand.PatientMgr.App
//-------------------------------------------------------------------
private void DeinitGlobals ()
{
if (SpmGlobals_Win.SessionProfile != null)
SpmGlobals_Win.SessionProfile.StoreProperties();
SpmGlobals.clear();
}
+13 -1
View File
@@ -40,11 +40,23 @@ namespace Sarand.PatientMgr.App
{
return Database;
}
public override bool TableExists (SpmSessionContext sessionContext, SpmDbDfn.TableIdx tableIdx)
{
SacsDatabase database = GetDatabase(sessionContext) as SacsDatabase;
if (database != null)
{
String tablename = SpmDbDfn.GetTableName(tableIdx, false);
DbDfnTable table = database.GetTableDfn(tablename);
if (table != null)
return true;
}
return false;
}
public override bool ColumnExists (SpmSessionContext sessionContext, SpmDbDfn.ColumnIdx columnIdx)
{
ISacsDatabase database = GetDatabase(sessionContext);
if (database != null)
return database.ColumnExists(SpmDbDfn.GetTableName(SpmDbDfn.GetTableForColumn(columnIdx)), SpmDbDfn.GetColumnName(columnIdx));
return database.ColumnExists(SpmDbDfn.GetTableName(SpmDbDfn.GetTableForColumn(columnIdx),false), SpmDbDfn.GetColumnName(columnIdx,false));
return false;
}
+10 -3
View File
@@ -58,6 +58,12 @@
<Compile Include="App\Forms\SaPatientMgrForm.Designer.cs">
<DependentUpon>SaPatientMgrForm.cs</DependentUpon>
</Compile>
<Compile Include="App\Panels\SpmPanel_ScheduleControl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="App\Panels\SpmPanel_ScheduleControl.Designer.cs">
<DependentUpon>SpmPanel_ScheduleControl.cs</DependentUpon>
</Compile>
<Compile Include="App\Program.cs" />
<Compile Include="App\SaPatientMgrApp.cs" />
<Compile Include="App\SpmApplication_Desktop.cs" />
@@ -67,6 +73,9 @@
<EmbeddedResource Include="App\Forms\SaPatientMgrForm.resx">
<DependentUpon>SaPatientMgrForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="App\Panels\SpmPanel_ScheduleControl.resx">
<DependentUpon>SpmPanel_ScheduleControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
@@ -90,9 +99,7 @@
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<Folder Include="App\Panels\" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<ProjectReference Include="..\..\..\Common-C#\Workspace\SacsCoreBase\SacsCoreBase.csproj">
<Project>{7528f88e-a24d-4d6b-be6c-9d5fb14f0cb5}</Project>