UCPatientAppts: Fixes printing empty table bug reported by EHS.
DAccessTemplate: Various usability improvements. CGDocumentManager: Fixed Delegate code so that it can operate asynchronously CGAVView: Some temporary fixes (not totally usable): Added non-functional Delete Slots menu option; Added Background worker for saving acccess slots In the future, Delete Slots will work; and will use ADO.net Updatable datatable for saving access slots. calendarGrid: just some comments for now AssemblyInfo: bumped version up to v1.4.2
This commit is contained in:
parent
0d678f0fa3
commit
9e34982831
|
@ -27,7 +27,7 @@ using System.Runtime.InteropServices;
|
|||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly: AssemblyVersion("1.4.1.*")]
|
||||
[assembly: AssemblyVersion("1.4.2.*")]
|
||||
|
||||
//
|
||||
// In order to sign your assembly you must specify a key to use. Refer to the
|
||||
|
@ -57,5 +57,5 @@ using System.Runtime.InteropServices;
|
|||
[assembly: AssemblyDelaySign(false)]
|
||||
[assembly: AssemblyKeyFile("")]
|
||||
[assembly: AssemblyKeyName("")]
|
||||
[assembly: AssemblyFileVersionAttribute("1.4.1.0")]
|
||||
[assembly: AssemblyFileVersionAttribute("1.4.2.0")]
|
||||
[assembly: ComVisibleAttribute(false)]
|
||||
|
|
|
@ -67,6 +67,7 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
this.menuItem1 = new System.Windows.Forms.MenuItem();
|
||||
this.mnuLoadTemplate = new System.Windows.Forms.MenuItem();
|
||||
this.mnuSaveTemplate = new System.Windows.Forms.MenuItem();
|
||||
this.mnuDeleteAllAppointments = new System.Windows.Forms.MenuItem();
|
||||
this.menuItem6 = new System.Windows.Forms.MenuItem();
|
||||
this.mnuSchedulingManagment = new System.Windows.Forms.MenuItem();
|
||||
this.menuItem5 = new System.Windows.Forms.MenuItem();
|
||||
|
@ -89,6 +90,7 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
this.mnuHelp = new System.Windows.Forms.MenuItem();
|
||||
this.mnuHelpAbout = new System.Windows.Forms.MenuItem();
|
||||
this.splitter1 = new System.Windows.Forms.Splitter();
|
||||
this.saveAccessBlocksWorker = new System.ComponentModel.BackgroundWorker();
|
||||
this.calendarGrid1 = new IndianHealthService.ClinicalScheduling.CalendarGrid();
|
||||
this.panelRight.SuspendLayout();
|
||||
this.panelClip.SuspendLayout();
|
||||
|
@ -103,7 +105,7 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
this.panelRight.Dock = System.Windows.Forms.DockStyle.Right;
|
||||
this.panelRight.Location = new System.Drawing.Point(728, 0);
|
||||
this.panelRight.Name = "panelRight";
|
||||
this.panelRight.Size = new System.Drawing.Size(120, 412);
|
||||
this.panelRight.Size = new System.Drawing.Size(120, 393);
|
||||
this.panelRight.TabIndex = 1;
|
||||
//
|
||||
// panelClip
|
||||
|
@ -124,12 +126,12 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
this.lstClip.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.lstClip.Location = new System.Drawing.Point(0, 32);
|
||||
this.lstClip.Name = "lstClip";
|
||||
this.lstClip.Size = new System.Drawing.Size(120, 407);
|
||||
this.lstClip.Size = new System.Drawing.Size(120, 416);
|
||||
this.lstClip.TabIndex = 0;
|
||||
this.lstClip.DragDrop += new System.Windows.Forms.DragEventHandler(this.lstClip_DragDrop);
|
||||
this.lstClip.MouseMove += new System.Windows.Forms.MouseEventHandler(this.lstClip_MouseMove);
|
||||
this.lstClip.MouseDown += new System.Windows.Forms.MouseEventHandler(this.lstClip_MouseDown);
|
||||
this.lstClip.DragEnter += new System.Windows.Forms.DragEventHandler(this.lstClip_DragEnter);
|
||||
this.lstClip.MouseDown += new System.Windows.Forms.MouseEventHandler(this.lstClip_MouseDown);
|
||||
this.lstClip.MouseMove += new System.Windows.Forms.MouseEventHandler(this.lstClip_MouseMove);
|
||||
//
|
||||
// ctxApptClipMenu
|
||||
//
|
||||
|
@ -164,7 +166,7 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
//
|
||||
this.panelBottom.Controls.Add(this.statusBar1);
|
||||
this.panelBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.panelBottom.Location = new System.Drawing.Point(8, 388);
|
||||
this.panelBottom.Location = new System.Drawing.Point(8, 369);
|
||||
this.panelBottom.Name = "panelBottom";
|
||||
this.panelBottom.Size = new System.Drawing.Size(720, 24);
|
||||
this.panelBottom.TabIndex = 2;
|
||||
|
@ -216,7 +218,7 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
this.panelCenter.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.panelCenter.Location = new System.Drawing.Point(8, 24);
|
||||
this.panelCenter.Name = "panelCenter";
|
||||
this.panelCenter.Size = new System.Drawing.Size(712, 364);
|
||||
this.panelCenter.Size = new System.Drawing.Size(712, 345);
|
||||
this.panelCenter.TabIndex = 4;
|
||||
//
|
||||
// ctxCalendarGrid
|
||||
|
@ -252,7 +254,7 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
this.tvSchedules.HotTracking = true;
|
||||
this.tvSchedules.Location = new System.Drawing.Point(0, 0);
|
||||
this.tvSchedules.Name = "tvSchedules";
|
||||
this.tvSchedules.Size = new System.Drawing.Size(8, 412);
|
||||
this.tvSchedules.Size = new System.Drawing.Size(8, 393);
|
||||
this.tvSchedules.Sorted = true;
|
||||
this.tvSchedules.TabIndex = 5;
|
||||
//
|
||||
|
@ -270,6 +272,7 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
this.menuItem1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
|
||||
this.mnuLoadTemplate,
|
||||
this.mnuSaveTemplate,
|
||||
this.mnuDeleteAllAppointments,
|
||||
this.menuItem6,
|
||||
this.mnuSchedulingManagment,
|
||||
this.menuItem5,
|
||||
|
@ -290,26 +293,34 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
this.mnuSaveTemplate.Text = "&Save Template";
|
||||
this.mnuSaveTemplate.Click += new System.EventHandler(this.mnuSaveTemplate_Click);
|
||||
//
|
||||
// mnuDeleteAllAppointments
|
||||
//
|
||||
this.mnuDeleteAllAppointments.Enabled = false;
|
||||
this.mnuDeleteAllAppointments.Index = 2;
|
||||
this.mnuDeleteAllAppointments.Shortcut = System.Windows.Forms.Shortcut.CtrlD;
|
||||
this.mnuDeleteAllAppointments.Text = "&Delete All Appointments";
|
||||
this.mnuDeleteAllAppointments.Click += new System.EventHandler(this.mnuDeleteAllAppointments_Click);
|
||||
//
|
||||
// menuItem6
|
||||
//
|
||||
this.menuItem6.Index = 2;
|
||||
this.menuItem6.Index = 3;
|
||||
this.menuItem6.Text = "-";
|
||||
//
|
||||
// mnuSchedulingManagment
|
||||
//
|
||||
this.mnuSchedulingManagment.Index = 3;
|
||||
this.mnuSchedulingManagment.Index = 4;
|
||||
this.mnuSchedulingManagment.Shortcut = System.Windows.Forms.Shortcut.CtrlShiftM;
|
||||
this.mnuSchedulingManagment.Text = "Scheduling &Management";
|
||||
this.mnuSchedulingManagment.Click += new System.EventHandler(this.mnuSchedulingManagment_Click);
|
||||
//
|
||||
// menuItem5
|
||||
//
|
||||
this.menuItem5.Index = 4;
|
||||
this.menuItem5.Index = 5;
|
||||
this.menuItem5.Text = "-";
|
||||
//
|
||||
// mnuClose
|
||||
//
|
||||
this.mnuClose.Index = 5;
|
||||
this.mnuClose.Index = 6;
|
||||
this.mnuClose.Shortcut = System.Windows.Forms.Shortcut.CtrlW;
|
||||
this.mnuClose.Text = "&Close";
|
||||
this.mnuClose.Click += new System.EventHandler(this.mnuClose_Click);
|
||||
|
@ -445,10 +456,17 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
this.splitter1.Dock = System.Windows.Forms.DockStyle.Right;
|
||||
this.splitter1.Location = new System.Drawing.Point(720, 24);
|
||||
this.splitter1.Name = "splitter1";
|
||||
this.splitter1.Size = new System.Drawing.Size(8, 364);
|
||||
this.splitter1.Size = new System.Drawing.Size(8, 345);
|
||||
this.splitter1.TabIndex = 6;
|
||||
this.splitter1.TabStop = false;
|
||||
//
|
||||
// saveAccessBlocksWorker
|
||||
//
|
||||
this.saveAccessBlocksWorker.WorkerReportsProgress = true;
|
||||
this.saveAccessBlocksWorker.DoWork += new System.ComponentModel.DoWorkEventHandler(this.saveAccessBlocksWorker_DoWork);
|
||||
this.saveAccessBlocksWorker.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.saveAccessBlocksWorker_ProgressChanged);
|
||||
this.saveAccessBlocksWorker.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.saveAccessBlocksWorker_RunWorkerCompleted);
|
||||
//
|
||||
// calendarGrid1
|
||||
//
|
||||
this.calendarGrid1.AllowDrop = true;
|
||||
|
@ -468,19 +486,19 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
this.calendarGrid1.Name = "calendarGrid1";
|
||||
this.calendarGrid1.Resources = ((System.Collections.ArrayList)(resources.GetObject("calendarGrid1.Resources")));
|
||||
this.calendarGrid1.SelectedAppointment = 0;
|
||||
this.calendarGrid1.Size = new System.Drawing.Size(712, 364);
|
||||
this.calendarGrid1.Size = new System.Drawing.Size(712, 345);
|
||||
this.calendarGrid1.StartDate = new System.DateTime(2003, 1, 27, 0, 0, 0, 0);
|
||||
this.calendarGrid1.TabIndex = 2;
|
||||
this.calendarGrid1.TimeScale = 20;
|
||||
this.calendarGrid1.DoubleClick += new System.EventHandler(this.calendarGrid1_DoubleClick);
|
||||
this.calendarGrid1.CGSelectionChanged += new IndianHealthService.ClinicalScheduling.CGSelectionChangedHandler(this.calendarGrid1_CGSelectionChanged);
|
||||
this.calendarGrid1.CGAppointmentChanged += new IndianHealthService.ClinicalScheduling.CGAppointmentChangedHandler(this.calendarGrid1_CGAppointmentChanged);
|
||||
this.calendarGrid1.CGAppointmentAdded += new IndianHealthService.ClinicalScheduling.CGAppointmentChangedHandler(this.calendarGrid1_CGAppointmentAdded);
|
||||
this.calendarGrid1.CGAppointmentChanged += new IndianHealthService.ClinicalScheduling.CGAppointmentChangedHandler(this.calendarGrid1_CGAppointmentChanged);
|
||||
this.calendarGrid1.CGSelectionChanged += new IndianHealthService.ClinicalScheduling.CGSelectionChangedHandler(this.calendarGrid1_CGSelectionChanged);
|
||||
this.calendarGrid1.DoubleClick += new System.EventHandler(this.calendarGrid1_DoubleClick);
|
||||
//
|
||||
// CGAVView
|
||||
//
|
||||
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
|
||||
this.ClientSize = new System.Drawing.Size(848, 412);
|
||||
this.ClientSize = new System.Drawing.Size(848, 393);
|
||||
this.Controls.Add(this.panelCenter);
|
||||
this.Controls.Add(this.splitter1);
|
||||
this.Controls.Add(this.panelTop);
|
||||
|
@ -491,8 +509,8 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
this.Menu = this.mainMenu1;
|
||||
this.Name = "CGAVView";
|
||||
this.Text = "CGAVView";
|
||||
this.Load += new System.EventHandler(this.CGAVView_Load);
|
||||
this.Closing += new System.ComponentModel.CancelEventHandler(this.CGAVView_Closing);
|
||||
this.Load += new System.EventHandler(this.CGAVView_Load);
|
||||
this.panelRight.ResumeLayout(false);
|
||||
this.panelClip.ResumeLayout(false);
|
||||
this.panelBottom.ResumeLayout(false);
|
||||
|
@ -555,6 +573,8 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
private System.Windows.Forms.MenuItem ctxCalGridAdd;
|
||||
private System.Windows.Forms.MenuItem ctxCalGridEdit;
|
||||
private System.Windows.Forms.MenuItem ctxCalGridDelete;
|
||||
private BackgroundWorker saveAccessBlocksWorker;
|
||||
private MenuItem mnuDeleteAllAppointments;
|
||||
private bool m_bDragDropStart = false;
|
||||
|
||||
#endregion
|
||||
|
@ -748,6 +768,34 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
}
|
||||
}//End AvailabilityAddNew
|
||||
|
||||
private void MassAppointmentDelete()
|
||||
{
|
||||
DialogResult msgResult = MessageBox.Show("Delete all Access Slots?", "Delete Slots?",MessageBoxButtons.YesNo);
|
||||
if (msgResult != DialogResult.Yes) return;
|
||||
|
||||
CGAppointments appointments = new CGAppointments();
|
||||
appointments = this.Document.AVBlocks;
|
||||
|
||||
foreach (CGAppointment a in appointments.AppointmentTable.Values)
|
||||
{
|
||||
int nApptID = a.AppointmentKey;
|
||||
Debug.Assert(nApptID != 0);
|
||||
try
|
||||
{
|
||||
Document.DeleteAvailability(nApptID);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show("Unable to delete access block" + ex.Message, "Clinical Scheduling");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
this.m_DocManager.UpdateViews((string)this.m_Document.Resources[0], "");
|
||||
RaiseRPMSEvent("BSDX SCHEDULE", m_Document.DocName);
|
||||
this.calendarGrid1.Invalidate();
|
||||
}
|
||||
|
||||
private void AppointmentDelete()
|
||||
{
|
||||
calendarGrid1.CGToolTip.Active = false;
|
||||
|
@ -755,11 +803,6 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
if (calendarGrid1.SelectedAppointments.AppointmentTable.Count > 1)
|
||||
sMsg = " these access blocks?";
|
||||
|
||||
if (MessageBox.Show("Are you sure you want to delete" + sMsg, "Clinical Scheduling", MessageBoxButtons.YesNo) != DialogResult.Yes)
|
||||
{
|
||||
calendarGrid1.CGToolTip.Active = true;
|
||||
return;
|
||||
}
|
||||
calendarGrid1.CGToolTip.Active = true;
|
||||
|
||||
bool bDeleted = false;
|
||||
|
@ -907,9 +950,6 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
{
|
||||
// this.DocManager.EnableAutoRefresh(false);
|
||||
|
||||
if (MessageBox.Show("Are you sure you want to move this access block?", "Clinical Scheduling", MessageBoxButtons.YesNo) != DialogResult.Yes)
|
||||
return;
|
||||
|
||||
m_Document.ChangeAppointmentTime(e.Appointment, e.StartTime, e.EndTime, e.Resource);
|
||||
this.m_DocManager.UpdateViews((string) this.m_Document.Resources[0], "");
|
||||
}
|
||||
|
@ -1009,71 +1049,73 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
|
||||
try
|
||||
{
|
||||
OpenFileDialog openFileDialog1 = dlg.FileDialog;
|
||||
Stream streamFile;
|
||||
if((streamFile = openFileDialog1.OpenFile())== null)
|
||||
{
|
||||
MessageBox.Show("Unable to open template file.");
|
||||
return;
|
||||
}
|
||||
this.saveAccessBlocksWorker.RunWorkerAsync(dlg);
|
||||
//OpenFileDialog openFileDialog1 = dlg.FileDialog;
|
||||
//openFileDialog1.RestoreDirectory = false; // go back to our dir
|
||||
//Stream streamFile;
|
||||
//if((streamFile = openFileDialog1.OpenFile())== null)
|
||||
//{
|
||||
// MessageBox.Show("Unable to open template file.");
|
||||
// return;
|
||||
//}
|
||||
|
||||
BinaryFormatter formatter = new BinaryFormatter();
|
||||
CGAppointments cgaTemp = (CGAppointments) formatter.Deserialize(streamFile);
|
||||
streamFile.Close();
|
||||
//BinaryFormatter formatter = new BinaryFormatter();
|
||||
//CGAppointments cgaTemp = (CGAppointments) formatter.Deserialize(streamFile);
|
||||
//streamFile.Close();
|
||||
|
||||
DateTime dtStart = dlg.StartDate;
|
||||
DateTime newStartDate, newEndDate;
|
||||
this.Document.WeekNeedsRefresh(1,dtStart, out newStartDate, out newEndDate);
|
||||
dtStart = newStartDate;
|
||||
int nWeeksToApply = dlg.WeeksToApply;
|
||||
DateTime dtEnd = dtStart.AddDays(6); // or 7?
|
||||
//DateTime dtStart = dlg.StartDate;
|
||||
//DateTime newStartDate, newEndDate;
|
||||
//this.Document.WeekNeedsRefresh(1,dtStart, out newStartDate, out newEndDate);
|
||||
//dtStart = newStartDate;
|
||||
//int nWeeksToApply = dlg.WeeksToApply;
|
||||
//DateTime dtEnd = dtStart.AddDays(6); // or 7?
|
||||
|
||||
string sResourceID = this.m_Document.ResourceID.ToString();
|
||||
DataTable dt;
|
||||
//string sResourceID = this.m_Document.ResourceID.ToString();
|
||||
//DataTable dt;
|
||||
|
||||
for (int j=1; j < nWeeksToApply + 1; j++)
|
||||
{
|
||||
//Convert start and end to string
|
||||
//string sStart = dtStart.ToString("M/d/yyyy");
|
||||
//string sEnd = dtEnd.ToString("M/d/yyyy");
|
||||
//i18n
|
||||
string sStart = FMDateTime.Create(dtStart).DateOnly.FMDateString;
|
||||
string sEnd = FMDateTime.Create(dtEnd).DateOnly.FMDateString;
|
||||
//Cancel all existing access blocks in the date range
|
||||
string sSql = "BSDX CANCEL AV BY DATE^" + sResourceID + "^" + sStart + "^" + sEnd;
|
||||
dt = this.m_DocManager.RPMSDataTable(sSql, "Cancelled");
|
||||
//for (int j=1; j < nWeeksToApply + 1; j++)
|
||||
//{
|
||||
// //Convert start and end to string
|
||||
// //string sStart = dtStart.ToString("M/d/yyyy");
|
||||
// //string sEnd = dtEnd.ToString("M/d/yyyy");
|
||||
// //i18n
|
||||
// string sStart = FMDateTime.Create(dtStart).DateOnly.FMDateString;
|
||||
// string sEnd = FMDateTime.Create(dtEnd).DateOnly.FMDateString;
|
||||
// //Cancel all existing access blocks in the date range
|
||||
// string sSql = "BSDX CANCEL AV BY DATE^" + sResourceID + "^" + sStart + "^" + sEnd;
|
||||
// dt = this.m_DocManager.RPMSDataTable(sSql, "Cancelled");
|
||||
|
||||
//for each CGAppointment in AVBlocks, call AddNew
|
||||
string sResource = "";
|
||||
sResource = (string) this.Document.Resources[0];
|
||||
foreach (CGAppointment a in cgaTemp.AppointmentTable.Values)
|
||||
{
|
||||
//Change the resource to the current one
|
||||
a.Resource = sResource;
|
||||
// //for each CGAppointment in AVBlocks, call AddNew
|
||||
// string sResource = "";
|
||||
// sResource = (string) this.Document.Resources[0];
|
||||
// foreach (CGAppointment a in cgaTemp.AppointmentTable.Values)
|
||||
// {
|
||||
// //Change the resource to the current one
|
||||
// a.Resource = sResource;
|
||||
|
||||
//Change the date to correspond to the GridColumn member
|
||||
int col = a.GridColumn;
|
||||
col--;
|
||||
DateTime dBuildDate = dtStart.Date;
|
||||
dBuildDate = dBuildDate.AddDays(col);
|
||||
dBuildDate = dBuildDate.AddHours(a.StartTime.Hour);
|
||||
dBuildDate = dBuildDate.AddMinutes(a.StartTime.Minute);
|
||||
a.StartTime = dBuildDate;
|
||||
dBuildDate = dtStart.Date;
|
||||
dBuildDate = dBuildDate.AddDays(col);
|
||||
dBuildDate = dBuildDate.AddHours(a.EndTime.Hour);
|
||||
dBuildDate = dBuildDate.AddMinutes(a.EndTime.Minute);
|
||||
a.EndTime = dBuildDate;
|
||||
// //Change the date to correspond to the GridColumn member
|
||||
// int col = a.GridColumn;
|
||||
// col--;
|
||||
// DateTime dBuildDate = dtStart.Date;
|
||||
// dBuildDate = dBuildDate.AddDays(col);
|
||||
// dBuildDate = dBuildDate.AddHours(a.StartTime.Hour);
|
||||
// dBuildDate = dBuildDate.AddMinutes(a.StartTime.Minute);
|
||||
// a.StartTime = dBuildDate;
|
||||
// dBuildDate = dtStart.Date;
|
||||
// dBuildDate = dBuildDate.AddDays(col);
|
||||
// dBuildDate = dBuildDate.AddHours(a.EndTime.Hour);
|
||||
// dBuildDate = dBuildDate.AddMinutes(a.EndTime.Minute);
|
||||
// a.EndTime = dBuildDate;
|
||||
|
||||
//Call Document to add a new appointment
|
||||
this.Document.CreateAppointmentAuto(a);
|
||||
}
|
||||
// //Call Document to add a new appointment
|
||||
// this.Document.CreateAppointmentAuto(a);
|
||||
// }
|
||||
|
||||
//Increment start and end
|
||||
dtStart = dtStart.AddDays(7);
|
||||
dtEnd = dtStart.AddDays(6);
|
||||
// //Increment start and end
|
||||
// dtStart = dtStart.AddDays(7);
|
||||
// dtEnd = dtStart.AddDays(6);
|
||||
|
||||
}//end for
|
||||
// }//end for
|
||||
try
|
||||
{
|
||||
RaiseRPMSEvent("BSDX SCHEDULE", m_Document.DocName);
|
||||
|
@ -1423,5 +1465,100 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
cg.AutoScrollPosition = new Point(50, nHeight);
|
||||
cg.Invalidate();
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void saveAccessBlocksWorker_DoWork(object sender, DoWorkEventArgs e)
|
||||
{
|
||||
BackgroundWorker worker = (BackgroundWorker)sender;
|
||||
DAccessTemplate dlg = (DAccessTemplate)e.Argument;
|
||||
|
||||
OpenFileDialog openFileDialog1 = dlg.FileDialog;
|
||||
openFileDialog1.RestoreDirectory = false; // go back to our dir
|
||||
Stream streamFile;
|
||||
if ((streamFile = openFileDialog1.OpenFile()) == null)
|
||||
{
|
||||
MessageBox.Show("Unable to open template file.");
|
||||
return;
|
||||
}
|
||||
|
||||
BinaryFormatter formatter = new BinaryFormatter();
|
||||
CGAppointments cgaTemp = (CGAppointments)formatter.Deserialize(streamFile);
|
||||
streamFile.Close();
|
||||
|
||||
DateTime dtStart = dlg.StartDate;
|
||||
DateTime newStartDate, newEndDate;
|
||||
this.Document.WeekNeedsRefresh(1, dtStart, out newStartDate, out newEndDate);
|
||||
dtStart = newStartDate;
|
||||
int nWeeksToApply = dlg.WeeksToApply;
|
||||
DateTime dtEnd = dtStart.AddDays(6); // or 7?
|
||||
|
||||
string sResourceID = this.m_Document.ResourceID.ToString();
|
||||
DataTable dt;
|
||||
|
||||
for (int j = 1; j < nWeeksToApply + 1; j++)
|
||||
{
|
||||
float fProgressPercentage = ((float)j / (float)nWeeksToApply) * 100;
|
||||
int iProgressPercentage = (int)fProgressPercentage;
|
||||
worker.ReportProgress(iProgressPercentage);
|
||||
//Convert start and end to string
|
||||
//string sStart = dtStart.ToString("M/d/yyyy");
|
||||
//string sEnd = dtEnd.ToString("M/d/yyyy");
|
||||
//i18n
|
||||
string sStart = FMDateTime.Create(dtStart).DateOnly.FMDateString;
|
||||
string sEnd = FMDateTime.Create(dtEnd).DateOnly.FMDateString;
|
||||
//Cancel all existing access blocks in the date range
|
||||
string sSql = "BSDX CANCEL AV BY DATE^" + sResourceID + "^" + sStart + "^" + sEnd;
|
||||
CGDocumentManager.RPMSDataTableDelegate d = new CGDocumentManager.RPMSDataTableDelegate(m_DocManager.RPMSDataTable);
|
||||
//dt = this.m_DocManager.RPMSDataTable(sSql, "Cancelled");
|
||||
dt = d(sSql, "Cancelled");
|
||||
//for each CGAppointment in AVBlocks, call AddNew
|
||||
string sResource = "";
|
||||
sResource = (string)this.Document.Resources[0];
|
||||
foreach (CGAppointment a in cgaTemp.AppointmentTable.Values)
|
||||
{
|
||||
//Change the resource to the current one
|
||||
a.Resource = sResource;
|
||||
|
||||
//Change the date to correspond to the GridColumn member
|
||||
int col = a.GridColumn;
|
||||
col--;
|
||||
DateTime dBuildDate = dtStart.Date;
|
||||
dBuildDate = dBuildDate.AddDays(col);
|
||||
dBuildDate = dBuildDate.AddHours(a.StartTime.Hour);
|
||||
dBuildDate = dBuildDate.AddMinutes(a.StartTime.Minute);
|
||||
a.StartTime = dBuildDate;
|
||||
dBuildDate = dtStart.Date;
|
||||
dBuildDate = dBuildDate.AddDays(col);
|
||||
dBuildDate = dBuildDate.AddHours(a.EndTime.Hour);
|
||||
dBuildDate = dBuildDate.AddMinutes(a.EndTime.Minute);
|
||||
a.EndTime = dBuildDate;
|
||||
|
||||
//Call Document to add a new appointment
|
||||
this.Document.CreateAppointmentAuto(a);
|
||||
}
|
||||
|
||||
//Increment start and end
|
||||
dtStart = dtStart.AddDays(7);
|
||||
dtEnd = dtStart.AddDays(6);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void saveAccessBlocksWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
|
||||
{
|
||||
this.statusBar1.Text = "Done saving access blocks.";
|
||||
}
|
||||
|
||||
private void saveAccessBlocksWorker_ProgressChanged(object sender, ProgressChangedEventArgs e)
|
||||
{
|
||||
this.statusBar1.Text = "Saving Data to VISTA. Progress: " + e.ProgressPercentage + " %";
|
||||
}
|
||||
|
||||
private void mnuDeleteAllAppointments_Click(object sender, EventArgs e)
|
||||
{
|
||||
MassAppointmentDelete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -132,6 +132,9 @@
|
|||
<metadata name="mainMenu1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>281, 17</value>
|
||||
</metadata>
|
||||
<metadata name="saveAccessBlocksWorker.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>398, 17</value>
|
||||
</metadata>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
|
|
|
@ -1034,7 +1034,7 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
|
||||
}
|
||||
|
||||
delegate DataTable RPMSDataTableDelegate(string CommandString, string TableName);
|
||||
public delegate DataTable RPMSDataTableDelegate(string CommandString, string TableName);
|
||||
|
||||
public DataTable RPMSDataTable(string sSQL, string sTableName)
|
||||
{
|
||||
|
@ -1047,7 +1047,7 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
#endif
|
||||
try
|
||||
{
|
||||
System.IntPtr pHandle = this.Handle;
|
||||
//System.IntPtr pHandle = this.Handle;
|
||||
RPMSDataTableDelegate rdtd = new RPMSDataTableDelegate(ConnectInfo.RPMSDataTable);
|
||||
dtOut = (DataTable) this.Invoke(rdtd, new object[] {sSQL, sTableName});
|
||||
}
|
||||
|
|
|
@ -94,17 +94,20 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
}
|
||||
|
||||
string sResName;
|
||||
// for each resource
|
||||
for (int i = 0; i < nSize; i++)
|
||||
{
|
||||
sResName = saryResourceNames[i].ToString();
|
||||
|
||||
//Gets all the slots (or Availabities, if you like)
|
||||
rsSlotSchedule = CGSchedLib.CreateAssignedSlotSchedule(docManager, sResName, StartTime, EndTime, saryApptTypes,/**/ stType, sSearchInfo);
|
||||
OutputArray(rsSlotSchedule, "rsSlotSchedule");
|
||||
|
||||
//if we have slots
|
||||
if (rsSlotSchedule.Rows.Count > 0 )
|
||||
{
|
||||
// Get appointment count to substract from the slots
|
||||
rsApptSchedule = CGSchedLib.CreateAppointmentSlotSchedule(docManager, sResName, StartTime, EndTime, stType);
|
||||
OutputArray(rsApptSchedule, "rsApptSchedule");
|
||||
// Perform the substraction
|
||||
rsTemp1 = CGSchedLib.SubtractSlotsRS2(rsSlotSchedule, rsApptSchedule, sResName);
|
||||
OutputArray(rsTemp1, "rsTemp1");
|
||||
}
|
||||
|
@ -113,6 +116,7 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
rsTemp1 = rsSlotSchedule;
|
||||
OutputArray(rsTemp1, "rsTemp1");
|
||||
}
|
||||
// if only one resource was passed in, its availablility is what we want
|
||||
if (i == 0)
|
||||
{
|
||||
rsOut = rsTemp1;
|
||||
|
@ -585,6 +589,13 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
while (!((bDirty == false) || (rTBArray.Count == 1)));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// My guess is that this calculates remaining slots
|
||||
/// </summary>
|
||||
/// <param name="rsBlocks1"></param>
|
||||
/// <param name="rsBlocks2"></param>
|
||||
/// <param name="sResource"></param>
|
||||
/// <returns></returns>
|
||||
public static DataTable SubtractSlotsRS2(DataTable rsBlocks1, DataTable rsBlocks2, string sResource)
|
||||
{
|
||||
//Subtract slots in rsBlocks2 from rsBlocks1
|
||||
|
@ -769,7 +780,11 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
return rsCopy;
|
||||
}//end IntersectBlocks
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Number of minutes since Jan 1 1980
|
||||
/// </summary>
|
||||
/// <param name="d">Date to compare</param>
|
||||
/// <returns>Minutes as integer</returns>
|
||||
public static int MinSince80(DateTime d)
|
||||
{
|
||||
//Returns the total minutes between d and 1 Jan 1980
|
||||
|
@ -877,6 +892,7 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
rect1.Y = CGSchedLib.MinSince80(dStart1);
|
||||
rect1.Height = CGSchedLib.MinSince80(dEnd1) - rect1.Y;
|
||||
|
||||
//for each row in the availability schedule
|
||||
foreach (DataRow r in rsBlock.Rows)
|
||||
{
|
||||
dStart2 = (DateTime) r[rsBlock.Columns["START_TIME"]];
|
||||
|
|
|
@ -676,6 +676,8 @@
|
|||
}
|
||||
else
|
||||
{
|
||||
//columnToPutAppt = (startTime - this.m_dtStart).Days + 1;
|
||||
//test sam
|
||||
columnToPutAppt = (startTime - this.m_dtStart).Days + 1;
|
||||
}
|
||||
if (columnToPutAppt < 1)
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
<RemoteDebugMachine>
|
||||
</RemoteDebugMachine>
|
||||
<StartAction>Project</StartAction>
|
||||
<StartArguments>/s=172.16.17.51 /p=9260 /a=shabiel12 /v=abc,123!</StartArguments>
|
||||
<StartArguments>/s=192.168.56.101 /p=9260 /a=shabiel12 /v=catdog.66</StartArguments>
|
||||
<StartPage>
|
||||
</StartPage>
|
||||
<StartProgram>C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\IEExec.exe</StartProgram>
|
||||
|
|
Binary file not shown.
|
@ -35,7 +35,7 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
{
|
||||
|
||||
UpdateDialogData(true);
|
||||
|
||||
//this.cmdSelectTemplate.Focus(); // Focus on first button on form
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -112,11 +112,6 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
//Open the file dialog and pick a file
|
||||
m_bSelectedFile = false;
|
||||
OpenFileDialog openFileDialog1 = new OpenFileDialog();
|
||||
string sPath = "";
|
||||
sPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
|
||||
|
||||
openFileDialog1.InitialDirectory = @"c:\" ;
|
||||
openFileDialog1.InitialDirectory = sPath ;
|
||||
openFileDialog1.Filter = "Schedule Template Files (*.bsdxa)|*.bsdxa|All files (*.*)|*.*" ;
|
||||
openFileDialog1.FilterIndex = 0 ;
|
||||
openFileDialog1.RestoreDirectory = true ;
|
||||
|
@ -184,7 +179,7 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
this.cmdCancel.Location = new System.Drawing.Point(360, 8);
|
||||
this.cmdCancel.Name = "cmdCancel";
|
||||
this.cmdCancel.Size = new System.Drawing.Size(56, 24);
|
||||
this.cmdCancel.TabIndex = 2;
|
||||
this.cmdCancel.TabIndex = 5;
|
||||
this.cmdCancel.Text = "Cancel";
|
||||
//
|
||||
// cmdOK
|
||||
|
@ -193,7 +188,7 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
this.cmdOK.Location = new System.Drawing.Point(280, 8);
|
||||
this.cmdOK.Name = "cmdOK";
|
||||
this.cmdOK.Size = new System.Drawing.Size(64, 24);
|
||||
this.cmdOK.TabIndex = 1;
|
||||
this.cmdOK.TabIndex = 4;
|
||||
this.cmdOK.Text = "OK";
|
||||
this.cmdOK.Click += new System.EventHandler(this.cmdOK_Click);
|
||||
//
|
||||
|
@ -233,7 +228,7 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
this.cmdSelectTemplate.Location = new System.Drawing.Point(24, 40);
|
||||
this.cmdSelectTemplate.Name = "cmdSelectTemplate";
|
||||
this.cmdSelectTemplate.Size = new System.Drawing.Size(136, 32);
|
||||
this.cmdSelectTemplate.TabIndex = 9;
|
||||
this.cmdSelectTemplate.TabIndex = 1;
|
||||
this.cmdSelectTemplate.Text = "Select Access Template";
|
||||
this.cmdSelectTemplate.Click += new System.EventHandler(this.cmdSelectTemplate_Click);
|
||||
//
|
||||
|
@ -253,7 +248,7 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
this.dtpStartDate.Location = new System.Drawing.Point(176, 104);
|
||||
this.dtpStartDate.Name = "dtpStartDate";
|
||||
this.dtpStartDate.Size = new System.Drawing.Size(184, 20);
|
||||
this.dtpStartDate.TabIndex = 11;
|
||||
this.dtpStartDate.TabIndex = 2;
|
||||
//
|
||||
// udWeeksToApply
|
||||
//
|
||||
|
@ -270,7 +265,7 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
0});
|
||||
this.udWeeksToApply.Name = "udWeeksToApply";
|
||||
this.udWeeksToApply.Size = new System.Drawing.Size(96, 20);
|
||||
this.udWeeksToApply.TabIndex = 12;
|
||||
this.udWeeksToApply.TabIndex = 3;
|
||||
this.udWeeksToApply.Value = new decimal(new int[] {
|
||||
1,
|
||||
0,
|
||||
|
|
|
@ -118,11 +118,21 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
|
||||
private void btnPrint_Click(object sender, EventArgs e)
|
||||
{
|
||||
//Fixes bug reported by EHS. Don't print if there are no appointments as this causes null ref
|
||||
if (dtAppt.Rows.Count == 0)
|
||||
{
|
||||
MessageBox.Show("No Appointments to Print", "Nothing to Print");
|
||||
return;
|
||||
}
|
||||
|
||||
rowToPrint = 0; //reset row to print
|
||||
DialogResult res = printDialog1.ShowDialog();
|
||||
if (res == DialogResult.OK) this.printDialog1.Document.Print();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets default page orientation to landscape.
|
||||
/// </summary>
|
||||
private void PrintPtAppts_QueryPageSettings(object sender, System.Drawing.Printing.QueryPageSettingsEventArgs e)
|
||||
{
|
||||
e.PageSettings.Landscape = true;
|
||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue