Files
PatientMgr-CSharp/SaPatientMgr/App/Forms/SaPatientMgrForm.cs
T

108 lines
3.3 KiB
C#

using Sarand.PatientMgr.Core.App;
using Sarand.PatientMgr.Win.Dbas.Utils;
using Sarand.PatientMgr.Win.Forms.App;
using Sarand.Win.Forms;
using Sarand.Win.Forms.Utils;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Sarand.PatientMgr.App.Forms
{
//=======================================================================
public partial class SaPatientMgrForm : SacsForm
{
//-------------------------------------------------------------------
// Configuration.
public new class Config : SacsForm.Config
{
}
//-------------------------------------------------------------------
// Data members.
private Config config = null;
//-------------------------------------------------------------------
// Construction.
private SaPatientMgrForm () : this(new Config()) { }
public SaPatientMgrForm (Config config) : base(config)
{
this.config = config;
InitializeComponent();
// Configuration.
Text = Spm.ApplicationCaption;
ShowIcon = false;
MinimizeBox = false;
MaximizeBox = false;
WindowState = FormWindowState.Maximized;
}
protected override void Dispose (bool disposing)
{
if (disposing)
{
if (components != null)
components.Dispose();
}
base.Dispose(disposing);
}
//-------------------------------------------------------------------
// Properties.
//-------------------------------------------------------------------
// I n i t i a l i s a t i o n
//-------------------------------------------------------------------
protected override void OnCreateControl ()
{
base.OnCreateControl();
if (this.IsDesignerHosted()) return;
// Configure schedule control panel.
panelScheduleControl.MainForm = this;
SetControlActivity();
}
protected override void OnShown (EventArgs e)
{
base.OnShown(e);
}
//-------------------------------------------------------------------
// C o n t r o l A c t i v i t y
//-------------------------------------------------------------------
protected override void SetControlActivity ()
{
SetControlsReadOnly();
}
protected override void SetControlsReadOnly ()
{
}
//-------------------------------------------------------------------
// F o r m E v e n t s
//-------------------------------------------------------------------
private void buttonGenerateDbDfn_Click (object sender, EventArgs e)
{
SpmDbDfnGenerator.DbDfnGeneratorResultData result = SpmDbDfnGenerator.Generate(SpmGlobals.Application.GetDatabase(SpmGlobals_Win.SessionProfile.SessionContext).ConnectionString);
if (result.Success)
MessageBox.Show("Database definition generated", "Database Definition", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
else MessageBox.Show("Database definition not generated.\n\n"+result.ErrorMessage, "Database Definition", MessageBoxButtons.OK, MessageBoxIcon.Stop);
}
private void spmPanel_ScheduleControl1_Load (object sender, EventArgs e)
{
}
//-------------------------------------------------------------------
}
//=======================================================================
}