Changeset 1118


Ignore:
Timestamp:
Mar 29, 2011, 5:46:30 AM (13 years ago)
Author:
Sam Habiel
Message:

CGView:

  • New Context Menu to Uncheck-in Patient
  • New Context Menus to Print Clinic Schedules for today, tomorrow, and 3 days from now.
  • ContextMenu for NoShow and Undo Noshow have changed logic for when they become enabled.
  • New logic to prevent checked-in appointments from being deleted.
  • PrintClinicSchedule method to be called by printing context menus just added.
  • Events are now NOT raised back to us from CGView.
  • In many circumstances, the job to update from the DB is not performed anymore after you make appointments or cancel appointments. We will rely on events to let us know of changes in the appointments in the DB.
Location:
Scheduling/trunk/cs/bsdx0200GUISourceCode
Files:
2 edited

Legend:

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

    r1112 r1118  
    100100        private MenuItem menuItem10;
    101101        private MenuItem ctxCalGridReprintApptSlip;
     102        private MenuItem ctxCalGridUndoCheckin;
     103        private MenuItem ctxPrintScheduleT0;
     104        private MenuItem ctxPrintScheduleT1;
     105        private MenuItem ctxPrintScheduleT3;
    102106        private IContainer components;
    103107
     
    222226            this.ctxProperties = new System.Windows.Forms.MenuItem();
    223227            this.ctxFindAppt = new System.Windows.Forms.MenuItem();
     228            this.ctxPrintScheduleT0 = new System.Windows.Forms.MenuItem();
     229            this.ctxPrintScheduleT1 = new System.Windows.Forms.MenuItem();
    224230            this.panelRight = new System.Windows.Forms.Panel();
    225231            this.panelClip = new System.Windows.Forms.Panel();
     
    239245            this.ctxCalGridDelete = new System.Windows.Forms.MenuItem();
    240246            this.ctxCalGridCheckIn = new System.Windows.Forms.MenuItem();
     247            this.ctxCalGridUndoCheckin = new System.Windows.Forms.MenuItem();
    241248            this.menuItem2 = new System.Windows.Forms.MenuItem();
    242249            this.ctxCalGridNoShow = new System.Windows.Forms.MenuItem();
     
    250257            this.splitter1 = new System.Windows.Forms.Splitter();
    251258            this.splitter2 = new System.Windows.Forms.Splitter();
     259            this.ctxPrintScheduleT3 = new System.Windows.Forms.MenuItem();
    252260            this.panelRight.SuspendLayout();
    253261            this.panelClip.SuspendLayout();
     
    616624            this.tvSchedules.Location = new System.Drawing.Point(0, 0);
    617625            this.tvSchedules.Name = "tvSchedules";
    618             this.tvSchedules.Size = new System.Drawing.Size(128, 393);
     626            this.tvSchedules.Size = new System.Drawing.Size(128, 351);
    619627            this.tvSchedules.Sorted = true;
    620628            this.tvSchedules.TabIndex = 1;
     
    630638            this.ctxEditAvailability,
    631639            this.ctxProperties,
    632             this.ctxFindAppt});
     640            this.ctxFindAppt,
     641            this.ctxPrintScheduleT0,
     642            this.ctxPrintScheduleT1,
     643            this.ctxPrintScheduleT3});
    633644            this.contextMenu1.Popup += new System.EventHandler(this.contextMenu1_Popup);
    634645            //
     
    649660            //
    650661            this.ctxProperties.Index = 2;
    651             this.ctxProperties.Text = "&Properties";
     662            this.ctxProperties.Text = "P&roperties";
    652663            this.ctxProperties.Click += new System.EventHandler(this.ctxProperties_Click);
    653664            //
     
    655666            //
    656667            this.ctxFindAppt.Index = 3;
    657             this.ctxFindAppt.Text = "Find Available Appointment";
     668            this.ctxFindAppt.Text = "&Find Available Appointment";
    658669            this.ctxFindAppt.Click += new System.EventHandler(this.ctxFindAppt_Click);
     670            //
     671            // ctxPrintScheduleT0
     672            //
     673            this.ctxPrintScheduleT0.Index = 4;
     674            this.ctxPrintScheduleT0.Text = "Print Clinic Schedule(s) (T+&0)";
     675            this.ctxPrintScheduleT0.Click += new System.EventHandler(this.ctxPrintScheduleT0_Click);
     676            //
     677            // ctxPrintScheduleT1
     678            //
     679            this.ctxPrintScheduleT1.Index = 5;
     680            this.ctxPrintScheduleT1.Text = "Print Clinic Schedule(s) (T+&1)";
     681            this.ctxPrintScheduleT1.Click += new System.EventHandler(this.ctxPrintScheduleT1_Click);
    659682            //
    660683            // panelRight
     
    664687            this.panelRight.Location = new System.Drawing.Point(996, 0);
    665688            this.panelRight.Name = "panelRight";
    666             this.panelRight.Size = new System.Drawing.Size(128, 393);
     689            this.panelRight.Size = new System.Drawing.Size(128, 351);
    667690            this.panelRight.TabIndex = 3;
    668691            this.panelRight.Visible = false;
     
    760783            this.panelCenter.Location = new System.Drawing.Point(136, 24);
    761784            this.panelCenter.Name = "panelCenter";
    762             this.panelCenter.Size = new System.Drawing.Size(857, 345);
     785            this.panelCenter.Size = new System.Drawing.Size(857, 303);
    763786            this.panelCenter.TabIndex = 7;
    764787            //
     
    782805            this.calendarGrid1.Resources = ((System.Collections.ArrayList)(resources.GetObject("calendarGrid1.Resources")));
    783806            this.calendarGrid1.SelectedAppointment = 0;
    784             this.calendarGrid1.Size = new System.Drawing.Size(857, 345);
     807            this.calendarGrid1.Size = new System.Drawing.Size(857, 303);
    785808            this.calendarGrid1.StartDate = new System.DateTime(2003, 1, 27, 0, 0, 0, 0);
    786809            this.calendarGrid1.TabIndex = 0;
     
    799822            this.ctxCalGridDelete,
    800823            this.ctxCalGridCheckIn,
     824            this.ctxCalGridUndoCheckin,
    801825            this.menuItem2,
    802826            this.ctxCalGridNoShow,
     
    832856            this.ctxCalGridCheckIn.Click += new System.EventHandler(this.ctxCalGridCheckIn_Click);
    833857            //
     858            // ctxCalGridUndoCheckin
     859            //
     860            this.ctxCalGridUndoCheckin.Index = 4;
     861            this.ctxCalGridUndoCheckin.Text = "&Undo Check In";
     862            this.ctxCalGridUndoCheckin.Click += new System.EventHandler(this.ctxCalGridUndoCheckin_Click);
     863            //
    834864            // menuItem2
    835865            //
    836             this.menuItem2.Index = 4;
     866            this.menuItem2.Index = 5;
    837867            this.menuItem2.Text = "-";
    838868            //
    839869            // ctxCalGridNoShow
    840870            //
    841             this.ctxCalGridNoShow.Index = 5;
     871            this.ctxCalGridNoShow.Index = 6;
    842872            this.ctxCalGridNoShow.Text = "Mark as No Show";
    843873            this.ctxCalGridNoShow.Click += new System.EventHandler(this.ctxCalGridNoShow_Click);
     
    845875            // ctxCalGridNoShowUndo
    846876            //
    847             this.ctxCalGridNoShowUndo.Index = 6;
     877            this.ctxCalGridNoShowUndo.Index = 7;
    848878            this.ctxCalGridNoShowUndo.Text = "Undo NoShow";
    849879            this.ctxCalGridNoShowUndo.Click += new System.EventHandler(this.ctxCalGridNoShowUndo_Click);
     
    851881            // menuItem9
    852882            //
    853             this.menuItem9.Index = 7;
     883            this.menuItem9.Index = 8;
    854884            this.menuItem9.Text = "-";
    855885            //
    856886            // ctxCalGridWalkin
    857887            //
    858             this.ctxCalGridWalkin.Index = 8;
     888            this.ctxCalGridWalkin.Index = 9;
    859889            this.ctxCalGridWalkin.Text = "Create Wal&k-In Appointment";
    860890            this.ctxCalGridWalkin.Click += new System.EventHandler(this.ctxCalGridWalkin_Click);
     
    862892            // menuItem10
    863893            //
    864             this.menuItem10.Index = 9;
     894            this.menuItem10.Index = 10;
    865895            this.menuItem10.Text = "-";
    866896            //
    867897            // ctxCalGridReprintApptSlip
    868898            //
    869             this.ctxCalGridReprintApptSlip.Index = 10;
     899            this.ctxCalGridReprintApptSlip.Index = 11;
    870900            this.ctxCalGridReprintApptSlip.Text = "&Reprint Appointment Slip";
    871901            this.ctxCalGridReprintApptSlip.Click += new System.EventHandler(this.ctxCalGridReprintApptSlip_Click);
     
    875905            this.panelBottom.Controls.Add(this.statusBar1);
    876906            this.panelBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
    877             this.panelBottom.Location = new System.Drawing.Point(136, 369);
     907            this.panelBottom.Location = new System.Drawing.Point(136, 327);
    878908            this.panelBottom.Name = "panelBottom";
    879909            this.panelBottom.Size = new System.Drawing.Size(857, 24);
     
    893923            this.splitter1.Location = new System.Drawing.Point(128, 24);
    894924            this.splitter1.Name = "splitter1";
    895             this.splitter1.Size = new System.Drawing.Size(8, 369);
     925            this.splitter1.Size = new System.Drawing.Size(8, 327);
    896926            this.splitter1.TabIndex = 9;
    897927            this.splitter1.TabStop = false;
     
    902932            this.splitter2.Location = new System.Drawing.Point(993, 24);
    903933            this.splitter2.Name = "splitter2";
    904             this.splitter2.Size = new System.Drawing.Size(3, 369);
     934            this.splitter2.Size = new System.Drawing.Size(3, 327);
    905935            this.splitter2.TabIndex = 10;
    906936            this.splitter2.TabStop = false;
    907937            //
     938            // ctxPrintScheduleT3
     939            //
     940            this.ctxPrintScheduleT3.Index = 6;
     941            this.ctxPrintScheduleT3.Text = "Print Clinic Schedule(s) (T+&3)";
     942            this.ctxPrintScheduleT3.Click += new System.EventHandler(this.ctxPrintScheduleT3_Click);
     943            //
    908944            // CGView
    909945            //
    910946            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
    911             this.ClientSize = new System.Drawing.Size(1124, 393);
     947            this.ClientSize = new System.Drawing.Size(1124, 351);
    912948            this.Controls.Add(this.panelCenter);
    913949            this.Controls.Add(this.panelBottom);
     
    10971133                }
    10981134
     1135        private void ctxCalGridUndoCheckin_Click(object sender, EventArgs e)
     1136        {
     1137            AppointmentUndoCheckin();
     1138        }
     1139
    10991140                #endregion AppointmentMenu Handlers
    11001141
     
    11071148                        this.ctxOpenSchedule.Enabled = bEnabled;
    11081149                        this.ctxFindAppt.Enabled = bEnabled;
     1150            this.ctxPrintScheduleT0.Enabled = bEnabled;
     1151            this.ctxPrintScheduleT1.Enabled = bEnabled;
     1152            this.ctxPrintScheduleT3.Enabled = bEnabled;
    11091153
    11101154                        //properties not supported now
     
    11621206                }
    11631207
     1208        private void ctxPrintScheduleT0_Click(object sender, EventArgs e)
     1209        {
     1210            PrintClinicSchedule(DateTime.Today, DateTime.Today);
     1211        }
     1212
     1213        private void ctxPrintScheduleT1_Click(object sender, EventArgs e)
     1214        {
     1215            PrintClinicSchedule(DateTime.Today.AddDays(1), DateTime.Today.AddDays(1));
     1216        }
     1217
     1218        private void ctxPrintScheduleT3_Click(object sender, EventArgs e)
     1219        {
     1220            PrintClinicSchedule(DateTime.Today.AddDays(3), DateTime.Today.AddDays(3));
     1221        }
     1222
    11641223                private void ctxProperties_Click(object sender, System.EventArgs e)
    11651224                {
     
    12141273                        ctxCalGridEdit.Enabled = bEditAppointments;
    12151274                        ctxCalGridCheckIn.Enabled = bEditAppointments;
    1216                         ctxCalGridNoShow.Enabled = bEditAppointments;
    1217                         ctxCalGridNoShowUndo.Enabled = bEditAppointments;
     1275                        ctxCalGridNoShow.Enabled = NoShowEnabled();
     1276            ctxCalGridNoShowUndo.Enabled = !NoShowEnabled() && calendarGrid1.SelectedAppointment > 0;
    12181277                        ctxCalGridWalkin.Enabled = ctxCalGridAdd.Enabled;
    12191278            //smh new code
    1220             ctxCalGridReprintApptSlip.Enabled = ctxCalGridEdit.Enabled;
    1221                     //end new code
     1279            ctxCalGridReprintApptSlip.Enabled = bEditAppointments;
     1280            ctxCalGridUndoCheckin.Enabled = UndoCheckinEnabled();
     1281            //end new code
    12221282        }
    12231283
     
    13421402                return ((bSlotsAvailable) || (bModSchedule) || (bOverbook));
    13431403            }
     1404        }
     1405
     1406        private bool NoShowEnabled()
     1407        {
     1408            if (calendarGrid1.SelectedAppointment < 1)
     1409                return false;
     1410            CGAppointment appt = (CGAppointment)this.Appointments.AppointmentTable[calendarGrid1.SelectedAppointment];
     1411            return !appt.NoShow;
     1412        }
     1413
     1414        private bool UndoCheckinEnabled()
     1415        {
     1416            if (calendarGrid1.SelectedAppointment < 1) return false;
     1417            CGAppointment appt = (CGAppointment)this.Appointments.AppointmentTable[calendarGrid1.SelectedAppointment];
     1418            return appt.CheckInTime.Ticks > 0;
    13441419        }
    13451420
     
    16861761
    16871762                /// <summary>
    1688                 /// Marks all selected appointments as No Show
     1763        /// Marks all selected appointments as No Show from this.calendarGrid1.SelectedAppointments
    16891764                /// </summary>
    1690                 /// <param name="nApptID"></param>
    1691                 /// <returns></returns>         
     1765                /// <param name="bNoShow">True - Mark as noshow; False - undo noshow</param>
    16921766                private void AppointmentNoShow(bool bNoShow)
    16931767                {
     
    16961770                        bool                    bMarked = false;        //Indicates at least one attempt to mark as noshow succeeded
    16971771                        bool                    bRebook = false;        //Stores user's response to auto-rebook dialog question
    1698                         CGAppointments  alRebookList = new CGAppointments();
    1699                         DNoShow dlg = new DNoShow();;
    1700                         if (bNoShow == true)
     1772                        CGAppointments  alRebookList = new CGAppointments();  // list of appointments to rebook
     1773
     1774                    DNoShow dlg = new DNoShow(); // no show dialog
     1775
     1776                        if (bNoShow == true)  // if noshowing, show the dialog to ask the user
    17011777                        {
    17021778                                if (dlg.ShowDialog(this) == DialogResult.Cancel)
     
    17141790                                try
    17151791                                {
    1716                                         if ((bNoShow == true)
     1792                                        if ((bNoShow == true)  // if no-showing
    17171793                                                &&
    17181794                                                (a.StartTime.Date > DateTime.Today.Date)
     
    17211797                                        {
    17221798                                        }
    1723                                         else
     1799                                        else  // otherwise, make or undo show
    17241800                                        {
    1725                                                 string sError = Document.AppointmentNoShow(nApptID, bNoShow);
     1801                                                string sError = Document.AppointmentNoShow(a, bNoShow);
    17261802                                                if (sError != "1")
    17271803                                                        throw new Exception(sError);
     
    17341810                                        MessageBox.Show("Unable to mark appointment No Show: " +  ex.Message, "Clinical Scheduling");
    17351811                                }
     1812
    17361813                                if (bRebook == true)
    17371814                                {
     
    17731850                                        }
    17741851                                }
    1775                         }
    1776                        
    1777                         if (bMarked == true)
    1778                         {
    1779                                 //Notify other scheduling users that this schedule has changed
    1780                                 try
    1781                                 {
    1782                                         this.Document.RefreshDocument();
    1783                                         RaiseRPMSEvent("BSDX SCHEDULE" , m_Document.DocName);
    1784                                 }
    1785                                 catch (Exception ex)
    1786                                 {
    1787                                         Debug.Write(ex.Message);
    1788                                 }
    1789                                 this.calendarGrid1.Invalidate();
    1790                                
    1791                                 AutoRebookFromList(alRebookList);
    1792                         }                       
     1852
     1853                if (bMarked == true)
     1854                {
     1855                    //Notify other scheduling users that this schedule has changed
     1856                    try
     1857                    {
     1858                        //this.Document.RefreshDocument(); no need for this; event raised back and prompts refresh itself.
     1859                        RaiseRPMSEvent("BSDX SCHEDULE", a.Resource);
     1860                    }
     1861                    catch (Exception ex)
     1862                    {
     1863                        Debug.Write(ex.Message);
     1864                    }
     1865                    this.calendarGrid1.Invalidate();
     1866                }                                               
     1867            }
     1868            AutoRebookFromList(alRebookList);
    17931869                }
    17941870               
     1871        /// <summary>
     1872        /// Prints Auto Rebook Letters; does nothing else to DB!!!
     1873        /// </summary>
     1874        /// <param name="alRebookList">List of appointments</param>
    17951875                private void AutoRebookFromList(CGAppointments alRebookList)
    17961876                {
     
    18361916                /// Delete all selected appointments
    18371917                /// </summary>
    1838                 private void AppointmentDelete()
    1839                 {
    1840                         calendarGrid1.CGToolTip.Active = false;
    1841                         CGAppointments alRebookList = new CGAppointments();
    1842 
    1843                         DCancelAppt dCancel = new DCancelAppt();
    1844                         dCancel.InitializePage(this.m_DocManager);
    1845                         if (dCancel.ShowDialog(this) != DialogResult.OK)
    1846                         {
    1847                                 calendarGrid1.CGToolTip.Active = true;
    1848                                 return;
    1849                         }
    1850 
    1851                         bool bClinic = dCancel.ClinicCancelled;
    1852                         int nReason = dCancel.CancelReason;
    1853                         string sRemarks = dCancel.CancelRemarks;
    1854                         bool bRebook = dCancel.AutoRebook;
    1855                         int nRebookStart = dCancel.RebookStartDays;
    1856                         int nRebookMax = dCancel.RebookMaxDays;
    1857                         int nRebookAccessType = dCancel.RebookAccessType;
    1858 
    1859                         calendarGrid1.CGToolTip.Active = true;
    1860 
    1861                         bool bDeleted = false;
    1862                         foreach (CGAppointment a in this.calendarGrid1.SelectedAppointments.AppointmentTable.Values)
    1863                         {
    1864                                 int nApptID = a.AppointmentKey;
    1865                                 Debug.Assert(nApptID != 0);
    1866                                 try
    1867                                 {
    1868                                         string sError = Document.DeleteAppointment(nApptID,bClinic, nReason, sRemarks);
    1869                                         if (sError != "")
    1870                                                 throw new Exception(sError);
    1871 
    1872                                         bDeleted = true;
    1873                                         if (bRebook == true)
    1874                                         {
    1875                                                 try
    1876                                                 {
    1877                                                         //TODO: Parameterize  or dialogize the minum and maximum rebook days
    1878                                                         CGAppointment aRebook;
    1879                                                         int nMinimumdays = nRebookStart;
    1880                                                         int nMaximumdays = nRebookMax;
    1881                                                         string sResult = Document.AutoRebook(a, nRebookAccessType, nMinimumdays, nMaximumdays, out aRebook);
    1882                                                         if (sResult == "1")
    1883                                                         {
    1884                                                                 //Add appointment to list of rebooked appointments
    1885                                                                 alRebookList.AddAppointment(a);
    1886                                                         }
    1887 
    1888                                                 }
    1889                                                 catch (Exception ex)
    1890                                                 {
    1891                                                         MessageBox.Show("Unable to rebook: " + ex.Message);
    1892                                                 }
    1893                                         }
    1894                                 }
    1895                                 catch (Exception ex)
    1896                                 {
    1897                                         MessageBox.Show("Unable to delete appointment.  " +  ex.Message, "Clinical Scheduling");
    1898                                 }
    1899 
    1900                         }
    1901                         if (bDeleted == true)
    1902                         {
    1903                                 try
    1904                                 {
    1905                     this.UpdateArrays();
    1906                                         RaiseRPMSEvent("BSDX SCHEDULE" , m_Document.DocName);
    1907 
    1908                     //Get the appointments and availabilities, async, from Server. Callback updates this thread's controls.
    1909                     OnUpdateScheduleDelegate ousd = new OnUpdateScheduleDelegate(OnUpdateSchedule);
    1910                     ousd.BeginInvoke(OnUpdateScheduleCallback, null);
    1911                                 }
    1912                                 catch (Exception ex)
    1913                                 {
    1914                                         Debug.Write(ex.Message);
    1915                                 }
    1916                                 this.calendarGrid1.Invalidate();
    1917                                 if (bRebook == true)
    1918                                 {
    1919                                         AutoRebookFromList(alRebookList);
    1920                                 }
    1921                         }
    1922 
    1923                 }
     1918        private void AppointmentDelete()
     1919        {
     1920            calendarGrid1.CGToolTip.Active = false;
     1921            CGAppointments alRebookList = new CGAppointments();
     1922
     1923            // check to see if any appointment is checked in first
     1924            foreach (CGAppointment a in this.calendarGrid1.SelectedAppointments.AppointmentTable.Values)
     1925            {
     1926                if (a.CheckInTime.Ticks > 0)
     1927                {
     1928                    MessageBox.Show("You must Un-checkin the appointment first before removing it.");
     1929                    return;
     1930                }
     1931            }
     1932
     1933            DCancelAppt dCancel = new DCancelAppt();
     1934            dCancel.InitializePage(this.m_DocManager);
     1935            if (dCancel.ShowDialog(this) != DialogResult.OK)
     1936            {
     1937                calendarGrid1.CGToolTip.Active = true;
     1938                return;
     1939            }
     1940
     1941            bool bClinic = dCancel.ClinicCancelled;
     1942            int nReason = dCancel.CancelReason;
     1943            string sRemarks = dCancel.CancelRemarks;
     1944            bool bRebook = dCancel.AutoRebook;
     1945            int nRebookStart = dCancel.RebookStartDays;
     1946            int nRebookMax = dCancel.RebookMaxDays;
     1947            int nRebookAccessType = dCancel.RebookAccessType;
     1948
     1949            calendarGrid1.CGToolTip.Active = true;
     1950
     1951            foreach (CGAppointment a in this.calendarGrid1.SelectedAppointments.AppointmentTable.Values)
     1952            {
     1953               
     1954                int nApptID = a.AppointmentKey;
     1955                Debug.Assert(nApptID != 0);
     1956                try
     1957                {
     1958                    string sError = Document.DeleteAppointment(nApptID, bClinic, nReason, sRemarks);
     1959                    if (sError != "")
     1960                        throw new Exception(sError);
     1961
     1962                    this.UpdateArrays(); //Redraw this calendar grid
     1963
     1964                    if (bRebook == true)
     1965                    {
     1966                        try
     1967                        {
     1968                            //TODO: Parameterize  or dialogize the minum and maximum rebook days
     1969                            CGAppointment aRebook;
     1970                            int nMinimumdays = nRebookStart;
     1971                            int nMaximumdays = nRebookMax;
     1972                            string sResult = Document.AutoRebook(a, nRebookAccessType, nMinimumdays, nMaximumdays, out aRebook);
     1973                            if (sResult == "1")
     1974                            {
     1975                                //Add appointment to list of rebooked appointments
     1976                                alRebookList.AddAppointment(a);
     1977                            }
     1978
     1979                        }
     1980                        catch (Exception ex)
     1981                        {
     1982                            MessageBox.Show("Unable to rebook: " + ex.Message);
     1983                        }
     1984                    }
     1985
     1986                    RaiseRPMSEvent("BSDX SCHEDULE", a.Resource);
     1987                }
     1988                catch (Exception ex)
     1989                {
     1990                    MessageBox.Show("Unable to delete appointment.  " + ex.Message, "Clinical Scheduling");
     1991                }
     1992
     1993
     1994                if (alRebookList.AppointmentCount > 0)
     1995                {
     1996                    AutoRebookFromList(alRebookList);
     1997                }
     1998            }
     1999        }
    19242000
    19252001                private void AppointmentCheckIn()
     
    19832059
    19842060                }
     2061
     2062        private void AppointmentUndoCheckin()
     2063        {
     2064            Debug.Assert(calendarGrid1.SelectedAppointment > 0);
     2065
     2066            foreach (CGAppointment a in this.calendarGrid1.SelectedAppointments.AppointmentTable.Values)
     2067            {
     2068                string msg; //out var
     2069                bool didweSucceed = Document.AppointmentUndoCheckin(a, out msg);
     2070
     2071                if (!didweSucceed)
     2072                {
     2073                    MessageBox.Show("Error: " + msg);
     2074                    continue;
     2075                }
     2076
     2077                RaiseRPMSEvent("BSDX SCHEDULE", a.Resource);
     2078            }
     2079           
     2080            this.UpdateArrays();
     2081        }
    19852082
    19862083                private void AppointmentAddWalkin()
     
    20702167                this.UpdateArrays();
    20712168
    2072                 //Get the appointments and availabilities, async, from Server. Callback updates this thread's controls.
    2073                 OnUpdateScheduleDelegate ousd = new OnUpdateScheduleDelegate(OnUpdateSchedule);
    2074                 ousd.BeginInvoke(OnUpdateScheduleCallback, null);
    2075 
    2076 
     2169                RaiseRPMSEvent("BSDX SCHEDULE", appt.Resource);
    20772170                        }
    20782171                        catch (Exception ex)
     
    20872180                return;
    20882181                        }
    2089 
    2090             try
    2091             {
    2092                 RaiseRPMSEvent("BSDX SCHEDULE", m_Document.DocName);
    2093             }
    2094             catch (Exception ex)
    2095             {
    2096                 Debug.Write(ex.Message);
    2097             }
    2098                        
    2099 
    21002182                }
    21012183
     
    21952277                //Show the new set of appointments by calling UpdateArrays. Fetches Document's CGAppointments
    21962278                this.UpdateArrays();
    2197                
    2198                 //Get the appointments and availabilities, async, from Server. Callback updates this thread's controls.
    2199                 OnUpdateScheduleDelegate ousd = new OnUpdateScheduleDelegate(OnUpdateSchedule);
    2200                 ousd.BeginInvoke(OnUpdateScheduleCallback, null);
     2279
     2280                RaiseRPMSEvent("BSDX SCHEDULE", appt.Resource);
    22012281                        }
    22022282                        catch (Exception ex)
     
    22102290                                MessageBox.Show("VISTA says: \r\n" + msg, "Unable to Make Appointment");
    22112291                                return;
    2212                         }
    2213 
    2214                         try
    2215                         {
    2216                                 RaiseRPMSEvent("BSDX SCHEDULE" , m_Document.DocName);
    2217                                 this.calendarGrid1.Invalidate();
    2218                         }
    2219                         catch (Exception ex)
    2220                         {
    2221                                 Debug.Write(ex.Message);
    22222292                        }
    22232293                }
     
    23322402            {
    23332403                //Signal RPMS to raise an event
    2334                 m_ConnectInfo.RaiseEvent(sEvent, sParams, true);
     2404                m_ConnectInfo.RaiseEvent(sEvent, sParams, false);
    23352405            }
    23362406            catch (Exception ex)
     
    33673437
    33683438
    3369 
    3370 
    3371 
    3372        
     3439        private void PrintClinicSchedule(DateTime dStart, DateTime dEnd)
     3440        {
     3441            DPatientLetter dpl = new DPatientLetter();
     3442
     3443            int[] resourceIENs = (from resource in CGDocumentManager.Current.GlobalDataSet.Tables["Resources"].AsEnumerable()
     3444                                  join resource_name in m_alSelectedTreeResourceArray.Cast<string>() on resource.Field<string>("RESOURCE_NAME") equals resource_name
     3445                                  select resource.Field<int>("RESOURCEID")
     3446                               ).ToArray<int>();
     3447
     3448            // + | is an oddity in the Mumps code which I haven't investigated yet.
     3449            dpl.InitializeFormClinicSchedule(this.DocManager, string.Join("|", resourceIENs) + "|", dStart, dEnd);
     3450            dpl.ShowDialog(this);
     3451        }
     3452
    33733453
    33743454
Note: See TracChangeset for help on using the changeset viewer.