Changeset 1143 for Scheduling/trunk


Ignore:
Timestamp:
Apr 14, 2011, 8:33:14 AM (13 years ago)
Author:
Sam Habiel
Message:

CalendarGrid: Many changes:

  1. Dragover handler to handle auto scrolling when dragging. Also highlights destination cell in dragging.
  2. Solution for the click-right click problem by better handling of right click issues.
  3. New method OnRButtonDown()
  4. Extra comments everywhere.
  5. Fix for single column being enabled when there are multiple resources. Columns property now calls this.SetColumnInfo() to rectify that problem.

CGDocument:

  1. EditAppoitment Used to send request a refresh from the DB and update the view itself, rather than letting the view handle that. That's now changed.

CGDocumentManager:

  1. MessageBox displayed during login splash now are shown BY the splash form.

CGView:

  1. Shortcuts and some display text updated.
  2. Splash screen when updating now removed.
  3. If print appointment slip checkbox is checked when EditAppointment is chosen, now it will print the routing slip.
  4. Tiny change in appointment structure generated during drag and drop (added Patient member, as it was causing a crash)

DApptSearch:

  1. Change of name of Appointment to Slot, for better user understanding.

DSplash:

  1. RemoteMessage box methods and associated delegates for mickey mousing the form from another thread.

Updated release exes and dlls

Location:
Scheduling/trunk/cs/bsdx0200GUISourceCode
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/CGDocument.cs

    r1128 r1143  
    10161016                if (sErrorID == "-1")
    10171017                    pAppt.Note = sNote;
    1018 
    1019                 if (this.m_appointments.AppointmentTable.ContainsKey(nApptID))
    1020                 {
    1021                     bool bRet = RefreshAvailabilitySchedule();
    1022                     UpdateAllViews();
    1023                 }
    10241018            }
    10251019            catch (Exception ex)
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/CGDocumentManager.cs

    r1131 r1143  
    400400                catch (System.Net.Sockets.SocketException)
    401401                {
    402                     MessageBox.Show("Cannot connect to VistA. Network Error");
     402                    m_ds.RemoteMsgBox("Can't connect to server! Network Error");
    403403                    return false;
    404404                }
     
    438438                catch (System.Net.Sockets.SocketException)
    439439                {
    440                     MessageBox.Show("Cannot connect to VistA. Network Error");
     440                    m_ds.RemoteMsgBox("Cannot connect to VistA. Network Error");
    441441                }
    442442                catch (BMXNetException ex)
    443443                {
    444                     if (MessageBox.Show("Unable to connect to VistA.  " + ex.Message, "Clinical Scheduling", MessageBoxButtons.RetryCancel) == DialogResult.Retry)
     444                    if (m_ds.RemoteMsgBox("Unable to connect to VistA.  " + ex.Message, "Clinical Scheduling", MessageBoxButtons.RetryCancel) == DialogResult.Retry)
    445445                    {
    446446                        bRetry = true;
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/CGView.cs

    r1131 r1143  
    428428            //
    429429            this.mnuNewAppointment.Index = 0;
     430            this.mnuNewAppointment.Shortcut = System.Windows.Forms.Shortcut.Ins;
    430431            this.mnuNewAppointment.Text = "&New Appointment";
    431432            this.mnuNewAppointment.Click += new System.EventHandler(this.mnuNewAppointment_Click);
     
    434435            //
    435436            this.mnuEditAppointment.Index = 1;
     437            this.mnuEditAppointment.Shortcut = System.Windows.Forms.Shortcut.F2;
    436438            this.mnuEditAppointment.Text = "&Edit Appointment";
    437439            this.mnuEditAppointment.Click += new System.EventHandler(this.mnuEditAppointment_Click);
     
    440442            //
    441443            this.mnuDeleteAppointment.Index = 2;
     444            this.mnuDeleteAppointment.Shortcut = System.Windows.Forms.Shortcut.Del;
    442445            this.mnuDeleteAppointment.Text = "Cance&l Appointment";
    443446            this.mnuDeleteAppointment.Click += new System.EventHandler(this.mnuDeleteAppointment_Click);
     
    481484            this.mnuFindAppt.Index = 9;
    482485            this.mnuFindAppt.Shortcut = System.Windows.Forms.Shortcut.CtrlF;
    483             this.mnuFindAppt.Text = "&Find Available Appointment";
     486            this.mnuFindAppt.Text = "&Find Empty Slots";
    484487            this.mnuFindAppt.Click += new System.EventHandler(this.mnuFindAppt_Click);
    485488            //
     
    647650            this.tvSchedules.Location = new System.Drawing.Point(0, 0);
    648651            this.tvSchedules.Name = "tvSchedules";
    649             this.tvSchedules.Size = new System.Drawing.Size(128, 359);
     652            this.tvSchedules.Size = new System.Drawing.Size(128, 317);
    650653            this.tvSchedules.Sorted = true;
    651654            this.tvSchedules.TabIndex = 1;
     
    689692            //
    690693            this.ctxFindAppt.Index = 3;
    691             this.ctxFindAppt.Text = "&Find Available Appointment";
     694            this.ctxFindAppt.Text = "&Find Empty Slots";
    692695            this.ctxFindAppt.Click += new System.EventHandler(this.ctxFindAppt_Click);
    693696            //
     
    716719            this.panelRight.Location = new System.Drawing.Point(996, 0);
    717720            this.panelRight.Name = "panelRight";
    718             this.panelRight.Size = new System.Drawing.Size(128, 359);
     721            this.panelRight.Size = new System.Drawing.Size(128, 317);
    719722            this.panelRight.TabIndex = 3;
    720723            this.panelRight.Visible = false;
     
    812815            this.panelCenter.Location = new System.Drawing.Point(136, 24);
    813816            this.panelCenter.Name = "panelCenter";
    814             this.panelCenter.Size = new System.Drawing.Size(857, 311);
     817            this.panelCenter.Size = new System.Drawing.Size(857, 269);
    815818            this.panelCenter.TabIndex = 7;
    816819            //
     
    905908            this.panelBottom.Controls.Add(this.statusBar1);
    906909            this.panelBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
    907             this.panelBottom.Location = new System.Drawing.Point(136, 335);
     910            this.panelBottom.Location = new System.Drawing.Point(136, 293);
    908911            this.panelBottom.Name = "panelBottom";
    909912            this.panelBottom.Size = new System.Drawing.Size(857, 24);
     
    923926            this.splitter1.Location = new System.Drawing.Point(128, 24);
    924927            this.splitter1.Name = "splitter1";
    925             this.splitter1.Size = new System.Drawing.Size(8, 335);
     928            this.splitter1.Size = new System.Drawing.Size(8, 293);
    926929            this.splitter1.TabIndex = 9;
    927930            this.splitter1.TabStop = false;
     
    932935            this.splitter2.Location = new System.Drawing.Point(993, 24);
    933936            this.splitter2.Name = "splitter2";
    934             this.splitter2.Size = new System.Drawing.Size(3, 335);
     937            this.splitter2.Size = new System.Drawing.Size(3, 293);
    935938            this.splitter2.TabIndex = 10;
    936939            this.splitter2.TabStop = false;
     
    955958            this.calendarGrid1.Resources = ((System.Collections.ArrayList)(resources.GetObject("calendarGrid1.Resources")));
    956959            this.calendarGrid1.SelectedAppointment = 0;
    957             this.calendarGrid1.Size = new System.Drawing.Size(857, 311);
     960            this.calendarGrid1.Size = new System.Drawing.Size(857, 269);
    958961            this.calendarGrid1.StartDate = new System.DateTime(2003, 1, 27, 0, 0, 0, 0);
    959962            this.calendarGrid1.TabIndex = 0;
     
    968971            //
    969972            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
    970             this.ClientSize = new System.Drawing.Size(1124, 359);
     973            this.ClientSize = new System.Drawing.Size(1124, 317);
    971974            this.Controls.Add(this.panelCenter);
    972975            this.Controls.Add(this.panelBottom);
     
    18171820                                this.Document.EditAppointment(a, sNote);
    18181821
     1822                if (dAppt.PrintAppointmentSlip)
     1823                {
     1824                    PrintAppointmentSlip(a);
     1825                }
     1826
     1827                //Redraw appointments
     1828                this.UpdateArrays();
     1829
     1830                //Then tell RPMS that we are updated
     1831                RaiseRPMSEvent("BSDX SCHEDULE", a.Resource);
    18191832                        }
    18201833                        catch (Exception ex)
     
    26842697                        this.calendarGrid1.Columns = 5;
    26852698            this.Document.m_nColumnCount = 5; // MJL 1/17/2007
    2686             //this.Document.UpdateAllViews();
    2687             //TODO: Is there a way to just reuse the existing arrays? How far in the future do they go?
    26882699            RequestRefreshGrid();
    26892700                }
     
    26932704                        this.calendarGrid1.Columns = 7;
    26942705            this.Document.m_nColumnCount = 7; // MJL 1/17/2007
    2695             //TODO: Is there a way to just reuse the existing arrays? How far in the future do they go?
    26962706            RequestRefreshGrid();
    26972707        }
     
    29532963                appt.HealthRecordNumber = e.Appointment.HealthRecordNumber;
    29542964                appt.AccessTypeID = e.AccessTypeID;
     2965                appt.Patient = e.Appointment.Patient;
     2966
    29552967                this.Document.CreateAppointment(appt);
    29562968
     
    35083520        }
    35093521
    3510         LoadingSplash _loadingSplash; // Splash object a data point in class
     3522        //private delegate DialogResult dLoadingSplash(IWin32Window owner);
     3523        string _tempStatusBartext;
    35113524
    35123525        /// <summary>
    3513         /// Loads a splash that says "Loading"
     3526        /// Loads a splash that says "Loading" -- removed it april 13 2010
    35143527        /// </summary>
    35153528        private void LoadSplash()
    35163529        {
    3517             _loadingSplash = new LoadingSplash();
    3518             _loadingSplash.StartPosition = FormStartPosition.CenterScreen;  //XXX: Don't like this, but will do for now.
    3519             _loadingSplash.UseWaitCursor = true;    // tell user we are working
    3520             Thread threadSplash = new Thread(new ThreadStart(() => _loadingSplash.ShowDialog())); // lambda
    3521             threadSplash.IsBackground = true; //expendable thread -- exit even if still running.
    3522             threadSplash.Name = "Loading Thread";
    3523             threadSplash.Start();
     3530            _tempStatusBartext = this.statusBar1.Text;
     3531            this.statusBar1.Text = "Refreshing Schedule...";
     3532            //_loadingSplash = new LoadingSplash();
     3533            //_loadingSplash.StartPosition = FormStartPosition.CenterScreen;  //XXX: Don't like this, but will do for now.
     3534            //_loadingSplash.UseWaitCursor = true;    // tell user we are working
     3535            //_loadingSplash.Show(this);
     3536            //Thread threadSplash = new Thread(tstart);
     3537            //threadSplash.IsBackground = true;
     3538            //threadSplash.Name = "Loading Thread";
     3539            //threadSplash.Start(this);
     3540
     3541            //Thread threadSplash = new Thread(new ThreadStart(() => _loadingSplash.ShowDialog())); // lambda
     3542            //threadSplash.IsBackground = true; //expendable thread -- exit even if still running.
     3543            //threadSplash.Name = "Loading Thread";
     3544            //threadSplash.Start();
    35243545        }
    35253546
    35263547        private void StopSplash()
    35273548        {
    3528             _loadingSplash.RemoteClose();
     3549            this.statusBar1.Text = _tempStatusBartext;
    35293550        }
    35303551
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/CalendarGrid.cs

    r1123 r1143  
    99    using System.Runtime.InteropServices;
    1010    using System.Windows.Forms;
     11    using System.Linq;
    1112
    1213    /// <summary>
     
    125126            try
    126127            {
     128                //calculate each cell's height
    127129                SizeF ef = g.MeasureString("Test", this.m_fCell);
    128130                this.m_cellHeight = ((int) ef.Height) + 4;
    129                 int nColumns = this.m_nColumns;
    130                 int num2 = 60 / this.m_nTimeScale;
    131                 int num3 = 24 * num2;
    132                 nColumns++;
    133                 num3++;
    134                 this.m_cellWidth = 600 / nColumns;
     131
     132                int nColumns = this.m_nColumns; // columns set via property
     133                int slotsPerHour = 60 / this.m_nTimeScale; //time scale set via property
     134                int slotsPerDay = 24 * slotsPerHour;
     135                nColumns++; // add extra column for time display
     136                slotsPerDay++; // not sure here why that's don't
     137
     138                //calculate each cell's height
     139                this.m_cellWidth = 600 / nColumns; // base size is 600 pixels
     140                // if larger:
    135141                if (base.ClientRectangle.Width > 600)
    136142                {
    137143                    this.m_cellWidth = (base.ClientRectangle.Width - this.m_col0Width) / (nColumns - 1);
    138144                }
     145                // if only one column
    139146                if (this.m_nColumns == 1)
    140147                {
    141148                    this.m_cellWidth = base.ClientRectangle.Width - this.m_col0Width;
    142149                }
     150                //next line seems to be useless (we don't use X and Y below)
    143151                g.TranslateTransform((float) base.AutoScrollPosition.X, (float) base.AutoScrollPosition.Y);
    144                 for (int i = num3; i > -1; i--)
     152               
     153                //now, build the grid cells
     154                for (int i = slotsPerDay; i > -1; i--)
    145155                {
    146156                    for (int j = 1; j < nColumns; j++)
     
    233243        }
    234244
     245        void CalendarGrid_DragOver(object sender, DragEventArgs e)
     246        {
     247            //Translate point to client point
     248            Point pt = this.PointToClient(new Point(e.X, e.Y));
     249           
     250            //clear selections
     251            foreach (DictionaryEntry entry in this.m_gridCells.CellHashTable)
     252            {
     253                CGCell cell = (CGCell)entry.Value;
     254                cell.IsSelected = false;
     255            }
     256            this.m_selectedRange.Cells.ClearAllCells();
     257
     258            //select a cell based on current drag position to visually assist the user
     259            int nRow = -1;
     260            int nCol = -1;
     261            if (this.HitTest(pt.X, pt.Y, ref nRow, ref nCol))
     262            {
     263                CGCell cellFromRowCol = this.m_gridCells.GetCellFromRowCol(nRow, nCol);
     264                if (cellFromRowCol != null)
     265                {
     266                    this.m_currentCell = cellFromRowCol;
     267                    this.m_selectedRange.StartCell = null;
     268                    this.m_selectedRange.EndCell = null;
     269                    this.m_selectedRange.CreateRange(this.m_gridCells, cellFromRowCol, cellFromRowCol);
     270
     271                    cellFromRowCol.IsSelected = true;
     272                }
     273
     274                base.Invalidate();
     275            }
     276
     277            //if Y axis is outside the top or bottom
     278
     279            if ((pt.Y + 40 >= this.ClientRectangle.Bottom) || (pt.Y - 40 <= this.ClientRectangle.Top))
     280            {
     281                //start auto scrolling. m_bScrollDown decides whether we scroll up or down.
     282                this.m_bScrollDown = (pt.Y + 40) >= this.ClientRectangle.Bottom;
     283                AutoDragStart();
     284            }
     285
     286            //if Y axis within client rectagle, stop dragging (whether you started or not)
     287            if ((pt.Y + 40 < this.ClientRectangle.Bottom) && (pt.Y - 40 > this.ClientRectangle.Top))
     288            {
     289                AutoDragStop();
     290            }
     291        }
     292
    235293        private void CalendarGrid_MouseDown(object sender, MouseEventArgs e)
    236294        {
     
    247305                this.OnLButtonDown(e.X, e.Y, true);
    248306            }
     307            //new code!!! smh 4/13/2011 -- refactor later
     308           
     309            else if (e.Button == MouseButtons.Right)
     310            {
     311                // clear all selected cells, but ONLY if the the pointer is NOT over one of the cells in
     312                // the selected range
     313
     314                int nRow = -1;
     315                int nCol = -1;
     316                CGCell cellFromRowCol = null;
     317                bool _isCellInRange = false;
     318                if (this.HitTest(e.X, e.Y, ref nRow, ref nCol))
     319                {
     320                    cellFromRowCol = this.m_gridCells.GetCellFromRowCol(nRow, nCol);
     321                }
     322
     323                if (cellFromRowCol != null)
     324                    _isCellInRange = this.m_selectedRange.CellIsInRange(cellFromRowCol);
     325
     326                if (!_isCellInRange)
     327                {
     328                    foreach (DictionaryEntry entry in this.m_gridCells.CellHashTable)
     329                    {
     330                        CGCell cell = (CGCell)entry.Value;
     331                        cell.IsSelected = false;
     332                    }
     333                    this.m_selectedRange.Cells.ClearAllCells();
     334                }
     335
     336                // clear all selected appointments
     337                this.m_SelectedAppointments.ClearAllAppointments();
     338                foreach (CGAppointment a in this.m_Appointments.AppointmentTable.Values) a.Selected = false;
     339                this.m_nSelectID = 0;
     340
     341                OnRButtonDown(e.X, e.Y, _isCellInRange);
     342            }
     343             
     344            //end new code!!! /smh 4/13/2011
    249345        }
    250346
    251347        private void CalendarGrid_MouseMove(object Sender, MouseEventArgs e)
    252348        {
    253             //test
    254             //System.Diagnostics.Debug.Write(watch.ElapsedMilliseconds + "\n");
    255             //test
    256349
    257350            //if the left mouse button is down and we are moving the mouse...
     
    288381                        this.m_bDragDropStart = true;
    289382                    }
    290                 }
     383               }
    291384            }
    292385            else
    293386            {
    294                 //test
    295                 AutoDragStop(); //is this needed?
    296                 //test
     387           
     388                AutoDragStop(); //is this needed?  //just in case maybe
     389
     390                //this code below displays the tooltip if we are moving the mouse over an appointment
    297391                int y = e.Y - base.AutoScrollPosition.Y;
    298392                int x = e.X - base.AutoScrollPosition.X;
     
    307401                }
    308402                this.m_toolTip.RemoveAll();
    309 
    310                 ////smh new code -- select cell
    311                 //int nRow = -1;
    312                 //int nCol = -1;
    313 
    314                 ////Is the mouse over a known cell? If so, highlight cell
    315                 //if (this.HitTest(x, y, ref nRow, ref nCol))
    316                 //{
    317                 //    CGCell cellFromRowCol = this.m_gridCells.GetCellFromRowCol(nRow, nCol);
    318                 //    if (cellFromRowCol != null)
    319                 //    {
    320                 //        this.m_currentCell = cellFromRowCol;
    321                 //        this.m_selectedRange.StartCell = null;
    322                 //        this.m_selectedRange.EndCell = null;
    323                 //        this.m_selectedRange.CreateRange(this.m_gridCells, cellFromRowCol, cellFromRowCol);
    324                 //        this.m_bSelectingRange = true;
    325                 //        cellFromRowCol.IsSelected = true;
    326                 //        base.Invalidate(this.m_currentCell.CellRectangle);
    327                 //        //base.Invalidate();
    328                 //    }
    329                 //}
    330 
    331 
    332403            }
    333404        }
     
    515586            // flag is true only if there are no cells what so ever in the screen
    516587            // Only true when no resource is selected.
    517             bool flag = this.m_gridCells.CellCount == 0;
     588            bool noCellsFlag = this.m_gridCells.CellCount == 0;
    518589
    519590            // Move the base point from the client screen to the scrolling region top-left corner.
     
    600671                        num12 = this.m_col0Width;
    601672                    }
    602                     if (k > 1)      //
     673                    if (k > 1)      // if we are subsequent columns, adjust accordingly
    603674                    {
    604675                        num12 = this.m_col0Width + (this.m_cellWidth * (k - 1));
    605676                    }
     677                    //make a rectangle for the cell
    606678                    Point point4 = new Point(num12, j * this.m_cellHeight);
    607679                    Rectangle r = new Rectangle(point4.X, point4.Y, this.m_cellWidth, this.m_cellHeight);
    608                     if (j != 0)
    609                     {
    610                         CGCell cellFromRowCol = null;
    611                         if (flag)
     680                    if (j != 0) // if we are not at the top (we are starting from the bottom)
     681                    {
     682                        CGCell cellFromRowCol = null; 
     683                        if (noCellsFlag)  //if there are no cells, create the cell
    612684                        {
    613685                            cellFromRowCol = new CGCell(r, j, k);
    614686                            this.m_gridCells.AddCell(cellFromRowCol);
    615687                        }
    616                         else
     688                        else // otherwise, get the cell from the m_gridCells array
    617689                        {
    618690                            cellFromRowCol = this.m_gridCells.GetCellFromRowCol(j, k);
    619691                            cellFromRowCol.CellRectangle = r;
    620692                        }
    621                         if (this.m_sResourcesArray.Count > 0)
     693                        if (this.m_sResourcesArray.Count > 0) // if we have any resources open
    622694                        {
    623695                            //IMP
    624696                            //this is the place where we the selected cells are drawn in Light Light Blue.
    625697                            //IMP
     698                            // if cell is selected, draw it in Aquamarine (light light blue)
    626699                            if (this.m_selectedRange.CellIsInRange(cellFromRowCol))
    627700                            {
     
    629702                                //g.FillRectangle(Brushes.AntiqueWhite, r);
    630703                            }
     704                            // otherwise, draw it from Appointment Type Color set by BuildGridCellsArray()
    631705                            else
    632706                            {
    633707                                g.FillRectangle(cellFromRowCol.AppointmentTypeColor, r);
    634708                            }
     709                            // finally the drawing
    635710                            g.DrawRectangle(pen, r.X, r.Y, r.Width, r.Height);
     711                            // once done with availabilities, draw the appointments
    636712                            if (j == 1)
    637713                            {
     
    641717                        continue;
    642718                    }
     719                   
     720                    //Below draws the top column either containing the dates or resources
    643721                    if (!this.m_bScroll)
    644722                    {
     
    9221000            this.MouseUp += new System.Windows.Forms.MouseEventHandler(this.CalendarGrid_MouseUp);
    9231001            this.DragEnter += new System.Windows.Forms.DragEventHandler(this.CalendarGrid_DragEnter);
     1002            this.DragOver += new DragEventHandler(CalendarGrid_DragOver);
    9241003            this.ResumeLayout(false);
    9251004
    9261005        }
    9271006
     1007 
    9281008        private static int MinSince80(DateTime d)
    9291009        {
     
    9311011            TimeSpan span = (TimeSpan) (d - time);
    9321012            return (int) span.TotalMinutes;
     1013        }
     1014
     1015        //new code1!! smh 4/14/2011
     1016        private void OnRButtonDown(int X, int Y, bool RangeAlreadySelected)
     1017        {
     1018            //if right mouse button is clicked, select an appointment if mouse hovers over one
     1019            foreach (CGAppointment appointment3 in this.m_Appointments.AppointmentTable.Values)
     1020            {
     1021                int y = Y - base.AutoScrollPosition.Y;
     1022                int x = X - base.AutoScrollPosition.X;
     1023                Point pt = new Point(x, y);
     1024
     1025                if (!appointment3.GridRectangle.Contains(pt))
     1026                {
     1027                    continue;
     1028                }
     1029                this.m_bMouseDown = false;
     1030
     1031                this.m_SelectedAppointments.AddAppointment(appointment3);
     1032                appointment3.Selected = true;
     1033                this.m_nSelectID = appointment3.AppointmentKey;
     1034                //this.m_bGridEnter = true;
     1035            }
     1036
     1037            // if we find an appointment, redraw the grid
     1038            if (this.m_SelectedAppointments.AppointmentCount > 0)
     1039            {
     1040                base.Invalidate();
     1041                return;
     1042            }
     1043
     1044            // Otherwise, select a cell, but only if we don't don't have an existing range
     1045            if (RangeAlreadySelected) return;
     1046
     1047            // Ok, select cell here
     1048            int nRow = -1;
     1049            int nCol = -1;
     1050            if (this.HitTest(X, Y, ref nRow, ref nCol))
     1051            {
     1052                CGCell cellFromRowCol = this.m_gridCells.GetCellFromRowCol(nRow, nCol);
     1053                if (cellFromRowCol != null)
     1054                {
     1055                    this.m_currentCell = cellFromRowCol;
     1056                    this.m_selectedRange.StartCell = null;
     1057                    this.m_selectedRange.EndCell = null;
     1058                    this.m_selectedRange.CreateRange(this.m_gridCells, cellFromRowCol, cellFromRowCol);
     1059
     1060                    cellFromRowCol.IsSelected = true;
     1061                }
     1062
     1063                base.Invalidate();
     1064                return;
     1065            }
    9331066        }
    9341067
     
    10671200            if (this.m_gridCells.CellCount != 0)
    10681201            {
     1202                // this happens for the CGAVView Grid
    10691203                foreach (DictionaryEntry entry in this.m_gridCells.CellHashTable)
    10701204                {
     
    10721206                    cell.AppointmentTypeColor = (this.m_GridBackColor == "blue") ? Brushes.CornflowerBlue : Brushes.Khaki;
    10731207                }
     1208                // won't happen for CGAVView Grid b/c it has no availabilites
     1209                // BUT, will happen for normal CGView Grid if there any availabilies
    10741210                if ((this.m_pAvArray != null) && (this.m_pAvArray.Count != 0))
    10751211                {
     
    10801216                        int num3 = 0;
    10811217                        int num4 = 0;
     1218                        // pick the color from the availability
    10821219                        Brush brush = new SolidBrush(Color.FromArgb(availability.Red, availability.Green, availability.Blue));
     1220                        // get starting and ending cell
    10831221                        this.GetCellFromTime(availability.StartTime, ref nRow, ref nCol, true, availability.ResourceList);
    10841222                        this.GetCellFromTime(availability.EndTime, ref num3, ref num4, false, availability.ResourceList);
     1223                        // for each of the range cells between starting and ending, change their color
    10851224                        for (int i = nCol; i <= num4; i++)
    10861225                        {
     
    13281467                {
    13291468                    this.m_nColumns = value;
    1330                     this.m_gridCells.ClearAllCells();
    1331                     this.m_selectedRange.Cells.ClearAllCells();
     1469                    //new line
     1470                    this.SetColumnInfo();  // redoes the columns if we have multiple resources
     1471                    //end new line
     1472                    this.m_gridCells.ClearAllCells();               //remove all cells
     1473                    this.m_selectedRange.Cells.ClearAllCells();     //remove selected range
    13321474                    Graphics g = base.CreateGraphics();
    1333                     this.BuildGridCellsArray(g);
    1334                     this.SetAppointmentTypes();
    1335                     base.Invalidate();
     1475                    this.BuildGridCellsArray(g);                    //rebuild the cells
     1476                    this.SetAppointmentTypes();                     //set the colors on the cells for availabilities
     1477                    base.Invalidate();                              //Fire paint to call DrawGrid
    13361478                }
    13371479            }
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/ClinicalScheduling.csproj.user

    r1131 r1143  
    3737    </RemoteDebugMachine>
    3838    <StartAction>Project</StartAction>
    39     <StartArguments>/s=172.16.16.108 /p=9250 /a=BASMA.ALDWAIRI /v=SELEN.123</StartArguments>
     39    <StartArguments>/s=172.16.16.108 /p=9250 /a=s.habiel /v=catdog.66</StartArguments>
    4040    <StartPage>
    4141    </StartPage>
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/DApptSearch.cs

    r1123 r1143  
    55using System.Data;
    66using System.Linq;
    7 //using System.Data.OleDb;
    87
    98namespace IndianHealthService.ClinicalScheduling
     
    114113                {
    115114
    116             this.Text = "Searching for Appointments in: " + string.Join(" | ", alResources.Cast<string>());
     115            this.Text = "Searching for available slots in: " + string.Join(" | ", alResources.Cast<string>());
    117116           
    118117            this.m_DocManager = docManager;
     
    275274                {
    276275            this.panel1 = new System.Windows.Forms.Panel();
     276            this.lblMessage = new System.Windows.Forms.Label();
    277277            this.cmdSearch = new System.Windows.Forms.Button();
    278278            this.cmdCancel = new System.Windows.Forms.Button();
     
    313313            this.colSlots = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
    314314            this.colAccessType = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
    315             this.lblMessage = new System.Windows.Forms.Label();
    316315            this.panel1.SuspendLayout();
    317316            this.pnlDescription.SuspendLayout();
     
    335334            this.panel1.TabIndex = 4;
    336335            //
     336            // lblMessage
     337            //
     338            this.lblMessage.AutoSize = true;
     339            this.lblMessage.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     340            this.lblMessage.ForeColor = System.Drawing.Color.Red;
     341            this.lblMessage.Location = new System.Drawing.Point(337, 16);
     342            this.lblMessage.Name = "lblMessage";
     343            this.lblMessage.Size = new System.Drawing.Size(0, 16);
     344            this.lblMessage.TabIndex = 3;
     345            //
    337346            // cmdSearch
    338347            //
     
    390399            this.lblDescription.Size = new System.Drawing.Size(917, 45);
    391400            this.lblDescription.TabIndex = 1;
    392             this.lblDescription.Text = "Search for available appointment times using this panel.  You may narrow your sea" +
    393                 "rch by selecting an access type or by selecting specific days of the week or tim" +
    394                 "es of day.";
     401            this.lblDescription.Text = "Search for available slots times using this panel.  You may narrow your search by" +
     402                " selecting an access type or by selecting specific days of the week or times of " +
     403                "day.";
    395404            //
    396405            // groupBox1
     
    676685            this.colAccessType.Text = "Access Type";
    677686            this.colAccessType.Width = 101;
    678             //
    679             // lblMessage
    680             //
    681             this.lblMessage.AutoSize = true;
    682             this.lblMessage.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
    683             this.lblMessage.ForeColor = System.Drawing.Color.Red;
    684             this.lblMessage.Location = new System.Drawing.Point(337, 16);
    685             this.lblMessage.Name = "lblMessage";
    686             this.lblMessage.Size = new System.Drawing.Size(0, 16);
    687             this.lblMessage.TabIndex = 3;
    688687            //
    689688            // DApptSearch
     
    899898
    900899            if (items.Length > 0) lstResults.Items.AddRange(items); // add new data
    901             else this.lblMessage.Text = "No available Appointment Slots Found!";
     900            else this.lblMessage.Text = "No available slots found!";
    902901
    903902            lstResults.EndUpdate(); // ok done adding items, draw now.
     
    944943            {
    945944                this.DialogResult = DialogResult.None;
    946                 lblMessage.Text = "No Appointment Slot selected!";
     945                lblMessage.Text = "No slot selected!";
    947946                return;
    948947            }
    949948
    950             long availabilityKey = long.Parse(lstResults.SelectedItems[0].SubItems[0].Text);
     949            int availabilityKey = Int32.Parse(lstResults.SelectedItems[0].SubItems[0].Text);
    951950            _selectedAvailability = (from av in lstResultantAvailabilities
    952951                                     where av.AvailabilityType == availabilityKey
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/DSplash.cs

    r1061 r1143  
    88{
    99        /// <summary>
    10         /// Summary description for DSplash.
     10        /// Program loading splash screen. Notice the numerous remote methods intended
     11    /// to mickey mouse the form from another thread.
     12    ///
     13    /// I don't know of a better way of doing this right now.
    1114        /// </summary>
    1215        public class DSplash : System.Windows.Forms.Form
     
    147150        public delegate void dAny();
    148151        public delegate void dProgressBarSet(int number);
     152        public delegate DialogResult dMessageBox(IWin32Window owner, string message);
     153        public delegate DialogResult dMessageBox2(IWin32Window owner, string message, string caption, MessageBoxButtons btns);
    149154               
    150155        public void SetStatus(string sStatus)
     
    165170                }
    166171
     172        public DialogResult RemoteMsgBox(string msg)
     173        {
     174            dMessageBox d = new dMessageBox(MessageBox.Show);
     175            return (DialogResult)this.Invoke(d, this, msg);
     176        }
     177
     178        public DialogResult RemoteMsgBox(string msg, string caption, MessageBoxButtons btns)
     179        {
     180            dMessageBox2 d = new dMessageBox2(MessageBox.Show);
     181            return (DialogResult)this.Invoke(d, this, msg, caption, btns);
     182        }
     183
    167184        public void RemoteClose()
    168185        {
    169186            dAny d = new dAny(this.Close);
     187            this.Invoke(d);
     188        }
     189
     190        public void RemoteActivate()
     191        {
     192            dAny d = new dAny(this.Activate);
     193            this.Invoke(d);
     194        }
     195
     196        public void RemoteHide()
     197        {
     198            dAny d = new dAny(this.Hide);
    170199            this.Invoke(d);
    171200        }
Note: See TracChangeset for help on using the changeset viewer.