SB 12-Jun-2019, create listView & listFilter

This commit is contained in:
sbrignell
2019-06-12 14:08:41 +01:00
parent 065ed7fe93
commit 5e9e9b9331
86 changed files with 10296 additions and 5 deletions
+129
View File
@@ -0,0 +1,129 @@
using Sarand.Core.Base;
using Sarand.Core.CodeTypes;
using Sarand.Core.Interfaces;
using Sarand.Core.ItemDocs;
using Sarand.Core.ItemOptions;
using Sarand.Core.Security;
using Sarand.Core.UpdateLog;
using Sarand.PatientMgr.Core.Mgr;
using System;
using System.Collections.Generic;
using System.Text;
namespace Sarand.PatientMgr.Core.App
{
//=======================================================================
public class SpmInternals : SacsDisposable
{
//-------------------------------------------------------------------
// Data members.
private readonly SpmSystem system = SpmGlobals.System;
// Managers.
private SpmAdmissionMgr admissionMgr = null;
private SpmDepartmentMgr departmentMgr = null;
private SpmInstitutionMgr institutionMgr = null;
// Consoles.
private SaSecurityConsole securityConsole;
private SaCodeTypeConsole codeTypeConsole;
private SaUpdateLogConsole updateLogConsole;
private SaItemOptionConsole itemOptionConsole;
//-------------------------------------------------------------------
// Construction.
public SpmInternals(SpmUserContext userContext)
{
UserContext = userContext;
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (admissionMgr != null) admissionMgr.Dispose();
if (departmentMgr != null) departmentMgr.Dispose();
}
}
//-------------------------------------------------------------------
// Properties.
//-------------------------------------------------------------------
// Session.
public SpmUserContext UserContext { get; }
public SpmSessionContext SessionContext { get { return UserContext.SessionContext; } }
public SpmSecurityProfile SecurityProfile { get { return UserContext.SecurityProfile; } }
//-------------------------------------------------------------------
// Managers.
public SpmAdmissionMgr AdmissionMgr {
get
{
if (admissionMgr == null)
admissionMgr = system.CreateAdmissionMgr(UserContext);
return admissionMgr;
}
}
public SpmDepartmentMgr DepartmentMgr
{
get
{
if (departmentMgr == null)
departmentMgr = SpmGlobals.System.CreateDepartmentMgr(UserContext);
return departmentMgr;
}
}
public SpmInstitutionMgr InstitutionMgr
{
get
{
if (institutionMgr == null)
institutionMgr = system.CreateInstitutionMgr(UserContext);
return institutionMgr;
}
}
//-------------------------------------------------------------------
// Consoles.
public SaSecurityConsole SecurityConsole
{
get
{
if (securityConsole == null)
securityConsole = SpmGlobals.GetSecurityConsole(UserContext);
return securityConsole;
}
}
public SaCodeTypeConsole CodeTypeConsole
{
get
{
if (codeTypeConsole == null)
codeTypeConsole = SpmGlobals.GetCodeTypeConsole(UserContext);
return codeTypeConsole;
}
}
public SaUpdateLogConsole UpdateLogConsole
{
get
{
if (updateLogConsole == null)
updateLogConsole = SpmGlobals.GetUpdateLogConsole(UserContext);
return updateLogConsole;
}
}
public SaItemOptionConsole ItemOptionConsole
{
get
{
if (itemOptionConsole == null)
itemOptionConsole = SpmGlobals.GetItemOptionConsole(UserContext);
return itemOptionConsole;
}
}
//-------------------------------------------------------------------
}
//=======================================================================
}
+1 -2
View File
@@ -79,7 +79,6 @@ namespace Sarand.PatientMgr.Core.Bus
CancelReBookBy,
CancelReBookDue,
CancelCount,
Notes,
// Facility.
Facility_Type,
Facility_TypeDesc,
@@ -136,7 +135,7 @@ namespace Sarand.PatientMgr.Core.Bus
Role_Anaesthetist_Operating_Code,
// Common properties.
//Notes,
Notes,
Flags,
Status,
Status_Ind,
@@ -18,8 +18,10 @@ namespace Sarand.PatientMgr.Core.Bus
{
Pos,
Id,
Category,
Type,
Type_Desc,
Sort,
Group,
Name,
+6
View File
@@ -16,6 +16,12 @@ namespace Sarand.PatientMgr.Core.Bus
// Columns.
public enum Column
{
Pos,
/*Id,
FacilityTemplateId,
Type,
Seq,*/
// Common properties.
Notes,
Flags,
+248 -3
View File
@@ -33,6 +33,8 @@
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
@@ -43,6 +45,204 @@
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Win\Forms\App\SpmGlobals_Win.cs" />
<Compile Include="Win\Forms\App\SpmSessionProfile_Win.cs" />
<Compile Include="Win\Forms\Controls\SpmItemListView_Procedure.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Win\Forms\Controls\SpmItemListView_Procedure.Designer.cs">
<DependentUpon>SpmItemListView_Procedure.cs</DependentUpon>
</Compile>
<Compile Include="Win\Forms\Controls\SpmItemListView_TemplateData.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Win\Forms\Controls\SpmItemListView_TemplateData.Designer.cs">
<DependentUpon>SpmItemListView_TemplateData.cs</DependentUpon>
</Compile>
<Compile Include="Win\Forms\Controls\SpmItemListView_Operation.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Win\Forms\Controls\SpmItemListView_Operation.Designer.cs">
<DependentUpon>SpmItemListView_Operation.cs</DependentUpon>
</Compile>
<Compile Include="Win\Forms\Controls\SpmItemListView_Patient.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Win\Forms\Controls\SpmItemListView_Patient.Designer.cs">
<DependentUpon>SpmItemListView_Patient.cs</DependentUpon>
</Compile>
<Compile Include="Win\Forms\Controls\SpmItemListView_Department.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Win\Forms\Controls\SpmItemListView_Department.Designer.cs">
<DependentUpon>SpmItemListView_Department.cs</DependentUpon>
</Compile>
<Compile Include="Win\Forms\Controls\SpmItemListView_Institution.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Win\Forms\Controls\SpmItemListView_Institution.Designer.cs">
<DependentUpon>SpmItemListView_Institution.cs</DependentUpon>
</Compile>
<Compile Include="Win\Forms\Controls\SpmItemListView_Employee.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Win\Forms\Controls\SpmItemListView_Employee.Designer.cs">
<DependentUpon>SpmItemListView_Employee.cs</DependentUpon>
</Compile>
<Compile Include="Win\Forms\Controls\SpmItemListView_EmployeeRole.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Win\Forms\Controls\SpmItemListView_EmployeeRole.Designer.cs">
<DependentUpon>SpmItemListView_EmployeeRole.cs</DependentUpon>
</Compile>
<Compile Include="Win\Forms\Controls\SpmItemListView_Facility.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Win\Forms\Controls\SpmItemListView_Facility.Designer.cs">
<DependentUpon>SpmItemListView_Facility.cs</DependentUpon>
</Compile>
<Compile Include="Win\Forms\Controls\SpmItemListView_FacilitySession.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Win\Forms\Controls\SpmItemListView_FacilitySession.Designer.cs">
<DependentUpon>SpmItemListView_FacilitySession.cs</DependentUpon>
</Compile>
<Compile Include="Win\Forms\Controls\SpmItemListView_FacilityTemplate.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Win\Forms\Controls\SpmItemListView_FacilityTemplate.Designer.cs">
<DependentUpon>SpmItemListView_FacilityTemplate.cs</DependentUpon>
</Compile>
<Compile Include="Win\Forms\Controls\SpmItemListView_AdmissionData.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Win\Forms\Controls\SpmItemListView_AdmissionData.Designer.cs">
<DependentUpon>SpmItemListView_AdmissionData.cs</DependentUpon>
</Compile>
<Compile Include="Win\Forms\Controls\SpmItemListView_AdmissionAction.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Win\Forms\Controls\SpmItemListView_AdmissionAction.Designer.cs">
<DependentUpon>SpmItemListView_AdmissionAction.cs</DependentUpon>
</Compile>
<Compile Include="Win\Forms\Controls\SpmItemListView_AdmissionRole.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Win\Forms\Controls\SpmItemListView_AdmissionRole.Designer.cs">
<DependentUpon>SpmItemListView_AdmissionRole.cs</DependentUpon>
</Compile>
<Compile Include="Win\Forms\Controls\SpmItemListView_Admission.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Win\Forms\Controls\SpmItemListView_Admission.Designer.cs">
<DependentUpon>SpmItemListView_Admission.cs</DependentUpon>
</Compile>
<Compile Include="Win\Forms\Controls\SpmItemListView.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Win\Forms\Controls\SpmItemListView.Designer.cs">
<DependentUpon>SpmItemListView.cs</DependentUpon>
</Compile>
<Compile Include="Win\Forms\Filters\SpmItemListFilter_Patient.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Win\Forms\Filters\SpmItemListFilter_Patient.Designer.cs">
<DependentUpon>SpmItemListFilter_Patient.cs</DependentUpon>
</Compile>
<Compile Include="Win\Forms\Filters\SpmItemListFilter_Procedure.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Win\Forms\Filters\SpmItemListFilter_Procedure.Designer.cs">
<DependentUpon>SpmItemListFilter_Procedure.cs</DependentUpon>
</Compile>
<Compile Include="Win\Forms\Filters\SpmItemListFilter_TemplateData.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Win\Forms\Filters\SpmItemListFilter_TemplateData.Designer.cs">
<DependentUpon>SpmItemListFilter_TemplateData.cs</DependentUpon>
</Compile>
<Compile Include="Win\Forms\Filters\SpmItemListFilter_Operation.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Win\Forms\Filters\SpmItemListFilter_Operation.Designer.cs">
<DependentUpon>SpmItemListFilter_Operation.cs</DependentUpon>
</Compile>
<Compile Include="Win\Forms\Filters\SpmItemListFilter_Institution.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Win\Forms\Filters\SpmItemListFilter_Institution.Designer.cs">
<DependentUpon>SpmItemListFilter_Institution.cs</DependentUpon>
</Compile>
<Compile Include="Win\Forms\Filters\SpmItemListFilter_FacilityTemplate.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Win\Forms\Filters\SpmItemListFilter_FacilityTemplate.Designer.cs">
<DependentUpon>SpmItemListFilter_FacilityTemplate.cs</DependentUpon>
</Compile>
<Compile Include="Win\Forms\Filters\SpmItemListFilter_Facility.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Win\Forms\Filters\SpmItemListFilter_Facility.Designer.cs">
<DependentUpon>SpmItemListFilter_Facility.cs</DependentUpon>
</Compile>
<Compile Include="Win\Forms\Filters\SpmItemListFilter_FacilitySession.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Win\Forms\Filters\SpmItemListFilter_FacilitySession.Designer.cs">
<DependentUpon>SpmItemListFilter_FacilitySession.cs</DependentUpon>
</Compile>
<Compile Include="Win\Forms\Filters\SpmItemListFilter_EmployeeRole.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Win\Forms\Filters\SpmItemListFilter_EmployeeRole.Designer.cs">
<DependentUpon>SpmItemListFilter_EmployeeRole.cs</DependentUpon>
</Compile>
<Compile Include="Win\Forms\Filters\SpmItemListFilter_Employee.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Win\Forms\Filters\SpmItemListFilter_Employee.Designer.cs">
<DependentUpon>SpmItemListFilter_Employee.cs</DependentUpon>
</Compile>
<Compile Include="Win\Forms\Filters\SpmItemListFilter_Department.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Win\Forms\Filters\SpmItemListFilter_Department.Designer.cs">
<DependentUpon>SpmItemListFilter_Department.cs</DependentUpon>
</Compile>
<Compile Include="Win\Forms\Filters\SpmItemListFilter_AdmissionRole.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Win\Forms\Filters\SpmItemListFilter_AdmissionRole.Designer.cs">
<DependentUpon>SpmItemListFilter_AdmissionRole.cs</DependentUpon>
</Compile>
<Compile Include="Win\Forms\Filters\SpmItemListFilter_AdmissionData.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Win\Forms\Filters\SpmItemListFilter_AdmissionData.Designer.cs">
<DependentUpon>SpmItemListFilter_AdmissionData.cs</DependentUpon>
</Compile>
<Compile Include="Win\Forms\Filters\SpmItemListFilter_AdmissionAction.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Win\Forms\Filters\SpmItemListFilter_AdmissionAction.Designer.cs">
<DependentUpon>SpmItemListFilter_AdmissionAction.cs</DependentUpon>
</Compile>
<Compile Include="Win\Forms\Filters\SpmItemListFilter_Admission.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Win\Forms\Filters\SpmItemListFilter_Admission.Designer.cs">
<DependentUpon>SpmItemListFilter_Admission.cs</DependentUpon>
</Compile>
<Compile Include="Win\Forms\Filters\SpmItemListFilter.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Win\Forms\Filters\SpmItemListFilter.Designer.cs">
<DependentUpon>SpmItemListFilter.cs</DependentUpon>
</Compile>
<Compile Include="Win\Forms\Base\SpmPanel.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Win\Forms\Base\SpmPanel.Designer.cs">
<DependentUpon>SpmPanel.cs</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Common-C#\Workspace\SacsCoreBase\SacsCoreBase.csproj">
@@ -62,9 +262,7 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="Win\Forms\Base\" />
<Folder Include="Win\Forms\Controls\" />
<Folder Include="Win\Forms\Filters\" />
<Folder Include="SbmItemListFilter\" />
<Folder Include="Win\Forms\Maint\" />
<Folder Include="Win\Forms\Panels\" />
<Folder Include="Win\Forms\Procs\" />
@@ -72,5 +270,52 @@
<Folder Include="Win\Forms\Testing\" />
<Folder Include="Win\Forms\Views\" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Win\Forms\Filters\SpmItemListFilter_Patient.resx">
<DependentUpon>SpmItemListFilter_Patient.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Win\Forms\Filters\SpmItemListFilter_Procedure.resx">
<DependentUpon>SpmItemListFilter_Procedure.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Win\Forms\Filters\SpmItemListFilter_TemplateData.resx">
<DependentUpon>SpmItemListFilter_TemplateData.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Win\Forms\Filters\SpmItemListFilter_Operation.resx">
<DependentUpon>SpmItemListFilter_Operation.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Win\Forms\Filters\SpmItemListFilter_Institution.resx">
<DependentUpon>SpmItemListFilter_Institution.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Win\Forms\Filters\SpmItemListFilter_FacilityTemplate.resx">
<DependentUpon>SpmItemListFilter_FacilityTemplate.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Win\Forms\Filters\SpmItemListFilter_Facility.resx">
<DependentUpon>SpmItemListFilter_Facility.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Win\Forms\Filters\SpmItemListFilter_FacilitySession.resx">
<DependentUpon>SpmItemListFilter_FacilitySession.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Win\Forms\Filters\SpmItemListFilter_EmployeeRole.resx">
<DependentUpon>SpmItemListFilter_EmployeeRole.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Win\Forms\Filters\SpmItemListFilter_Employee.resx">
<DependentUpon>SpmItemListFilter_Employee.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Win\Forms\Filters\SpmItemListFilter_Department.resx">
<DependentUpon>SpmItemListFilter_Department.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Win\Forms\Filters\SpmItemListFilter_AdmissionRole.resx">
<DependentUpon>SpmItemListFilter_AdmissionRole.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Win\Forms\Filters\SpmItemListFilter_AdmissionData.resx">
<DependentUpon>SpmItemListFilter_AdmissionData.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Win\Forms\Filters\SpmItemListFilter_AdmissionAction.resx">
<DependentUpon>SpmItemListFilter_AdmissionAction.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Win\Forms\Filters\SpmItemListFilter_Admission.resx">
<DependentUpon>SpmItemListFilter_Admission.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
+24
View File
@@ -0,0 +1,24 @@
namespace Sarand.PatientMgr.Win.Forms.Base
{
partial class SpmPanel
{
/// <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();
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
}
#endregion
}
}
@@ -0,0 +1,87 @@
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;
namespace Sarand.PatientMgr.Win.Forms.Base
{
//=======================================================================
public partial class SpmPanel : SacsChildPanel
{
//-------------------------------------------------------------------
// Configuration.
public new class Config : SacsChildPanel.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); } }
// Security.
protected SpmSecurityProfile SecurityProfile { get { return internals.SecurityProfile; } }
// Managers.
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;
}
//-------------------------------------------------------------------
}
//=======================================================================
}
@@ -0,0 +1,23 @@
namespace Sarand.PatientMgr.Win.Forms.Controls
{
partial class SpmItemListView
{
/// <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,102 @@
using Sarand.Win.Forms.Controls;
using Sarand.Win.Forms.Utils;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
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.UpdateLog;
using Sarand.Core.ItemOptions;
namespace Sarand.PatientMgr.Win.Forms.Controls
{
//=======================================================================
public partial class SpmItemListView : SacsListView
{
//-------------------------------------------------------------------
// Configuration.
public class Config
{
}
//-------------------------------------------------------------------
// Data members.
private Config config = new Config();
private readonly SpmInternals internals;
//-------------------------------------------------------------------
// Construction.
private SpmItemListView() : this(new Config()) { }
public SpmItemListView(Config config)
{
this.config = 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.
/// <summary>Flag to indicate initial population</summary>
[Browsable(false), ReadOnly(true), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public virtual bool InitialPopulation { get; protected set; } = true;
[Browsable(false), ReadOnly(true), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public virtual int DisplayRecordsBatchSize { get; } = 32;
/// <summary>Total number of items to be displayed (not items already in the list).</summary>
[Browsable(false), ReadOnly(true), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public virtual int ItemTotal { get; protected set; } = 0;
// 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); } }
// 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)
{
this.config = config;
}
//-------------------------------------------------------------------
// Initialisation.
protected override void OnCreateControl()
{
base.OnCreateControl();
if (this.IsDesignerHosted()) return;
}
//-------------------------------------------------------------------
}
//=======================================================================
}
@@ -0,0 +1,23 @@
namespace Sarand.PatientMgr.Win.Forms.Controls
{
partial class SpmItemListView_Admission
{
/// <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,400 @@
using Sarand.Core.Base;
using Sarand.Core.Bus;
using Sarand.Core.Dbas.Base;
using Sarand.PatientMgr.Core.Bus;
using Sarand.Win.Forms.Controls;
using Sarand.Win.Forms.Utils;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Sarand.PatientMgr.Win.Forms.Controls
{
//=======================================================================
public partial class SpmItemListView_Admission : SpmItemListView
{
//-------------------------------------------------------------------
// Configuration.
public enum ListMode
{
General,
}
public new class Config : SpmItemListView.Config
{
public ListMode Mode { get; set; } = ListMode.General;
}
//-------------------------------------------------------------------
// Data members.
private Config config = new Config();
private readonly List<ColumnDfn> columnsDisplay = new List<ColumnDfn>();
private readonly List<ColumnDfn> columnsQuery = new List<ColumnDfn>();
private Timer timerQueryData = null;
private Timer timerDisplayItem = null;
private ColumnDfn columnDfnId = null;
private DbResultSet dbResultSet = null;
private SpmAdmission.Params prmAdmission;
//-------------------------------------------------------------------
// Construction.
public SpmItemListView_Admission() : this(new Config()) { }
public SpmItemListView_Admission(Config config) : base(config)
{
this.config = config;
InitializeComponent();
/* ToDo Timers function need modifying.
timerQueryData = new Timer() { Interval = 250 };
timerQueryData.Tick += OnTimerQueryData;
timerDisplayItem = new Timer() { Interval = 5 };
timerDisplayItem.Tick += OnTimerDisplayItem;*/
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (components != null) components.Dispose();
timerQueryData.Dispose();
timerDisplayItem.Dispose();
ClearResultSet();
}
base.Dispose(disposing);
}
private void ClearResultSet()
{
if (dbResultSet != null)
dbResultSet.Dispose();
dbResultSet = null;
}
//-------------------------------------------------------------------
// Properties.
[Browsable(false)]
public List<ColumnDfn> DisplayColumns { get { return new List<ColumnDfn>(columnsDisplay); } }
[Browsable(false)]
public SysId SelectedAdmissionId { get { return SelectedItemId; } }
[Browsable(false)]
public SpmAdmission SelectedAdmission
{
get
{
if (SelectedItemCount == 1)
return AdmissionMgr.GetAdmissionById(SelectedAdmissionId);
return null;
}
}
//-------------------------------------------------------------------
// Configure.
public void SetConfig(Config config)
{
base.SetConfig(config);
this.config = config;
ConfigureList();
}
//-------------------------------------------------------------------
// Initialisation.
protected override void OnCreateControl()
{
base.OnCreateControl();
if (this.IsDesignerHosted()) return;
}
private void ConfigureList()
{
if (!this.Created) return;
InitAdmissionList(true);
}
//-------------------------------------------------------------------
private void InitAdmissionList(bool forceInit = false)
{
// Clear the existing list.
if (Columns.Count > 0 && !forceInit) return;
Clear();
columnsDisplay.Clear();
columnsQuery.Clear();
// Populate list of columns to be displayed.
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.FacilityId));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.TemplateId));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.Seq));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.AdmissionFromDate));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.AdmissionFromTime));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.AdmissionFromDateTime));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.AdmissionToDate));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.AdmissionToTime));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.AdmissionToDateTime));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.Type));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.Type_Desc));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.DecisionToReferOn));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.ReferredOn));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.BreechOn));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.DecisionToAdmitOn));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.Patient));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.PatientId));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.PatientNo));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.PatientName));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.PatientSurname));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.PatientForename));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.BirthAge));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.BirthOn));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.Age));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.AgeOn));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.FacilityIdWard));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.Ward));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.ProcedureId));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.SpecialityCode));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.Procedure));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.ComplexityCode));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.ProcedureIndication));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.DurationExp));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.DurationAct));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.Anaesthetic));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.Position));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.SpecialEquipment));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.AttendanceStatusDesc));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.ComfortScore));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.TimeCalled));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.TimeArrived));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.TimeAnaesStart));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.TimeProcStart));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.TimeProcEnd));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.TimeInRecovery));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.TimeInformDest));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.TimeLeave));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.CancelType));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.CancelTypeDesc));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.CancelDate));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.CancelElapsed));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.CancelReBookBy));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.CancelReBookDue));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.CancelCount));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.Facility_Type));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.Facility_TypeDesc));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.Facility_Name));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.Facility_Desc));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.Facility_TemplateMapType));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.Facility_ApplicFrom));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.Facility_ApplicTo));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.Facility_Notes));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.Template_WeekOfMonth));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.Template_DayOfWeek));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.Template_ConsultantId));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.Template_ConsultantCode));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.Template_SpecialityCode));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.Template_StartAt));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.Template_FinishAt));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.Template_CategoryDesc));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.Template_TypeDesc));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.Template_Name));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.Template_Desc));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.Template_Group));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.Template_ApplicFrom));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.Template_ApplicTo));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.Template_Notes));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.Session_TemplateId));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.Session_ConsultantId));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.Session_ConsultantCode));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.Session_SpecialityCode));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.Session_StartAt));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.Session_FinishAt));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.Session_Name));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.Session_Desc));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.Session_Flags));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.Session_Notes));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.SessionDfn_Summary));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.SessionDfn_Name));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.Patient_PatientNo));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.Patient_Surname));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.Patient_Forename));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.Patient_BirthOn));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.Patient_Age));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.Patient_AgeOn));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.Role_Consultant_Operating_Code));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.Role_Consultant_Referring_Code));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.Role_Surgeon_Operating_Code));
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.Role_Anaesthetist_Operating_Code));
#if DEBUG
columnsDisplay.Add(AdmissionMgr.GetAdmissionColumnDfn(SpmAdmission.Column.Id));
#endif
// Populate columns to list view.
SetColumns(columnsDisplay);
// Default sort column.
SortColumnIdx = GetColumnIdxById((int)SpmAdmission.Column.FacilityId);
Refresh();
// Initialise list of columns to be queries - ensure Id column in list.
columnsQuery.Clear();
columnsQuery.AddRange(columnsDisplay);
if (!columnsQuery.HasId(columnDfnId.Id))
columnsQuery.Add(columnDfnId);
}
//-------------------------------------------------------------------
// P o p u l a t i o n
//-------------------------------------------------------------------
public bool IsValidFiter(SpmAdmission.Params prmAdmission)
{
if (prmAdmission == null) return false;
return true;
}
public void RefreshAdmissions(SpmAdmission.Params prmAdmission)
{
// Clear timers.
/*timerQueryData.Enabled = false;
timerDisplayItem.Enabled = false;*/
// Item Ids in the 'Initial selection' list are automatically selected on population.
// Subsequent refreshes automatically select the current selection by repopulation of the 'Initial selection' list.
if (!InitialPopulation)
{
InitiallySelectedItemIds.Clear();
InitiallySelectedItemIds.AddRange(SelectedItemIds);
}
SelectedIndices.Clear();
// Clear previous results.
ItemTotal = 0;
Items.Clear();
// Prepare query.
ClearResultSet();
this.prmAdmission = prmAdmission;
// Enable timer.
}
void OnTimerQueryData(Object myObject, EventArgs myEventArgs)
{
//timerQueryData.Enabled = false;
QueryData();
}
private void QueryData()
{
ClearResultSet();
if (!IsValidFiter(prmAdmission)) return;
// Query data.
ItemTotal = (int)AdmissionMgr.GetAdmissionCount(prmAdmission);
if (ItemTotal > 0) Logger.Trace(GetType().Name + ".QueryData Admission count: " + ItemTotal);
dbResultSet = AdmissionMgr.ExecuteAdmissionQuery(columnsQuery, prmAdmission);
//timerDisplayItem.Enabled = true;
InitialPopulation = false;
}
public void RefreshAdmission(SysId affiliateId)
{
// Parameters to query single item:
if (!SysId.IsValid(affiliateId)) return;
SpmAdmission.Params prm = new SpmAdmission.Params();
prm.IncludedIds.Add(affiliateId);
// Query data.
using (DbResultSet dbResultSet = AdmissionMgr.ExecuteAdmissionQuery(columnsQuery, prm))
{
if (dbResultSet.NextRecord())
DisplayItem(dbResultSet.GetRecordValues(), true);
}
}
//-------------------------------------------------------------------
// D i s p l a y I t e m s
//-------------------------------------------------------------------
private void OnTimerDisplayItem(Object myObject, EventArgs myEventArgs)
{
//timerDisplayItem.Enabled = false;
DisplayNextItems();
}
private void DisplayNextItems()
{
if (dbResultSet == null) return;
for (int itemCount = 0; itemCount <= Math.Min(64, Math.Max(0, DisplayRecordsBatchSize)); itemCount++)
{
if (dbResultSet.NextRecord())
{
DisplayItem(dbResultSet.GetRecordValues());
//timerDisplayItem.Enabled = true;
}
else
{
ClearResultSet();
return;
}
}
}
private void DisplayItem(NamedValue.Map values, bool highlight = false)
{
// Item identity.
SysId itemId = new SysId(StringUtil.ToInt(values.GetValue(columnDfnId.DataName).ToString()));
String itemName = SysId.ToString(itemId);
bool addNewItem = false;
ListViewItem item = FindItemWithName(itemName);
if (item == null)
{
// New item to be added.
item = new ListViewItem();
item.Name = itemName;
addNewItem = true;
}
else
{
// Clear sub items for existing item.
item.SubItems.Clear();
item.Name = itemName;
}
// Populate list view item.
int columnIdx = -1;
foreach (var column in columnsDisplay)
{
DataValue value = new DataValue();
if (column.Id == (int)SpmAdmission.Column.Pos)
{
value = new DataValue((Items.Count + 1).ToString() + ".");
}
else
{
value = AdmissionMgr.GetAdmissionDataValue(column, values);
if (!value.IsValid())
value = new DataValue(column.FormatValue(values));
}
if (++columnIdx == 0)
item.Text = value.ToString();
else
item.SubItems.Add(new ListViewSubItemExtended(column, value));
}
// Add to list if required (otherwise item has already been updated in list.
if (addNewItem)
{
ListViewItem itemAdded = Items.Add(item);
}
// Check for selection:
if (!highlight && InitiallySelectedItemIds.Contains(itemId))
highlight = true;
if (highlight)
{
item.Selected = true;
item.Focused = true;
EnsureVisible(item.Index);
}
}
//-------------------------------------------------------------------
// C o n t r o l E v e n t s
//-------------------------------------------------------------------
protected override void OnResize(EventArgs e)
{
base.OnResize(e);
//Logger.Debug(GetType().Name + ".OnResize Size: " + Size.ToString());
}
//-------------------------------------------------------------------
}
//=======================================================================
}
@@ -0,0 +1,23 @@
namespace Sarand.PatientMgr.Win.Forms.Controls
{
partial class SpmItemListView_AdmissionAction
{
/// <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,315 @@
using Sarand.Core.Base;
using Sarand.Core.Bus;
using Sarand.Core.Dbas.Base;
using Sarand.PatientMgr.Core.Bus;
using Sarand.Win.Forms.Controls;
using Sarand.Win.Forms.Utils;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows.Forms;
namespace Sarand.PatientMgr.Win.Forms.Controls
{
//=======================================================================
public partial class SpmItemListView_AdmissionAction : SpmItemListView
{
//-------------------------------------------------------------------
// Configuration.
public enum ListMode
{
General,
}
public new class Config : SpmItemListView.Config
{
public ListMode Mode { get; set; } = ListMode.General;
}
//-------------------------------------------------------------------
// Data members.
private Config config = new Config();
private readonly List<ColumnDfn> columnsDisplay = new List<ColumnDfn>();
private readonly List<ColumnDfn> columnsQuery = new List<ColumnDfn>();
private Timer timerQueryData = null;
private Timer timerDisplayItem = null;
private ColumnDfn columnDfnId = null;
private DbResultSet dbResultSet = null;
private SpmAdmissionAction.Params prmAdmissionAction;
//-------------------------------------------------------------------
// Construction.
public SpmItemListView_AdmissionAction() : this(new Config()) { }
public SpmItemListView_AdmissionAction(Config config) : base(config)
{
this.config = config;
InitializeComponent();
/* ToDo Timers function need modifying.
timerQueryData = new Timer() { Interval = 250 };
timerQueryData.Tick += OnTimerQueryData;
timerDisplayItem = new Timer() { Interval = 5 };
timerDisplayItem.Tick += OnTimerDisplayItem;*/
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (components != null) components.Dispose();
timerQueryData.Dispose();
timerDisplayItem.Dispose();
ClearResultSet();
}
base.Dispose(disposing);
}
private void ClearResultSet()
{
if (dbResultSet != null)
dbResultSet.Dispose();
dbResultSet = null;
}
//-------------------------------------------------------------------
// Properties.
[Browsable(false)]
public List<ColumnDfn> DisplayColumns { get { return new List<ColumnDfn>(columnsDisplay); } }
[Browsable(false)]
public SysId SelectedAdmissionActionId { get { return SelectedItemId; } }
[Browsable(false)]
public SpmAdmissionAction SelectedAdmissionAction
{
get
{
if (SelectedItemCount == 1)
return AdmissionMgr.GetAdmissionActionById(SelectedAdmissionActionId);
return null;
}
}
//-------------------------------------------------------------------
// Configure.
public void SetConfig(Config config)
{
base.SetConfig(config);
this.config = config;
ConfigureList();
}
//-------------------------------------------------------------------
// Initialisation.
protected override void OnCreateControl()
{
base.OnCreateControl();
if (this.IsDesignerHosted()) return;
}
private void ConfigureList()
{
if (!this.Created) return;
InitAdmissionActionList(true);
}
//-------------------------------------------------------------------
private void InitAdmissionActionList(bool forceInit = false)
{
// Clear the existing list.
if (Columns.Count > 0 && !forceInit) return;
Clear();
columnsDisplay.Clear();
columnsQuery.Clear();
// Populate list of columns to be displayed.
columnsDisplay.Add(AdmissionMgr.GetAdmissionActionColumnDfn(SpmAdmissionAction.Column.AdmissionId));
columnsDisplay.Add(AdmissionMgr.GetAdmissionActionColumnDfn(SpmAdmissionAction.Column.Type));
columnsDisplay.Add(AdmissionMgr.GetAdmissionActionColumnDfn(SpmAdmissionAction.Column.Type_Desc));
columnsDisplay.Add(AdmissionMgr.GetAdmissionActionColumnDfn(SpmAdmissionAction.Column.Admission_FacilityId));
columnsDisplay.Add(AdmissionMgr.GetAdmissionActionColumnDfn(SpmAdmissionAction.Column.Admission_TemplateId));
columnsDisplay.Add(AdmissionMgr.GetAdmissionActionColumnDfn(SpmAdmissionAction.Column.AdmissionFrom));
columnsDisplay.Add(AdmissionMgr.GetAdmissionActionColumnDfn(SpmAdmissionAction.Column.AdmissionFromDateTime));
columnsDisplay.Add(AdmissionMgr.GetAdmissionActionColumnDfn(SpmAdmissionAction.Column.AdmissionFromDate));
columnsDisplay.Add(AdmissionMgr.GetAdmissionActionColumnDfn(SpmAdmissionAction.Column.AdmissionFromTime));
columnsDisplay.Add(AdmissionMgr.GetAdmissionActionColumnDfn(SpmAdmissionAction.Column.AdmissionTo));
columnsDisplay.Add(AdmissionMgr.GetAdmissionActionColumnDfn(SpmAdmissionAction.Column.AdmissionToDate));
columnsDisplay.Add(AdmissionMgr.GetAdmissionActionColumnDfn(SpmAdmissionAction.Column.AdmissionToTime));
columnsDisplay.Add(AdmissionMgr.GetAdmissionActionColumnDfn(SpmAdmissionAction.Column.AdmissionType));
columnsDisplay.Add(AdmissionMgr.GetAdmissionActionColumnDfn(SpmAdmissionAction.Column.AdmissionTypeDesc));
columnsDisplay.Add(AdmissionMgr.GetAdmissionActionColumnDfn(SpmAdmissionAction.Column.AdmissionNotes));
columnsDisplay.Add(AdmissionMgr.GetAdmissionActionColumnDfn(SpmAdmissionAction.Column.AdmissionFlags));
columnsDisplay.Add(AdmissionMgr.GetAdmissionActionColumnDfn(SpmAdmissionAction.Column.AdmissionStatus));
columnsDisplay.Add(AdmissionMgr.GetAdmissionActionColumnDfn(SpmAdmissionAction.Column.AdmissionStatusInd));
#if DEBUG
columnsDisplay.Add(AdmissionMgr.GetAdmissionActionColumnDfn(SpmAdmissionAction.Column.Id));
#endif
// Populate columns to list view.
SetColumns(columnsDisplay);
// Default sort column.
SortColumnIdx = GetColumnIdxById((int)SpmAdmissionAction.Column.AdmissionId);
Refresh();
// Initialise list of columns to be queries - ensure Id column in list.
columnsQuery.Clear();
columnsQuery.AddRange(columnsDisplay);
if (!columnsQuery.HasId(columnDfnId.Id))
columnsQuery.Add(columnDfnId);
}
//-------------------------------------------------------------------
// P o p u l a t i o n
//-------------------------------------------------------------------
public bool IsValidFiter(SpmAdmissionAction.Params prmAdmissionAction)
{
if (prmAdmissionAction == null) return false;
return true;
}
public void RefreshAdmissionActions(SpmAdmissionAction.Params prmAdmissionAction)
{
// Clear timers.
/*timerQueryData.Enabled = false;
timerDisplayItem.Enabled = false;*/
// Item Ids in the 'Initial selection' list are automatically selected on population.
// Subsequent refreshes automatically select the current selection by repopulation of the 'Initial selection' list.
if (!InitialPopulation)
{
InitiallySelectedItemIds.Clear();
InitiallySelectedItemIds.AddRange(SelectedItemIds);
}
SelectedIndices.Clear();
// Clear previous results.
ItemTotal = 0;
Items.Clear();
// Prepare query.
ClearResultSet();
this.prmAdmissionAction = prmAdmissionAction;
// Enable timer.
}
void OnTimerQueryData(Object myObject, EventArgs myEventArgs)
{
//timerQueryData.Enabled = false;
QueryData();
}
private void QueryData()
{
ClearResultSet();
if (!IsValidFiter(prmAdmissionAction)) return;
// Query data.
ItemTotal = (int)AdmissionMgr.GetAdmissionActionCount(prmAdmissionAction);
if (ItemTotal > 0) Logger.Trace(GetType().Name + ".QueryData AdmissionAction count: " + ItemTotal);
dbResultSet = AdmissionMgr.ExecuteAdmissionActionQuery(columnsQuery, prmAdmissionAction);
//timerDisplayItem.Enabled = true;
InitialPopulation = false;
}
public void RefreshAdmissionAction(SysId affiliateId)
{
// Parameters to query single item:
if (!SysId.IsValid(affiliateId)) return;
SpmAdmissionAction.Params prm = new SpmAdmissionAction.Params();
prm.IncludedIds.Add(affiliateId);
// Query data.
using (DbResultSet dbResultSet = AdmissionMgr.ExecuteAdmissionActionQuery(columnsQuery, prm))
{
if (dbResultSet.NextRecord())
DisplayItem(dbResultSet.GetRecordValues(), true);
}
}
//-------------------------------------------------------------------
// D i s p l a y I t e m s
//-------------------------------------------------------------------
private void OnTimerDisplayItem(Object myObject, EventArgs myEventArgs)
{
//timerDisplayItem.Enabled = false;
DisplayNextItems();
}
private void DisplayNextItems()
{
if (dbResultSet == null) return;
for (int itemCount = 0; itemCount <= Math.Min(64, Math.Max(0, DisplayRecordsBatchSize)); itemCount++)
{
if (dbResultSet.NextRecord())
{
DisplayItem(dbResultSet.GetRecordValues());
//timerDisplayItem.Enabled = true;
}
else
{
ClearResultSet();
return;
}
}
}
private void DisplayItem(NamedValue.Map values, bool highlight = false)
{
// Item identity.
SysId itemId = new SysId(StringUtil.ToInt(values.GetValue(columnDfnId.DataName).ToString()));
String itemName = SysId.ToString(itemId);
bool addNewItem = false;
ListViewItem item = FindItemWithName(itemName);
if (item == null)
{
// New item to be added.
item = new ListViewItem();
item.Name = itemName;
addNewItem = true;
}
else
{
// Clear sub items for existing item.
item.SubItems.Clear();
item.Name = itemName;
}
// Populate list view item.
int columnIdx = -1;
foreach (var column in columnsDisplay)
{
DataValue value = new DataValue();
if (column.Id == (int)SpmAdmissionAction.Column.Pos)
{
value = new DataValue((Items.Count + 1).ToString() + ".");
}
else
{
value = AdmissionMgr.GetAdmissionActionDataValue(column, values);
if (!value.IsValid())
value = new DataValue(column.FormatValue(values));
}
if (++columnIdx == 0)
item.Text = value.ToString();
else
item.SubItems.Add(new ListViewSubItemExtended(column, value));
}
// Add to list if required (otherwise item has already been updated in list.
if (addNewItem)
{
ListViewItem itemAdded = Items.Add(item);
}
// Check for selection:
if (!highlight && InitiallySelectedItemIds.Contains(itemId))
highlight = true;
if (highlight)
{
item.Selected = true;
item.Focused = true;
EnsureVisible(item.Index);
}
}
//-------------------------------------------------------------------
// C o n t r o l E v e n t s
//-------------------------------------------------------------------
protected override void OnResize(EventArgs e)
{
base.OnResize(e);
//Logger.Debug(GetType().Name + ".OnResize Size: " + Size.ToString());
}
//-------------------------------------------------------------------
}
//=======================================================================
}
@@ -0,0 +1,23 @@
namespace Sarand.PatientMgr.Win.Forms.Controls
{
partial class SpmItemListView_AdmissionData
{
/// <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,301 @@
using Sarand.Core.Base;
using Sarand.Core.Bus;
using Sarand.Core.Dbas.Base;
using Sarand.PatientMgr.Core.Bus;
using Sarand.Win.Forms.Controls;
using Sarand.Win.Forms.Utils;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows.Forms;
namespace Sarand.PatientMgr.Win.Forms.Controls
{
//=======================================================================
public partial class SpmItemListView_AdmissionData : SpmItemListView
{
//-------------------------------------------------------------------
// Configuration.
public enum ListMode
{
General,
}
public new class Config : SpmItemListView.Config
{
public ListMode Mode { get; set; } = ListMode.General;
}
//-------------------------------------------------------------------
// Data members.
private Config config = new Config();
private readonly List<ColumnDfn> columnsDisplay = new List<ColumnDfn>();
private readonly List<ColumnDfn> columnsQuery = new List<ColumnDfn>();
private Timer timerQueryData = null;
private Timer timerDisplayItem = null;
private ColumnDfn columnDfnId = null;
private DbResultSet dbResultSet = null;
private SpmAdmissionData.Params prmAdmissionData;
//-------------------------------------------------------------------
// Construction.
public SpmItemListView_AdmissionData() : this(new Config()) { }
public SpmItemListView_AdmissionData(Config config) : base(config)
{
this.config = config;
InitializeComponent();
/* ToDo Timers function need modifying.
timerQueryData = new Timer() { Interval = 250 };
timerQueryData.Tick += OnTimerQueryData;
timerDisplayItem = new Timer() { Interval = 5 };
timerDisplayItem.Tick += OnTimerDisplayItem;*/
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (components != null) components.Dispose();
timerQueryData.Dispose();
timerDisplayItem.Dispose();
ClearResultSet();
}
base.Dispose(disposing);
}
private void ClearResultSet()
{
if (dbResultSet != null)
dbResultSet.Dispose();
dbResultSet = null;
}
//-------------------------------------------------------------------
// Properties.
[Browsable(false)]
public List<ColumnDfn> DisplayColumns { get { return new List<ColumnDfn>(columnsDisplay); } }
[Browsable(false)]
public SysId SelectedAdmissionDataId { get { return SelectedItemId; } }
[Browsable(false)]
public SpmAdmissionData SelectedAdmissionData
{
get
{
if (SelectedItemCount == 1)
return AdmissionMgr.GetAdmissionDataById(SelectedAdmissionDataId);
return null;
}
}
//-------------------------------------------------------------------
// Configure.
public void SetConfig(Config config)
{
base.SetConfig(config);
this.config = config;
ConfigureList();
}
//-------------------------------------------------------------------
// Initialisation.
protected override void OnCreateControl()
{
base.OnCreateControl();
if (this.IsDesignerHosted()) return;
}
private void ConfigureList()
{
if (!this.Created) return;
InitAdmissionDataList(true);
}
//-------------------------------------------------------------------
private void InitAdmissionDataList(bool forceInit = false)
{
// Clear the existing list.
if (Columns.Count > 0 && !forceInit) return;
Clear();
columnsDisplay.Clear();
columnsQuery.Clear();
// Populate list of columns to be displayed.
columnsDisplay.Add(AdmissionMgr.GetAdmissionDataColumnDfn(SpmAdmissionData.Column.AdmissionId));
columnsDisplay.Add(AdmissionMgr.GetAdmissionDataColumnDfn(SpmAdmissionData.Column.Type));
columnsDisplay.Add(AdmissionMgr.GetAdmissionDataColumnDfn(SpmAdmissionData.Column.Type_Desc));
columnsDisplay.Add(AdmissionMgr.GetAdmissionDataColumnDfn(SpmAdmissionData.Column.AdmissionData));
#if DEBUG
columnsDisplay.Add(AdmissionMgr.GetAdmissionDataColumnDfn(SpmAdmissionData.Column.Id));
#endif
// Populate columns to list view.
SetColumns(columnsDisplay);
// Default sort column.
SortColumnIdx = GetColumnIdxById((int)SpmAdmissionData.Column.AdmissionId);
Refresh();
// Initialise list of columns to be queries - ensure Id column in list.
columnsQuery.Clear();
columnsQuery.AddRange(columnsDisplay);
if (!columnsQuery.HasId(columnDfnId.Id))
columnsQuery.Add(columnDfnId);
}
//-------------------------------------------------------------------
// P o p u l a t i o n
//-------------------------------------------------------------------
public bool IsValidFiter(SpmAdmissionData.Params prmAdmissionData)
{
if (prmAdmissionData == null) return false;
return true;
}
public void RefreshAdmissionDatas(SpmAdmissionData.Params prmAdmissionData)
{
// Clear timers.
/*timerQueryData.Enabled = false;
timerDisplayItem.Enabled = false;*/
// Item Ids in the 'Initial selection' list are automatically selected on population.
// Subsequent refreshes automatically select the current selection by repopulation of the 'Initial selection' list.
if (!InitialPopulation)
{
InitiallySelectedItemIds.Clear();
InitiallySelectedItemIds.AddRange(SelectedItemIds);
}
SelectedIndices.Clear();
// Clear previous results.
ItemTotal = 0;
Items.Clear();
// Prepare query.
ClearResultSet();
this.prmAdmissionData = prmAdmissionData;
// Enable timer.
}
void OnTimerQueryData(Object myObject, EventArgs myEventArgs)
{
//timerQueryData.Enabled = false;
QueryData();
}
private void QueryData()
{
ClearResultSet();
if (!IsValidFiter(prmAdmissionData)) return;
// Query data.
ItemTotal = (int)AdmissionMgr.GetAdmissionDataCount(prmAdmissionData);
if (ItemTotal > 0) Logger.Trace(GetType().Name + ".QueryData AdmissionData count: " + ItemTotal);
dbResultSet = AdmissionMgr.ExecuteAdmissionDataQuery(columnsQuery, prmAdmissionData);
//timerDisplayItem.Enabled = true;
InitialPopulation = false;
}
public void RefreshAdmissionData(SysId affiliateId)
{
// Parameters to query single item:
if (!SysId.IsValid(affiliateId)) return;
SpmAdmissionData.Params prm = new SpmAdmissionData.Params();
prm.IncludedIds.Add(affiliateId);
// Query data.
using (DbResultSet dbResultSet = AdmissionMgr.ExecuteAdmissionDataQuery(columnsQuery, prm))
{
if (dbResultSet.NextRecord())
DisplayItem(dbResultSet.GetRecordValues(), true);
}
}
//-------------------------------------------------------------------
// D i s p l a y I t e m s
//-------------------------------------------------------------------
private void OnTimerDisplayItem(Object myObject, EventArgs myEventArgs)
{
//timerDisplayItem.Enabled = false;
DisplayNextItems();
}
private void DisplayNextItems()
{
if (dbResultSet == null) return;
for (int itemCount = 0; itemCount <= Math.Min(64, Math.Max(0, DisplayRecordsBatchSize)); itemCount++)
{
if (dbResultSet.NextRecord())
{
DisplayItem(dbResultSet.GetRecordValues());
//timerDisplayItem.Enabled = true;
}
else
{
ClearResultSet();
return;
}
}
}
private void DisplayItem(NamedValue.Map values, bool highlight = false)
{
// Item identity.
SysId itemId = new SysId(StringUtil.ToInt(values.GetValue(columnDfnId.DataName).ToString()));
String itemName = SysId.ToString(itemId);
bool addNewItem = false;
ListViewItem item = FindItemWithName(itemName);
if (item == null)
{
// New item to be added.
item = new ListViewItem();
item.Name = itemName;
addNewItem = true;
}
else
{
// Clear sub items for existing item.
item.SubItems.Clear();
item.Name = itemName;
}
// Populate list view item.
int columnIdx = -1;
foreach (var column in columnsDisplay)
{
DataValue value = new DataValue();
if (column.Id == (int)SpmAdmissionData.Column.Pos)
{
value = new DataValue((Items.Count + 1).ToString() + ".");
}
else
{
value = AdmissionMgr.GetAdmissionDataDataValue(column, values);
if (!value.IsValid())
value = new DataValue(column.FormatValue(values));
}
if (++columnIdx == 0)
item.Text = value.ToString();
else
item.SubItems.Add(new ListViewSubItemExtended(column, value));
}
// Add to list if required (otherwise item has already been updated in list.
if (addNewItem)
{
ListViewItem itemAdded = Items.Add(item);
}
// Check for selection:
if (!highlight && InitiallySelectedItemIds.Contains(itemId))
highlight = true;
if (highlight)
{
item.Selected = true;
item.Focused = true;
EnsureVisible(item.Index);
}
}
//-------------------------------------------------------------------
// C o n t r o l E v e n t s
//-------------------------------------------------------------------
protected override void OnResize(EventArgs e)
{
base.OnResize(e);
//Logger.Debug(GetType().Name + ".OnResize Size: " + Size.ToString());
}
//-------------------------------------------------------------------
}
//=======================================================================
}
@@ -0,0 +1,23 @@
namespace Sarand.PatientMgr.Win.Forms.Controls
{
partial class SpmItemListView_AdmissionRole
{
/// <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,303 @@
using Sarand.Core.Base;
using Sarand.Core.Bus;
using Sarand.Core.Dbas.Base;
using Sarand.PatientMgr.Core.Bus;
using Sarand.Win.Forms.Controls;
using Sarand.Win.Forms.Utils;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows.Forms;
namespace Sarand.PatientMgr.Win.Forms.Controls
{
//=======================================================================
public partial class SpmItemListView_AdmissionRole : SpmItemListView
{
//-------------------------------------------------------------------
// Configuration.
public enum ListMode
{
General,
}
public new class Config : SpmItemListView.Config
{
public ListMode Mode { get; set; } = ListMode.General;
}
//-------------------------------------------------------------------
// Data members.
private Config config = new Config();
private readonly List<ColumnDfn> columnsDisplay = new List<ColumnDfn>();
private readonly List<ColumnDfn> columnsQuery = new List<ColumnDfn>();
private Timer timerQueryData = null;
private Timer timerDisplayItem = null;
private ColumnDfn columnDfnId = null;
private DbResultSet dbResultSet = null;
private SpmAdmissionRole.Params prmAdmissionRole;
//-------------------------------------------------------------------
// Construction.
public SpmItemListView_AdmissionRole() : this(new Config()) { }
public SpmItemListView_AdmissionRole(Config config) : base(config)
{
this.config = config;
InitializeComponent();
/* ToDo Timers function need modifying.
timerQueryData = new Timer() { Interval = 250 };
timerQueryData.Tick += OnTimerQueryData;
timerDisplayItem = new Timer() { Interval = 5 };
timerDisplayItem.Tick += OnTimerDisplayItem;*/
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (components != null) components.Dispose();
timerQueryData.Dispose();
timerDisplayItem.Dispose();
ClearResultSet();
}
base.Dispose(disposing);
}
private void ClearResultSet()
{
if (dbResultSet != null)
dbResultSet.Dispose();
dbResultSet = null;
}
//-------------------------------------------------------------------
// Properties.
[Browsable(false)]
public List<ColumnDfn> DisplayColumns { get { return new List<ColumnDfn>(columnsDisplay); } }
[Browsable(false)]
public SysId SelectedAdmissionRoleId { get { return SelectedItemId; } }
[Browsable(false)]
public SpmAdmissionRole SelectedAdmissionRole
{
get
{
if (SelectedItemCount == 1)
return AdmissionMgr.GetAdmissionRoleById(SelectedAdmissionRoleId);
return null;
}
}
//-------------------------------------------------------------------
// Configure.
public void SetConfig(Config config)
{
base.SetConfig(config);
this.config = config;
ConfigureList();
}
//-------------------------------------------------------------------
// Initialisation.
protected override void OnCreateControl()
{
base.OnCreateControl();
if (this.IsDesignerHosted()) return;
}
private void ConfigureList()
{
if (!this.Created) return;
InitAdmissionRoleList(true);
}
//-------------------------------------------------------------------
private void InitAdmissionRoleList(bool forceInit = false)
{
// Clear the existing list.
if (Columns.Count > 0 && !forceInit) return;
Clear();
columnsDisplay.Clear();
columnsQuery.Clear();
// Populate list of columns to be displayed.
columnsDisplay.Add(AdmissionMgr.GetAdmissionRoleColumnDfn(SpmAdmissionRole.Column.AdmissionId));
columnsDisplay.Add(AdmissionMgr.GetAdmissionRoleColumnDfn(SpmAdmissionRole.Column.Role));
columnsDisplay.Add(AdmissionMgr.GetAdmissionRoleColumnDfn(SpmAdmissionRole.Column.Category));
columnsDisplay.Add(AdmissionMgr.GetAdmissionRoleColumnDfn(SpmAdmissionRole.Column.Seq));
columnsDisplay.Add(AdmissionMgr.GetAdmissionRoleColumnDfn(SpmAdmissionRole.Column.EmployeeRoleId));
columnsDisplay.Add(AdmissionMgr.GetAdmissionRoleColumnDfn(SpmAdmissionRole.Column.EmployeeCode));
#if DEBUG
columnsDisplay.Add(AdmissionMgr.GetAdmissionRoleColumnDfn(SpmAdmissionRole.Column.Id));
#endif
// Populate columns to list view.
SetColumns(columnsDisplay);
// Default sort column.
SortColumnIdx = GetColumnIdxById((int)SpmAdmissionRole.Column.AdmissionId);
Refresh();
// Initialise list of columns to be queries - ensure Id column in list.
columnsQuery.Clear();
columnsQuery.AddRange(columnsDisplay);
if (!columnsQuery.HasId(columnDfnId.Id))
columnsQuery.Add(columnDfnId);
}
//-------------------------------------------------------------------
// P o p u l a t i o n
//-------------------------------------------------------------------
public bool IsValidFiter(SpmAdmissionRole.Params prmAdmissionRole)
{
if (prmAdmissionRole == null) return false;
return true;
}
public void RefreshAdmissionRoles(SpmAdmissionRole.Params prmAdmissionRole)
{
// Clear timers.
/*timerQueryData.Enabled = false;
timerDisplayItem.Enabled = false;*/
// Item Ids in the 'Initial selection' list are automatically selected on population.
// Subsequent refreshes automatically select the current selection by repopulation of the 'Initial selection' list.
if (!InitialPopulation)
{
InitiallySelectedItemIds.Clear();
InitiallySelectedItemIds.AddRange(SelectedItemIds);
}
SelectedIndices.Clear();
// Clear previous results.
ItemTotal = 0;
Items.Clear();
// Prepare query.
ClearResultSet();
this.prmAdmissionRole = prmAdmissionRole;
// Enable timer.
}
void OnTimerQueryData(Object myObject, EventArgs myEventArgs)
{
//timerQueryData.Enabled = false;
QueryData();
}
private void QueryData()
{
ClearResultSet();
if (!IsValidFiter(prmAdmissionRole)) return;
// Query data.
ItemTotal = (int)AdmissionMgr.GetAdmissionRoleCount(prmAdmissionRole);
if (ItemTotal > 0) Logger.Trace(GetType().Name + ".QueryData AdmissionRole count: " + ItemTotal);
dbResultSet = AdmissionMgr.ExecuteAdmissionRoleQuery(columnsQuery, prmAdmissionRole);
//timerDisplayItem.Enabled = true;
InitialPopulation = false;
}
public void RefreshAdmissionRole(SysId affiliateId)
{
// Parameters to query single item:
if (!SysId.IsValid(affiliateId)) return;
SpmAdmissionRole.Params prm = new SpmAdmissionRole.Params();
prm.IncludedIds.Add(affiliateId);
// Query data.
using (DbResultSet dbResultSet = AdmissionMgr.ExecuteAdmissionRoleQuery(columnsQuery, prm))
{
if (dbResultSet.NextRecord())
DisplayItem(dbResultSet.GetRecordValues(), true);
}
}
//-------------------------------------------------------------------
// D i s p l a y I t e m s
//-------------------------------------------------------------------
private void OnTimerDisplayItem(Object myObject, EventArgs myEventArgs)
{
//timerDisplayItem.Enabled = false;
DisplayNextItems();
}
private void DisplayNextItems()
{
if (dbResultSet == null) return;
for (int itemCount = 0; itemCount <= Math.Min(64, Math.Max(0, DisplayRecordsBatchSize)); itemCount++)
{
if (dbResultSet.NextRecord())
{
DisplayItem(dbResultSet.GetRecordValues());
//timerDisplayItem.Enabled = true;
}
else
{
ClearResultSet();
return;
}
}
}
private void DisplayItem(NamedValue.Map values, bool highlight = false)
{
// Item identity.
SysId itemId = new SysId(StringUtil.ToInt(values.GetValue(columnDfnId.DataName).ToString()));
String itemName = SysId.ToString(itemId);
bool addNewItem = false;
ListViewItem item = FindItemWithName(itemName);
if (item == null)
{
// New item to be added.
item = new ListViewItem();
item.Name = itemName;
addNewItem = true;
}
else
{
// Clear sub items for existing item.
item.SubItems.Clear();
item.Name = itemName;
}
// Populate list view item.
int columnIdx = -1;
foreach (var column in columnsDisplay)
{
DataValue value = new DataValue();
if (column.Id == (int)SpmAdmissionRole.Column.Pos)
{
value = new DataValue((Items.Count + 1).ToString() + ".");
}
else
{
value = AdmissionMgr.GetAdmissionRoleDataValue(column, values);
if (!value.IsValid())
value = new DataValue(column.FormatValue(values));
}
if (++columnIdx == 0)
item.Text = value.ToString();
else
item.SubItems.Add(new ListViewSubItemExtended(column, value));
}
// Add to list if required (otherwise item has already been updated in list.
if (addNewItem)
{
ListViewItem itemAdded = Items.Add(item);
}
// Check for selection:
if (!highlight && InitiallySelectedItemIds.Contains(itemId))
highlight = true;
if (highlight)
{
item.Selected = true;
item.Focused = true;
EnsureVisible(item.Index);
}
}
//-------------------------------------------------------------------
// C o n t r o l E v e n t s
//-------------------------------------------------------------------
protected override void OnResize(EventArgs e)
{
base.OnResize(e);
//Logger.Debug(GetType().Name + ".OnResize Size: " + Size.ToString());
}
//-------------------------------------------------------------------
}
//=======================================================================
}
@@ -0,0 +1,23 @@
namespace Sarand.PatientMgr.Win.Forms.Controls
{
partial class SpmItemListView_Department
{
/// <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,304 @@
using Sarand.Core.Base;
using Sarand.Core.Bus;
using Sarand.Core.Dbas.Base;
using Sarand.PatientMgr.Core.Bus;
using Sarand.Win.Forms.Controls;
using Sarand.Win.Forms.Utils;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Sarand.PatientMgr.Win.Forms.Controls
{
//=======================================================================
public partial class SpmItemListView_Department : SpmItemListView
{
//-------------------------------------------------------------------
// Configuration.
public enum ListMode
{
General,
}
public new class Config : SpmItemListView.Config
{
public ListMode Mode { get; set; } = ListMode.General;
}
//-------------------------------------------------------------------
// Data members.
private Config config = new Config();
private readonly List<ColumnDfn> columnsDisplay = new List<ColumnDfn>();
private readonly List<ColumnDfn> columnsQuery = new List<ColumnDfn>();
private Timer timerQueryData = null;
private Timer timerDisplayItem = null;
private ColumnDfn columnDfnId = null;
private DbResultSet dbResultSet = null;
private SpmDepartment.Params prmDepartment;
//-------------------------------------------------------------------
// Construction.
public SpmItemListView_Department() : this(new Config()) { }
public SpmItemListView_Department(Config config) : base(config)
{
this.config = config;
InitializeComponent();
/* ToDo Timers function need modifying.
timerQueryData = new Timer() { Interval = 250 };
timerQueryData.Tick += OnTimerQueryData;
timerDisplayItem = new Timer() { Interval = 5 };
timerDisplayItem.Tick += OnTimerDisplayItem;*/
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (components != null) components.Dispose();
timerQueryData.Dispose();
timerDisplayItem.Dispose();
ClearResultSet();
}
base.Dispose(disposing);
}
private void ClearResultSet()
{
if (dbResultSet != null)
dbResultSet.Dispose();
dbResultSet = null;
}
//-------------------------------------------------------------------
// Properties.
[Browsable(false)]
public List<ColumnDfn> DisplayColumns { get { return new List<ColumnDfn>(columnsDisplay); } }
[Browsable(false)]
public SysId SelectedDepartmentId { get { return SelectedItemId; } }
[Browsable(false)]
public SpmDepartment SelectedDepartment
{
get
{
if (SelectedItemCount == 1)
return DepartmentMgr.GetDepartmentById(SelectedDepartmentId);
return null;
}
}
//-------------------------------------------------------------------
// Configure.
public void SetConfig(Config config)
{
base.SetConfig(config);
this.config = config;
ConfigureList();
}
//-------------------------------------------------------------------
// Initialisation.
protected override void OnCreateControl()
{
base.OnCreateControl();
if (this.IsDesignerHosted()) return;
}
private void ConfigureList()
{
if (!this.Created) return;
InitDepartmentList(true);
}
//-------------------------------------------------------------------
private void InitDepartmentList(bool forceInit = false)
{
// Clear the existing list.
if (Columns.Count > 0 && !forceInit) return;
Clear();
columnsDisplay.Clear();
columnsQuery.Clear();
// Populate list of columns to be displayed.
columnsDisplay.Add(DepartmentMgr.GetDepartmentColumnDfn(SpmDepartment.Column.Name));
columnsDisplay.Add(DepartmentMgr.GetDepartmentColumnDfn(SpmDepartment.Column.ApplicatonFrom));
columnsDisplay.Add(DepartmentMgr.GetDepartmentColumnDfn(SpmDepartment.Column.ApplicationTo));
#if DEBUG
columnsDisplay.Add(DepartmentMgr.GetDepartmentColumnDfn(SpmDepartment.Column.Id));
#endif
// Populate columns to list view.
SetColumns(columnsDisplay);
// Default sort column.
SortColumnIdx = GetColumnIdxById((int)SpmDepartment.Column.Name);
Refresh();
// Initialise list of columns to be queries - ensure Id column in list.
columnsQuery.Clear();
columnsQuery.AddRange(columnsDisplay);
if (!columnsQuery.HasId(columnDfnId.Id))
columnsQuery.Add(columnDfnId);
}
//-------------------------------------------------------------------
// P o p u l a t i o n
//-------------------------------------------------------------------
public bool IsValidFiter(SpmDepartment.Params prmDepartment)
{
if (prmDepartment == null) return false;
return true;
}
public void RefreshDepartments(SpmDepartment.Params prmDepartment)
{
// Clear timers.
/*timerQueryData.Enabled = false;
timerDisplayItem.Enabled = false;*/
// Item Ids in the 'Initial selection' list are automatically selected on population.
// Subsequent refreshes automatically select the current selection by repopulation of the 'Initial selection' list.
if (!InitialPopulation)
{
InitiallySelectedItemIds.Clear();
InitiallySelectedItemIds.AddRange(SelectedItemIds);
}
SelectedIndices.Clear();
// Clear previous results.
ItemTotal = 0;
Items.Clear();
// Prepare query.
ClearResultSet();
this.prmDepartment = prmDepartment;
// Enable timer.
}
void OnTimerQueryData(Object myObject, EventArgs myEventArgs)
{
//timerQueryData.Enabled = false;
QueryData();
}
private void QueryData()
{
ClearResultSet();
if (!IsValidFiter(prmDepartment)) return;
// Query data.
ItemTotal = (int)DepartmentMgr.GetDepartmentCount(prmDepartment);
if (ItemTotal > 0) Logger.Trace(GetType().Name + ".QueryData Department count: " + ItemTotal);
dbResultSet = DepartmentMgr.ExecuteDepartmentQuery(columnsQuery, prmDepartment);
//timerDisplayItem.Enabled = true;
InitialPopulation = false;
}
public void RefreshDepartment(SysId affiliateId)
{
// Parameters to query single item:
if (!SysId.IsValid(affiliateId)) return;
SpmDepartment.Params prm = new SpmDepartment.Params();
prm.IncludedIds.Add(affiliateId);
// Query data.
using (DbResultSet dbResultSet = DepartmentMgr.ExecuteDepartmentQuery(columnsQuery, prm))
{
if (dbResultSet.NextRecord())
DisplayItem(dbResultSet.GetRecordValues(), true);
}
}
//-------------------------------------------------------------------
// D i s p l a y I t e m s
//-------------------------------------------------------------------
private void OnTimerDisplayItem(Object myObject, EventArgs myEventArgs)
{
//timerDisplayItem.Enabled = false;
DisplayNextItems();
}
private void DisplayNextItems()
{
if (dbResultSet == null) return;
for (int itemCount = 0; itemCount <= Math.Min(64, Math.Max(0, DisplayRecordsBatchSize)); itemCount++)
{
if (dbResultSet.NextRecord())
{
DisplayItem(dbResultSet.GetRecordValues());
//timerDisplayItem.Enabled = true;
}
else
{
ClearResultSet();
return;
}
}
}
private void DisplayItem(NamedValue.Map values, bool highlight = false)
{
// Item identity.
SysId itemId = new SysId(StringUtil.ToInt(values.GetValue(columnDfnId.DataName).ToString()));
String itemName = SysId.ToString(itemId);
bool addNewItem = false;
ListViewItem item = FindItemWithName(itemName);
if (item == null)
{
// New item to be added.
item = new ListViewItem();
item.Name = itemName;
addNewItem = true;
}
else
{
// Clear sub items for existing item.
item.SubItems.Clear();
item.Name = itemName;
}
// Populate list view item.
int columnIdx = -1;
foreach (var column in columnsDisplay)
{
DataValue value = new DataValue();
if (column.Id == (int)SpmDepartment.Column.Pos)
{
value = new DataValue((Items.Count + 1).ToString() + ".");
}
else
{
value = DepartmentMgr.GetDepartmentDataValue(column, values);
if (!value.IsValid())
value = new DataValue(column.FormatValue(values));
}
if (++columnIdx == 0)
item.Text = value.ToString();
else
item.SubItems.Add(new ListViewSubItemExtended(column, value));
}
// Add to list if required (otherwise item has already been updated in list.
if (addNewItem)
{
ListViewItem itemAdded = Items.Add(item);
}
// Check for selection:
if (!highlight && InitiallySelectedItemIds.Contains(itemId))
highlight = true;
if (highlight)
{
item.Selected = true;
item.Focused = true;
EnsureVisible(item.Index);
}
}
//-------------------------------------------------------------------
// C o n t r o l E v e n t s
//-------------------------------------------------------------------
protected override void OnResize(EventArgs e)
{
base.OnResize(e);
//Logger.Debug(GetType().Name + ".OnResize Size: " + Size.ToString());
}
//-------------------------------------------------------------------
}
//=======================================================================
}
@@ -0,0 +1,23 @@
namespace Sarand.PatientMgr.Win.Forms.Controls
{
partial class SpmItemListView_Employee
{
/// <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,304 @@
using Sarand.Core.Base;
using Sarand.Core.Bus;
using Sarand.Core.Dbas.Base;
using Sarand.PatientMgr.Core.Bus;
using Sarand.Win.Forms.Controls;
using Sarand.Win.Forms.Utils;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows.Forms;
namespace Sarand.PatientMgr.Win.Forms.Controls
{
//=======================================================================
public partial class SpmItemListView_Employee : SpmItemListView
{
//-------------------------------------------------------------------
// Configuration.
public enum ListMode
{
General,
}
public new class Config : SpmItemListView.Config
{
public ListMode Mode { get; set; } = ListMode.General;
}
//-------------------------------------------------------------------
// Data members.
private Config config = new Config();
private readonly List<ColumnDfn> columnsDisplay = new List<ColumnDfn>();
private readonly List<ColumnDfn> columnsQuery = new List<ColumnDfn>();
private Timer timerQueryData = null;
private Timer timerDisplayItem = null;
private ColumnDfn columnDfnId = null;
private DbResultSet dbResultSet = null;
private SpmEmployee.Params prmEmployee;
//-------------------------------------------------------------------
// Construction.
public SpmItemListView_Employee() : this(new Config()) { }
public SpmItemListView_Employee(Config config) : base(config)
{
this.config = config;
InitializeComponent();
/* ToDo Timers function need modifying.
timerQueryData = new Timer() { Interval = 250 };
timerQueryData.Tick += OnTimerQueryData;
timerDisplayItem = new Timer() { Interval = 5 };
timerDisplayItem.Tick += OnTimerDisplayItem;*/
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (components != null) components.Dispose();
timerQueryData.Dispose();
timerDisplayItem.Dispose();
ClearResultSet();
}
base.Dispose(disposing);
}
private void ClearResultSet()
{
if (dbResultSet != null)
dbResultSet.Dispose();
dbResultSet = null;
}
//-------------------------------------------------------------------
// Properties.
[Browsable(false)]
public List<ColumnDfn> DisplayColumns { get { return new List<ColumnDfn>(columnsDisplay); } }
[Browsable(false)]
public SysId SelectedEmployeeId { get { return SelectedItemId; } }
[Browsable(false)]
public SpmEmployee SelectedEmployee
{
get
{
if (SelectedItemCount == 1)
return InstitutionMgr.GetEmployeeById(SelectedEmployeeId);
return null;
}
}
//-------------------------------------------------------------------
// Configure.
public void SetConfig(Config config)
{
base.SetConfig(config);
this.config = config;
ConfigureList();
}
//-------------------------------------------------------------------
// Initialisation.
protected override void OnCreateControl()
{
base.OnCreateControl();
if (this.IsDesignerHosted()) return;
}
private void ConfigureList()
{
if (!this.Created) return;
InitEmployeeList(true);
}
//-------------------------------------------------------------------
private void InitEmployeeList(bool forceInit = false)
{
// Clear the existing list.
if (Columns.Count > 0 && !forceInit) return;
Clear();
columnsDisplay.Clear();
columnsQuery.Clear();
// Populate list of columns to be displayed.
columnsDisplay.Add(InstitutionMgr.GetEmployeeColumnDfn(SpmEmployee.Column.InstitutionId));
columnsDisplay.Add(InstitutionMgr.GetEmployeeColumnDfn(SpmEmployee.Column.EmployeeNo));
columnsDisplay.Add(InstitutionMgr.GetEmployeeColumnDfn(SpmEmployee.Column.Code));
columnsDisplay.Add(InstitutionMgr.GetEmployeeColumnDfn(SpmEmployee.Column.Initials));
columnsDisplay.Add(InstitutionMgr.GetEmployeeColumnDfn(SpmEmployee.Column.Title));
columnsDisplay.Add(InstitutionMgr.GetEmployeeColumnDfn(SpmEmployee.Column.Forename));
columnsDisplay.Add(InstitutionMgr.GetEmployeeColumnDfn(SpmEmployee.Column.Surname));
#if DEBUG
columnsDisplay.Add(InstitutionMgr.GetEmployeeColumnDfn(SpmEmployee.Column.Id));
#endif
// Populate columns to list view.
SetColumns(columnsDisplay);
// Default sort column.
SortColumnIdx = GetColumnIdxById((int)SpmEmployee.Column.InstitutionId);
Refresh();
// Initialise list of columns to be queries - ensure Id column in list.
columnsQuery.Clear();
columnsQuery.AddRange(columnsDisplay);
if (!columnsQuery.HasId(columnDfnId.Id))
columnsQuery.Add(columnDfnId);
}
//-------------------------------------------------------------------
// P o p u l a t i o n
//-------------------------------------------------------------------
public bool IsValidFiter(SpmEmployee.Params prmEmployee)
{
if (prmEmployee == null) return false;
return true;
}
public void RefreshEmployees(SpmEmployee.Params prmEmployee)
{
// Clear timers.
/*timerQueryData.Enabled = false;
timerDisplayItem.Enabled = false;*/
// Item Ids in the 'Initial selection' list are automatically selected on population.
// Subsequent refreshes automatically select the current selection by repopulation of the 'Initial selection' list.
if (!InitialPopulation)
{
InitiallySelectedItemIds.Clear();
InitiallySelectedItemIds.AddRange(SelectedItemIds);
}
SelectedIndices.Clear();
// Clear previous results.
ItemTotal = 0;
Items.Clear();
// Prepare query.
ClearResultSet();
this.prmEmployee = prmEmployee;
// Enable timer.
}
void OnTimerQueryData(Object myObject, EventArgs myEventArgs)
{
//timerQueryData.Enabled = false;
QueryData();
}
private void QueryData()
{
ClearResultSet();
if (!IsValidFiter(prmEmployee)) return;
// Query data.
ItemTotal = (int)InstitutionMgr.GetEmployeeCount(prmEmployee);
if (ItemTotal > 0) Logger.Trace(GetType().Name + ".QueryData Employee count: " + ItemTotal);
dbResultSet = InstitutionMgr.ExecuteEmployeeQuery(columnsQuery, prmEmployee);
//timerDisplayItem.Enabled = true;
InitialPopulation = false;
}
public void RefreshEmployee(SysId affiliateId)
{
// Parameters to query single item:
if (!SysId.IsValid(affiliateId)) return;
SpmEmployee.Params prm = new SpmEmployee.Params();
prm.IncludedIds.Add(affiliateId);
// Query data.
using (DbResultSet dbResultSet = InstitutionMgr.ExecuteEmployeeQuery(columnsQuery, prm))
{
if (dbResultSet.NextRecord())
DisplayItem(dbResultSet.GetRecordValues(), true);
}
}
//-------------------------------------------------------------------
// D i s p l a y I t e m s
//-------------------------------------------------------------------
private void OnTimerDisplayItem(Object myObject, EventArgs myEventArgs)
{
//timerDisplayItem.Enabled = false;
DisplayNextItems();
}
private void DisplayNextItems()
{
if (dbResultSet == null) return;
for (int itemCount = 0; itemCount <= Math.Min(64, Math.Max(0, DisplayRecordsBatchSize)); itemCount++)
{
if (dbResultSet.NextRecord())
{
DisplayItem(dbResultSet.GetRecordValues());
//timerDisplayItem.Enabled = true;
}
else
{
ClearResultSet();
return;
}
}
}
private void DisplayItem(NamedValue.Map values, bool highlight = false)
{
// Item identity.
SysId itemId = new SysId(StringUtil.ToInt(values.GetValue(columnDfnId.DataName).ToString()));
String itemName = SysId.ToString(itemId);
bool addNewItem = false;
ListViewItem item = FindItemWithName(itemName);
if (item == null)
{
// New item to be added.
item = new ListViewItem();
item.Name = itemName;
addNewItem = true;
}
else
{
// Clear sub items for existing item.
item.SubItems.Clear();
item.Name = itemName;
}
// Populate list view item.
int columnIdx = -1;
foreach (var column in columnsDisplay)
{
DataValue value = new DataValue();
if (column.Id == (int)SpmEmployee.Column.Pos)
{
value = new DataValue((Items.Count + 1).ToString() + ".");
}
else
{
value = InstitutionMgr.GetEmployeeDataValue(column, values);
if (!value.IsValid())
value = new DataValue(column.FormatValue(values));
}
if (++columnIdx == 0)
item.Text = value.ToString();
else
item.SubItems.Add(new ListViewSubItemExtended(column, value));
}
// Add to list if required (otherwise item has already been updated in list.
if (addNewItem)
{
ListViewItem itemAdded = Items.Add(item);
}
// Check for selection:
if (!highlight && InitiallySelectedItemIds.Contains(itemId))
highlight = true;
if (highlight)
{
item.Selected = true;
item.Focused = true;
EnsureVisible(item.Index);
}
}
//-------------------------------------------------------------------
// C o n t r o l E v e n t s
//-------------------------------------------------------------------
protected override void OnResize(EventArgs e)
{
base.OnResize(e);
//Logger.Debug(GetType().Name + ".OnResize Size: " + Size.ToString());
}
//-------------------------------------------------------------------
}
//=======================================================================
}
@@ -0,0 +1,23 @@
namespace Sarand.PatientMgr.Win.Forms.Controls
{
partial class SpmItemListView_EmployeeRole
{
/// <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,302 @@
using Sarand.Core.Base;
using Sarand.Core.Bus;
using Sarand.Core.Dbas.Base;
using Sarand.PatientMgr.Core.Bus;
using Sarand.Win.Forms.Controls;
using Sarand.Win.Forms.Utils;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows.Forms;
namespace Sarand.PatientMgr.Win.Forms.Controls
{
//=======================================================================
public partial class SpmItemListView_EmployeeRole : SpmItemListView
{
//-------------------------------------------------------------------
// Configuration.
public enum ListMode
{
General,
}
public new class Config : SpmItemListView.Config
{
public ListMode Mode { get; set; } = ListMode.General;
}
//-------------------------------------------------------------------
// Data members.
private Config config = new Config();
private readonly List<ColumnDfn> columnsDisplay = new List<ColumnDfn>();
private readonly List<ColumnDfn> columnsQuery = new List<ColumnDfn>();
private Timer timerQueryData = null;
private Timer timerDisplayItem = null;
private ColumnDfn columnDfnId = null;
private DbResultSet dbResultSet = null;
private SpmEmployeeRole.Params prmEmployeeRole;
//-------------------------------------------------------------------
// Construction.
public SpmItemListView_EmployeeRole() : this(new Config()) { }
public SpmItemListView_EmployeeRole(Config config) : base(config)
{
this.config = config;
InitializeComponent();
/* ToDo Timers function need modifying.
timerQueryData = new Timer() { Interval = 250 };
timerQueryData.Tick += OnTimerQueryData;
timerDisplayItem = new Timer() { Interval = 5 };
timerDisplayItem.Tick += OnTimerDisplayItem;*/
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (components != null) components.Dispose();
timerQueryData.Dispose();
timerDisplayItem.Dispose();
ClearResultSet();
}
base.Dispose(disposing);
}
private void ClearResultSet()
{
if (dbResultSet != null)
dbResultSet.Dispose();
dbResultSet = null;
}
//-------------------------------------------------------------------
// Properties.
[Browsable(false)]
public List<ColumnDfn> DisplayColumns { get { return new List<ColumnDfn>(columnsDisplay); } }
[Browsable(false)]
public SysId SelectedEmployeeRoleId { get { return SelectedItemId; } }
[Browsable(false)]
public SpmEmployeeRole SelectedEmployeeRole
{
get
{
if (SelectedItemCount == 1)
return DepartmentMgr.GetEmployeeRoleById(SelectedEmployeeRoleId);
return null;
}
}
//-------------------------------------------------------------------
// Configure.
public void SetConfig(Config config)
{
base.SetConfig(config);
this.config = config;
ConfigureList();
}
//-------------------------------------------------------------------
// Initialisation.
protected override void OnCreateControl()
{
base.OnCreateControl();
if (this.IsDesignerHosted()) return;
}
private void ConfigureList()
{
if (!this.Created) return;
InitEmployeeRoleList(true);
}
//-------------------------------------------------------------------
private void InitEmployeeRoleList(bool forceInit = false)
{
// Clear the existing list.
if (Columns.Count > 0 && !forceInit) return;
Clear();
columnsDisplay.Clear();
columnsQuery.Clear();
// Populate list of columns to be displayed.
columnsDisplay.Add(DepartmentMgr.GetEmployeeRoleColumnDfn(SpmEmployeeRole.Column.DepartmentId));
columnsDisplay.Add(DepartmentMgr.GetEmployeeRoleColumnDfn(SpmEmployeeRole.Column.EmployeeId));
columnsDisplay.Add(DepartmentMgr.GetEmployeeRoleColumnDfn(SpmEmployeeRole.Column.Role));
columnsDisplay.Add(DepartmentMgr.GetEmployeeRoleColumnDfn(SpmEmployeeRole.Column.ApplicationFrom));
columnsDisplay.Add(DepartmentMgr.GetEmployeeRoleColumnDfn(SpmEmployeeRole.Column.ApplicationTo));
#if DEBUG
columnsDisplay.Add(DepartmentMgr.GetEmployeeRoleColumnDfn(SpmEmployeeRole.Column.Id));
#endif
// Populate columns to list view.
SetColumns(columnsDisplay);
// Default sort column.
SortColumnIdx = GetColumnIdxById((int)SpmEmployeeRole.Column.DepartmentId);
Refresh();
// Initialise list of columns to be queries - ensure Id column in list.
columnsQuery.Clear();
columnsQuery.AddRange(columnsDisplay);
if (!columnsQuery.HasId(columnDfnId.Id))
columnsQuery.Add(columnDfnId);
}
//-------------------------------------------------------------------
// P o p u l a t i o n
//-------------------------------------------------------------------
public bool IsValidFiter(SpmEmployeeRole.Params prmEmployeeRole)
{
if (prmEmployeeRole == null) return false;
return true;
}
public void RefreshEmployeeRoles(SpmEmployeeRole.Params prmEmployeeRole)
{
// Clear timers.
/*timerQueryData.Enabled = false;
timerDisplayItem.Enabled = false;*/
// Item Ids in the 'Initial selection' list are automatically selected on population.
// Subsequent refreshes automatically select the current selection by repopulation of the 'Initial selection' list.
if (!InitialPopulation)
{
InitiallySelectedItemIds.Clear();
InitiallySelectedItemIds.AddRange(SelectedItemIds);
}
SelectedIndices.Clear();
// Clear previous results.
ItemTotal = 0;
Items.Clear();
// Prepare query.
ClearResultSet();
this.prmEmployeeRole = prmEmployeeRole;
// Enable timer.
}
void OnTimerQueryData(Object myObject, EventArgs myEventArgs)
{
//timerQueryData.Enabled = false;
QueryData();
}
private void QueryData()
{
ClearResultSet();
if (!IsValidFiter(prmEmployeeRole)) return;
// Query data.
ItemTotal = (int)DepartmentMgr.GetEmployeeRoleCount(prmEmployeeRole);
if (ItemTotal > 0) Logger.Trace(GetType().Name + ".QueryData EmployeeRole count: " + ItemTotal);
dbResultSet = DepartmentMgr.ExecuteEmployeeRoleQuery(columnsQuery, prmEmployeeRole);
//timerDisplayItem.Enabled = true;
InitialPopulation = false;
}
public void RefreshEmployeeRole(SysId affiliateId)
{
// Parameters to query single item:
if (!SysId.IsValid(affiliateId)) return;
SpmEmployeeRole.Params prm = new SpmEmployeeRole.Params();
prm.IncludedIds.Add(affiliateId);
// Query data.
using (DbResultSet dbResultSet = DepartmentMgr.ExecuteEmployeeRoleQuery(columnsQuery, prm))
{
if (dbResultSet.NextRecord())
DisplayItem(dbResultSet.GetRecordValues(), true);
}
}
//-------------------------------------------------------------------
// D i s p l a y I t e m s
//-------------------------------------------------------------------
private void OnTimerDisplayItem(Object myObject, EventArgs myEventArgs)
{
//timerDisplayItem.Enabled = false;
DisplayNextItems();
}
private void DisplayNextItems()
{
if (dbResultSet == null) return;
for (int itemCount = 0; itemCount <= Math.Min(64, Math.Max(0, DisplayRecordsBatchSize)); itemCount++)
{
if (dbResultSet.NextRecord())
{
DisplayItem(dbResultSet.GetRecordValues());
//timerDisplayItem.Enabled = true;
}
else
{
ClearResultSet();
return;
}
}
}
private void DisplayItem(NamedValue.Map values, bool highlight = false)
{
// Item identity.
SysId itemId = new SysId(StringUtil.ToInt(values.GetValue(columnDfnId.DataName).ToString()));
String itemName = SysId.ToString(itemId);
bool addNewItem = false;
ListViewItem item = FindItemWithName(itemName);
if (item == null)
{
// New item to be added.
item = new ListViewItem();
item.Name = itemName;
addNewItem = true;
}
else
{
// Clear sub items for existing item.
item.SubItems.Clear();
item.Name = itemName;
}
// Populate list view item.
int columnIdx = -1;
foreach (var column in columnsDisplay)
{
DataValue value = new DataValue();
if (column.Id == (int)SpmEmployeeRole.Column.Pos)
{
value = new DataValue((Items.Count + 1).ToString() + ".");
}
else
{
value = DepartmentMgr.GetEmployeeRoleDataValue(column, values);
if (!value.IsValid())
value = new DataValue(column.FormatValue(values));
}
if (++columnIdx == 0)
item.Text = value.ToString();
else
item.SubItems.Add(new ListViewSubItemExtended(column, value));
}
// Add to list if required (otherwise item has already been updated in list.
if (addNewItem)
{
ListViewItem itemAdded = Items.Add(item);
}
// Check for selection:
if (!highlight && InitiallySelectedItemIds.Contains(itemId))
highlight = true;
if (highlight)
{
item.Selected = true;
item.Focused = true;
EnsureVisible(item.Index);
}
}
//-------------------------------------------------------------------
// C o n t r o l E v e n t s
//-------------------------------------------------------------------
protected override void OnResize(EventArgs e)
{
base.OnResize(e);
//Logger.Debug(GetType().Name + ".OnResize Size: " + Size.ToString());
}
//-------------------------------------------------------------------
}
//=======================================================================
}
@@ -0,0 +1,23 @@
namespace Sarand.PatientMgr.Win.Forms.Controls
{
partial class SpmItemListView_Facility
{
/// <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,302 @@
using Sarand.Core.Base;
using Sarand.Core.Bus;
using Sarand.Core.Dbas.Base;
using Sarand.PatientMgr.Core.Bus;
using Sarand.Win.Forms.Controls;
using Sarand.Win.Forms.Utils;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows.Forms;
namespace Sarand.PatientMgr.Win.Forms.Controls
{
//=======================================================================
public partial class SpmItemListView_Facility : SpmItemListView
{
//-------------------------------------------------------------------
// Configuration.
public enum ListMode
{
General,
}
public new class Config : SpmItemListView.Config
{
public ListMode Mode { get; set; } = ListMode.General;
}
//-------------------------------------------------------------------
// Data members.
private Config config = new Config();
private readonly List<ColumnDfn> columnsDisplay = new List<ColumnDfn>();
private readonly List<ColumnDfn> columnsQuery = new List<ColumnDfn>();
private Timer timerQueryData = null;
private Timer timerDisplayItem = null;
private ColumnDfn columnDfnId = null;
private DbResultSet dbResultSet = null;
private SpmFacility.Params prmFacility;
//-------------------------------------------------------------------
// Construction.
public SpmItemListView_Facility() : this(new Config()) { }
public SpmItemListView_Facility(Config config) : base(config)
{
this.config = config;
InitializeComponent();
/* ToDo Timers function need modifying.
timerQueryData = new Timer() { Interval = 250 };
timerQueryData.Tick += OnTimerQueryData;
timerDisplayItem = new Timer() { Interval = 5 };
timerDisplayItem.Tick += OnTimerDisplayItem;*/
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (components != null) components.Dispose();
timerQueryData.Dispose();
timerDisplayItem.Dispose();
ClearResultSet();
}
base.Dispose(disposing);
}
private void ClearResultSet()
{
if (dbResultSet != null)
dbResultSet.Dispose();
dbResultSet = null;
}
//-------------------------------------------------------------------
// Properties.
[Browsable(false)]
public List<ColumnDfn> DisplayColumns { get { return new List<ColumnDfn>(columnsDisplay); } }
[Browsable(false)]
public SysId SelectedFacilityId { get { return SelectedItemId; } }
[Browsable(false)]
public SpmFacility SelectedFacility
{
get
{
if (SelectedItemCount == 1)
return DepartmentMgr.GetFacilityById(SelectedFacilityId);
return null;
}
}
//-------------------------------------------------------------------
// Configure.
public void SetConfig(Config config)
{
base.SetConfig(config);
this.config = config;
ConfigureList();
}
//-------------------------------------------------------------------
// Initialisation.
protected override void OnCreateControl()
{
base.OnCreateControl();
if (this.IsDesignerHosted()) return;
}
private void ConfigureList()
{
if (!this.Created) return;
InitFacilityList(true);
}
//-------------------------------------------------------------------
private void InitFacilityList(bool forceInit = false)
{
// Clear the existing list.
if (Columns.Count > 0 && !forceInit) return;
Clear();
columnsDisplay.Clear();
columnsQuery.Clear();
// Populate list of columns to be displayed.
columnsDisplay.Add(DepartmentMgr.GetFacilityColumnDfn(SpmFacility.Column.DepartmentId));
columnsDisplay.Add(DepartmentMgr.GetFacilityColumnDfn(SpmFacility.Column.Type));
columnsDisplay.Add(DepartmentMgr.GetFacilityColumnDfn(SpmFacility.Column.Type_Desc));
columnsDisplay.Add(DepartmentMgr.GetFacilityColumnDfn(SpmFacility.Column.Name));
columnsDisplay.Add(DepartmentMgr.GetFacilityColumnDfn(SpmFacility.Column.SortCode));
#if DEBUG
columnsDisplay.Add(DepartmentMgr.GetFacilityColumnDfn(SpmFacility.Column.Id));
#endif
// Populate columns to list view.
SetColumns(columnsDisplay);
// Default sort column.
SortColumnIdx = GetColumnIdxById((int)SpmFacility.Column.DepartmentId);
Refresh();
// Initialise list of columns to be queries - ensure Id column in list.
columnsQuery.Clear();
columnsQuery.AddRange(columnsDisplay);
if (!columnsQuery.HasId(columnDfnId.Id))
columnsQuery.Add(columnDfnId);
}
//-------------------------------------------------------------------
// P o p u l a t i o n
//-------------------------------------------------------------------
public bool IsValidFiter(SpmFacility.Params prmFacility)
{
if (prmFacility == null) return false;
return true;
}
public void RefreshFacilitys(SpmFacility.Params prmFacility)
{
// Clear timers.
/*timerQueryData.Enabled = false;
timerDisplayItem.Enabled = false;*/
// Item Ids in the 'Initial selection' list are automatically selected on population.
// Subsequent refreshes automatically select the current selection by repopulation of the 'Initial selection' list.
if (!InitialPopulation)
{
InitiallySelectedItemIds.Clear();
InitiallySelectedItemIds.AddRange(SelectedItemIds);
}
SelectedIndices.Clear();
// Clear previous results.
ItemTotal = 0;
Items.Clear();
// Prepare query.
ClearResultSet();
this.prmFacility = prmFacility;
// Enable timer.
}
void OnTimerQueryData(Object myObject, EventArgs myEventArgs)
{
//timerQueryData.Enabled = false;
QueryData();
}
private void QueryData()
{
ClearResultSet();
if (!IsValidFiter(prmFacility)) return;
// Query data.
ItemTotal = (int)DepartmentMgr.GetFacilityCount(prmFacility);
if (ItemTotal > 0) Logger.Trace(GetType().Name + ".QueryData Facility count: " + ItemTotal);
dbResultSet = DepartmentMgr.ExecuteFacilityQuery(columnsQuery, prmFacility);
//timerDisplayItem.Enabled = true;
InitialPopulation = false;
}
public void RefreshFacility(SysId affiliateId)
{
// Parameters to query single item:
if (!SysId.IsValid(affiliateId)) return;
SpmFacility.Params prm = new SpmFacility.Params();
prm.IncludedIds.Add(affiliateId);
// Query data.
using (DbResultSet dbResultSet = DepartmentMgr.ExecuteFacilityQuery(columnsQuery, prm))
{
if (dbResultSet.NextRecord())
DisplayItem(dbResultSet.GetRecordValues(), true);
}
}
//-------------------------------------------------------------------
// D i s p l a y I t e m s
//-------------------------------------------------------------------
private void OnTimerDisplayItem(Object myObject, EventArgs myEventArgs)
{
//timerDisplayItem.Enabled = false;
DisplayNextItems();
}
private void DisplayNextItems()
{
if (dbResultSet == null) return;
for (int itemCount = 0; itemCount <= Math.Min(64, Math.Max(0, DisplayRecordsBatchSize)); itemCount++)
{
if (dbResultSet.NextRecord())
{
DisplayItem(dbResultSet.GetRecordValues());
//timerDisplayItem.Enabled = true;
}
else
{
ClearResultSet();
return;
}
}
}
private void DisplayItem(NamedValue.Map values, bool highlight = false)
{
// Item identity.
SysId itemId = new SysId(StringUtil.ToInt(values.GetValue(columnDfnId.DataName).ToString()));
String itemName = SysId.ToString(itemId);
bool addNewItem = false;
ListViewItem item = FindItemWithName(itemName);
if (item == null)
{
// New item to be added.
item = new ListViewItem();
item.Name = itemName;
addNewItem = true;
}
else
{
// Clear sub items for existing item.
item.SubItems.Clear();
item.Name = itemName;
}
// Populate list view item.
int columnIdx = -1;
foreach (var column in columnsDisplay)
{
DataValue value = new DataValue();
if (column.Id == (int)SpmFacility.Column.Pos)
{
value = new DataValue((Items.Count + 1).ToString() + ".");
}
else
{
value = DepartmentMgr.GetFacilityDataValue(column, values);
if (!value.IsValid())
value = new DataValue(column.FormatValue(values));
}
if (++columnIdx == 0)
item.Text = value.ToString();
else
item.SubItems.Add(new ListViewSubItemExtended(column, value));
}
// Add to list if required (otherwise item has already been updated in list.
if (addNewItem)
{
ListViewItem itemAdded = Items.Add(item);
}
// Check for selection:
if (!highlight && InitiallySelectedItemIds.Contains(itemId))
highlight = true;
if (highlight)
{
item.Selected = true;
item.Focused = true;
EnsureVisible(item.Index);
}
}
//-------------------------------------------------------------------
// C o n t r o l E v e n t s
//-------------------------------------------------------------------
protected override void OnResize(EventArgs e)
{
base.OnResize(e);
//Logger.Debug(GetType().Name + ".OnResize Size: " + Size.ToString());
}
//-------------------------------------------------------------------
}
//=======================================================================
}
@@ -0,0 +1,23 @@
namespace Sarand.PatientMgr.Win.Forms.Controls
{
partial class SpmItemListView_FacilitySession
{
/// <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,299 @@
using Sarand.Core.Base;
using Sarand.Core.Bus;
using Sarand.Core.Dbas.Base;
using Sarand.PatientMgr.Core.Bus;
using Sarand.Win.Forms.Controls;
using Sarand.Win.Forms.Utils;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows.Forms;
namespace Sarand.PatientMgr.Win.Forms.Controls
{
//=======================================================================
public partial class SpmItemListView_FacilitySession : SpmItemListView
{
//-------------------------------------------------------------------
// Configuration.
public enum ListMode
{
General,
}
public new class Config : SpmItemListView.Config
{
public ListMode Mode { get; set; } = ListMode.General;
}
//-------------------------------------------------------------------
// Data members.
private Config config = new Config();
private readonly List<ColumnDfn> columnsDisplay = new List<ColumnDfn>();
private readonly List<ColumnDfn> columnsQuery = new List<ColumnDfn>();
private Timer timerQueryData = null;
private Timer timerDisplayItem = null;
private ColumnDfn columnDfnId = null;
private DbResultSet dbResultSet = null;
private SpmFacilitySession.Params prmFacilitySession;
//-------------------------------------------------------------------
// Construction.
public SpmItemListView_FacilitySession() : this(new Config()) { }
public SpmItemListView_FacilitySession(Config config) : base(config)
{
this.config = config;
InitializeComponent();
/* ToDo Timers function need modifying.
timerQueryData = new Timer() { Interval = 250 };
timerQueryData.Tick += OnTimerQueryData;
timerDisplayItem = new Timer() { Interval = 5 };
timerDisplayItem.Tick += OnTimerDisplayItem;*/
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (components != null) components.Dispose();
timerQueryData.Dispose();
timerDisplayItem.Dispose();
ClearResultSet();
}
base.Dispose(disposing);
}
private void ClearResultSet()
{
if (dbResultSet != null)
dbResultSet.Dispose();
dbResultSet = null;
}
//-------------------------------------------------------------------
// Properties.
[Browsable(false)]
public List<ColumnDfn> DisplayColumns { get { return new List<ColumnDfn>(columnsDisplay); } }
[Browsable(false)]
public SysId SelectedFacilitySessionId { get { return SelectedItemId; } }
[Browsable(false)]
public SpmFacilitySession SelectedFacilitySession
{
get
{
if (SelectedItemCount == 1)
return DepartmentMgr.GetFacilitySessionById(SelectedFacilitySessionId);
return null;
}
}
//-------------------------------------------------------------------
// Configure.
public void SetConfig(Config config)
{
base.SetConfig(config);
this.config = config;
ConfigureList();
}
//-------------------------------------------------------------------
// Initialisation.
protected override void OnCreateControl()
{
base.OnCreateControl();
if (this.IsDesignerHosted()) return;
}
private void ConfigureList()
{
if (!this.Created) return;
InitFacilitySessionList(true);
}
//-------------------------------------------------------------------
private void InitFacilitySessionList(bool forceInit = false)
{
// Clear the existing list.
if (Columns.Count > 0 && !forceInit) return;
Clear();
columnsDisplay.Clear();
columnsQuery.Clear();
// Populate list of columns to be displayed.
columnsDisplay.Add(DepartmentMgr.GetFacilitySessionColumnDfn(SpmFacilitySession.Column.Facility_TypeDesc));
columnsDisplay.Add(DepartmentMgr.GetFacilitySessionColumnDfn(SpmFacilitySession.Column.Facility_Name));
columnsDisplay.Add(DepartmentMgr.GetFacilitySessionColumnDfn(SpmFacilitySession.Column.Facility_SortCode));
columnsDisplay.Add(DepartmentMgr.GetFacilitySessionColumnDfn(SpmFacilitySession.Column.Facility_Desc));
columnsDisplay.Add(DepartmentMgr.GetFacilitySessionColumnDfn(SpmFacilitySession.Column.Facility_TemplateMapTypeDesc));
// Populate columns to list view.
SetColumns(columnsDisplay);
// Default sort column.
SortColumnIdx = GetColumnIdxById((int)SpmFacilitySession.Column.Facility_Name);
Refresh();
// Initialise list of columns to be queries - ensure Id column in list.
columnsQuery.Clear();
columnsQuery.AddRange(columnsDisplay);
if (!columnsQuery.HasId(columnDfnId.Id))
columnsQuery.Add(columnDfnId);
}
//-------------------------------------------------------------------
// P o p u l a t i o n
//-------------------------------------------------------------------
public bool IsValidFiter(SpmFacilitySession.Params prmFacilitySession)
{
if (prmFacilitySession == null) return false;
return true;
}
public void RefreshFacilitySessions(SpmFacilitySession.Params prmFacilitySession)
{
// Clear timers.
/*timerQueryData.Enabled = false;
timerDisplayItem.Enabled = false;*/
// Item Ids in the 'Initial selection' list are automatically selected on population.
// Subsequent refreshes automatically select the current selection by repopulation of the 'Initial selection' list.
if (!InitialPopulation)
{
InitiallySelectedItemIds.Clear();
InitiallySelectedItemIds.AddRange(SelectedItemIds);
}
SelectedIndices.Clear();
// Clear previous results.
ItemTotal = 0;
Items.Clear();
// Prepare query.
ClearResultSet();
this.prmFacilitySession = prmFacilitySession;
// Enable timer.
}
void OnTimerQueryData(Object myObject, EventArgs myEventArgs)
{
//timerQueryData.Enabled = false;
QueryData();
}
private void QueryData()
{
ClearResultSet();
if (!IsValidFiter(prmFacilitySession)) return;
// Query data.
ItemTotal = (int)DepartmentMgr.GetFacilitySessionCount(prmFacilitySession);
if (ItemTotal > 0) Logger.Trace(GetType().Name + ".QueryData FacilitySession count: " + ItemTotal);
dbResultSet = DepartmentMgr.ExecuteFacilitySessionQuery(columnsQuery, prmFacilitySession);
//timerDisplayItem.Enabled = true;
InitialPopulation = false;
}
public void RefreshFacilitySession(SysId affiliateId)
{
// Parameters to query single item:
if (!SysId.IsValid(affiliateId)) return;
SpmFacilitySession.Params prm = new SpmFacilitySession.Params();
prm.IncludedIds.Add(affiliateId);
// Query data.
using (DbResultSet dbResultSet = DepartmentMgr.ExecuteFacilitySessionQuery(columnsQuery, prm))
{
if (dbResultSet.NextRecord())
DisplayItem(dbResultSet.GetRecordValues(), true);
}
}
//-------------------------------------------------------------------
// D i s p l a y I t e m s
//-------------------------------------------------------------------
private void OnTimerDisplayItem(Object myObject, EventArgs myEventArgs)
{
//timerDisplayItem.Enabled = false;
DisplayNextItems();
}
private void DisplayNextItems()
{
if (dbResultSet == null) return;
for (int itemCount = 0; itemCount <= Math.Min(64, Math.Max(0, DisplayRecordsBatchSize)); itemCount++)
{
if (dbResultSet.NextRecord())
{
DisplayItem(dbResultSet.GetRecordValues());
//timerDisplayItem.Enabled = true;
}
else
{
ClearResultSet();
return;
}
}
}
private void DisplayItem(NamedValue.Map values, bool highlight = false)
{
// Item identity.
SysId itemId = new SysId(StringUtil.ToInt(values.GetValue(columnDfnId.DataName).ToString()));
String itemName = SysId.ToString(itemId);
bool addNewItem = false;
ListViewItem item = FindItemWithName(itemName);
if (item == null)
{
// New item to be added.
item = new ListViewItem();
item.Name = itemName;
addNewItem = true;
}
else
{
// Clear sub items for existing item.
item.SubItems.Clear();
item.Name = itemName;
}
// Populate list view item.
int columnIdx = -1;
foreach (var column in columnsDisplay)
{
DataValue value = new DataValue();
if (column.Id == (int)SpmFacilitySession.Column.Pos)
{
value = new DataValue((Items.Count + 1).ToString() + ".");
}
else
{
value = DepartmentMgr.GetFacilitySessionDataValue(column, values);
if (!value.IsValid())
value = new DataValue(column.FormatValue(values));
}
if (++columnIdx == 0)
item.Text = value.ToString();
else
item.SubItems.Add(new ListViewSubItemExtended(column, value));
}
// Add to list if required (otherwise item has already been updated in list.
if (addNewItem)
{
ListViewItem itemAdded = Items.Add(item);
}
// Check for selection:
if (!highlight && InitiallySelectedItemIds.Contains(itemId))
highlight = true;
if (highlight)
{
item.Selected = true;
item.Focused = true;
EnsureVisible(item.Index);
}
}
//-------------------------------------------------------------------
// C o n t r o l E v e n t s
//-------------------------------------------------------------------
protected override void OnResize(EventArgs e)
{
base.OnResize(e);
//Logger.Debug(GetType().Name + ".OnResize Size: " + Size.ToString());
}
//-------------------------------------------------------------------
}
//=======================================================================
}
@@ -0,0 +1,23 @@
namespace Sarand.PatientMgr.Win.Forms.Controls
{
partial class SpmItemListView_FacilityTemplate
{
/// <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,302 @@
using Sarand.Core.Base;
using Sarand.Core.Bus;
using Sarand.Core.Dbas.Base;
using Sarand.PatientMgr.Core.Bus;
using Sarand.Win.Forms.Controls;
using Sarand.Win.Forms.Utils;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows.Forms;
namespace Sarand.PatientMgr.Win.Forms.Controls
{
//=======================================================================
public partial class SpmItemListView_FacilityTemplate : SpmItemListView
{
//-------------------------------------------------------------------
// Configuration.
public enum ListMode
{
General,
}
public new class Config : SpmItemListView.Config
{
public ListMode Mode { get; set; } = ListMode.General;
}
//-------------------------------------------------------------------
// Data members.
private Config config = new Config();
private readonly List<ColumnDfn> columnsDisplay = new List<ColumnDfn>();
private readonly List<ColumnDfn> columnsQuery = new List<ColumnDfn>();
private Timer timerQueryData = null;
private Timer timerDisplayItem = null;
private ColumnDfn columnDfnId = null;
private DbResultSet dbResultSet = null;
private SpmFacilityTemplate.Params prmFacilityTemplate;
//-------------------------------------------------------------------
// Construction.
public SpmItemListView_FacilityTemplate() : this(new Config()) { }
public SpmItemListView_FacilityTemplate(Config config) : base(config)
{
this.config = config;
InitializeComponent();
/* ToDo Timers function need modifying.
timerQueryData = new Timer() { Interval = 250 };
timerQueryData.Tick += OnTimerQueryData;
timerDisplayItem = new Timer() { Interval = 5 };
timerDisplayItem.Tick += OnTimerDisplayItem;*/
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (components != null) components.Dispose();
timerQueryData.Dispose();
timerDisplayItem.Dispose();
ClearResultSet();
}
base.Dispose(disposing);
}
private void ClearResultSet()
{
if (dbResultSet != null)
dbResultSet.Dispose();
dbResultSet = null;
}
//-------------------------------------------------------------------
// Properties.
[Browsable(false)]
public List<ColumnDfn> DisplayColumns { get { return new List<ColumnDfn>(columnsDisplay); } }
[Browsable(false)]
public SysId SelectedFacilityTemplateId { get { return SelectedItemId; } }
[Browsable(false)]
public SpmFacilityTemplate SelectedFacilityTemplate
{
get
{
if (SelectedItemCount == 1)
return DepartmentMgr.GetFacilityTemplateById(SelectedFacilityTemplateId);
return null;
}
}
//-------------------------------------------------------------------
// Configure.
public void SetConfig(Config config)
{
base.SetConfig(config);
this.config = config;
ConfigureList();
}
//-------------------------------------------------------------------
// Initialisation.
protected override void OnCreateControl()
{
base.OnCreateControl();
if (this.IsDesignerHosted()) return;
}
private void ConfigureList()
{
if (!this.Created) return;
InitFacilityTemplateList(true);
}
//-------------------------------------------------------------------
private void InitFacilityTemplateList(bool forceInit = false)
{
// Clear the existing list.
if (Columns.Count > 0 && !forceInit) return;
Clear();
columnsDisplay.Clear();
columnsQuery.Clear();
// Populate list of columns to be displayed.
columnsDisplay.Add(DepartmentMgr.GetFacilityTemplateColumnDfn(SpmFacilityTemplate.Column.Category));
columnsDisplay.Add(DepartmentMgr.GetFacilityTemplateColumnDfn(SpmFacilityTemplate.Column.Type));
columnsDisplay.Add(DepartmentMgr.GetFacilityTemplateColumnDfn(SpmFacilityTemplate.Column.Type_Desc));
columnsDisplay.Add(DepartmentMgr.GetFacilityTemplateColumnDfn(SpmFacilityTemplate.Column.Sort));
columnsDisplay.Add(DepartmentMgr.GetFacilityTemplateColumnDfn(SpmFacilityTemplate.Column.Group));
#if DEBUG
columnsDisplay.Add(DepartmentMgr.GetFacilityTemplateColumnDfn(SpmFacilityTemplate.Column.Id));
#endif
// Populate columns to list view.
SetColumns(columnsDisplay);
// Default sort column.
SortColumnIdx = GetColumnIdxById((int)SpmFacilityTemplate.Column.Name);
Refresh();
// Initialise list of columns to be queries - ensure Id column in list.
columnsQuery.Clear();
columnsQuery.AddRange(columnsDisplay);
if (!columnsQuery.HasId(columnDfnId.Id))
columnsQuery.Add(columnDfnId);
}
//-------------------------------------------------------------------
// P o p u l a t i o n
//-------------------------------------------------------------------
public bool IsValidFiter(SpmFacilityTemplate.Params prmFacilityTemplate)
{
if (prmFacilityTemplate == null) return false;
return true;
}
public void RefreshFacilityTemplates(SpmFacilityTemplate.Params prmFacilityTemplate)
{
// Clear timers.
/*timerQueryData.Enabled = false;
timerDisplayItem.Enabled = false;*/
// Item Ids in the 'Initial selection' list are automatically selected on population.
// Subsequent refreshes automatically select the current selection by repopulation of the 'Initial selection' list.
if (!InitialPopulation)
{
InitiallySelectedItemIds.Clear();
InitiallySelectedItemIds.AddRange(SelectedItemIds);
}
SelectedIndices.Clear();
// Clear previous results.
ItemTotal = 0;
Items.Clear();
// Prepare query.
ClearResultSet();
this.prmFacilityTemplate = prmFacilityTemplate;
// Enable timer.
}
void OnTimerQueryData(Object myObject, EventArgs myEventArgs)
{
//timerQueryData.Enabled = false;
QueryData();
}
private void QueryData()
{
ClearResultSet();
if (!IsValidFiter(prmFacilityTemplate)) return;
// Query data.
ItemTotal = (int)DepartmentMgr.GetFacilityTemplateCount(prmFacilityTemplate);
if (ItemTotal > 0) Logger.Trace(GetType().Name + ".QueryData FacilityTemplate count: " + ItemTotal);
dbResultSet = DepartmentMgr.ExecuteFacilityTemplateQuery(columnsQuery, prmFacilityTemplate);
//timerDisplayItem.Enabled = true;
InitialPopulation = false;
}
public void RefreshFacilityTemplate(SysId affiliateId)
{
// Parameters to query single item:
if (!SysId.IsValid(affiliateId)) return;
SpmFacilityTemplate.Params prm = new SpmFacilityTemplate.Params();
prm.IncludedIds.Add(affiliateId);
// Query data.
using (DbResultSet dbResultSet = DepartmentMgr.ExecuteFacilityTemplateQuery(columnsQuery, prm))
{
if (dbResultSet.NextRecord())
DisplayItem(dbResultSet.GetRecordValues(), true);
}
}
//-------------------------------------------------------------------
// D i s p l a y I t e m s
//-------------------------------------------------------------------
private void OnTimerDisplayItem(Object myObject, EventArgs myEventArgs)
{
//timerDisplayItem.Enabled = false;
DisplayNextItems();
}
private void DisplayNextItems()
{
if (dbResultSet == null) return;
for (int itemCount = 0; itemCount <= Math.Min(64, Math.Max(0, DisplayRecordsBatchSize)); itemCount++)
{
if (dbResultSet.NextRecord())
{
DisplayItem(dbResultSet.GetRecordValues());
//timerDisplayItem.Enabled = true;
}
else
{
ClearResultSet();
return;
}
}
}
private void DisplayItem(NamedValue.Map values, bool highlight = false)
{
// Item identity.
SysId itemId = new SysId(StringUtil.ToInt(values.GetValue(columnDfnId.DataName).ToString()));
String itemName = SysId.ToString(itemId);
bool addNewItem = false;
ListViewItem item = FindItemWithName(itemName);
if (item == null)
{
// New item to be added.
item = new ListViewItem();
item.Name = itemName;
addNewItem = true;
}
else
{
// Clear sub items for existing item.
item.SubItems.Clear();
item.Name = itemName;
}
// Populate list view item.
int columnIdx = -1;
foreach (var column in columnsDisplay)
{
DataValue value = new DataValue();
if (column.Id == (int)SpmFacilityTemplate.Column.Pos)
{
value = new DataValue((Items.Count + 1).ToString() + ".");
}
else
{
value = DepartmentMgr.GetFacilityTemplateDataValue(column, values);
if (!value.IsValid())
value = new DataValue(column.FormatValue(values));
}
if (++columnIdx == 0)
item.Text = value.ToString();
else
item.SubItems.Add(new ListViewSubItemExtended(column, value));
}
// Add to list if required (otherwise item has already been updated in list.
if (addNewItem)
{
ListViewItem itemAdded = Items.Add(item);
}
// Check for selection:
if (!highlight && InitiallySelectedItemIds.Contains(itemId))
highlight = true;
if (highlight)
{
item.Selected = true;
item.Focused = true;
EnsureVisible(item.Index);
}
}
//-------------------------------------------------------------------
// C o n t r o l E v e n t s
//-------------------------------------------------------------------
protected override void OnResize(EventArgs e)
{
base.OnResize(e);
//Logger.Debug(GetType().Name + ".OnResize Size: " + Size.ToString());
}
//-------------------------------------------------------------------
}
//=======================================================================
}
@@ -0,0 +1,23 @@
namespace Sarand.PatientMgr.Win.Forms.Controls
{
partial class SpmItemListView_Institution
{
/// <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,302 @@
using Sarand.Core.Base;
using Sarand.Core.Bus;
using Sarand.Core.Dbas.Base;
using Sarand.PatientMgr.Core.Bus;
using Sarand.Win.Forms.Controls;
using Sarand.Win.Forms.Utils;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Sarand.PatientMgr.Win.Forms.Controls
{
//=======================================================================
public partial class SpmItemListView_Institution : SpmItemListView
{
//-------------------------------------------------------------------
// Configuration.
public enum ListMode
{
General,
}
public new class Config : SpmItemListView.Config
{
public ListMode Mode { get; set; } = ListMode.General;
}
//-------------------------------------------------------------------
// Data members.
private Config config = new Config();
private readonly List<ColumnDfn> columnsDisplay = new List<ColumnDfn>();
private readonly List<ColumnDfn> columnsQuery = new List<ColumnDfn>();
private Timer timerQueryData = null;
private Timer timerDisplayItem = null;
private ColumnDfn columnDfnId = null;
private DbResultSet dbResultSet = null;
private SpmInstitution.Params prmInstitution;
//-------------------------------------------------------------------
// Construction.
public SpmItemListView_Institution() : this(new Config()) { }
public SpmItemListView_Institution(Config config) : base(config)
{
this.config = config;
InitializeComponent();
/* ToDo Timers function need modifying.
timerQueryData = new Timer() { Interval = 250 };
timerQueryData.Tick += OnTimerQueryData;
timerDisplayItem = new Timer() { Interval = 5 };
timerDisplayItem.Tick += OnTimerDisplayItem;*/
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (components != null) components.Dispose();
timerQueryData.Dispose();
timerDisplayItem.Dispose();
ClearResultSet();
}
base.Dispose(disposing);
}
private void ClearResultSet()
{
if (dbResultSet != null)
dbResultSet.Dispose();
dbResultSet = null;
}
//-------------------------------------------------------------------
// Properties.
[Browsable(false)]
public List<ColumnDfn> DisplayColumns { get { return new List<ColumnDfn>(columnsDisplay); } }
[Browsable(false)]
public SysId SelectedInstitutionId { get { return SelectedItemId; } }
[Browsable(false)]
public SpmInstitution SelectedInstitution
{
get
{
if (SelectedItemCount == 1)
return InstitutionMgr.GetInstitutionById(SelectedInstitutionId);
return null;
}
}
//-------------------------------------------------------------------
// Configure.
public void SetConfig(Config config)
{
base.SetConfig(config);
this.config = config;
ConfigureList();
}
//-------------------------------------------------------------------
// Initialisation.
protected override void OnCreateControl()
{
base.OnCreateControl();
if (this.IsDesignerHosted()) return;
}
private void ConfigureList()
{
if (!this.Created) return;
InitInstitutionList(true);
}
//-------------------------------------------------------------------
private void InitInstitutionList(bool forceInit = false)
{
// Clear the existing list.
if (Columns.Count > 0 && !forceInit) return;
Clear();
columnsDisplay.Clear();
columnsQuery.Clear();
// Populate list of columns to be displayed.
columnsDisplay.Add(InstitutionMgr.GetInstitutionColumnDfn(SpmInstitution.Column.Name));
#if DEBUG
columnsDisplay.Add(InstitutionMgr.GetInstitutionColumnDfn(SpmInstitution.Column.Id));
#endif
// Populate columns to list view.
SetColumns(columnsDisplay);
// Default sort column.
SortColumnIdx = GetColumnIdxById((int)SpmInstitution.Column.Name);
Refresh();
// Initialise list of columns to be queries - ensure Id column in list.
columnsQuery.Clear();
columnsQuery.AddRange(columnsDisplay);
if (!columnsQuery.HasId(columnDfnId.Id))
columnsQuery.Add(columnDfnId);
}
//-------------------------------------------------------------------
// P o p u l a t i o n
//-------------------------------------------------------------------
public bool IsValidFiter(SpmInstitution.Params prmInstitution)
{
if (prmInstitution == null) return false;
return true;
}
public void RefreshInstitutions(SpmInstitution.Params prmInstitution)
{
// Clear timers.
/*timerQueryData.Enabled = false;
timerDisplayItem.Enabled = false;*/
// Item Ids in the 'Initial selection' list are automatically selected on population.
// Subsequent refreshes automatically select the current selection by repopulation of the 'Initial selection' list.
if (!InitialPopulation)
{
InitiallySelectedItemIds.Clear();
InitiallySelectedItemIds.AddRange(SelectedItemIds);
}
SelectedIndices.Clear();
// Clear previous results.
ItemTotal = 0;
Items.Clear();
// Prepare query.
ClearResultSet();
this.prmInstitution = prmInstitution;
// Enable timer.
}
void OnTimerQueryData(Object myObject, EventArgs myEventArgs)
{
//timerQueryData.Enabled = false;
QueryData();
}
private void QueryData()
{
ClearResultSet();
if (!IsValidFiter(prmInstitution)) return;
// Query data.
ItemTotal = (int)InstitutionMgr.GetInstitutionCount(prmInstitution);
if (ItemTotal > 0) Logger.Trace(GetType().Name + ".QueryData Institution count: " + ItemTotal);
dbResultSet = InstitutionMgr.ExecuteInstitutionQuery(columnsQuery, prmInstitution);
//timerDisplayItem.Enabled = true;
InitialPopulation = false;
}
public void RefreshInstitution(SysId affiliateId)
{
// Parameters to query single item:
if (!SysId.IsValid(affiliateId)) return;
SpmInstitution.Params prm = new SpmInstitution.Params();
prm.IncludedIds.Add(affiliateId);
// Query data.
using (DbResultSet dbResultSet = InstitutionMgr.ExecuteInstitutionQuery(columnsQuery, prm))
{
if (dbResultSet.NextRecord())
DisplayItem(dbResultSet.GetRecordValues(), true);
}
}
//-------------------------------------------------------------------
// D i s p l a y I t e m s
//-------------------------------------------------------------------
private void OnTimerDisplayItem(Object myObject, EventArgs myEventArgs)
{
//timerDisplayItem.Enabled = false;
DisplayNextItems();
}
private void DisplayNextItems()
{
if (dbResultSet == null) return;
for (int itemCount = 0; itemCount <= Math.Min(64, Math.Max(0, DisplayRecordsBatchSize)); itemCount++)
{
if (dbResultSet.NextRecord())
{
DisplayItem(dbResultSet.GetRecordValues());
//timerDisplayItem.Enabled = true;
}
else
{
ClearResultSet();
return;
}
}
}
private void DisplayItem(NamedValue.Map values, bool highlight = false)
{
// Item identity.
SysId itemId = new SysId(StringUtil.ToInt(values.GetValue(columnDfnId.DataName).ToString()));
String itemName = SysId.ToString(itemId);
bool addNewItem = false;
ListViewItem item = FindItemWithName(itemName);
if (item == null)
{
// New item to be added.
item = new ListViewItem();
item.Name = itemName;
addNewItem = true;
}
else
{
// Clear sub items for existing item.
item.SubItems.Clear();
item.Name = itemName;
}
// Populate list view item.
int columnIdx = -1;
foreach (var column in columnsDisplay)
{
DataValue value = new DataValue();
if (column.Id == (int)SpmInstitution.Column.Pos)
{
value = new DataValue((Items.Count + 1).ToString() + ".");
}
else
{
value = InstitutionMgr.GetInstitutionDataValue(column, values);
if (!value.IsValid())
value = new DataValue(column.FormatValue(values));
}
if (++columnIdx == 0)
item.Text = value.ToString();
else
item.SubItems.Add(new ListViewSubItemExtended(column, value));
}
// Add to list if required (otherwise item has already been updated in list.
if (addNewItem)
{
ListViewItem itemAdded = Items.Add(item);
}
// Check for selection:
if (!highlight && InitiallySelectedItemIds.Contains(itemId))
highlight = true;
if (highlight)
{
item.Selected = true;
item.Focused = true;
EnsureVisible(item.Index);
}
}
//-------------------------------------------------------------------
// C o n t r o l E v e n t s
//-------------------------------------------------------------------
protected override void OnResize(EventArgs e)
{
base.OnResize(e);
//Logger.Debug(GetType().Name + ".OnResize Size: " + Size.ToString());
}
//-------------------------------------------------------------------
}
//=======================================================================
}
@@ -0,0 +1,23 @@
namespace Sarand.PatientMgr.Win.Forms.Controls
{
partial class SpmItemListView_Operation
{
/// <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,300 @@
using Sarand.Core.Base;
using Sarand.Core.Bus;
using Sarand.Core.Dbas.Base;
using Sarand.PatientMgr.Core.Bus;
using Sarand.Win.Forms.Controls;
using Sarand.Win.Forms.Utils;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows.Forms;
namespace Sarand.PatientMgr.Win.Forms.Controls
{
//=======================================================================
public partial class SpmItemListView_Operation : SpmItemListView
{
//-------------------------------------------------------------------
// Configuration.
public enum ListMode
{
General,
}
public new class Config : SpmItemListView.Config
{
public ListMode Mode { get; set; } = ListMode.General;
}
//-------------------------------------------------------------------
// Data members.
private Config config = new Config();
private readonly List<ColumnDfn> columnsDisplay = new List<ColumnDfn>();
private readonly List<ColumnDfn> columnsQuery = new List<ColumnDfn>();
private Timer timerQueryData = null;
private Timer timerDisplayItem = null;
private ColumnDfn columnDfnId = null;
private DbResultSet dbResultSet = null;
private SpmOperation.Params prmOperation;
//-------------------------------------------------------------------
// Construction.
public SpmItemListView_Operation() : this(new Config()) { }
public SpmItemListView_Operation(Config config) : base(config)
{
this.config = config;
InitializeComponent();
/* ToDo Timers function need modifying.
timerQueryData = new Timer() { Interval = 250 };
timerQueryData.Tick += OnTimerQueryData;
timerDisplayItem = new Timer() { Interval = 5 };
timerDisplayItem.Tick += OnTimerDisplayItem;*/
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (components != null) components.Dispose();
timerQueryData.Dispose();
timerDisplayItem.Dispose();
ClearResultSet();
}
base.Dispose(disposing);
}
private void ClearResultSet()
{
if (dbResultSet != null)
dbResultSet.Dispose();
dbResultSet = null;
}
//-------------------------------------------------------------------
// Properties.
[Browsable(false)]
public List<ColumnDfn> DisplayColumns { get { return new List<ColumnDfn>(columnsDisplay); } }
[Browsable(false)]
public SysId SelectedOperationId { get { return SelectedItemId; } }
[Browsable(false)]
public SpmOperation SelectedOperation
{
get
{
if (SelectedItemCount == 1)
return InstitutionMgr.GetOperationById(SelectedOperationId);
return null;
}
}
//-------------------------------------------------------------------
// Configure.
public void SetConfig(Config config)
{
base.SetConfig(config);
this.config = config;
ConfigureList();
}
//-------------------------------------------------------------------
// Initialisation.
protected override void OnCreateControl()
{
base.OnCreateControl();
if (this.IsDesignerHosted()) return;
}
private void ConfigureList()
{
if (!this.Created) return;
InitOperationList(true);
}
//-------------------------------------------------------------------
private void InitOperationList(bool forceInit = false)
{
// Clear the existing list.
if (Columns.Count > 0 && !forceInit) return;
Clear();
columnsDisplay.Clear();
columnsQuery.Clear();
// Populate list of columns to be displayed.
columnsDisplay.Add(InstitutionMgr.GetOperationColumnDfn(SpmOperation.Column.InstitutionId));
columnsDisplay.Add(InstitutionMgr.GetOperationColumnDfn(SpmOperation.Column.Code));
columnsDisplay.Add(InstitutionMgr.GetOperationColumnDfn(SpmOperation.Column.Description));
#if DEBUG
columnsDisplay.Add(InstitutionMgr.GetOperationColumnDfn(SpmOperation.Column.Id));
#endif
// Populate columns to list view.
SetColumns(columnsDisplay);
// Default sort column.
SortColumnIdx = GetColumnIdxById((int)SpmOperation.Column.InstitutionId);
Refresh();
// Initialise list of columns to be queries - ensure Id column in list.
columnsQuery.Clear();
columnsQuery.AddRange(columnsDisplay);
if (!columnsQuery.HasId(columnDfnId.Id))
columnsQuery.Add(columnDfnId);
}
//-------------------------------------------------------------------
// P o p u l a t i o n
//-------------------------------------------------------------------
public bool IsValidFiter(SpmOperation.Params prmOperation)
{
if (prmOperation == null) return false;
return true;
}
public void RefreshOperations(SpmOperation.Params prmOperation)
{
// Clear timers.
/*timerQueryData.Enabled = false;
timerDisplayItem.Enabled = false;*/
// Item Ids in the 'Initial selection' list are automatically selected on population.
// Subsequent refreshes automatically select the current selection by repopulation of the 'Initial selection' list.
if (!InitialPopulation)
{
InitiallySelectedItemIds.Clear();
InitiallySelectedItemIds.AddRange(SelectedItemIds);
}
SelectedIndices.Clear();
// Clear previous results.
ItemTotal = 0;
Items.Clear();
// Prepare query.
ClearResultSet();
this.prmOperation = prmOperation;
// Enable timer.
}
void OnTimerQueryData(Object myObject, EventArgs myEventArgs)
{
//timerQueryData.Enabled = false;
QueryData();
}
private void QueryData()
{
ClearResultSet();
if (!IsValidFiter(prmOperation)) return;
// Query data.
ItemTotal = (int)InstitutionMgr.GetOperationCount(prmOperation);
if (ItemTotal > 0) Logger.Trace(GetType().Name + ".QueryData Operation count: " + ItemTotal);
dbResultSet = InstitutionMgr.ExecuteOperationQuery(columnsQuery, prmOperation);
//timerDisplayItem.Enabled = true;
InitialPopulation = false;
}
public void RefreshOperation(SysId affiliateId)
{
// Parameters to query single item:
if (!SysId.IsValid(affiliateId)) return;
SpmOperation.Params prm = new SpmOperation.Params();
prm.IncludedIds.Add(affiliateId);
// Query data.
using (DbResultSet dbResultSet = InstitutionMgr.ExecuteOperationQuery(columnsQuery, prm))
{
if (dbResultSet.NextRecord())
DisplayItem(dbResultSet.GetRecordValues(), true);
}
}
//-------------------------------------------------------------------
// D i s p l a y I t e m s
//-------------------------------------------------------------------
private void OnTimerDisplayItem(Object myObject, EventArgs myEventArgs)
{
//timerDisplayItem.Enabled = false;
DisplayNextItems();
}
private void DisplayNextItems()
{
if (dbResultSet == null) return;
for (int itemCount = 0; itemCount <= Math.Min(64, Math.Max(0, DisplayRecordsBatchSize)); itemCount++)
{
if (dbResultSet.NextRecord())
{
DisplayItem(dbResultSet.GetRecordValues());
//timerDisplayItem.Enabled = true;
}
else
{
ClearResultSet();
return;
}
}
}
private void DisplayItem(NamedValue.Map values, bool highlight = false)
{
// Item identity.
SysId itemId = new SysId(StringUtil.ToInt(values.GetValue(columnDfnId.DataName).ToString()));
String itemName = SysId.ToString(itemId);
bool addNewItem = false;
ListViewItem item = FindItemWithName(itemName);
if (item == null)
{
// New item to be added.
item = new ListViewItem();
item.Name = itemName;
addNewItem = true;
}
else
{
// Clear sub items for existing item.
item.SubItems.Clear();
item.Name = itemName;
}
// Populate list view item.
int columnIdx = -1;
foreach (var column in columnsDisplay)
{
DataValue value = new DataValue();
if (column.Id == (int)SpmOperation.Column.Pos)
{
value = new DataValue((Items.Count + 1).ToString() + ".");
}
else
{
value = InstitutionMgr.GetOperationDataValue(column, values);
if (!value.IsValid())
value = new DataValue(column.FormatValue(values));
}
if (++columnIdx == 0)
item.Text = value.ToString();
else
item.SubItems.Add(new ListViewSubItemExtended(column, value));
}
// Add to list if required (otherwise item has already been updated in list.
if (addNewItem)
{
ListViewItem itemAdded = Items.Add(item);
}
// Check for selection:
if (!highlight && InitiallySelectedItemIds.Contains(itemId))
highlight = true;
if (highlight)
{
item.Selected = true;
item.Focused = true;
EnsureVisible(item.Index);
}
}
//-------------------------------------------------------------------
// C o n t r o l E v e n t s
//-------------------------------------------------------------------
protected override void OnResize(EventArgs e)
{
base.OnResize(e);
//Logger.Debug(GetType().Name + ".OnResize Size: " + Size.ToString());
}
//-------------------------------------------------------------------
}
//=======================================================================
}
@@ -0,0 +1,23 @@
namespace Sarand.PatientMgr.Win.Forms.Controls
{
partial class SpmItemListView_Patient
{
/// <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,302 @@
using Sarand.Core.Base;
using Sarand.Core.Bus;
using Sarand.Core.Dbas.Base;
using Sarand.PatientMgr.Core.Bus;
using Sarand.Win.Forms.Controls;
using Sarand.Win.Forms.Utils;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows.Forms;
namespace Sarand.PatientMgr.Win.Forms.Controls
{
//=======================================================================
public partial class SpmItemListView_Patient : SpmItemListView
{
//-------------------------------------------------------------------
// Configuration.
public enum ListMode
{
General,
}
public new class Config : SpmItemListView.Config
{
public ListMode Mode { get; set; } = ListMode.General;
}
//-------------------------------------------------------------------
// Data members.
private Config config = new Config();
private readonly List<ColumnDfn> columnsDisplay = new List<ColumnDfn>();
private readonly List<ColumnDfn> columnsQuery = new List<ColumnDfn>();
private Timer timerQueryData = null;
private Timer timerDisplayItem = null;
private ColumnDfn columnDfnId = null;
private DbResultSet dbResultSet = null;
private SpmPatient.Params prmPatient;
//-------------------------------------------------------------------
// Construction.
public SpmItemListView_Patient() : this(new Config()) { }
public SpmItemListView_Patient(Config config) : base(config)
{
this.config = config;
InitializeComponent();
/* ToDo Timers function need modifying.
timerQueryData = new Timer() { Interval = 250 };
timerQueryData.Tick += OnTimerQueryData;
timerDisplayItem = new Timer() { Interval = 5 };
timerDisplayItem.Tick += OnTimerDisplayItem;*/
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (components != null) components.Dispose();
timerQueryData.Dispose();
timerDisplayItem.Dispose();
ClearResultSet();
}
base.Dispose(disposing);
}
private void ClearResultSet()
{
if (dbResultSet != null)
dbResultSet.Dispose();
dbResultSet = null;
}
//-------------------------------------------------------------------
// Properties.
[Browsable(false)]
public List<ColumnDfn> DisplayColumns { get { return new List<ColumnDfn>(columnsDisplay); } }
[Browsable(false)]
public SysId SelectedPatientId { get { return SelectedItemId; } }
[Browsable(false)]
public SpmPatient SelectedPatient
{
get
{
if (SelectedItemCount == 1)
return InstitutionMgr.GetPatientById(SelectedPatientId);
return null;
}
}
//-------------------------------------------------------------------
// Configure.
public void SetConfig(Config config)
{
base.SetConfig(config);
this.config = config;
ConfigureList();
}
//-------------------------------------------------------------------
// Initialisation.
protected override void OnCreateControl()
{
base.OnCreateControl();
if (this.IsDesignerHosted()) return;
}
private void ConfigureList()
{
if (!this.Created) return;
InitPatientList(true);
}
//-------------------------------------------------------------------
private void InitPatientList(bool forceInit = false)
{
// Clear the existing list.
if (Columns.Count > 0 && !forceInit) return;
Clear();
columnsDisplay.Clear();
columnsQuery.Clear();
// Populate list of columns to be displayed.
columnsDisplay.Add(InstitutionMgr.GetPatientColumnDfn(SpmPatient.Column.InstitutionId));
columnsDisplay.Add(InstitutionMgr.GetPatientColumnDfn(SpmPatient.Column.PatientNo));
columnsDisplay.Add(InstitutionMgr.GetPatientColumnDfn(SpmPatient.Column.NhsNumber));
columnsDisplay.Add(InstitutionMgr.GetPatientColumnDfn(SpmPatient.Column.Title));
columnsDisplay.Add(InstitutionMgr.GetPatientColumnDfn(SpmPatient.Column.Forename));
#if DEBUG
columnsDisplay.Add(InstitutionMgr.GetPatientColumnDfn(SpmPatient.Column.Id));
#endif
// Populate columns to list view.
SetColumns(columnsDisplay);
// Default sort column.
SortColumnIdx = GetColumnIdxById((int)SpmPatient.Column.InstitutionId);
Refresh();
// Initialise list of columns to be queries - ensure Id column in list.
columnsQuery.Clear();
columnsQuery.AddRange(columnsDisplay);
if (!columnsQuery.HasId(columnDfnId.Id))
columnsQuery.Add(columnDfnId);
}
//-------------------------------------------------------------------
// P o p u l a t i o n
//-------------------------------------------------------------------
public bool IsValidFiter(SpmPatient.Params prmPatient)
{
if (prmPatient == null) return false;
return true;
}
public void RefreshPatients(SpmPatient.Params prmPatient)
{
// Clear timers.
/*timerQueryData.Enabled = false;
timerDisplayItem.Enabled = false;*/
// Item Ids in the 'Initial selection' list are automatically selected on population.
// Subsequent refreshes automatically select the current selection by repopulation of the 'Initial selection' list.
if (!InitialPopulation)
{
InitiallySelectedItemIds.Clear();
InitiallySelectedItemIds.AddRange(SelectedItemIds);
}
SelectedIndices.Clear();
// Clear previous results.
ItemTotal = 0;
Items.Clear();
// Prepare query.
ClearResultSet();
this.prmPatient = prmPatient;
// Enable timer.
}
void OnTimerQueryData(Object myObject, EventArgs myEventArgs)
{
//timerQueryData.Enabled = false;
QueryData();
}
private void QueryData()
{
ClearResultSet();
if (!IsValidFiter(prmPatient)) return;
// Query data.
ItemTotal = (int)InstitutionMgr.GetPatientCount(prmPatient);
if (ItemTotal > 0) Logger.Trace(GetType().Name + ".QueryData Patient count: " + ItemTotal);
dbResultSet = InstitutionMgr.ExecutePatientQuery(columnsQuery, prmPatient);
//timerDisplayItem.Enabled = true;
InitialPopulation = false;
}
public void RefreshPatient(SysId affiliateId)
{
// Parameters to query single item:
if (!SysId.IsValid(affiliateId)) return;
SpmPatient.Params prm = new SpmPatient.Params();
prm.IncludedIds.Add(affiliateId);
// Query data.
using (DbResultSet dbResultSet = InstitutionMgr.ExecutePatientQuery(columnsQuery, prm))
{
if (dbResultSet.NextRecord())
DisplayItem(dbResultSet.GetRecordValues(), true);
}
}
//-------------------------------------------------------------------
// D i s p l a y I t e m s
//-------------------------------------------------------------------
private void OnTimerDisplayItem(Object myObject, EventArgs myEventArgs)
{
//timerDisplayItem.Enabled = false;
DisplayNextItems();
}
private void DisplayNextItems()
{
if (dbResultSet == null) return;
for (int itemCount = 0; itemCount <= Math.Min(64, Math.Max(0, DisplayRecordsBatchSize)); itemCount++)
{
if (dbResultSet.NextRecord())
{
DisplayItem(dbResultSet.GetRecordValues());
//timerDisplayItem.Enabled = true;
}
else
{
ClearResultSet();
return;
}
}
}
private void DisplayItem(NamedValue.Map values, bool highlight = false)
{
// Item identity.
SysId itemId = new SysId(StringUtil.ToInt(values.GetValue(columnDfnId.DataName).ToString()));
String itemName = SysId.ToString(itemId);
bool addNewItem = false;
ListViewItem item = FindItemWithName(itemName);
if (item == null)
{
// New item to be added.
item = new ListViewItem();
item.Name = itemName;
addNewItem = true;
}
else
{
// Clear sub items for existing item.
item.SubItems.Clear();
item.Name = itemName;
}
// Populate list view item.
int columnIdx = -1;
foreach (var column in columnsDisplay)
{
DataValue value = new DataValue();
if (column.Id == (int)SpmPatient.Column.Pos)
{
value = new DataValue((Items.Count + 1).ToString() + ".");
}
else
{
value = InstitutionMgr.GetPatientDataValue(column, values);
if (!value.IsValid())
value = new DataValue(column.FormatValue(values));
}
if (++columnIdx == 0)
item.Text = value.ToString();
else
item.SubItems.Add(new ListViewSubItemExtended(column, value));
}
// Add to list if required (otherwise item has already been updated in list.
if (addNewItem)
{
ListViewItem itemAdded = Items.Add(item);
}
// Check for selection:
if (!highlight && InitiallySelectedItemIds.Contains(itemId))
highlight = true;
if (highlight)
{
item.Selected = true;
item.Focused = true;
EnsureVisible(item.Index);
}
}
//-------------------------------------------------------------------
// C o n t r o l E v e n t s
//-------------------------------------------------------------------
protected override void OnResize(EventArgs e)
{
base.OnResize(e);
//Logger.Debug(GetType().Name + ".OnResize Size: " + Size.ToString());
}
//-------------------------------------------------------------------
}
//=======================================================================
}
@@ -0,0 +1,23 @@
namespace Sarand.PatientMgr.Win.Forms.Controls
{
partial class SpmItemListView_Procedure
{
/// <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,302 @@
using Sarand.Core.Base;
using Sarand.Core.Bus;
using Sarand.Core.Dbas.Base;
using Sarand.PatientMgr.Core.Bus;
using Sarand.Win.Forms.Controls;
using Sarand.Win.Forms.Utils;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows.Forms;
namespace Sarand.PatientMgr.Win.Forms.Controls
{
//=======================================================================
public partial class SpmItemListView_Procedure : SpmItemListView
{
//-------------------------------------------------------------------
// Configuration.
public enum ListMode
{
General,
}
public new class Config : SpmItemListView.Config
{
public ListMode Mode { get; set; } = ListMode.General;
}
//-------------------------------------------------------------------
// Data members.
private Config config = new Config();
private readonly List<ColumnDfn> columnsDisplay = new List<ColumnDfn>();
private readonly List<ColumnDfn> columnsQuery = new List<ColumnDfn>();
private Timer timerQueryData = null;
private Timer timerDisplayItem = null;
private ColumnDfn columnDfnId = null;
private DbResultSet dbResultSet = null;
private SpmProcedure.Params prmProcedure;
//-------------------------------------------------------------------
// Construction.
public SpmItemListView_Procedure() : this(new Config()) { }
public SpmItemListView_Procedure(Config config) : base(config)
{
this.config = config;
InitializeComponent();
/* ToDo Timers function need modifying.
timerQueryData = new Timer() { Interval = 250 };
timerQueryData.Tick += OnTimerQueryData;
timerDisplayItem = new Timer() { Interval = 5 };
timerDisplayItem.Tick += OnTimerDisplayItem;*/
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (components != null) components.Dispose();
timerQueryData.Dispose();
timerDisplayItem.Dispose();
ClearResultSet();
}
base.Dispose(disposing);
}
private void ClearResultSet()
{
if (dbResultSet != null)
dbResultSet.Dispose();
dbResultSet = null;
}
//-------------------------------------------------------------------
// Properties.
[Browsable(false)]
public List<ColumnDfn> DisplayColumns { get { return new List<ColumnDfn>(columnsDisplay); } }
[Browsable(false)]
public SysId SelectedProcedureId { get { return SelectedItemId; } }
[Browsable(false)]
public SpmProcedure SelectedProcedure
{
get
{
if (SelectedItemCount == 1)
return DepartmentMgr.GetProcedureById(SelectedProcedureId);
return null;
}
}
//-------------------------------------------------------------------
// Configure.
public void SetConfig(Config config)
{
base.SetConfig(config);
this.config = config;
ConfigureList();
}
//-------------------------------------------------------------------
// Initialisation.
protected override void OnCreateControl()
{
base.OnCreateControl();
if (this.IsDesignerHosted()) return;
}
private void ConfigureList()
{
if (!this.Created) return;
InitProcedureList(true);
}
//-------------------------------------------------------------------
private void InitProcedureList(bool forceInit = false)
{
// Clear the existing list.
if (Columns.Count > 0 && !forceInit) return;
Clear();
columnsDisplay.Clear();
columnsQuery.Clear();
// Populate list of columns to be displayed.
columnsDisplay.Add(DepartmentMgr.GetProcedureColumnDfn(SpmProcedure.Column.DepartmentId));
columnsDisplay.Add(DepartmentMgr.GetProcedureColumnDfn(SpmProcedure.Column.OperationId));
columnsDisplay.Add(DepartmentMgr.GetProcedureColumnDfn(SpmProcedure.Column.Description));
columnsDisplay.Add(DepartmentMgr.GetProcedureColumnDfn(SpmProcedure.Column.SpecialityCode));
columnsDisplay.Add(DepartmentMgr.GetProcedureColumnDfn(SpmProcedure.Column.ComplexityCode));
#if DEBUG
columnsDisplay.Add(DepartmentMgr.GetProcedureColumnDfn(SpmProcedure.Column.Id));
#endif
// Populate columns to list view.
SetColumns(columnsDisplay);
// Default sort column.
SortColumnIdx = GetColumnIdxById((int)SpmProcedure.Column.DepartmentId);
Refresh();
// Initialise list of columns to be queries - ensure Id column in list.
columnsQuery.Clear();
columnsQuery.AddRange(columnsDisplay);
if (!columnsQuery.HasId(columnDfnId.Id))
columnsQuery.Add(columnDfnId);
}
//-------------------------------------------------------------------
// P o p u l a t i o n
//-------------------------------------------------------------------
public bool IsValidFiter(SpmProcedure.Params prmProcedure)
{
if (prmProcedure == null) return false;
return true;
}
public void RefreshProcedures(SpmProcedure.Params prmProcedure)
{
// Clear timers.
/*timerQueryData.Enabled = false;
timerDisplayItem.Enabled = false;*/
// Item Ids in the 'Initial selection' list are automatically selected on population.
// Subsequent refreshes automatically select the current selection by repopulation of the 'Initial selection' list.
if (!InitialPopulation)
{
InitiallySelectedItemIds.Clear();
InitiallySelectedItemIds.AddRange(SelectedItemIds);
}
SelectedIndices.Clear();
// Clear previous results.
ItemTotal = 0;
Items.Clear();
// Prepare query.
ClearResultSet();
this.prmProcedure = prmProcedure;
// Enable timer.
}
void OnTimerQueryData(Object myObject, EventArgs myEventArgs)
{
//timerQueryData.Enabled = false;
QueryData();
}
private void QueryData()
{
ClearResultSet();
if (!IsValidFiter(prmProcedure)) return;
// Query data.
ItemTotal = (int)DepartmentMgr.GetProcedureCount(prmProcedure);
if (ItemTotal > 0) Logger.Trace(GetType().Name + ".QueryData Procedure count: " + ItemTotal);
dbResultSet = DepartmentMgr.ExecuteProcedureQuery(columnsQuery, prmProcedure);
//timerDisplayItem.Enabled = true;
InitialPopulation = false;
}
public void RefreshProcedure(SysId affiliateId)
{
// Parameters to query single item:
if (!SysId.IsValid(affiliateId)) return;
SpmProcedure.Params prm = new SpmProcedure.Params();
prm.IncludedIds.Add(affiliateId);
// Query data.
using (DbResultSet dbResultSet = DepartmentMgr.ExecuteProcedureQuery(columnsQuery, prm))
{
if (dbResultSet.NextRecord())
DisplayItem(dbResultSet.GetRecordValues(), true);
}
}
//-------------------------------------------------------------------
// D i s p l a y I t e m s
//-------------------------------------------------------------------
private void OnTimerDisplayItem(Object myObject, EventArgs myEventArgs)
{
//timerDisplayItem.Enabled = false;
DisplayNextItems();
}
private void DisplayNextItems()
{
if (dbResultSet == null) return;
for (int itemCount = 0; itemCount <= Math.Min(64, Math.Max(0, DisplayRecordsBatchSize)); itemCount++)
{
if (dbResultSet.NextRecord())
{
DisplayItem(dbResultSet.GetRecordValues());
//timerDisplayItem.Enabled = true;
}
else
{
ClearResultSet();
return;
}
}
}
private void DisplayItem(NamedValue.Map values, bool highlight = false)
{
// Item identity.
SysId itemId = new SysId(StringUtil.ToInt(values.GetValue(columnDfnId.DataName).ToString()));
String itemName = SysId.ToString(itemId);
bool addNewItem = false;
ListViewItem item = FindItemWithName(itemName);
if (item == null)
{
// New item to be added.
item = new ListViewItem();
item.Name = itemName;
addNewItem = true;
}
else
{
// Clear sub items for existing item.
item.SubItems.Clear();
item.Name = itemName;
}
// Populate list view item.
int columnIdx = -1;
foreach (var column in columnsDisplay)
{
DataValue value = new DataValue();
if (column.Id == (int)SpmProcedure.Column.Pos)
{
value = new DataValue((Items.Count + 1).ToString() + ".");
}
else
{
value = DepartmentMgr.GetProcedureDataValue(column, values);
if (!value.IsValid())
value = new DataValue(column.FormatValue(values));
}
if (++columnIdx == 0)
item.Text = value.ToString();
else
item.SubItems.Add(new ListViewSubItemExtended(column, value));
}
// Add to list if required (otherwise item has already been updated in list.
if (addNewItem)
{
ListViewItem itemAdded = Items.Add(item);
}
// Check for selection:
if (!highlight && InitiallySelectedItemIds.Contains(itemId))
highlight = true;
if (highlight)
{
item.Selected = true;
item.Focused = true;
EnsureVisible(item.Index);
}
}
//-------------------------------------------------------------------
// C o n t r o l E v e n t s
//-------------------------------------------------------------------
protected override void OnResize(EventArgs e)
{
base.OnResize(e);
//Logger.Debug(GetType().Name + ".OnResize Size: " + Size.ToString());
}
//-------------------------------------------------------------------
}
//=======================================================================
}
@@ -0,0 +1,23 @@
namespace Sarand.PatientMgr.Win.Forms.Controls
{
partial class SpmItemListView_TemplateData
{
/// <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,298 @@
using Sarand.Core.Base;
using Sarand.Core.Bus;
using Sarand.Core.Dbas.Base;
using Sarand.PatientMgr.Core.Bus;
using Sarand.Win.Forms.Controls;
using Sarand.Win.Forms.Utils;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows.Forms;
namespace Sarand.PatientMgr.Win.Forms.Controls
{
//=======================================================================
public partial class SpmItemListView_TemplateData : SpmItemListView
{
//-------------------------------------------------------------------
// Configuration.
public enum ListMode
{
General,
}
public new class Config : SpmItemListView.Config
{
public ListMode Mode { get; set; } = ListMode.General;
}
//-------------------------------------------------------------------
// Data members.
private Config config = new Config();
private readonly List<ColumnDfn> columnsDisplay = new List<ColumnDfn>();
private readonly List<ColumnDfn> columnsQuery = new List<ColumnDfn>();
private Timer timerQueryData = null;
private Timer timerDisplayItem = null;
private ColumnDfn columnDfnId = null;
private DbResultSet dbResultSet = null;
private SpmTemplateData.Params prmTemplateData;
//-------------------------------------------------------------------
// Construction.
public SpmItemListView_TemplateData() : this(new Config()) { }
public SpmItemListView_TemplateData(Config config) : base(config)
{
this.config = config;
InitializeComponent();
/* ToDo Timers function need modifying.
timerQueryData = new Timer() { Interval = 250 };
timerQueryData.Tick += OnTimerQueryData;
timerDisplayItem = new Timer() { Interval = 5 };
timerDisplayItem.Tick += OnTimerDisplayItem;*/
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (components != null) components.Dispose();
timerQueryData.Dispose();
timerDisplayItem.Dispose();
ClearResultSet();
}
base.Dispose(disposing);
}
private void ClearResultSet()
{
if (dbResultSet != null)
dbResultSet.Dispose();
dbResultSet = null;
}
//-------------------------------------------------------------------
// Properties.
[Browsable(false)]
public List<ColumnDfn> DisplayColumns { get { return new List<ColumnDfn>(columnsDisplay); } }
[Browsable(false)]
public SysId SelectedTemplateDataId { get { return SelectedItemId; } }
[Browsable(false)]
public SpmTemplateData SelectedTemplateData
{
get
{
if (SelectedItemCount == 1)
return DepartmentMgr.GetTemplateDataById(SelectedTemplateDataId);
return null;
}
}
//-------------------------------------------------------------------
// Configure.
public void SetConfig(Config config)
{
base.SetConfig(config);
this.config = config;
ConfigureList();
}
//-------------------------------------------------------------------
// Initialisation.
protected override void OnCreateControl()
{
base.OnCreateControl();
if (this.IsDesignerHosted()) return;
}
private void ConfigureList()
{
if (!this.Created) return;
InitTemplateDataList(true);
}
//-------------------------------------------------------------------
private void InitTemplateDataList(bool forceInit = false)
{
// Clear the existing list.
if (Columns.Count > 0 && !forceInit) return;
Clear();
columnsDisplay.Clear();
columnsQuery.Clear();
// Populate list of columns to be displayed.
//columnsDisplay.Add(DepartmentMgr.GetTemplateDataColumnDfn(SpmTemplateData.Column.Name));
/*#if DEBUG
columnsDisplay.Add(DepartmentMgr.GetTemplateDataColumnDfn(SpmTemplateData.Column.Id));
#endif*/
// Populate columns to list view.
SetColumns(columnsDisplay);
// Default sort column.
//SortColumnIdx = GetColumnIdxById((int)SpmTemplateData.Column.Name);
Refresh();
// Initialise list of columns to be queries - ensure Id column in list.
columnsQuery.Clear();
columnsQuery.AddRange(columnsDisplay);
if (!columnsQuery.HasId(columnDfnId.Id))
columnsQuery.Add(columnDfnId);
}
//-------------------------------------------------------------------
// P o p u l a t i o n
//-------------------------------------------------------------------
public bool IsValidFiter(SpmTemplateData.Params prmTemplateData)
{
if (prmTemplateData == null) return false;
return true;
}
public void RefreshTemplateDatas(SpmTemplateData.Params prmTemplateData)
{
// Clear timers.
/*timerQueryData.Enabled = false;
timerDisplayItem.Enabled = false;*/
// Item Ids in the 'Initial selection' list are automatically selected on population.
// Subsequent refreshes automatically select the current selection by repopulation of the 'Initial selection' list.
if (!InitialPopulation)
{
InitiallySelectedItemIds.Clear();
InitiallySelectedItemIds.AddRange(SelectedItemIds);
}
SelectedIndices.Clear();
// Clear previous results.
ItemTotal = 0;
Items.Clear();
// Prepare query.
ClearResultSet();
this.prmTemplateData = prmTemplateData;
// Enable timer.
}
void OnTimerQueryData(Object myObject, EventArgs myEventArgs)
{
//timerQueryData.Enabled = false;
QueryData();
}
private void QueryData()
{
ClearResultSet();
if (!IsValidFiter(prmTemplateData)) return;
// Query data.
ItemTotal = (int)DepartmentMgr.GetTemplateDataCount(prmTemplateData);
if (ItemTotal > 0) Logger.Trace(GetType().Name + ".QueryData TemplateData count: " + ItemTotal);
dbResultSet = DepartmentMgr.ExecuteTemplateDataQuery(columnsQuery, prmTemplateData);
//timerDisplayItem.Enabled = true;
InitialPopulation = false;
}
public void RefreshTemplateData(SysId affiliateId)
{
// Parameters to query single item:
if (!SysId.IsValid(affiliateId)) return;
SpmTemplateData.Params prm = new SpmTemplateData.Params();
prm.IncludedIds.Add(affiliateId);
// Query data.
using (DbResultSet dbResultSet = DepartmentMgr.ExecuteTemplateDataQuery(columnsQuery, prm))
{
if (dbResultSet.NextRecord())
DisplayItem(dbResultSet.GetRecordValues(), true);
}
}
//-------------------------------------------------------------------
// D i s p l a y I t e m s
//-------------------------------------------------------------------
private void OnTimerDisplayItem(Object myObject, EventArgs myEventArgs)
{
//timerDisplayItem.Enabled = false;
DisplayNextItems();
}
private void DisplayNextItems()
{
if (dbResultSet == null) return;
for (int itemCount = 0; itemCount <= Math.Min(64, Math.Max(0, DisplayRecordsBatchSize)); itemCount++)
{
if (dbResultSet.NextRecord())
{
DisplayItem(dbResultSet.GetRecordValues());
//timerDisplayItem.Enabled = true;
}
else
{
ClearResultSet();
return;
}
}
}
private void DisplayItem(NamedValue.Map values, bool highlight = false)
{
// Item identity.
SysId itemId = new SysId(StringUtil.ToInt(values.GetValue(columnDfnId.DataName).ToString()));
String itemName = SysId.ToString(itemId);
bool addNewItem = false;
ListViewItem item = FindItemWithName(itemName);
if (item == null)
{
// New item to be added.
item = new ListViewItem();
item.Name = itemName;
addNewItem = true;
}
else
{
// Clear sub items for existing item.
item.SubItems.Clear();
item.Name = itemName;
}
// Populate list view item.
int columnIdx = -1;
foreach (var column in columnsDisplay)
{
DataValue value = new DataValue();
if (column.Id == (int)SpmTemplateData.Column.Pos)
{
value = new DataValue((Items.Count + 1).ToString() + ".");
}
else
{
value = DepartmentMgr.GetTemplateDataDataValue(column, values);
if (!value.IsValid())
value = new DataValue(column.FormatValue(values));
}
if (++columnIdx == 0)
item.Text = value.ToString();
else
item.SubItems.Add(new ListViewSubItemExtended(column, value));
}
// Add to list if required (otherwise item has already been updated in list.
if (addNewItem)
{
ListViewItem itemAdded = Items.Add(item);
}
// Check for selection:
if (!highlight && InitiallySelectedItemIds.Contains(itemId))
highlight = true;
if (highlight)
{
item.Selected = true;
item.Focused = true;
EnsureVisible(item.Index);
}
}
//-------------------------------------------------------------------
// C o n t r o l E v e n t s
//-------------------------------------------------------------------
protected override void OnResize(EventArgs e)
{
base.OnResize(e);
//Logger.Debug(GetType().Name + ".OnResize Size: " + Size.ToString());
}
//-------------------------------------------------------------------
}
//=======================================================================
}
@@ -0,0 +1,25 @@
namespace Sarand.PatientMgr.Win.Forms.Filters
{
partial class SpmItemListFilter
{
/// <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();
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
}
#endregion
}
}
@@ -0,0 +1,63 @@
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.PatientMgr.Win.Forms.Base;
namespace Sarand.PatientMgr.Win.Forms.Filters
{
//=======================================================================
public partial class SpmItemListFilter : SpmPanel
{
//-------------------------------------------------------------------
// Configuration.
public new class Config : SpmPanel.Config
{
}
//-------------------------------------------------------------------
// Data members.
private Config config = new Config();
//-------------------------------------------------------------------
// Construction.
public SpmItemListFilter() : this(new Config()) { }
public SpmItemListFilter(Config config) : base(config)
{
this.config = config;
InitializeComponent();
DoubleBuffered = true;
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (components != null) components.Dispose();
}
base.Dispose(disposing);
}
//-------------------------------------------------------------------
// Filter Events.
public event EventHandler FilterChanged;
protected void InvokeFilterChangedEvent(EventArgs e)
{
FilterChanged?.Invoke(this, e);
}
//-------------------------------------------------------------------
// Panel Drawing.
protected override void OnPaintBackground(PaintEventArgs e)
{
base.OnPaintBackground(e);
}
//-------------------------------------------------------------------
}
//=======================================================================
}
@@ -0,0 +1,60 @@
namespace Sarand.PatientMgr.Win.Forms.Filters
{
partial class SpmItemListFilter_Admission
{
/// <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.panelAttrFilter = new Sarand.Win.Forms.Controls.SacsPanelAttrFilter();
this.buttonClear = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// panelAttrFilter
//
this.panelAttrFilter.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panelAttrFilter.Location = new System.Drawing.Point(5, 4);
this.panelAttrFilter.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.panelAttrFilter.Name = "panelAttrFilter";
this.panelAttrFilter.Size = new System.Drawing.Size(273, 30);
this.panelAttrFilter.TabIndex = 0;
//
// buttonClear
//
this.buttonClear.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.buttonClear.Location = new System.Drawing.Point(289, 4);
this.buttonClear.Margin = new System.Windows.Forms.Padding(4);
this.buttonClear.Name = "buttonClear";
this.buttonClear.Size = new System.Drawing.Size(100, 28);
this.buttonClear.TabIndex = 1;
this.buttonClear.Text = "Clear";
this.buttonClear.UseVisualStyleBackColor = true;
//
// SpmItemListFilter_Admission
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.buttonClear);
this.Controls.Add(this.panelAttrFilter);
this.Name = "SpmItemListFilter_Admission";
this.Size = new System.Drawing.Size(393, 37);
this.ResumeLayout(false);
}
#endregion
private Sarand.Win.Forms.Controls.SacsPanelAttrFilter panelAttrFilter;
private System.Windows.Forms.Button buttonClear;
}
}
@@ -0,0 +1,127 @@
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.PatientMgr.Win.Forms.Base;
using Sarand.Win.Forms.Utils;
using Sarand.Win.Forms.Controls;
using Sarand.Core.Base;
namespace Sarand.PatientMgr.Win.Forms.Filters
{
//=======================================================================
public partial class SpmItemListFilter_Admission : SpmItemListFilter
{
//-------------------------------------------------------------------
// Filter attribute types.
public enum AttrType
{
Notes,
}
//-------------------------------------------------------------------
// Configuration.
public new class Config : SpmItemListFilter.Config
{
}
//-------------------------------------------------------------------
// Data members.
private Config config = new Config();
//-------------------------------------------------------------------
// Construction.
public SpmItemListFilter_Admission() : this(new Config()) { }
public SpmItemListFilter_Admission(Config config) : base(config)
{
this.config = config;
InitializeComponent();
}
// Dispose.
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (components != null) components.Dispose();
}
base.Dispose(disposing);
}
//-------------------------------------------------------------------
// Properties.
// Filter values.
[Browsable(false)]
public String GetAttrTypeValue(AttrType attrType)
{
return panelAttrFilter.GetAttrValue((int)attrType);
}
//-------------------------------------------------------------------
// Configure.
public void SetConfig(Config config)
{
base.SetConfig(config);
this.config = config;
ConfigureFilter();
}
private void ConfigureFilter()
{
if (!this.Created) return;
ConfigureAttrTypeFilter();
}
//-------------------------------------------------------------------
// I n i t i a l i s a t i o n
//-------------------------------------------------------------------
protected override void OnCreateControl()
{
base.OnCreateControl();
if (this.IsDesignerHosted()) return;
// Filter attribute types.
panelAttrFilter.BorderStyle = BorderStyle.None;
ConfigureAttrTypeFilter();
SetControlActivity();
}
//-------------------------------------------------------------------
// F i l t e r A t t r i b u t e s
//-------------------------------------------------------------------
private void ConfigureAttrTypeFilter()
{
SacsPanelAttrFilter.Config filterConfig = new SacsPanelAttrFilter.Config() { AttrTypeControlWidth = 90, AttrValueControlWidth = 100 };
filterConfig.AttrTypes.Add(AttrType.Notes, "Notes", SacsPanelAttrFilter.ControlType.TextBox);
panelAttrFilter.SetFilterConfig(filterConfig);
}
public List<CodeDesc> GetAttrTypeValues(int type)
{
return GetAttrTypeValues(type);
}
//-------------------------------------------------------------------
// C o n t r o l A c t i v i t y
//-------------------------------------------------------------------
protected override void SetControlActivity()
{
SetControlsReadOnly();
panelAttrFilter.Enabled = Enabled;
}
protected override void SetControlsReadOnly()
{
}
//-------------------------------------------------------------------
// F i l t e r 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,60 @@
namespace Sarand.PatientMgr.Win.Forms.Filters
{
partial class SpmItemListFilter_AdmissionAction
{
/// <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.panelAttrFilter = new Sarand.Win.Forms.Controls.SacsPanelAttrFilter();
this.buttonClear = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// panelAttrFilter
//
this.panelAttrFilter.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panelAttrFilter.Location = new System.Drawing.Point(5, 4);
this.panelAttrFilter.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.panelAttrFilter.Name = "panelAttrFilter";
this.panelAttrFilter.Size = new System.Drawing.Size(273, 30);
this.panelAttrFilter.TabIndex = 0;
//
// buttonClear
//
this.buttonClear.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.buttonClear.Location = new System.Drawing.Point(289, 4);
this.buttonClear.Margin = new System.Windows.Forms.Padding(4);
this.buttonClear.Name = "buttonClear";
this.buttonClear.Size = new System.Drawing.Size(100, 28);
this.buttonClear.TabIndex = 1;
this.buttonClear.Text = "Clear";
this.buttonClear.UseVisualStyleBackColor = true;
//
// SpmItemListFilter_AdmissionAction
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.buttonClear);
this.Controls.Add(this.panelAttrFilter);
this.Name = "SpmItemListFilter_AdmissionAction";
this.Size = new System.Drawing.Size(393, 37);
this.ResumeLayout(false);
}
#endregion
private Sarand.Win.Forms.Controls.SacsPanelAttrFilter panelAttrFilter;
private System.Windows.Forms.Button buttonClear;
}
}
@@ -0,0 +1,127 @@
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.PatientMgr.Win.Forms.Base;
using Sarand.Win.Forms.Utils;
using Sarand.Win.Forms.Controls;
using Sarand.Core.Base;
namespace Sarand.PatientMgr.Win.Forms.Filters
{
//=======================================================================
public partial class SpmItemListFilter_AdmissionAction : SpmItemListFilter
{
//-------------------------------------------------------------------
// Filter attribute types.
public enum AttrType
{
Notes,
}
//-------------------------------------------------------------------
// Configuration.
public new class Config : SpmItemListFilter.Config
{
}
//-------------------------------------------------------------------
// Data members.
private Config config = new Config();
//-------------------------------------------------------------------
// Construction.
public SpmItemListFilter_AdmissionAction() : this(new Config()) { }
public SpmItemListFilter_AdmissionAction(Config config) : base(config)
{
this.config = config;
InitializeComponent();
}
// Dispose.
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (components != null) components.Dispose();
}
base.Dispose(disposing);
}
//-------------------------------------------------------------------
// Properties.
// Filter values.
[Browsable(false)]
public String GetAttrTypeValue(AttrType attrType)
{
return panelAttrFilter.GetAttrValue((int)attrType);
}
//-------------------------------------------------------------------
// Configure.
public void SetConfig(Config config)
{
base.SetConfig(config);
this.config = config;
ConfigureFilter();
}
private void ConfigureFilter()
{
if (!this.Created) return;
ConfigureAttrTypeFilter();
}
//-------------------------------------------------------------------
// I n i t i a l i s a t i o n
//-------------------------------------------------------------------
protected override void OnCreateControl()
{
base.OnCreateControl();
if (this.IsDesignerHosted()) return;
// Filter attribute types.
panelAttrFilter.BorderStyle = BorderStyle.None;
ConfigureAttrTypeFilter();
SetControlActivity();
}
//-------------------------------------------------------------------
// F i l t e r A t t r i b u t e s
//-------------------------------------------------------------------
private void ConfigureAttrTypeFilter()
{
SacsPanelAttrFilter.Config filterConfig = new SacsPanelAttrFilter.Config() { AttrTypeControlWidth = 90, AttrValueControlWidth = 100 };
filterConfig.AttrTypes.Add(AttrType.Notes, "Notes", SacsPanelAttrFilter.ControlType.TextBox);
panelAttrFilter.SetFilterConfig(filterConfig);
}
public List<CodeDesc> GetAttrTypeValues(int type)
{
return GetAttrTypeValues(type);
}
//-------------------------------------------------------------------
// C o n t r o l A c t i v i t y
//-------------------------------------------------------------------
protected override void SetControlActivity()
{
SetControlsReadOnly();
panelAttrFilter.Enabled = Enabled;
}
protected override void SetControlsReadOnly()
{
}
//-------------------------------------------------------------------
// F i l t e r 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,60 @@
namespace Sarand.PatientMgr.Win.Forms.Filters
{
partial class SpmItemListFilter_AdmissionData
{
/// <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.panelAttrFilter = new Sarand.Win.Forms.Controls.SacsPanelAttrFilter();
this.buttonClear = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// panelAttrFilter
//
this.panelAttrFilter.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panelAttrFilter.Location = new System.Drawing.Point(5, 4);
this.panelAttrFilter.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.panelAttrFilter.Name = "panelAttrFilter";
this.panelAttrFilter.Size = new System.Drawing.Size(273, 30);
this.panelAttrFilter.TabIndex = 0;
//
// buttonClear
//
this.buttonClear.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.buttonClear.Location = new System.Drawing.Point(289, 4);
this.buttonClear.Margin = new System.Windows.Forms.Padding(4);
this.buttonClear.Name = "buttonClear";
this.buttonClear.Size = new System.Drawing.Size(100, 28);
this.buttonClear.TabIndex = 1;
this.buttonClear.Text = "Clear";
this.buttonClear.UseVisualStyleBackColor = true;
//
// SpmItemListFilter_AdmissionData
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.buttonClear);
this.Controls.Add(this.panelAttrFilter);
this.Name = "SpmItemListFilter_AdmissionData";
this.Size = new System.Drawing.Size(393, 37);
this.ResumeLayout(false);
}
#endregion
private Sarand.Win.Forms.Controls.SacsPanelAttrFilter panelAttrFilter;
private System.Windows.Forms.Button buttonClear;
}
}
@@ -0,0 +1,127 @@
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.PatientMgr.Win.Forms.Base;
using Sarand.Win.Forms.Utils;
using Sarand.Win.Forms.Controls;
using Sarand.Core.Base;
namespace Sarand.PatientMgr.Win.Forms.Filters
{
//=======================================================================
public partial class SpmItemListFilter_AdmissionData : SpmItemListFilter
{
//-------------------------------------------------------------------
// Filter attribute types.
public enum AttrType
{
Notes,
}
//-------------------------------------------------------------------
// Configuration.
public new class Config : SpmItemListFilter.Config
{
}
//-------------------------------------------------------------------
// Data members.
private Config config = new Config();
//-------------------------------------------------------------------
// Construction.
public SpmItemListFilter_AdmissionData() : this(new Config()) { }
public SpmItemListFilter_AdmissionData(Config config) : base(config)
{
this.config = config;
InitializeComponent();
}
// Dispose.
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (components != null) components.Dispose();
}
base.Dispose(disposing);
}
//-------------------------------------------------------------------
// Properties.
// Filter values.
[Browsable(false)]
public String GetAttrTypeValue(AttrType attrType)
{
return panelAttrFilter.GetAttrValue((int)attrType);
}
//-------------------------------------------------------------------
// Configure.
public void SetConfig(Config config)
{
base.SetConfig(config);
this.config = config;
ConfigureFilter();
}
private void ConfigureFilter()
{
if (!this.Created) return;
ConfigureAttrTypeFilter();
}
//-------------------------------------------------------------------
// I n i t i a l i s a t i o n
//-------------------------------------------------------------------
protected override void OnCreateControl()
{
base.OnCreateControl();
if (this.IsDesignerHosted()) return;
// Filter attribute types.
panelAttrFilter.BorderStyle = BorderStyle.None;
ConfigureAttrTypeFilter();
SetControlActivity();
}
//-------------------------------------------------------------------
// F i l t e r A t t r i b u t e s
//-------------------------------------------------------------------
private void ConfigureAttrTypeFilter()
{
SacsPanelAttrFilter.Config filterConfig = new SacsPanelAttrFilter.Config() { AttrTypeControlWidth = 90, AttrValueControlWidth = 100 };
filterConfig.AttrTypes.Add(AttrType.Notes, "Notes", SacsPanelAttrFilter.ControlType.TextBox);
panelAttrFilter.SetFilterConfig(filterConfig);
}
public List<CodeDesc> GetAttrTypeValues(int type)
{
return GetAttrTypeValues(type);
}
//-------------------------------------------------------------------
// C o n t r o l A c t i v i t y
//-------------------------------------------------------------------
protected override void SetControlActivity()
{
SetControlsReadOnly();
panelAttrFilter.Enabled = Enabled;
}
protected override void SetControlsReadOnly()
{
}
//-------------------------------------------------------------------
// F i l t e r 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,60 @@
namespace Sarand.PatientMgr.Win.Forms.Filters
{
partial class SpmItemListFilter_AdmissionRole
{
/// <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.panelAttrFilter = new Sarand.Win.Forms.Controls.SacsPanelAttrFilter();
this.buttonClear = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// panelAttrFilter
//
this.panelAttrFilter.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panelAttrFilter.Location = new System.Drawing.Point(5, 4);
this.panelAttrFilter.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.panelAttrFilter.Name = "panelAttrFilter";
this.panelAttrFilter.Size = new System.Drawing.Size(273, 30);
this.panelAttrFilter.TabIndex = 0;
//
// buttonClear
//
this.buttonClear.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.buttonClear.Location = new System.Drawing.Point(289, 4);
this.buttonClear.Margin = new System.Windows.Forms.Padding(4);
this.buttonClear.Name = "buttonClear";
this.buttonClear.Size = new System.Drawing.Size(100, 28);
this.buttonClear.TabIndex = 1;
this.buttonClear.Text = "Clear";
this.buttonClear.UseVisualStyleBackColor = true;
//
// SpmItemListFilter_AdmissionRole
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.buttonClear);
this.Controls.Add(this.panelAttrFilter);
this.Name = "SpmItemListFilter_AdmissionRole";
this.Size = new System.Drawing.Size(393, 37);
this.ResumeLayout(false);
}
#endregion
private Sarand.Win.Forms.Controls.SacsPanelAttrFilter panelAttrFilter;
private System.Windows.Forms.Button buttonClear;
}
}
@@ -0,0 +1,127 @@
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.PatientMgr.Win.Forms.Base;
using Sarand.Win.Forms.Utils;
using Sarand.Win.Forms.Controls;
using Sarand.Core.Base;
namespace Sarand.PatientMgr.Win.Forms.Filters
{
//=======================================================================
public partial class SpmItemListFilter_AdmissionRole : SpmItemListFilter
{
//-------------------------------------------------------------------
// Filter attribute types.
public enum AttrType
{
Notes,
}
//-------------------------------------------------------------------
// Configuration.
public new class Config : SpmItemListFilter.Config
{
}
//-------------------------------------------------------------------
// Data members.
private Config config = new Config();
//-------------------------------------------------------------------
// Construction.
public SpmItemListFilter_AdmissionRole() : this(new Config()) { }
public SpmItemListFilter_AdmissionRole(Config config) : base(config)
{
this.config = config;
InitializeComponent();
}
// Dispose.
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (components != null) components.Dispose();
}
base.Dispose(disposing);
}
//-------------------------------------------------------------------
// Properties.
// Filter values.
[Browsable(false)]
public String GetAttrTypeValue(AttrType attrType)
{
return panelAttrFilter.GetAttrValue((int)attrType);
}
//-------------------------------------------------------------------
// Configure.
public void SetConfig(Config config)
{
base.SetConfig(config);
this.config = config;
ConfigureFilter();
}
private void ConfigureFilter()
{
if (!this.Created) return;
ConfigureAttrTypeFilter();
}
//-------------------------------------------------------------------
// I n i t i a l i s a t i o n
//-------------------------------------------------------------------
protected override void OnCreateControl()
{
base.OnCreateControl();
if (this.IsDesignerHosted()) return;
// Filter attribute types.
panelAttrFilter.BorderStyle = BorderStyle.None;
ConfigureAttrTypeFilter();
SetControlActivity();
}
//-------------------------------------------------------------------
// F i l t e r A t t r i b u t e s
//-------------------------------------------------------------------
private void ConfigureAttrTypeFilter()
{
SacsPanelAttrFilter.Config filterConfig = new SacsPanelAttrFilter.Config() { AttrTypeControlWidth = 90, AttrValueControlWidth = 100 };
filterConfig.AttrTypes.Add(AttrType.Notes, "Notes", SacsPanelAttrFilter.ControlType.TextBox);
panelAttrFilter.SetFilterConfig(filterConfig);
}
public List<CodeDesc> GetAttrTypeValues(int type)
{
return GetAttrTypeValues(type);
}
//-------------------------------------------------------------------
// C o n t r o l A c t i v i t y
//-------------------------------------------------------------------
protected override void SetControlActivity()
{
SetControlsReadOnly();
panelAttrFilter.Enabled = Enabled;
}
protected override void SetControlsReadOnly()
{
}
//-------------------------------------------------------------------
// F i l t e r 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,60 @@
namespace Sarand.PatientMgr.Win.Forms.Filters
{
partial class SpmItemListFilter_Department
{
/// <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.panelAttrFilter = new Sarand.Win.Forms.Controls.SacsPanelAttrFilter();
this.buttonClear = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// panelAttrFilter
//
this.panelAttrFilter.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panelAttrFilter.Location = new System.Drawing.Point(5, 4);
this.panelAttrFilter.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.panelAttrFilter.Name = "panelAttrFilter";
this.panelAttrFilter.Size = new System.Drawing.Size(273, 30);
this.panelAttrFilter.TabIndex = 0;
//
// buttonClear
//
this.buttonClear.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.buttonClear.Location = new System.Drawing.Point(289, 4);
this.buttonClear.Margin = new System.Windows.Forms.Padding(4);
this.buttonClear.Name = "buttonClear";
this.buttonClear.Size = new System.Drawing.Size(100, 28);
this.buttonClear.TabIndex = 1;
this.buttonClear.Text = "Clear";
this.buttonClear.UseVisualStyleBackColor = true;
//
// SpmItemListFilter_Department
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.buttonClear);
this.Controls.Add(this.panelAttrFilter);
this.Name = "SpmItemListFilter_Department";
this.Size = new System.Drawing.Size(393, 37);
this.ResumeLayout(false);
}
#endregion
private Sarand.Win.Forms.Controls.SacsPanelAttrFilter panelAttrFilter;
private System.Windows.Forms.Button buttonClear;
}
}
@@ -0,0 +1,127 @@
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.PatientMgr.Win.Forms.Base;
using Sarand.Win.Forms.Utils;
using Sarand.Win.Forms.Controls;
using Sarand.Core.Base;
namespace Sarand.PatientMgr.Win.Forms.Filters
{
//=======================================================================
public partial class SpmItemListFilter_Department : SpmItemListFilter
{
//-------------------------------------------------------------------
// Filter attribute types.
public enum AttrType
{
Notes,
}
//-------------------------------------------------------------------
// Configuration.
public new class Config : SpmItemListFilter.Config
{
}
//-------------------------------------------------------------------
// Data members.
private Config config = new Config();
//-------------------------------------------------------------------
// Construction.
public SpmItemListFilter_Department() : this(new Config()) { }
public SpmItemListFilter_Department(Config config) : base(config)
{
this.config = config;
InitializeComponent();
}
// Dispose.
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (components != null) components.Dispose();
}
base.Dispose(disposing);
}
//-------------------------------------------------------------------
// Properties.
// Filter values.
[Browsable(false)]
public String GetAttrTypeValue(AttrType attrType)
{
return panelAttrFilter.GetAttrValue((int)attrType);
}
//-------------------------------------------------------------------
// Configure.
public void SetConfig(Config config)
{
base.SetConfig(config);
this.config = config;
ConfigureFilter();
}
private void ConfigureFilter()
{
if (!this.Created) return;
ConfigureAttrTypeFilter();
}
//-------------------------------------------------------------------
// I n i t i a l i s a t i o n
//-------------------------------------------------------------------
protected override void OnCreateControl()
{
base.OnCreateControl();
if (this.IsDesignerHosted()) return;
// Filter attribute types.
panelAttrFilter.BorderStyle = BorderStyle.None;
ConfigureAttrTypeFilter();
SetControlActivity();
}
//-------------------------------------------------------------------
// F i l t e r A t t r i b u t e s
//-------------------------------------------------------------------
private void ConfigureAttrTypeFilter()
{
SacsPanelAttrFilter.Config filterConfig = new SacsPanelAttrFilter.Config() { AttrTypeControlWidth = 90, AttrValueControlWidth = 100 };
filterConfig.AttrTypes.Add(AttrType.Notes, "Notes", SacsPanelAttrFilter.ControlType.TextBox);
panelAttrFilter.SetFilterConfig(filterConfig);
}
public List<CodeDesc> GetAttrTypeValues(int type)
{
return GetAttrTypeValues(type);
}
//-------------------------------------------------------------------
// C o n t r o l A c t i v i t y
//-------------------------------------------------------------------
protected override void SetControlActivity()
{
SetControlsReadOnly();
panelAttrFilter.Enabled = Enabled;
}
protected override void SetControlsReadOnly()
{
}
//-------------------------------------------------------------------
// F i l t e r 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,60 @@
namespace Sarand.PatientMgr.Win.Forms.Filters
{
partial class SpmItemListFilter_Employee
{
/// <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.panelAttrFilter = new Sarand.Win.Forms.Controls.SacsPanelAttrFilter();
this.buttonClear = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// panelAttrFilter
//
this.panelAttrFilter.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panelAttrFilter.Location = new System.Drawing.Point(5, 4);
this.panelAttrFilter.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.panelAttrFilter.Name = "panelAttrFilter";
this.panelAttrFilter.Size = new System.Drawing.Size(273, 30);
this.panelAttrFilter.TabIndex = 0;
//
// buttonClear
//
this.buttonClear.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.buttonClear.Location = new System.Drawing.Point(289, 4);
this.buttonClear.Margin = new System.Windows.Forms.Padding(4);
this.buttonClear.Name = "buttonClear";
this.buttonClear.Size = new System.Drawing.Size(100, 28);
this.buttonClear.TabIndex = 1;
this.buttonClear.Text = "Clear";
this.buttonClear.UseVisualStyleBackColor = true;
//
// SpmItemListFilter_Employee
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.buttonClear);
this.Controls.Add(this.panelAttrFilter);
this.Name = "SpmItemListFilter_Employee";
this.Size = new System.Drawing.Size(393, 37);
this.ResumeLayout(false);
}
#endregion
private Sarand.Win.Forms.Controls.SacsPanelAttrFilter panelAttrFilter;
private System.Windows.Forms.Button buttonClear;
}
}
@@ -0,0 +1,127 @@
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.PatientMgr.Win.Forms.Base;
using Sarand.Win.Forms.Utils;
using Sarand.Win.Forms.Controls;
using Sarand.Core.Base;
namespace Sarand.PatientMgr.Win.Forms.Filters
{
//=======================================================================
public partial class SpmItemListFilter_Employee : SpmItemListFilter
{
//-------------------------------------------------------------------
// Filter attribute types.
public enum AttrType
{
Notes,
}
//-------------------------------------------------------------------
// Configuration.
public new class Config : SpmItemListFilter.Config
{
}
//-------------------------------------------------------------------
// Data members.
private Config config = new Config();
//-------------------------------------------------------------------
// Construction.
public SpmItemListFilter_Employee() : this(new Config()) { }
public SpmItemListFilter_Employee(Config config) : base(config)
{
this.config = config;
InitializeComponent();
}
// Dispose.
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (components != null) components.Dispose();
}
base.Dispose(disposing);
}
//-------------------------------------------------------------------
// Properties.
// Filter values.
[Browsable(false)]
public String GetAttrTypeValue(AttrType attrType)
{
return panelAttrFilter.GetAttrValue((int)attrType);
}
//-------------------------------------------------------------------
// Configure.
public void SetConfig(Config config)
{
base.SetConfig(config);
this.config = config;
ConfigureFilter();
}
private void ConfigureFilter()
{
if (!this.Created) return;
ConfigureAttrTypeFilter();
}
//-------------------------------------------------------------------
// I n i t i a l i s a t i o n
//-------------------------------------------------------------------
protected override void OnCreateControl()
{
base.OnCreateControl();
if (this.IsDesignerHosted()) return;
// Filter attribute types.
panelAttrFilter.BorderStyle = BorderStyle.None;
ConfigureAttrTypeFilter();
SetControlActivity();
}
//-------------------------------------------------------------------
// F i l t e r A t t r i b u t e s
//-------------------------------------------------------------------
private void ConfigureAttrTypeFilter()
{
SacsPanelAttrFilter.Config filterConfig = new SacsPanelAttrFilter.Config() { AttrTypeControlWidth = 90, AttrValueControlWidth = 100 };
filterConfig.AttrTypes.Add(AttrType.Notes, "Notes", SacsPanelAttrFilter.ControlType.TextBox);
panelAttrFilter.SetFilterConfig(filterConfig);
}
public List<CodeDesc> GetAttrTypeValues(int type)
{
return GetAttrTypeValues(type);
}
//-------------------------------------------------------------------
// C o n t r o l A c t i v i t y
//-------------------------------------------------------------------
protected override void SetControlActivity()
{
SetControlsReadOnly();
panelAttrFilter.Enabled = Enabled;
}
protected override void SetControlsReadOnly()
{
}
//-------------------------------------------------------------------
// F i l t e r 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,60 @@
namespace Sarand.PatientMgr.Win.Forms.Filters
{
partial class SpmItemListFilter_EmployeeRole
{
/// <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.panelAttrFilter = new Sarand.Win.Forms.Controls.SacsPanelAttrFilter();
this.buttonClear = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// panelAttrFilter
//
this.panelAttrFilter.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panelAttrFilter.Location = new System.Drawing.Point(5, 4);
this.panelAttrFilter.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.panelAttrFilter.Name = "panelAttrFilter";
this.panelAttrFilter.Size = new System.Drawing.Size(273, 30);
this.panelAttrFilter.TabIndex = 0;
//
// buttonClear
//
this.buttonClear.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.buttonClear.Location = new System.Drawing.Point(289, 4);
this.buttonClear.Margin = new System.Windows.Forms.Padding(4);
this.buttonClear.Name = "buttonClear";
this.buttonClear.Size = new System.Drawing.Size(100, 28);
this.buttonClear.TabIndex = 1;
this.buttonClear.Text = "Clear";
this.buttonClear.UseVisualStyleBackColor = true;
//
// SpmItemListFilter_EmployeeRole
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.buttonClear);
this.Controls.Add(this.panelAttrFilter);
this.Name = "SpmItemListFilter_EmployeeRole";
this.Size = new System.Drawing.Size(393, 37);
this.ResumeLayout(false);
}
#endregion
private Sarand.Win.Forms.Controls.SacsPanelAttrFilter panelAttrFilter;
private System.Windows.Forms.Button buttonClear;
}
}
@@ -0,0 +1,127 @@
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.PatientMgr.Win.Forms.Base;
using Sarand.Win.Forms.Utils;
using Sarand.Win.Forms.Controls;
using Sarand.Core.Base;
namespace Sarand.PatientMgr.Win.Forms.Filters
{
//=======================================================================
public partial class SpmItemListFilter_EmployeeRole : SpmItemListFilter
{
//-------------------------------------------------------------------
// Filter attribute types.
public enum AttrType
{
Notes,
}
//-------------------------------------------------------------------
// Configuration.
public new class Config : SpmItemListFilter.Config
{
}
//-------------------------------------------------------------------
// Data members.
private Config config = new Config();
//-------------------------------------------------------------------
// Construction.
public SpmItemListFilter_EmployeeRole() : this(new Config()) { }
public SpmItemListFilter_EmployeeRole(Config config) : base(config)
{
this.config = config;
InitializeComponent();
}
// Dispose.
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (components != null) components.Dispose();
}
base.Dispose(disposing);
}
//-------------------------------------------------------------------
// Properties.
// Filter values.
[Browsable(false)]
public String GetAttrTypeValue(AttrType attrType)
{
return panelAttrFilter.GetAttrValue((int)attrType);
}
//-------------------------------------------------------------------
// Configure.
public void SetConfig(Config config)
{
base.SetConfig(config);
this.config = config;
ConfigureFilter();
}
private void ConfigureFilter()
{
if (!this.Created) return;
ConfigureAttrTypeFilter();
}
//-------------------------------------------------------------------
// I n i t i a l i s a t i o n
//-------------------------------------------------------------------
protected override void OnCreateControl()
{
base.OnCreateControl();
if (this.IsDesignerHosted()) return;
// Filter attribute types.
panelAttrFilter.BorderStyle = BorderStyle.None;
ConfigureAttrTypeFilter();
SetControlActivity();
}
//-------------------------------------------------------------------
// F i l t e r A t t r i b u t e s
//-------------------------------------------------------------------
private void ConfigureAttrTypeFilter()
{
SacsPanelAttrFilter.Config filterConfig = new SacsPanelAttrFilter.Config() { AttrTypeControlWidth = 90, AttrValueControlWidth = 100 };
filterConfig.AttrTypes.Add(AttrType.Notes, "Notes", SacsPanelAttrFilter.ControlType.TextBox);
panelAttrFilter.SetFilterConfig(filterConfig);
}
public List<CodeDesc> GetAttrTypeValues(int type)
{
return GetAttrTypeValues(type);
}
//-------------------------------------------------------------------
// C o n t r o l A c t i v i t y
//-------------------------------------------------------------------
protected override void SetControlActivity()
{
SetControlsReadOnly();
panelAttrFilter.Enabled = Enabled;
}
protected override void SetControlsReadOnly()
{
}
//-------------------------------------------------------------------
// F i l t e r 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,60 @@
namespace Sarand.PatientMgr.Win.Forms.Filters
{
partial class SpmItemListFilter_Facility
{
/// <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.panelAttrFilter = new Sarand.Win.Forms.Controls.SacsPanelAttrFilter();
this.buttonClear = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// panelAttrFilter
//
this.panelAttrFilter.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panelAttrFilter.Location = new System.Drawing.Point(5, 4);
this.panelAttrFilter.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.panelAttrFilter.Name = "panelAttrFilter";
this.panelAttrFilter.Size = new System.Drawing.Size(273, 30);
this.panelAttrFilter.TabIndex = 0;
//
// buttonClear
//
this.buttonClear.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.buttonClear.Location = new System.Drawing.Point(289, 4);
this.buttonClear.Margin = new System.Windows.Forms.Padding(4);
this.buttonClear.Name = "buttonClear";
this.buttonClear.Size = new System.Drawing.Size(100, 28);
this.buttonClear.TabIndex = 1;
this.buttonClear.Text = "Clear";
this.buttonClear.UseVisualStyleBackColor = true;
//
// SpmItemListFilter_Facility
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.buttonClear);
this.Controls.Add(this.panelAttrFilter);
this.Name = "SpmItemListFilter_Facility";
this.Size = new System.Drawing.Size(393, 37);
this.ResumeLayout(false);
}
#endregion
private Sarand.Win.Forms.Controls.SacsPanelAttrFilter panelAttrFilter;
private System.Windows.Forms.Button buttonClear;
}
}
@@ -0,0 +1,127 @@
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.PatientMgr.Win.Forms.Base;
using Sarand.Win.Forms.Utils;
using Sarand.Win.Forms.Controls;
using Sarand.Core.Base;
namespace Sarand.PatientMgr.Win.Forms.Filters
{
//=======================================================================
public partial class SpmItemListFilter_Facility : SpmItemListFilter
{
//-------------------------------------------------------------------
// Filter attribute types.
public enum AttrType
{
Notes,
}
//-------------------------------------------------------------------
// Configuration.
public new class Config : SpmItemListFilter.Config
{
}
//-------------------------------------------------------------------
// Data members.
private Config config = new Config();
//-------------------------------------------------------------------
// Construction.
public SpmItemListFilter_Facility() : this(new Config()) { }
public SpmItemListFilter_Facility(Config config) : base(config)
{
this.config = config;
InitializeComponent();
}
// Dispose.
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (components != null) components.Dispose();
}
base.Dispose(disposing);
}
//-------------------------------------------------------------------
// Properties.
// Filter values.
[Browsable(false)]
public String GetAttrTypeValue(AttrType attrType)
{
return panelAttrFilter.GetAttrValue((int)attrType);
}
//-------------------------------------------------------------------
// Configure.
public void SetConfig(Config config)
{
base.SetConfig(config);
this.config = config;
ConfigureFilter();
}
private void ConfigureFilter()
{
if (!this.Created) return;
ConfigureAttrTypeFilter();
}
//-------------------------------------------------------------------
// I n i t i a l i s a t i o n
//-------------------------------------------------------------------
protected override void OnCreateControl()
{
base.OnCreateControl();
if (this.IsDesignerHosted()) return;
// Filter attribute types.
panelAttrFilter.BorderStyle = BorderStyle.None;
ConfigureAttrTypeFilter();
SetControlActivity();
}
//-------------------------------------------------------------------
// F i l t e r A t t r i b u t e s
//-------------------------------------------------------------------
private void ConfigureAttrTypeFilter()
{
SacsPanelAttrFilter.Config filterConfig = new SacsPanelAttrFilter.Config() { AttrTypeControlWidth = 90, AttrValueControlWidth = 100 };
filterConfig.AttrTypes.Add(AttrType.Notes, "Notes", SacsPanelAttrFilter.ControlType.TextBox);
panelAttrFilter.SetFilterConfig(filterConfig);
}
public List<CodeDesc> GetAttrTypeValues(int type)
{
return GetAttrTypeValues(type);
}
//-------------------------------------------------------------------
// C o n t r o l A c t i v i t y
//-------------------------------------------------------------------
protected override void SetControlActivity()
{
SetControlsReadOnly();
panelAttrFilter.Enabled = Enabled;
}
protected override void SetControlsReadOnly()
{
}
//-------------------------------------------------------------------
// F i l t e r 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,60 @@
namespace Sarand.PatientMgr.Win.Forms.Filters
{
partial class SpmItemListFilter_FacilitySession
{
/// <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.panelAttrFilter = new Sarand.Win.Forms.Controls.SacsPanelAttrFilter();
this.buttonClear = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// panelAttrFilter
//
this.panelAttrFilter.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panelAttrFilter.Location = new System.Drawing.Point(5, 4);
this.panelAttrFilter.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.panelAttrFilter.Name = "panelAttrFilter";
this.panelAttrFilter.Size = new System.Drawing.Size(273, 30);
this.panelAttrFilter.TabIndex = 0;
//
// buttonClear
//
this.buttonClear.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.buttonClear.Location = new System.Drawing.Point(289, 4);
this.buttonClear.Margin = new System.Windows.Forms.Padding(4);
this.buttonClear.Name = "buttonClear";
this.buttonClear.Size = new System.Drawing.Size(100, 28);
this.buttonClear.TabIndex = 1;
this.buttonClear.Text = "Clear";
this.buttonClear.UseVisualStyleBackColor = true;
//
// SpmItemListFilter_FacilitySession
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.buttonClear);
this.Controls.Add(this.panelAttrFilter);
this.Name = "SpmItemListFilter_FacilitySession";
this.Size = new System.Drawing.Size(393, 37);
this.ResumeLayout(false);
}
#endregion
private Sarand.Win.Forms.Controls.SacsPanelAttrFilter panelAttrFilter;
private System.Windows.Forms.Button buttonClear;
}
}
@@ -0,0 +1,127 @@
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.PatientMgr.Win.Forms.Base;
using Sarand.Win.Forms.Utils;
using Sarand.Win.Forms.Controls;
using Sarand.Core.Base;
namespace Sarand.PatientMgr.Win.Forms.Filters
{
//=======================================================================
public partial class SpmItemListFilter_FacilitySession : SpmItemListFilter
{
//-------------------------------------------------------------------
// Filter attribute types.
public enum AttrType
{
Notes,
}
//-------------------------------------------------------------------
// Configuration.
public new class Config : SpmItemListFilter.Config
{
}
//-------------------------------------------------------------------
// Data members.
private Config config = new Config();
//-------------------------------------------------------------------
// Construction.
public SpmItemListFilter_FacilitySession() : this(new Config()) { }
public SpmItemListFilter_FacilitySession(Config config) : base(config)
{
this.config = config;
InitializeComponent();
}
// Dispose.
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (components != null) components.Dispose();
}
base.Dispose(disposing);
}
//-------------------------------------------------------------------
// Properties.
// Filter values.
[Browsable(false)]
public String GetAttrTypeValue(AttrType attrType)
{
return panelAttrFilter.GetAttrValue((int)attrType);
}
//-------------------------------------------------------------------
// Configure.
public void SetConfig(Config config)
{
base.SetConfig(config);
this.config = config;
ConfigureFilter();
}
private void ConfigureFilter()
{
if (!this.Created) return;
ConfigureAttrTypeFilter();
}
//-------------------------------------------------------------------
// I n i t i a l i s a t i o n
//-------------------------------------------------------------------
protected override void OnCreateControl()
{
base.OnCreateControl();
if (this.IsDesignerHosted()) return;
// Filter attribute types.
panelAttrFilter.BorderStyle = BorderStyle.None;
ConfigureAttrTypeFilter();
SetControlActivity();
}
//-------------------------------------------------------------------
// F i l t e r A t t r i b u t e s
//-------------------------------------------------------------------
private void ConfigureAttrTypeFilter()
{
SacsPanelAttrFilter.Config filterConfig = new SacsPanelAttrFilter.Config() { AttrTypeControlWidth = 90, AttrValueControlWidth = 100 };
filterConfig.AttrTypes.Add(AttrType.Notes, "Notes", SacsPanelAttrFilter.ControlType.TextBox);
panelAttrFilter.SetFilterConfig(filterConfig);
}
public List<CodeDesc> GetAttrTypeValues(int type)
{
return GetAttrTypeValues(type);
}
//-------------------------------------------------------------------
// C o n t r o l A c t i v i t y
//-------------------------------------------------------------------
protected override void SetControlActivity()
{
SetControlsReadOnly();
panelAttrFilter.Enabled = Enabled;
}
protected override void SetControlsReadOnly()
{
}
//-------------------------------------------------------------------
// F i l t e r 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,60 @@
namespace Sarand.PatientMgr.Win.Forms.Filters
{
partial class SpmItemListFilter_FacilityTemplate
{
/// <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.panelAttrFilter = new Sarand.Win.Forms.Controls.SacsPanelAttrFilter();
this.buttonClear = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// panelAttrFilter
//
this.panelAttrFilter.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panelAttrFilter.Location = new System.Drawing.Point(5, 4);
this.panelAttrFilter.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.panelAttrFilter.Name = "panelAttrFilter";
this.panelAttrFilter.Size = new System.Drawing.Size(273, 30);
this.panelAttrFilter.TabIndex = 0;
//
// buttonClear
//
this.buttonClear.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.buttonClear.Location = new System.Drawing.Point(289, 4);
this.buttonClear.Margin = new System.Windows.Forms.Padding(4);
this.buttonClear.Name = "buttonClear";
this.buttonClear.Size = new System.Drawing.Size(100, 28);
this.buttonClear.TabIndex = 1;
this.buttonClear.Text = "Clear";
this.buttonClear.UseVisualStyleBackColor = true;
//
// SpmItemListFilter_FacilityTemplate
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.buttonClear);
this.Controls.Add(this.panelAttrFilter);
this.Name = "SpmItemListFilter_FacilityTemplate";
this.Size = new System.Drawing.Size(393, 37);
this.ResumeLayout(false);
}
#endregion
private Sarand.Win.Forms.Controls.SacsPanelAttrFilter panelAttrFilter;
private System.Windows.Forms.Button buttonClear;
}
}
@@ -0,0 +1,127 @@
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.PatientMgr.Win.Forms.Base;
using Sarand.Win.Forms.Utils;
using Sarand.Win.Forms.Controls;
using Sarand.Core.Base;
namespace Sarand.PatientMgr.Win.Forms.Filters
{
//=======================================================================
public partial class SpmItemListFilter_FacilityTemplate : SpmItemListFilter
{
//-------------------------------------------------------------------
// Filter attribute types.
public enum AttrType
{
Notes,
}
//-------------------------------------------------------------------
// Configuration.
public new class Config : SpmItemListFilter.Config
{
}
//-------------------------------------------------------------------
// Data members.
private Config config = new Config();
//-------------------------------------------------------------------
// Construction.
public SpmItemListFilter_FacilityTemplate() : this(new Config()) { }
public SpmItemListFilter_FacilityTemplate(Config config) : base(config)
{
this.config = config;
InitializeComponent();
}
// Dispose.
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (components != null) components.Dispose();
}
base.Dispose(disposing);
}
//-------------------------------------------------------------------
// Properties.
// Filter values.
[Browsable(false)]
public String GetAttrTypeValue(AttrType attrType)
{
return panelAttrFilter.GetAttrValue((int)attrType);
}
//-------------------------------------------------------------------
// Configure.
public void SetConfig(Config config)
{
base.SetConfig(config);
this.config = config;
ConfigureFilter();
}
private void ConfigureFilter()
{
if (!this.Created) return;
ConfigureAttrTypeFilter();
}
//-------------------------------------------------------------------
// I n i t i a l i s a t i o n
//-------------------------------------------------------------------
protected override void OnCreateControl()
{
base.OnCreateControl();
if (this.IsDesignerHosted()) return;
// Filter attribute types.
panelAttrFilter.BorderStyle = BorderStyle.None;
ConfigureAttrTypeFilter();
SetControlActivity();
}
//-------------------------------------------------------------------
// F i l t e r A t t r i b u t e s
//-------------------------------------------------------------------
private void ConfigureAttrTypeFilter()
{
SacsPanelAttrFilter.Config filterConfig = new SacsPanelAttrFilter.Config() { AttrTypeControlWidth = 90, AttrValueControlWidth = 100 };
filterConfig.AttrTypes.Add(AttrType.Notes, "Notes", SacsPanelAttrFilter.ControlType.TextBox);
panelAttrFilter.SetFilterConfig(filterConfig);
}
public List<CodeDesc> GetAttrTypeValues(int type)
{
return GetAttrTypeValues(type);
}
//-------------------------------------------------------------------
// C o n t r o l A c t i v i t y
//-------------------------------------------------------------------
protected override void SetControlActivity()
{
SetControlsReadOnly();
panelAttrFilter.Enabled = Enabled;
}
protected override void SetControlsReadOnly()
{
}
//-------------------------------------------------------------------
// F i l t e r 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,60 @@
namespace Sarand.PatientMgr.Win.Forms.Filters
{
partial class SpmItemListFilter_Institution
{
/// <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.panelAttrFilter = new Sarand.Win.Forms.Controls.SacsPanelAttrFilter();
this.buttonClear = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// panelAttrFilter
//
this.panelAttrFilter.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panelAttrFilter.Location = new System.Drawing.Point(5, 4);
this.panelAttrFilter.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.panelAttrFilter.Name = "panelAttrFilter";
this.panelAttrFilter.Size = new System.Drawing.Size(273, 30);
this.panelAttrFilter.TabIndex = 0;
//
// buttonClear
//
this.buttonClear.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.buttonClear.Location = new System.Drawing.Point(289, 4);
this.buttonClear.Margin = new System.Windows.Forms.Padding(4);
this.buttonClear.Name = "buttonClear";
this.buttonClear.Size = new System.Drawing.Size(100, 28);
this.buttonClear.TabIndex = 1;
this.buttonClear.Text = "Clear";
this.buttonClear.UseVisualStyleBackColor = true;
//
// SpmItemListFilter_Institution
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.buttonClear);
this.Controls.Add(this.panelAttrFilter);
this.Name = "SpmItemListFilter_Institution";
this.Size = new System.Drawing.Size(393, 37);
this.ResumeLayout(false);
}
#endregion
private Sarand.Win.Forms.Controls.SacsPanelAttrFilter panelAttrFilter;
private System.Windows.Forms.Button buttonClear;
}
}
@@ -0,0 +1,127 @@
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.PatientMgr.Win.Forms.Base;
using Sarand.Win.Forms.Utils;
using Sarand.Win.Forms.Controls;
using Sarand.Core.Base;
namespace Sarand.PatientMgr.Win.Forms.Filters
{
//=======================================================================
public partial class SpmItemListFilter_Institution : SpmItemListFilter
{
//-------------------------------------------------------------------
// Filter attribute types.
public enum AttrType
{
Notes,
}
//-------------------------------------------------------------------
// Configuration.
public new class Config : SpmItemListFilter.Config
{
}
//-------------------------------------------------------------------
// Data members.
private Config config = new Config();
//-------------------------------------------------------------------
// Construction.
public SpmItemListFilter_Institution() : this(new Config()) { }
public SpmItemListFilter_Institution(Config config) : base(config)
{
this.config = config;
InitializeComponent();
}
// Dispose.
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (components != null) components.Dispose();
}
base.Dispose(disposing);
}
//-------------------------------------------------------------------
// Properties.
// Filter values.
[Browsable(false)]
public String GetAttrTypeValue(AttrType attrType)
{
return panelAttrFilter.GetAttrValue((int)attrType);
}
//-------------------------------------------------------------------
// Configure.
public void SetConfig(Config config)
{
base.SetConfig(config);
this.config = config;
ConfigureFilter();
}
private void ConfigureFilter()
{
if (!this.Created) return;
ConfigureAttrTypeFilter();
}
//-------------------------------------------------------------------
// I n i t i a l i s a t i o n
//-------------------------------------------------------------------
protected override void OnCreateControl()
{
base.OnCreateControl();
if (this.IsDesignerHosted()) return;
// Filter attribute types.
panelAttrFilter.BorderStyle = BorderStyle.None;
ConfigureAttrTypeFilter();
SetControlActivity();
}
//-------------------------------------------------------------------
// F i l t e r A t t r i b u t e s
//-------------------------------------------------------------------
private void ConfigureAttrTypeFilter()
{
SacsPanelAttrFilter.Config filterConfig = new SacsPanelAttrFilter.Config() { AttrTypeControlWidth = 90, AttrValueControlWidth = 100 };
filterConfig.AttrTypes.Add(AttrType.Notes, "Notes", SacsPanelAttrFilter.ControlType.TextBox);
panelAttrFilter.SetFilterConfig(filterConfig);
}
public List<CodeDesc> GetAttrTypeValues(int type)
{
return GetAttrTypeValues(type);
}
//-------------------------------------------------------------------
// C o n t r o l A c t i v i t y
//-------------------------------------------------------------------
protected override void SetControlActivity()
{
SetControlsReadOnly();
panelAttrFilter.Enabled = Enabled;
}
protected override void SetControlsReadOnly()
{
}
//-------------------------------------------------------------------
// F i l t e r 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,60 @@
namespace Sarand.PatientMgr.Win.Forms.Filters
{
partial class SpmItemListFilter_Operation
{
/// <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.panelAttrFilter = new Sarand.Win.Forms.Controls.SacsPanelAttrFilter();
this.buttonClear = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// panelAttrFilter
//
this.panelAttrFilter.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panelAttrFilter.Location = new System.Drawing.Point(5, 4);
this.panelAttrFilter.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.panelAttrFilter.Name = "panelAttrFilter";
this.panelAttrFilter.Size = new System.Drawing.Size(273, 30);
this.panelAttrFilter.TabIndex = 0;
//
// buttonClear
//
this.buttonClear.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.buttonClear.Location = new System.Drawing.Point(289, 4);
this.buttonClear.Margin = new System.Windows.Forms.Padding(4);
this.buttonClear.Name = "buttonClear";
this.buttonClear.Size = new System.Drawing.Size(100, 28);
this.buttonClear.TabIndex = 1;
this.buttonClear.Text = "Clear";
this.buttonClear.UseVisualStyleBackColor = true;
//
// SpmItemListFilter_Operation
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.buttonClear);
this.Controls.Add(this.panelAttrFilter);
this.Name = "SpmItemListFilter_Operation";
this.Size = new System.Drawing.Size(393, 37);
this.ResumeLayout(false);
}
#endregion
private Sarand.Win.Forms.Controls.SacsPanelAttrFilter panelAttrFilter;
private System.Windows.Forms.Button buttonClear;
}
}
@@ -0,0 +1,127 @@
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.PatientMgr.Win.Forms.Base;
using Sarand.Win.Forms.Utils;
using Sarand.Win.Forms.Controls;
using Sarand.Core.Base;
namespace Sarand.PatientMgr.Win.Forms.Filters
{
//=======================================================================
public partial class SpmItemListFilter_Operation : SpmItemListFilter
{
//-------------------------------------------------------------------
// Filter attribute types.
public enum AttrType
{
Notes,
}
//-------------------------------------------------------------------
// Configuration.
public new class Config : SpmItemListFilter.Config
{
}
//-------------------------------------------------------------------
// Data members.
private Config config = new Config();
//-------------------------------------------------------------------
// Construction.
public SpmItemListFilter_Operation() : this(new Config()) { }
public SpmItemListFilter_Operation(Config config) : base(config)
{
this.config = config;
InitializeComponent();
}
// Dispose.
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (components != null) components.Dispose();
}
base.Dispose(disposing);
}
//-------------------------------------------------------------------
// Properties.
// Filter values.
[Browsable(false)]
public String GetAttrTypeValue(AttrType attrType)
{
return panelAttrFilter.GetAttrValue((int)attrType);
}
//-------------------------------------------------------------------
// Configure.
public void SetConfig(Config config)
{
base.SetConfig(config);
this.config = config;
ConfigureFilter();
}
private void ConfigureFilter()
{
if (!this.Created) return;
ConfigureAttrTypeFilter();
}
//-------------------------------------------------------------------
// I n i t i a l i s a t i o n
//-------------------------------------------------------------------
protected override void OnCreateControl()
{
base.OnCreateControl();
if (this.IsDesignerHosted()) return;
// Filter attribute types.
panelAttrFilter.BorderStyle = BorderStyle.None;
ConfigureAttrTypeFilter();
SetControlActivity();
}
//-------------------------------------------------------------------
// F i l t e r A t t r i b u t e s
//-------------------------------------------------------------------
private void ConfigureAttrTypeFilter()
{
SacsPanelAttrFilter.Config filterConfig = new SacsPanelAttrFilter.Config() { AttrTypeControlWidth = 90, AttrValueControlWidth = 100 };
filterConfig.AttrTypes.Add(AttrType.Notes, "Notes", SacsPanelAttrFilter.ControlType.TextBox);
panelAttrFilter.SetFilterConfig(filterConfig);
}
public List<CodeDesc> GetAttrTypeValues(int type)
{
return GetAttrTypeValues(type);
}
//-------------------------------------------------------------------
// C o n t r o l A c t i v i t y
//-------------------------------------------------------------------
protected override void SetControlActivity()
{
SetControlsReadOnly();
panelAttrFilter.Enabled = Enabled;
}
protected override void SetControlsReadOnly()
{
}
//-------------------------------------------------------------------
// F i l t e r 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,60 @@
namespace Sarand.PatientMgr.Win.Forms.Filters
{
partial class SpmItemListFilter_Patient
{
/// <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.panelAttrFilter = new Sarand.Win.Forms.Controls.SacsPanelAttrFilter();
this.buttonClear = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// panelAttrFilter
//
this.panelAttrFilter.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panelAttrFilter.Location = new System.Drawing.Point(5, 4);
this.panelAttrFilter.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.panelAttrFilter.Name = "panelAttrFilter";
this.panelAttrFilter.Size = new System.Drawing.Size(273, 30);
this.panelAttrFilter.TabIndex = 0;
//
// buttonClear
//
this.buttonClear.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.buttonClear.Location = new System.Drawing.Point(289, 4);
this.buttonClear.Margin = new System.Windows.Forms.Padding(4);
this.buttonClear.Name = "buttonClear";
this.buttonClear.Size = new System.Drawing.Size(100, 28);
this.buttonClear.TabIndex = 1;
this.buttonClear.Text = "Clear";
this.buttonClear.UseVisualStyleBackColor = true;
//
// SpmItemListFilter_Patient
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.buttonClear);
this.Controls.Add(this.panelAttrFilter);
this.Name = "SpmItemListFilter_Patient";
this.Size = new System.Drawing.Size(393, 37);
this.ResumeLayout(false);
}
#endregion
private Sarand.Win.Forms.Controls.SacsPanelAttrFilter panelAttrFilter;
private System.Windows.Forms.Button buttonClear;
}
}
@@ -0,0 +1,127 @@
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.PatientMgr.Win.Forms.Base;
using Sarand.Win.Forms.Utils;
using Sarand.Win.Forms.Controls;
using Sarand.Core.Base;
namespace Sarand.PatientMgr.Win.Forms.Filters
{
//=======================================================================
public partial class SpmItemListFilter_Patient : SpmItemListFilter
{
//-------------------------------------------------------------------
// Filter attribute types.
public enum AttrType
{
Notes,
}
//-------------------------------------------------------------------
// Configuration.
public new class Config : SpmItemListFilter.Config
{
}
//-------------------------------------------------------------------
// Data members.
private Config config = new Config();
//-------------------------------------------------------------------
// Construction.
public SpmItemListFilter_Patient() : this(new Config()) { }
public SpmItemListFilter_Patient(Config config) : base(config)
{
this.config = config;
InitializeComponent();
}
// Dispose.
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (components != null) components.Dispose();
}
base.Dispose(disposing);
}
//-------------------------------------------------------------------
// Properties.
// Filter values.
[Browsable(false)]
public String GetAttrTypeValue(AttrType attrType)
{
return panelAttrFilter.GetAttrValue((int)attrType);
}
//-------------------------------------------------------------------
// Configure.
public void SetConfig(Config config)
{
base.SetConfig(config);
this.config = config;
ConfigureFilter();
}
private void ConfigureFilter()
{
if (!this.Created) return;
ConfigureAttrTypeFilter();
}
//-------------------------------------------------------------------
// I n i t i a l i s a t i o n
//-------------------------------------------------------------------
protected override void OnCreateControl()
{
base.OnCreateControl();
if (this.IsDesignerHosted()) return;
// Filter attribute types.
panelAttrFilter.BorderStyle = BorderStyle.None;
ConfigureAttrTypeFilter();
SetControlActivity();
}
//-------------------------------------------------------------------
// F i l t e r A t t r i b u t e s
//-------------------------------------------------------------------
private void ConfigureAttrTypeFilter()
{
SacsPanelAttrFilter.Config filterConfig = new SacsPanelAttrFilter.Config() { AttrTypeControlWidth = 90, AttrValueControlWidth = 100 };
filterConfig.AttrTypes.Add(AttrType.Notes, "Notes", SacsPanelAttrFilter.ControlType.TextBox);
panelAttrFilter.SetFilterConfig(filterConfig);
}
public List<CodeDesc> GetAttrTypeValues(int type)
{
return GetAttrTypeValues(type);
}
//-------------------------------------------------------------------
// C o n t r o l A c t i v i t y
//-------------------------------------------------------------------
protected override void SetControlActivity()
{
SetControlsReadOnly();
panelAttrFilter.Enabled = Enabled;
}
protected override void SetControlsReadOnly()
{
}
//-------------------------------------------------------------------
// F i l t e r 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,60 @@
namespace Sarand.PatientMgr.Win.Forms.Filters
{
partial class SpmItemListFilter_Procedure
{
/// <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.panelAttrFilter = new Sarand.Win.Forms.Controls.SacsPanelAttrFilter();
this.buttonClear = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// panelAttrFilter
//
this.panelAttrFilter.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panelAttrFilter.Location = new System.Drawing.Point(5, 4);
this.panelAttrFilter.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.panelAttrFilter.Name = "panelAttrFilter";
this.panelAttrFilter.Size = new System.Drawing.Size(273, 30);
this.panelAttrFilter.TabIndex = 0;
//
// buttonClear
//
this.buttonClear.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.buttonClear.Location = new System.Drawing.Point(289, 4);
this.buttonClear.Margin = new System.Windows.Forms.Padding(4);
this.buttonClear.Name = "buttonClear";
this.buttonClear.Size = new System.Drawing.Size(100, 28);
this.buttonClear.TabIndex = 1;
this.buttonClear.Text = "Clear";
this.buttonClear.UseVisualStyleBackColor = true;
//
// SpmItemListFilter_Procedure
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.buttonClear);
this.Controls.Add(this.panelAttrFilter);
this.Name = "SpmItemListFilter_Procedure";
this.Size = new System.Drawing.Size(393, 37);
this.ResumeLayout(false);
}
#endregion
private Sarand.Win.Forms.Controls.SacsPanelAttrFilter panelAttrFilter;
private System.Windows.Forms.Button buttonClear;
}
}
@@ -0,0 +1,127 @@
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.PatientMgr.Win.Forms.Base;
using Sarand.Win.Forms.Utils;
using Sarand.Win.Forms.Controls;
using Sarand.Core.Base;
namespace Sarand.PatientMgr.Win.Forms.Filters
{
//=======================================================================
public partial class SpmItemListFilter_Procedure : SpmItemListFilter
{
//-------------------------------------------------------------------
// Filter attribute types.
public enum AttrType
{
Notes,
}
//-------------------------------------------------------------------
// Configuration.
public new class Config : SpmItemListFilter.Config
{
}
//-------------------------------------------------------------------
// Data members.
private Config config = new Config();
//-------------------------------------------------------------------
// Construction.
public SpmItemListFilter_Procedure() : this(new Config()) { }
public SpmItemListFilter_Procedure(Config config) : base(config)
{
this.config = config;
InitializeComponent();
}
// Dispose.
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (components != null) components.Dispose();
}
base.Dispose(disposing);
}
//-------------------------------------------------------------------
// Properties.
// Filter values.
[Browsable(false)]
public String GetAttrTypeValue(AttrType attrType)
{
return panelAttrFilter.GetAttrValue((int)attrType);
}
//-------------------------------------------------------------------
// Configure.
public void SetConfig(Config config)
{
base.SetConfig(config);
this.config = config;
ConfigureFilter();
}
private void ConfigureFilter()
{
if (!this.Created) return;
ConfigureAttrTypeFilter();
}
//-------------------------------------------------------------------
// I n i t i a l i s a t i o n
//-------------------------------------------------------------------
protected override void OnCreateControl()
{
base.OnCreateControl();
if (this.IsDesignerHosted()) return;
// Filter attribute types.
panelAttrFilter.BorderStyle = BorderStyle.None;
ConfigureAttrTypeFilter();
SetControlActivity();
}
//-------------------------------------------------------------------
// F i l t e r A t t r i b u t e s
//-------------------------------------------------------------------
private void ConfigureAttrTypeFilter()
{
SacsPanelAttrFilter.Config filterConfig = new SacsPanelAttrFilter.Config() { AttrTypeControlWidth = 90, AttrValueControlWidth = 100 };
filterConfig.AttrTypes.Add(AttrType.Notes, "Notes", SacsPanelAttrFilter.ControlType.TextBox);
panelAttrFilter.SetFilterConfig(filterConfig);
}
public List<CodeDesc> GetAttrTypeValues(int type)
{
return GetAttrTypeValues(type);
}
//-------------------------------------------------------------------
// C o n t r o l A c t i v i t y
//-------------------------------------------------------------------
protected override void SetControlActivity()
{
SetControlsReadOnly();
panelAttrFilter.Enabled = Enabled;
}
protected override void SetControlsReadOnly()
{
}
//-------------------------------------------------------------------
// F i l t e r 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,60 @@
namespace Sarand.PatientMgr.Win.Forms.Filters
{
partial class SpmItemListFilter_TemplateData
{
/// <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.panelAttrFilter = new Sarand.Win.Forms.Controls.SacsPanelAttrFilter();
this.buttonClear = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// panelAttrFilter
//
this.panelAttrFilter.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panelAttrFilter.Location = new System.Drawing.Point(5, 4);
this.panelAttrFilter.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.panelAttrFilter.Name = "panelAttrFilter";
this.panelAttrFilter.Size = new System.Drawing.Size(273, 30);
this.panelAttrFilter.TabIndex = 0;
//
// buttonClear
//
this.buttonClear.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.buttonClear.Location = new System.Drawing.Point(289, 4);
this.buttonClear.Margin = new System.Windows.Forms.Padding(4);
this.buttonClear.Name = "buttonClear";
this.buttonClear.Size = new System.Drawing.Size(100, 28);
this.buttonClear.TabIndex = 1;
this.buttonClear.Text = "Clear";
this.buttonClear.UseVisualStyleBackColor = true;
//
// SpmItemListFilter_TemplateData
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.buttonClear);
this.Controls.Add(this.panelAttrFilter);
this.Name = "SpmItemListFilter_TemplateData";
this.Size = new System.Drawing.Size(393, 37);
this.ResumeLayout(false);
}
#endregion
private Sarand.Win.Forms.Controls.SacsPanelAttrFilter panelAttrFilter;
private System.Windows.Forms.Button buttonClear;
}
}
@@ -0,0 +1,127 @@
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.PatientMgr.Win.Forms.Base;
using Sarand.Win.Forms.Utils;
using Sarand.Win.Forms.Controls;
using Sarand.Core.Base;
namespace Sarand.PatientMgr.Win.Forms.Filters
{
//=======================================================================
public partial class SpmItemListFilter_TemplateData : SpmItemListFilter
{
//-------------------------------------------------------------------
// Filter attribute types.
public enum AttrType
{
Notes,
}
//-------------------------------------------------------------------
// Configuration.
public new class Config : SpmItemListFilter.Config
{
}
//-------------------------------------------------------------------
// Data members.
private Config config = new Config();
//-------------------------------------------------------------------
// Construction.
public SpmItemListFilter_TemplateData() : this(new Config()) { }
public SpmItemListFilter_TemplateData(Config config) : base(config)
{
this.config = config;
InitializeComponent();
}
// Dispose.
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (components != null) components.Dispose();
}
base.Dispose(disposing);
}
//-------------------------------------------------------------------
// Properties.
// Filter values.
[Browsable(false)]
public String GetAttrTypeValue(AttrType attrType)
{
return panelAttrFilter.GetAttrValue((int)attrType);
}
//-------------------------------------------------------------------
// Configure.
public void SetConfig(Config config)
{
base.SetConfig(config);
this.config = config;
ConfigureFilter();
}
private void ConfigureFilter()
{
if (!this.Created) return;
ConfigureAttrTypeFilter();
}
//-------------------------------------------------------------------
// I n i t i a l i s a t i o n
//-------------------------------------------------------------------
protected override void OnCreateControl()
{
base.OnCreateControl();
if (this.IsDesignerHosted()) return;
// Filter attribute types.
panelAttrFilter.BorderStyle = BorderStyle.None;
ConfigureAttrTypeFilter();
SetControlActivity();
}
//-------------------------------------------------------------------
// F i l t e r A t t r i b u t e s
//-------------------------------------------------------------------
private void ConfigureAttrTypeFilter()
{
SacsPanelAttrFilter.Config filterConfig = new SacsPanelAttrFilter.Config() { AttrTypeControlWidth = 90, AttrValueControlWidth = 100 };
filterConfig.AttrTypes.Add(AttrType.Notes, "Notes", SacsPanelAttrFilter.ControlType.TextBox);
panelAttrFilter.SetFilterConfig(filterConfig);
}
public List<CodeDesc> GetAttrTypeValues(int type)
{
return GetAttrTypeValues(type);
}
//-------------------------------------------------------------------
// C o n t r o l A c t i v i t y
//-------------------------------------------------------------------
protected override void SetControlActivity()
{
SetControlsReadOnly();
panelAttrFilter.Enabled = Enabled;
}
protected override void SetControlsReadOnly()
{
}
//-------------------------------------------------------------------
// F i l t e r 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>