diff --git a/cs/bsdx0200GUISourceCode/CGDocument.cs b/cs/bsdx0200GUISourceCode/CGDocument.cs index 6dab2c2..28da426 100644 --- a/cs/bsdx0200GUISourceCode/CGDocument.cs +++ b/cs/bsdx0200GUISourceCode/CGDocument.cs @@ -1015,12 +1015,6 @@ namespace IndianHealthService.ClinicalScheduling string sErrorID = r["ERRORID"].ToString(); if (sErrorID == "-1") pAppt.Note = sNote; - - if (this.m_appointments.AppointmentTable.ContainsKey(nApptID)) - { - bool bRet = RefreshAvailabilitySchedule(); - UpdateAllViews(); - } } catch (Exception ex) { diff --git a/cs/bsdx0200GUISourceCode/CGDocumentManager.cs b/cs/bsdx0200GUISourceCode/CGDocumentManager.cs index 2921982..c886552 100644 --- a/cs/bsdx0200GUISourceCode/CGDocumentManager.cs +++ b/cs/bsdx0200GUISourceCode/CGDocumentManager.cs @@ -399,7 +399,7 @@ namespace IndianHealthService.ClinicalScheduling } catch (System.Net.Sockets.SocketException) { - MessageBox.Show("Cannot connect to VistA. Network Error"); + m_ds.RemoteMsgBox("Can't connect to server! Network Error"); return false; } } @@ -437,11 +437,11 @@ namespace IndianHealthService.ClinicalScheduling } catch (System.Net.Sockets.SocketException) { - MessageBox.Show("Cannot connect to VistA. Network Error"); + m_ds.RemoteMsgBox("Cannot connect to VistA. Network Error"); } catch (BMXNetException ex) { - if (MessageBox.Show("Unable to connect to VistA. " + ex.Message, "Clinical Scheduling", MessageBoxButtons.RetryCancel) == DialogResult.Retry) + if (m_ds.RemoteMsgBox("Unable to connect to VistA. " + ex.Message, "Clinical Scheduling", MessageBoxButtons.RetryCancel) == DialogResult.Retry) { bRetry = true; //I hate this, but this is how the library is designed. It throws an error if the user cancels. XXX: Won't fix library until BMX 4.0 port. diff --git a/cs/bsdx0200GUISourceCode/CGView.cs b/cs/bsdx0200GUISourceCode/CGView.cs index 737beb2..ab41c05 100644 --- a/cs/bsdx0200GUISourceCode/CGView.cs +++ b/cs/bsdx0200GUISourceCode/CGView.cs @@ -427,18 +427,21 @@ namespace IndianHealthService.ClinicalScheduling // mnuNewAppointment // this.mnuNewAppointment.Index = 0; + this.mnuNewAppointment.Shortcut = System.Windows.Forms.Shortcut.Ins; this.mnuNewAppointment.Text = "&New Appointment"; this.mnuNewAppointment.Click += new System.EventHandler(this.mnuNewAppointment_Click); // // mnuEditAppointment // this.mnuEditAppointment.Index = 1; + this.mnuEditAppointment.Shortcut = System.Windows.Forms.Shortcut.F2; this.mnuEditAppointment.Text = "&Edit Appointment"; this.mnuEditAppointment.Click += new System.EventHandler(this.mnuEditAppointment_Click); // // mnuDeleteAppointment // this.mnuDeleteAppointment.Index = 2; + this.mnuDeleteAppointment.Shortcut = System.Windows.Forms.Shortcut.Del; this.mnuDeleteAppointment.Text = "Cance&l Appointment"; this.mnuDeleteAppointment.Click += new System.EventHandler(this.mnuDeleteAppointment_Click); // @@ -480,7 +483,7 @@ namespace IndianHealthService.ClinicalScheduling // this.mnuFindAppt.Index = 9; this.mnuFindAppt.Shortcut = System.Windows.Forms.Shortcut.CtrlF; - this.mnuFindAppt.Text = "&Find Available Appointment"; + this.mnuFindAppt.Text = "&Find Empty Slots"; this.mnuFindAppt.Click += new System.EventHandler(this.mnuFindAppt_Click); // // mnuCheckIn @@ -646,7 +649,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(128, 359); + this.tvSchedules.Size = new System.Drawing.Size(128, 317); this.tvSchedules.Sorted = true; this.tvSchedules.TabIndex = 1; this.tvSchedules.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.tvSchedules_AfterSelect); @@ -688,7 +691,7 @@ namespace IndianHealthService.ClinicalScheduling // ctxFindAppt // this.ctxFindAppt.Index = 3; - this.ctxFindAppt.Text = "&Find Available Appointment"; + this.ctxFindAppt.Text = "&Find Empty Slots"; this.ctxFindAppt.Click += new System.EventHandler(this.ctxFindAppt_Click); // // ctxPrintScheduleT0 @@ -715,7 +718,7 @@ namespace IndianHealthService.ClinicalScheduling this.panelRight.Dock = System.Windows.Forms.DockStyle.Right; this.panelRight.Location = new System.Drawing.Point(996, 0); this.panelRight.Name = "panelRight"; - this.panelRight.Size = new System.Drawing.Size(128, 359); + this.panelRight.Size = new System.Drawing.Size(128, 317); this.panelRight.TabIndex = 3; this.panelRight.Visible = false; // @@ -811,7 +814,7 @@ namespace IndianHealthService.ClinicalScheduling this.panelCenter.Dock = System.Windows.Forms.DockStyle.Fill; this.panelCenter.Location = new System.Drawing.Point(136, 24); this.panelCenter.Name = "panelCenter"; - this.panelCenter.Size = new System.Drawing.Size(857, 311); + this.panelCenter.Size = new System.Drawing.Size(857, 269); this.panelCenter.TabIndex = 7; // // ctxCalendarGrid @@ -904,7 +907,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(136, 335); + this.panelBottom.Location = new System.Drawing.Point(136, 293); this.panelBottom.Name = "panelBottom"; this.panelBottom.Size = new System.Drawing.Size(857, 24); this.panelBottom.TabIndex = 8; @@ -922,7 +925,7 @@ namespace IndianHealthService.ClinicalScheduling // this.splitter1.Location = new System.Drawing.Point(128, 24); this.splitter1.Name = "splitter1"; - this.splitter1.Size = new System.Drawing.Size(8, 335); + this.splitter1.Size = new System.Drawing.Size(8, 293); this.splitter1.TabIndex = 9; this.splitter1.TabStop = false; // @@ -931,7 +934,7 @@ namespace IndianHealthService.ClinicalScheduling this.splitter2.Dock = System.Windows.Forms.DockStyle.Right; this.splitter2.Location = new System.Drawing.Point(993, 24); this.splitter2.Name = "splitter2"; - this.splitter2.Size = new System.Drawing.Size(3, 335); + this.splitter2.Size = new System.Drawing.Size(3, 293); this.splitter2.TabIndex = 10; this.splitter2.TabStop = false; // @@ -954,7 +957,7 @@ 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(857, 311); + this.calendarGrid1.Size = new System.Drawing.Size(857, 269); this.calendarGrid1.StartDate = new System.DateTime(2003, 1, 27, 0, 0, 0, 0); this.calendarGrid1.TabIndex = 0; this.calendarGrid1.TimeScale = 20; @@ -967,7 +970,7 @@ namespace IndianHealthService.ClinicalScheduling // CGView // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); - this.ClientSize = new System.Drawing.Size(1124, 359); + this.ClientSize = new System.Drawing.Size(1124, 317); this.Controls.Add(this.panelCenter); this.Controls.Add(this.panelBottom); this.Controls.Add(this.splitter2); @@ -1816,6 +1819,16 @@ namespace IndianHealthService.ClinicalScheduling //Call Document to edit appointment this.Document.EditAppointment(a, sNote); + if (dAppt.PrintAppointmentSlip) + { + PrintAppointmentSlip(a); + } + + //Redraw appointments + this.UpdateArrays(); + + //Then tell RPMS that we are updated + RaiseRPMSEvent("BSDX SCHEDULE", a.Resource); } catch (Exception ex) { @@ -2683,8 +2696,6 @@ namespace IndianHealthService.ClinicalScheduling this.calendarGrid1.Columns = 5; this.Document.m_nColumnCount = 5; // MJL 1/17/2007 - //this.Document.UpdateAllViews(); - //TODO: Is there a way to just reuse the existing arrays? How far in the future do they go? RequestRefreshGrid(); } @@ -2692,7 +2703,6 @@ namespace IndianHealthService.ClinicalScheduling { this.calendarGrid1.Columns = 7; this.Document.m_nColumnCount = 7; // MJL 1/17/2007 - //TODO: Is there a way to just reuse the existing arrays? How far in the future do they go? RequestRefreshGrid(); } @@ -2952,6 +2962,8 @@ namespace IndianHealthService.ClinicalScheduling appt.Note = e.Appointment.Note; appt.HealthRecordNumber = e.Appointment.HealthRecordNumber; appt.AccessTypeID = e.AccessTypeID; + appt.Patient = e.Appointment.Patient; + this.Document.CreateAppointment(appt); //CGAppointment a = new CGAppointment(); @@ -3507,25 +3519,34 @@ namespace IndianHealthService.ClinicalScheduling this.Cursor = Cursors.Default; } - LoadingSplash _loadingSplash; // Splash object a data point in class + //private delegate DialogResult dLoadingSplash(IWin32Window owner); + string _tempStatusBartext; /// - /// Loads a splash that says "Loading" + /// Loads a splash that says "Loading" -- removed it april 13 2010 /// private void LoadSplash() { - _loadingSplash = new LoadingSplash(); - _loadingSplash.StartPosition = FormStartPosition.CenterScreen; //XXX: Don't like this, but will do for now. - _loadingSplash.UseWaitCursor = true; // tell user we are working - Thread threadSplash = new Thread(new ThreadStart(() => _loadingSplash.ShowDialog())); // lambda - threadSplash.IsBackground = true; //expendable thread -- exit even if still running. - threadSplash.Name = "Loading Thread"; - threadSplash.Start(); + _tempStatusBartext = this.statusBar1.Text; + this.statusBar1.Text = "Refreshing Schedule..."; + //_loadingSplash = new LoadingSplash(); + //_loadingSplash.StartPosition = FormStartPosition.CenterScreen; //XXX: Don't like this, but will do for now. + //_loadingSplash.UseWaitCursor = true; // tell user we are working + //_loadingSplash.Show(this); + //Thread threadSplash = new Thread(tstart); + //threadSplash.IsBackground = true; + //threadSplash.Name = "Loading Thread"; + //threadSplash.Start(this); + + //Thread threadSplash = new Thread(new ThreadStart(() => _loadingSplash.ShowDialog())); // lambda + //threadSplash.IsBackground = true; //expendable thread -- exit even if still running. + //threadSplash.Name = "Loading Thread"; + //threadSplash.Start(); } private void StopSplash() { - _loadingSplash.RemoteClose(); + this.statusBar1.Text = _tempStatusBartext; } diff --git a/cs/bsdx0200GUISourceCode/CalendarGrid.cs b/cs/bsdx0200GUISourceCode/CalendarGrid.cs index 47c3d68..94c2a23 100644 --- a/cs/bsdx0200GUISourceCode/CalendarGrid.cs +++ b/cs/bsdx0200GUISourceCode/CalendarGrid.cs @@ -8,6 +8,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Windows.Forms; + using System.Linq; /// /// This class is reponsible for rendering the Calendar Grid. @@ -124,24 +125,33 @@ { try { + //calculate each cell's height SizeF ef = g.MeasureString("Test", this.m_fCell); this.m_cellHeight = ((int) ef.Height) + 4; - int nColumns = this.m_nColumns; - int num2 = 60 / this.m_nTimeScale; - int num3 = 24 * num2; - nColumns++; - num3++; - this.m_cellWidth = 600 / nColumns; + + int nColumns = this.m_nColumns; // columns set via property + int slotsPerHour = 60 / this.m_nTimeScale; //time scale set via property + int slotsPerDay = 24 * slotsPerHour; + nColumns++; // add extra column for time display + slotsPerDay++; // not sure here why that's don't + + //calculate each cell's height + this.m_cellWidth = 600 / nColumns; // base size is 600 pixels + // if larger: if (base.ClientRectangle.Width > 600) { this.m_cellWidth = (base.ClientRectangle.Width - this.m_col0Width) / (nColumns - 1); } + // if only one column if (this.m_nColumns == 1) { this.m_cellWidth = base.ClientRectangle.Width - this.m_col0Width; } + //next line seems to be useless (we don't use X and Y below) g.TranslateTransform((float) base.AutoScrollPosition.X, (float) base.AutoScrollPosition.Y); - for (int i = num3; i > -1; i--) + + //now, build the grid cells + for (int i = slotsPerDay; i > -1; i--) { for (int j = 1; j < nColumns; j++) { @@ -232,6 +242,54 @@ } } + void CalendarGrid_DragOver(object sender, DragEventArgs e) + { + //Translate point to client point + Point pt = this.PointToClient(new Point(e.X, e.Y)); + + //clear selections + foreach (DictionaryEntry entry in this.m_gridCells.CellHashTable) + { + CGCell cell = (CGCell)entry.Value; + cell.IsSelected = false; + } + this.m_selectedRange.Cells.ClearAllCells(); + + //select a cell based on current drag position to visually assist the user + int nRow = -1; + int nCol = -1; + if (this.HitTest(pt.X, pt.Y, ref nRow, ref nCol)) + { + CGCell cellFromRowCol = this.m_gridCells.GetCellFromRowCol(nRow, nCol); + if (cellFromRowCol != null) + { + this.m_currentCell = cellFromRowCol; + this.m_selectedRange.StartCell = null; + this.m_selectedRange.EndCell = null; + this.m_selectedRange.CreateRange(this.m_gridCells, cellFromRowCol, cellFromRowCol); + + cellFromRowCol.IsSelected = true; + } + + base.Invalidate(); + } + + //if Y axis is outside the top or bottom + + if ((pt.Y + 40 >= this.ClientRectangle.Bottom) || (pt.Y - 40 <= this.ClientRectangle.Top)) + { + //start auto scrolling. m_bScrollDown decides whether we scroll up or down. + this.m_bScrollDown = (pt.Y + 40) >= this.ClientRectangle.Bottom; + AutoDragStart(); + } + + //if Y axis within client rectagle, stop dragging (whether you started or not) + if ((pt.Y + 40 < this.ClientRectangle.Bottom) && (pt.Y - 40 > this.ClientRectangle.Top)) + { + AutoDragStop(); + } + } + private void CalendarGrid_MouseDown(object sender, MouseEventArgs e) { //watch.Restart(); @@ -246,13 +304,48 @@ this.m_bMouseDown = true; this.OnLButtonDown(e.X, e.Y, true); } + //new code!!! smh 4/13/2011 -- refactor later + + else if (e.Button == MouseButtons.Right) + { + // clear all selected cells, but ONLY if the the pointer is NOT over one of the cells in + // the selected range + + int nRow = -1; + int nCol = -1; + CGCell cellFromRowCol = null; + bool _isCellInRange = false; + if (this.HitTest(e.X, e.Y, ref nRow, ref nCol)) + { + cellFromRowCol = this.m_gridCells.GetCellFromRowCol(nRow, nCol); + } + + if (cellFromRowCol != null) + _isCellInRange = this.m_selectedRange.CellIsInRange(cellFromRowCol); + + if (!_isCellInRange) + { + foreach (DictionaryEntry entry in this.m_gridCells.CellHashTable) + { + CGCell cell = (CGCell)entry.Value; + cell.IsSelected = false; + } + this.m_selectedRange.Cells.ClearAllCells(); + } + + // clear all selected appointments + this.m_SelectedAppointments.ClearAllAppointments(); + foreach (CGAppointment a in this.m_Appointments.AppointmentTable.Values) a.Selected = false; + this.m_nSelectID = 0; + + OnRButtonDown(e.X, e.Y, _isCellInRange); + } + + //end new code!!! /smh 4/13/2011 } private void CalendarGrid_MouseMove(object Sender, MouseEventArgs e) { - //test - //System.Diagnostics.Debug.Write(watch.ElapsedMilliseconds + "\n"); - //test //if the left mouse button is down and we are moving the mouse... if (this.m_bMouseDown) @@ -287,13 +380,14 @@ base.DoDragDrop(data, DragDropEffects.Move); this.m_bDragDropStart = true; } - } + } } else { - //test - AutoDragStop(); //is this needed? - //test + + AutoDragStop(); //is this needed? //just in case maybe + + //this code below displays the tooltip if we are moving the mouse over an appointment int y = e.Y - base.AutoScrollPosition.Y; int x = e.X - base.AutoScrollPosition.X; Point pt = new Point(x, y); @@ -306,29 +400,6 @@ } } this.m_toolTip.RemoveAll(); - - ////smh new code -- select cell - //int nRow = -1; - //int nCol = -1; - - ////Is the mouse over a known cell? If so, highlight cell - //if (this.HitTest(x, y, ref nRow, ref nCol)) - //{ - // CGCell cellFromRowCol = this.m_gridCells.GetCellFromRowCol(nRow, nCol); - // if (cellFromRowCol != null) - // { - // this.m_currentCell = cellFromRowCol; - // this.m_selectedRange.StartCell = null; - // this.m_selectedRange.EndCell = null; - // this.m_selectedRange.CreateRange(this.m_gridCells, cellFromRowCol, cellFromRowCol); - // this.m_bSelectingRange = true; - // cellFromRowCol.IsSelected = true; - // base.Invalidate(this.m_currentCell.CellRectangle); - // //base.Invalidate(); - // } - //} - - } } @@ -514,7 +585,7 @@ // flag is true only if there are no cells what so ever in the screen // Only true when no resource is selected. - bool flag = this.m_gridCells.CellCount == 0; + bool noCellsFlag = this.m_gridCells.CellCount == 0; // Move the base point from the client screen to the scrolling region top-left corner. g.TranslateTransform((float) base.AutoScrollPosition.X, (float) base.AutoScrollPosition.Y); @@ -599,40 +670,45 @@ { num12 = this.m_col0Width; } - if (k > 1) // + if (k > 1) // if we are subsequent columns, adjust accordingly { num12 = this.m_col0Width + (this.m_cellWidth * (k - 1)); } + //make a rectangle for the cell Point point4 = new Point(num12, j * this.m_cellHeight); Rectangle r = new Rectangle(point4.X, point4.Y, this.m_cellWidth, this.m_cellHeight); - if (j != 0) + if (j != 0) // if we are not at the top (we are starting from the bottom) { - CGCell cellFromRowCol = null; - if (flag) + CGCell cellFromRowCol = null; + if (noCellsFlag) //if there are no cells, create the cell { cellFromRowCol = new CGCell(r, j, k); this.m_gridCells.AddCell(cellFromRowCol); } - else + else // otherwise, get the cell from the m_gridCells array { cellFromRowCol = this.m_gridCells.GetCellFromRowCol(j, k); cellFromRowCol.CellRectangle = r; } - if (this.m_sResourcesArray.Count > 0) + if (this.m_sResourcesArray.Count > 0) // if we have any resources open { //IMP //this is the place where we the selected cells are drawn in Light Light Blue. //IMP + // if cell is selected, draw it in Aquamarine (light light blue) if (this.m_selectedRange.CellIsInRange(cellFromRowCol)) { g.FillRectangle(Brushes.Aquamarine, r); //g.FillRectangle(Brushes.AntiqueWhite, r); } + // otherwise, draw it from Appointment Type Color set by BuildGridCellsArray() else { g.FillRectangle(cellFromRowCol.AppointmentTypeColor, r); } + // finally the drawing g.DrawRectangle(pen, r.X, r.Y, r.Width, r.Height); + // once done with availabilities, draw the appointments if (j == 1) { this.DrawAppointments(g, this.m_col0Width, this.m_cellWidth, this.m_cellHeight); @@ -640,6 +716,8 @@ } continue; } + + //Below draws the top column either containing the dates or resources if (!this.m_bScroll) { g.TranslateTransform(0f, (float) -base.AutoScrollPosition.Y); @@ -921,10 +999,12 @@ this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.CalendarGrid_MouseDown); this.MouseUp += new System.Windows.Forms.MouseEventHandler(this.CalendarGrid_MouseUp); this.DragEnter += new System.Windows.Forms.DragEventHandler(this.CalendarGrid_DragEnter); + this.DragOver += new DragEventHandler(CalendarGrid_DragOver); this.ResumeLayout(false); } + private static int MinSince80(DateTime d) { DateTime time = new DateTime(1980, 1, 1, 0, 0, 0); @@ -932,6 +1012,59 @@ return (int) span.TotalMinutes; } + //new code1!! smh 4/14/2011 + private void OnRButtonDown(int X, int Y, bool RangeAlreadySelected) + { + //if right mouse button is clicked, select an appointment if mouse hovers over one + foreach (CGAppointment appointment3 in this.m_Appointments.AppointmentTable.Values) + { + int y = Y - base.AutoScrollPosition.Y; + int x = X - base.AutoScrollPosition.X; + Point pt = new Point(x, y); + + if (!appointment3.GridRectangle.Contains(pt)) + { + continue; + } + this.m_bMouseDown = false; + + this.m_SelectedAppointments.AddAppointment(appointment3); + appointment3.Selected = true; + this.m_nSelectID = appointment3.AppointmentKey; + //this.m_bGridEnter = true; + } + + // if we find an appointment, redraw the grid + if (this.m_SelectedAppointments.AppointmentCount > 0) + { + base.Invalidate(); + return; + } + + // Otherwise, select a cell, but only if we don't don't have an existing range + if (RangeAlreadySelected) return; + + // Ok, select cell here + int nRow = -1; + int nCol = -1; + if (this.HitTest(X, Y, ref nRow, ref nCol)) + { + CGCell cellFromRowCol = this.m_gridCells.GetCellFromRowCol(nRow, nCol); + if (cellFromRowCol != null) + { + this.m_currentCell = cellFromRowCol; + this.m_selectedRange.StartCell = null; + this.m_selectedRange.EndCell = null; + this.m_selectedRange.CreateRange(this.m_gridCells, cellFromRowCol, cellFromRowCol); + + cellFromRowCol.IsSelected = true; + } + + base.Invalidate(); + return; + } + } + private void OnLButtonDown(int X, int Y, bool bStart) { this.m_bDragDropStart = false; @@ -1066,11 +1199,14 @@ { if (this.m_gridCells.CellCount != 0) { + // this happens for the CGAVView Grid foreach (DictionaryEntry entry in this.m_gridCells.CellHashTable) { CGCell cell = (CGCell) entry.Value; cell.AppointmentTypeColor = (this.m_GridBackColor == "blue") ? Brushes.CornflowerBlue : Brushes.Khaki; } + // won't happen for CGAVView Grid b/c it has no availabilites + // BUT, will happen for normal CGView Grid if there any availabilies if ((this.m_pAvArray != null) && (this.m_pAvArray.Count != 0)) { foreach (CGAvailability availability in this.m_pAvArray) @@ -1079,9 +1215,12 @@ int nCol = 0; int num3 = 0; int num4 = 0; + // pick the color from the availability Brush brush = new SolidBrush(Color.FromArgb(availability.Red, availability.Green, availability.Blue)); + // get starting and ending cell this.GetCellFromTime(availability.StartTime, ref nRow, ref nCol, true, availability.ResourceList); this.GetCellFromTime(availability.EndTime, ref num3, ref num4, false, availability.ResourceList); + // for each of the range cells between starting and ending, change their color for (int i = nCol; i <= num4; i++) { for (int j = nRow; (i == num4) && (j <= num3); j++) @@ -1327,12 +1466,15 @@ if ((value > 0) && (value < 11)) { this.m_nColumns = value; - this.m_gridCells.ClearAllCells(); - this.m_selectedRange.Cells.ClearAllCells(); + //new line + this.SetColumnInfo(); // redoes the columns if we have multiple resources + //end new line + this.m_gridCells.ClearAllCells(); //remove all cells + this.m_selectedRange.Cells.ClearAllCells(); //remove selected range Graphics g = base.CreateGraphics(); - this.BuildGridCellsArray(g); - this.SetAppointmentTypes(); - base.Invalidate(); + this.BuildGridCellsArray(g); //rebuild the cells + this.SetAppointmentTypes(); //set the colors on the cells for availabilities + base.Invalidate(); //Fire paint to call DrawGrid } } } diff --git a/cs/bsdx0200GUISourceCode/ClinicalScheduling.csproj.user b/cs/bsdx0200GUISourceCode/ClinicalScheduling.csproj.user index 8da5200..a5c306a 100644 --- a/cs/bsdx0200GUISourceCode/ClinicalScheduling.csproj.user +++ b/cs/bsdx0200GUISourceCode/ClinicalScheduling.csproj.user @@ -36,7 +36,7 @@ Project - /s=172.16.16.108 /p=9250 /a=BASMA.ALDWAIRI /v=SELEN.123 + /s=172.16.16.108 /p=9250 /a=s.habiel /v=catdog.66 C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\IEExec.exe diff --git a/cs/bsdx0200GUISourceCode/ClinicalScheduling.suo b/cs/bsdx0200GUISourceCode/ClinicalScheduling.suo index dee9b1c..fb42e6d 100644 Binary files a/cs/bsdx0200GUISourceCode/ClinicalScheduling.suo and b/cs/bsdx0200GUISourceCode/ClinicalScheduling.suo differ diff --git a/cs/bsdx0200GUISourceCode/DApptSearch.cs b/cs/bsdx0200GUISourceCode/DApptSearch.cs index 1efc231..25be554 100644 --- a/cs/bsdx0200GUISourceCode/DApptSearch.cs +++ b/cs/bsdx0200GUISourceCode/DApptSearch.cs @@ -4,7 +4,6 @@ using System.Collections.Generic; using System.Windows.Forms; using System.Data; using System.Linq; -//using System.Data.OleDb; namespace IndianHealthService.ClinicalScheduling { @@ -113,7 +112,7 @@ namespace IndianHealthService.ClinicalScheduling public void InitializePage(ArrayList alResources, CGDocumentManager docManager) { - this.Text = "Searching for Appointments in: " + string.Join(" | ", alResources.Cast()); + this.Text = "Searching for available slots in: " + string.Join(" | ", alResources.Cast()); this.m_DocManager = docManager; this.m_dsGlobal = m_DocManager.GlobalDataSet; @@ -274,6 +273,7 @@ namespace IndianHealthService.ClinicalScheduling private void InitializeComponent() { this.panel1 = new System.Windows.Forms.Panel(); + this.lblMessage = new System.Windows.Forms.Label(); this.cmdSearch = new System.Windows.Forms.Button(); this.cmdCancel = new System.Windows.Forms.Button(); this.btnAccept = new System.Windows.Forms.Button(); @@ -312,7 +312,6 @@ namespace IndianHealthService.ClinicalScheduling this.colResource = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.colSlots = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.colAccessType = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.lblMessage = new System.Windows.Forms.Label(); this.panel1.SuspendLayout(); this.pnlDescription.SuspendLayout(); this.grpDescription.SuspendLayout(); @@ -334,6 +333,16 @@ namespace IndianHealthService.ClinicalScheduling this.panel1.Size = new System.Drawing.Size(923, 40); this.panel1.TabIndex = 4; // + // lblMessage + // + this.lblMessage.AutoSize = true; + this.lblMessage.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lblMessage.ForeColor = System.Drawing.Color.Red; + this.lblMessage.Location = new System.Drawing.Point(337, 16); + this.lblMessage.Name = "lblMessage"; + this.lblMessage.Size = new System.Drawing.Size(0, 16); + this.lblMessage.TabIndex = 3; + // // cmdSearch // this.cmdSearch.Location = new System.Drawing.Point(33, 6); @@ -389,9 +398,9 @@ namespace IndianHealthService.ClinicalScheduling this.lblDescription.Name = "lblDescription"; this.lblDescription.Size = new System.Drawing.Size(917, 45); this.lblDescription.TabIndex = 1; - this.lblDescription.Text = "Search for available appointment times using this panel. You may narrow your sea" + - "rch by selecting an access type or by selecting specific days of the week or tim" + - "es of day."; + this.lblDescription.Text = "Search for available slots times using this panel. You may narrow your search by" + + " selecting an access type or by selecting specific days of the week or times of " + + "day."; // // groupBox1 // @@ -676,16 +685,6 @@ namespace IndianHealthService.ClinicalScheduling this.colAccessType.Text = "Access Type"; this.colAccessType.Width = 101; // - // lblMessage - // - this.lblMessage.AutoSize = true; - this.lblMessage.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblMessage.ForeColor = System.Drawing.Color.Red; - this.lblMessage.Location = new System.Drawing.Point(337, 16); - this.lblMessage.Name = "lblMessage"; - this.lblMessage.Size = new System.Drawing.Size(0, 16); - this.lblMessage.TabIndex = 3; - // // DApptSearch // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); @@ -898,7 +897,7 @@ namespace IndianHealthService.ClinicalScheduling lstResults.Items.Clear(); //empty it from old data if (items.Length > 0) lstResults.Items.AddRange(items); // add new data - else this.lblMessage.Text = "No available Appointment Slots Found!"; + else this.lblMessage.Text = "No available slots found!"; lstResults.EndUpdate(); // ok done adding items, draw now. //--End Update Listview @@ -943,11 +942,11 @@ namespace IndianHealthService.ClinicalScheduling if (lstResults.SelectedIndices.Count == 0) { this.DialogResult = DialogResult.None; - lblMessage.Text = "No Appointment Slot selected!"; + lblMessage.Text = "No slot selected!"; return; } - long availabilityKey = long.Parse(lstResults.SelectedItems[0].SubItems[0].Text); + int availabilityKey = Int32.Parse(lstResults.SelectedItems[0].SubItems[0].Text); _selectedAvailability = (from av in lstResultantAvailabilities where av.AvailabilityType == availabilityKey select av).Single(); diff --git a/cs/bsdx0200GUISourceCode/DSplash.cs b/cs/bsdx0200GUISourceCode/DSplash.cs index 05616f0..d624e56 100644 --- a/cs/bsdx0200GUISourceCode/DSplash.cs +++ b/cs/bsdx0200GUISourceCode/DSplash.cs @@ -7,7 +7,10 @@ using System.Windows.Forms; namespace IndianHealthService.ClinicalScheduling { /// - /// Summary description for DSplash. + /// Program loading splash screen. Notice the numerous remote methods intended + /// to mickey mouse the form from another thread. + /// + /// I don't know of a better way of doing this right now. /// public class DSplash : System.Windows.Forms.Form { @@ -146,6 +149,8 @@ namespace IndianHealthService.ClinicalScheduling public delegate void dSetStatus(string sStatus); public delegate void dAny(); public delegate void dProgressBarSet(int number); + public delegate DialogResult dMessageBox(IWin32Window owner, string message); + public delegate DialogResult dMessageBox2(IWin32Window owner, string message, string caption, MessageBoxButtons btns); public void SetStatus(string sStatus) { @@ -164,12 +169,36 @@ namespace IndianHealthService.ClinicalScheduling this.lblVersion.Text = "Version " + Application.ProductVersion; } + public DialogResult RemoteMsgBox(string msg) + { + dMessageBox d = new dMessageBox(MessageBox.Show); + return (DialogResult)this.Invoke(d, this, msg); + } + + public DialogResult RemoteMsgBox(string msg, string caption, MessageBoxButtons btns) + { + dMessageBox2 d = new dMessageBox2(MessageBox.Show); + return (DialogResult)this.Invoke(d, this, msg, caption, btns); + } + public void RemoteClose() { dAny d = new dAny(this.Close); this.Invoke(d); } + public void RemoteActivate() + { + dAny d = new dAny(this.Activate); + this.Invoke(d); + } + + public void RemoteHide() + { + dAny d = new dAny(this.Hide); + this.Invoke(d); + } + public void RemoteProgressBarMaxSet(int max) { if (this.InvokeRequired == true) diff --git a/cs/bsdx0200GUISourceCode/bin/Release/BMXNet23.dll b/cs/bsdx0200GUISourceCode/bin/Release/BMXNet23.dll index 04331cd..ea8bcda 100644 Binary files a/cs/bsdx0200GUISourceCode/bin/Release/BMXNet23.dll and b/cs/bsdx0200GUISourceCode/bin/Release/BMXNet23.dll differ diff --git a/cs/bsdx0200GUISourceCode/bin/Release/ClinicalScheduling.exe b/cs/bsdx0200GUISourceCode/bin/Release/ClinicalScheduling.exe index c46b8de..78dd826 100644 Binary files a/cs/bsdx0200GUISourceCode/bin/Release/ClinicalScheduling.exe and b/cs/bsdx0200GUISourceCode/bin/Release/ClinicalScheduling.exe differ diff --git a/cs/bsdx0200GUISourceCode/bin/Release/ar/ClinicalScheduling.resources.dll b/cs/bsdx0200GUISourceCode/bin/Release/ar/ClinicalScheduling.resources.dll index 356675b..c45c204 100644 Binary files a/cs/bsdx0200GUISourceCode/bin/Release/ar/ClinicalScheduling.resources.dll and b/cs/bsdx0200GUISourceCode/bin/Release/ar/ClinicalScheduling.resources.dll differ