Changeset 1011


Ignore:
Timestamp:
Nov 18, 2010, 7:47:04 AM (13 years ago)
Author:
Sam Habiel
Message:

UCPatientAppts: Fixes printing empty table bug reported by EHS.
DAccessTemplate: Various usability improvements.
CGDocumentManager: Fixed Delegate code so that it can operate asynchronously
CGAVView: Some temporary fixes (not totally usable): Added non-functional Delete Slots menu option; Added Background worker for saving acccess slots
In the future, Delete Slots will work; and will use ADO.net Updatable datatable for saving access slots.
calendarGrid: just some comments for now
AssemblyInfo: bumped version up to v1.4.2

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

Legend:

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

    r966 r1011  
    2828// by using the '*' as shown below:
    2929
    30 [assembly: AssemblyVersion("1.4.1.*")]
     30[assembly: AssemblyVersion("1.4.2.*")]
    3131
    3232//
     
    5858[assembly: AssemblyKeyFile("")]
    5959[assembly: AssemblyKeyName("")]
    60 [assembly: AssemblyFileVersionAttribute("1.4.1.0")]
     60[assembly: AssemblyFileVersionAttribute("1.4.2.0")]
    6161[assembly: ComVisibleAttribute(false)]
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/CGAVView.cs

    r917 r1011  
    6868            this.mnuLoadTemplate = new System.Windows.Forms.MenuItem();
    6969            this.mnuSaveTemplate = new System.Windows.Forms.MenuItem();
     70            this.mnuDeleteAllAppointments = new System.Windows.Forms.MenuItem();
    7071            this.menuItem6 = new System.Windows.Forms.MenuItem();
    7172            this.mnuSchedulingManagment = new System.Windows.Forms.MenuItem();
     
    9091            this.mnuHelpAbout = new System.Windows.Forms.MenuItem();
    9192            this.splitter1 = new System.Windows.Forms.Splitter();
     93            this.saveAccessBlocksWorker = new System.ComponentModel.BackgroundWorker();
    9294            this.calendarGrid1 = new IndianHealthService.ClinicalScheduling.CalendarGrid();
    9395            this.panelRight.SuspendLayout();
     
    104106            this.panelRight.Location = new System.Drawing.Point(728, 0);
    105107            this.panelRight.Name = "panelRight";
    106             this.panelRight.Size = new System.Drawing.Size(120, 412);
     108            this.panelRight.Size = new System.Drawing.Size(120, 393);
    107109            this.panelRight.TabIndex = 1;
    108110            //
     
    125127            this.lstClip.Location = new System.Drawing.Point(0, 32);
    126128            this.lstClip.Name = "lstClip";
    127             this.lstClip.Size = new System.Drawing.Size(120, 407);
     129            this.lstClip.Size = new System.Drawing.Size(120, 416);
    128130            this.lstClip.TabIndex = 0;
    129131            this.lstClip.DragDrop += new System.Windows.Forms.DragEventHandler(this.lstClip_DragDrop);
     132            this.lstClip.DragEnter += new System.Windows.Forms.DragEventHandler(this.lstClip_DragEnter);
     133            this.lstClip.MouseDown += new System.Windows.Forms.MouseEventHandler(this.lstClip_MouseDown);
    130134            this.lstClip.MouseMove += new System.Windows.Forms.MouseEventHandler(this.lstClip_MouseMove);
    131             this.lstClip.MouseDown += new System.Windows.Forms.MouseEventHandler(this.lstClip_MouseDown);
    132             this.lstClip.DragEnter += new System.Windows.Forms.DragEventHandler(this.lstClip_DragEnter);
    133135            //
    134136            // ctxApptClipMenu
     
    165167            this.panelBottom.Controls.Add(this.statusBar1);
    166168            this.panelBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
    167             this.panelBottom.Location = new System.Drawing.Point(8, 388);
     169            this.panelBottom.Location = new System.Drawing.Point(8, 369);
    168170            this.panelBottom.Name = "panelBottom";
    169171            this.panelBottom.Size = new System.Drawing.Size(720, 24);
     
    217219            this.panelCenter.Location = new System.Drawing.Point(8, 24);
    218220            this.panelCenter.Name = "panelCenter";
    219             this.panelCenter.Size = new System.Drawing.Size(712, 364);
     221            this.panelCenter.Size = new System.Drawing.Size(712, 345);
    220222            this.panelCenter.TabIndex = 4;
    221223            //
     
    253255            this.tvSchedules.Location = new System.Drawing.Point(0, 0);
    254256            this.tvSchedules.Name = "tvSchedules";
    255             this.tvSchedules.Size = new System.Drawing.Size(8, 412);
     257            this.tvSchedules.Size = new System.Drawing.Size(8, 393);
    256258            this.tvSchedules.Sorted = true;
    257259            this.tvSchedules.TabIndex = 5;
     
    271273            this.mnuLoadTemplate,
    272274            this.mnuSaveTemplate,
     275            this.mnuDeleteAllAppointments,
    273276            this.menuItem6,
    274277            this.mnuSchedulingManagment,
     
    291294            this.mnuSaveTemplate.Click += new System.EventHandler(this.mnuSaveTemplate_Click);
    292295            //
     296            // mnuDeleteAllAppointments
     297            //
     298            this.mnuDeleteAllAppointments.Enabled = false;
     299            this.mnuDeleteAllAppointments.Index = 2;
     300            this.mnuDeleteAllAppointments.Shortcut = System.Windows.Forms.Shortcut.CtrlD;
     301            this.mnuDeleteAllAppointments.Text = "&Delete All Appointments";
     302            this.mnuDeleteAllAppointments.Click += new System.EventHandler(this.mnuDeleteAllAppointments_Click);
     303            //
    293304            // menuItem6
    294305            //
    295             this.menuItem6.Index = 2;
     306            this.menuItem6.Index = 3;
    296307            this.menuItem6.Text = "-";
    297308            //
    298309            // mnuSchedulingManagment
    299310            //
    300             this.mnuSchedulingManagment.Index = 3;
     311            this.mnuSchedulingManagment.Index = 4;
    301312            this.mnuSchedulingManagment.Shortcut = System.Windows.Forms.Shortcut.CtrlShiftM;
    302313            this.mnuSchedulingManagment.Text = "Scheduling &Management";
     
    305316            // menuItem5
    306317            //
    307             this.menuItem5.Index = 4;
     318            this.menuItem5.Index = 5;
    308319            this.menuItem5.Text = "-";
    309320            //
    310321            // mnuClose
    311322            //
    312             this.mnuClose.Index = 5;
     323            this.mnuClose.Index = 6;
    313324            this.mnuClose.Shortcut = System.Windows.Forms.Shortcut.CtrlW;
    314325            this.mnuClose.Text = "&Close";
     
    446457            this.splitter1.Location = new System.Drawing.Point(720, 24);
    447458            this.splitter1.Name = "splitter1";
    448             this.splitter1.Size = new System.Drawing.Size(8, 364);
     459            this.splitter1.Size = new System.Drawing.Size(8, 345);
    449460            this.splitter1.TabIndex = 6;
    450461            this.splitter1.TabStop = false;
     462            //
     463            // saveAccessBlocksWorker
     464            //
     465            this.saveAccessBlocksWorker.WorkerReportsProgress = true;
     466            this.saveAccessBlocksWorker.DoWork += new System.ComponentModel.DoWorkEventHandler(this.saveAccessBlocksWorker_DoWork);
     467            this.saveAccessBlocksWorker.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.saveAccessBlocksWorker_ProgressChanged);
     468            this.saveAccessBlocksWorker.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.saveAccessBlocksWorker_RunWorkerCompleted);
    451469            //
    452470            // calendarGrid1
     
    469487            this.calendarGrid1.Resources = ((System.Collections.ArrayList)(resources.GetObject("calendarGrid1.Resources")));
    470488            this.calendarGrid1.SelectedAppointment = 0;
    471             this.calendarGrid1.Size = new System.Drawing.Size(712, 364);
     489            this.calendarGrid1.Size = new System.Drawing.Size(712, 345);
    472490            this.calendarGrid1.StartDate = new System.DateTime(2003, 1, 27, 0, 0, 0, 0);
    473491            this.calendarGrid1.TabIndex = 2;
    474492            this.calendarGrid1.TimeScale = 20;
     493            this.calendarGrid1.CGAppointmentAdded += new IndianHealthService.ClinicalScheduling.CGAppointmentChangedHandler(this.calendarGrid1_CGAppointmentAdded);
     494            this.calendarGrid1.CGAppointmentChanged += new IndianHealthService.ClinicalScheduling.CGAppointmentChangedHandler(this.calendarGrid1_CGAppointmentChanged);
     495            this.calendarGrid1.CGSelectionChanged += new IndianHealthService.ClinicalScheduling.CGSelectionChangedHandler(this.calendarGrid1_CGSelectionChanged);
    475496            this.calendarGrid1.DoubleClick += new System.EventHandler(this.calendarGrid1_DoubleClick);
    476             this.calendarGrid1.CGSelectionChanged += new IndianHealthService.ClinicalScheduling.CGSelectionChangedHandler(this.calendarGrid1_CGSelectionChanged);
    477             this.calendarGrid1.CGAppointmentChanged += new IndianHealthService.ClinicalScheduling.CGAppointmentChangedHandler(this.calendarGrid1_CGAppointmentChanged);
    478             this.calendarGrid1.CGAppointmentAdded += new IndianHealthService.ClinicalScheduling.CGAppointmentChangedHandler(this.calendarGrid1_CGAppointmentAdded);
    479497            //
    480498            // CGAVView
    481499            //
    482500            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
    483             this.ClientSize = new System.Drawing.Size(848, 412);
     501            this.ClientSize = new System.Drawing.Size(848, 393);
    484502            this.Controls.Add(this.panelCenter);
    485503            this.Controls.Add(this.splitter1);
     
    492510            this.Name = "CGAVView";
    493511            this.Text = "CGAVView";
     512            this.Closing += new System.ComponentModel.CancelEventHandler(this.CGAVView_Closing);
    494513            this.Load += new System.EventHandler(this.CGAVView_Load);
    495             this.Closing += new System.ComponentModel.CancelEventHandler(this.CGAVView_Closing);
    496514            this.panelRight.ResumeLayout(false);
    497515            this.panelClip.ResumeLayout(false);
     
    556574                private System.Windows.Forms.MenuItem ctxCalGridEdit;
    557575                private System.Windows.Forms.MenuItem ctxCalGridDelete;
     576        private BackgroundWorker saveAccessBlocksWorker;
     577        private MenuItem mnuDeleteAllAppointments;
    558578                private bool                            m_bDragDropStart = false;
    559579
     
    749769                }//End AvailabilityAddNew
    750770
     771        private void MassAppointmentDelete()
     772        {
     773            DialogResult msgResult = MessageBox.Show("Delete all Access Slots?", "Delete Slots?",MessageBoxButtons.YesNo);
     774            if (msgResult != DialogResult.Yes) return;
     775
     776            CGAppointments appointments = new CGAppointments();
     777            appointments = this.Document.AVBlocks;
     778
     779            foreach (CGAppointment a in appointments.AppointmentTable.Values)
     780            {
     781                int nApptID = a.AppointmentKey;
     782                Debug.Assert(nApptID != 0);
     783                try
     784                {
     785                    Document.DeleteAvailability(nApptID);
     786                }
     787                catch (Exception ex)
     788                {
     789                    MessageBox.Show("Unable to delete access block" + ex.Message, "Clinical Scheduling");
     790                }
     791
     792            }
     793
     794            this.m_DocManager.UpdateViews((string)this.m_Document.Resources[0], "");
     795            RaiseRPMSEvent("BSDX SCHEDULE", m_Document.DocName);
     796            this.calendarGrid1.Invalidate();
     797        }
     798
    751799                private void AppointmentDelete()
    752800                {
     
    756804                                sMsg = " these access blocks?";
    757805
    758                         if (MessageBox.Show("Are you sure you want to delete" + sMsg, "Clinical Scheduling",  MessageBoxButtons.YesNo) != DialogResult.Yes)
    759                         {
    760                                 calendarGrid1.CGToolTip.Active = true;
    761                                 return;
    762                         }
    763806                        calendarGrid1.CGToolTip.Active = true;
    764807
     
    907950                        {
    908951//                              this.DocManager.EnableAutoRefresh(false);
    909 
    910                                 if (MessageBox.Show("Are you sure you want to move this access block?", "Clinical Scheduling",  MessageBoxButtons.YesNo) != DialogResult.Yes)
    911                                         return;
    912952
    913953                                m_Document.ChangeAppointmentTime(e.Appointment, e.StartTime, e.EndTime, e.Resource);
     
    10101050                        try
    10111051                        {
    1012                                 OpenFileDialog openFileDialog1 = dlg.FileDialog;
    1013                                 Stream streamFile;
    1014                                 if((streamFile = openFileDialog1.OpenFile())== null)
    1015                                 {
    1016                                         MessageBox.Show("Unable to open template file.");
    1017                                         return;
    1018                                 }
    1019 
    1020                                 BinaryFormatter formatter = new BinaryFormatter();
    1021                                 CGAppointments cgaTemp = (CGAppointments) formatter.Deserialize(streamFile);
    1022                                 streamFile.Close();
    1023 
    1024                                 DateTime dtStart = dlg.StartDate;
    1025                 DateTime newStartDate, newEndDate;
    1026                 this.Document.WeekNeedsRefresh(1,dtStart, out newStartDate, out newEndDate);
    1027                 dtStart = newStartDate;
    1028                                 int nWeeksToApply = dlg.WeeksToApply;
    1029                                 DateTime dtEnd = dtStart.AddDays(6); // or 7?
    1030 
    1031                                 string sResourceID = this.m_Document.ResourceID.ToString();
    1032                                 DataTable dt;
    1033 
    1034                                 for (int j=1; j < nWeeksToApply + 1; j++)
    1035                                 {
    1036                                         //Convert start and end to string
    1037                                         //string sStart = dtStart.ToString("M/d/yyyy");
    1038                                         //string sEnd = dtEnd.ToString("M/d/yyyy");
    1039                     //i18n
    1040                     string sStart = FMDateTime.Create(dtStart).DateOnly.FMDateString;
    1041                     string sEnd = FMDateTime.Create(dtEnd).DateOnly.FMDateString;
    1042                                         //Cancel all existing access blocks in the date range
    1043                                         string sSql = "BSDX CANCEL AV BY DATE^" + sResourceID + "^" + sStart + "^" + sEnd;
    1044                                         dt = this.m_DocManager.RPMSDataTable(sSql, "Cancelled");
    1045 
    1046                                         //for each CGAppointment in AVBlocks, call AddNew
    1047                                         string sResource = "";
    1048                                         sResource = (string) this.Document.Resources[0];
    1049                                         foreach (CGAppointment a in cgaTemp.AppointmentTable.Values)
    1050                                         {
    1051                                                 //Change the resource to the current one
    1052                                                 a.Resource = sResource;
    1053 
    1054                                                 //Change the date to correspond to the GridColumn member
    1055                                                 int col = a.GridColumn;
    1056                                                 col--;
    1057                                                 DateTime dBuildDate = dtStart.Date;
    1058                                                 dBuildDate = dBuildDate.AddDays(col);
    1059                                                 dBuildDate = dBuildDate.AddHours(a.StartTime.Hour);
    1060                                                 dBuildDate = dBuildDate.AddMinutes(a.StartTime.Minute);
    1061                                                 a.StartTime = dBuildDate;
    1062                                                 dBuildDate = dtStart.Date;
    1063                                                 dBuildDate = dBuildDate.AddDays(col);
    1064                                                 dBuildDate = dBuildDate.AddHours(a.EndTime.Hour);
    1065                                                 dBuildDate = dBuildDate.AddMinutes(a.EndTime.Minute);
    1066                                                 a.EndTime = dBuildDate;
    1067 
    1068                                                 //Call Document to add a new appointment
    1069                                                 this.Document.CreateAppointmentAuto(a);
    1070                                         }
    1071 
    1072                                         //Increment start and end
    1073                                         dtStart = dtStart.AddDays(7);
    1074                                         dtEnd = dtStart.AddDays(6);
    1075 
    1076                                 }//end for
     1052                this.saveAccessBlocksWorker.RunWorkerAsync(dlg);
     1053                //OpenFileDialog openFileDialog1 = dlg.FileDialog;
     1054                //openFileDialog1.RestoreDirectory = false; // go back to our dir
     1055                //Stream streamFile;
     1056                //if((streamFile = openFileDialog1.OpenFile())== null)
     1057                //{
     1058                //    MessageBox.Show("Unable to open template file.");
     1059                //    return;
     1060                //}
     1061
     1062                //BinaryFormatter formatter = new BinaryFormatter();
     1063                //CGAppointments cgaTemp = (CGAppointments) formatter.Deserialize(streamFile);
     1064                //streamFile.Close();
     1065
     1066                //DateTime dtStart = dlg.StartDate;
     1067                //DateTime newStartDate, newEndDate;
     1068                //this.Document.WeekNeedsRefresh(1,dtStart, out newStartDate, out newEndDate);
     1069                //dtStart = newStartDate;
     1070                //int nWeeksToApply = dlg.WeeksToApply;
     1071                //DateTime dtEnd = dtStart.AddDays(6); // or 7?
     1072
     1073                //string sResourceID = this.m_Document.ResourceID.ToString();
     1074                //DataTable dt;
     1075
     1076                //for (int j=1; j < nWeeksToApply + 1; j++)
     1077                //{
     1078                //    //Convert start and end to string
     1079                //    //string sStart = dtStart.ToString("M/d/yyyy");
     1080                //    //string sEnd = dtEnd.ToString("M/d/yyyy");
     1081                //    //i18n
     1082                //    string sStart = FMDateTime.Create(dtStart).DateOnly.FMDateString;
     1083                //    string sEnd = FMDateTime.Create(dtEnd).DateOnly.FMDateString;
     1084                //    //Cancel all existing access blocks in the date range
     1085                //    string sSql = "BSDX CANCEL AV BY DATE^" + sResourceID + "^" + sStart + "^" + sEnd;
     1086                //    dt = this.m_DocManager.RPMSDataTable(sSql, "Cancelled");
     1087
     1088                //    //for each CGAppointment in AVBlocks, call AddNew
     1089                //    string sResource = "";
     1090                //    sResource = (string) this.Document.Resources[0];
     1091                //    foreach (CGAppointment a in cgaTemp.AppointmentTable.Values)
     1092                //    {
     1093                //        //Change the resource to the current one
     1094                //        a.Resource = sResource;
     1095
     1096                //        //Change the date to correspond to the GridColumn member
     1097                //        int col = a.GridColumn;
     1098                //        col--;
     1099                //        DateTime dBuildDate = dtStart.Date;
     1100                //        dBuildDate = dBuildDate.AddDays(col);
     1101                //        dBuildDate = dBuildDate.AddHours(a.StartTime.Hour);
     1102                //        dBuildDate = dBuildDate.AddMinutes(a.StartTime.Minute);
     1103                //        a.StartTime = dBuildDate;
     1104                //        dBuildDate = dtStart.Date;
     1105                //        dBuildDate = dBuildDate.AddDays(col);
     1106                //        dBuildDate = dBuildDate.AddHours(a.EndTime.Hour);
     1107                //        dBuildDate = dBuildDate.AddMinutes(a.EndTime.Minute);
     1108                //        a.EndTime = dBuildDate;
     1109
     1110                //        //Call Document to add a new appointment
     1111                //        this.Document.CreateAppointmentAuto(a);
     1112                //    }
     1113
     1114                //    //Increment start and end
     1115                //    dtStart = dtStart.AddDays(7);
     1116                //    dtEnd = dtStart.AddDays(6);
     1117
     1118                                // }//end for
    10771119                                try
    10781120                                {
     
    14241466                        cg.Invalidate();
    14251467                }
     1468
     1469
     1470
     1471        private void saveAccessBlocksWorker_DoWork(object sender, DoWorkEventArgs e)
     1472        {
     1473            BackgroundWorker worker = (BackgroundWorker)sender;
     1474            DAccessTemplate dlg = (DAccessTemplate)e.Argument;
     1475
     1476            OpenFileDialog openFileDialog1 = dlg.FileDialog;
     1477            openFileDialog1.RestoreDirectory = false; // go back to our dir
     1478            Stream streamFile;
     1479            if ((streamFile = openFileDialog1.OpenFile()) == null)
     1480            {
     1481                MessageBox.Show("Unable to open template file.");
     1482                return;
     1483            }
     1484
     1485            BinaryFormatter formatter = new BinaryFormatter();
     1486            CGAppointments cgaTemp = (CGAppointments)formatter.Deserialize(streamFile);
     1487            streamFile.Close();
     1488
     1489            DateTime dtStart = dlg.StartDate;
     1490            DateTime newStartDate, newEndDate;
     1491            this.Document.WeekNeedsRefresh(1, dtStart, out newStartDate, out newEndDate);
     1492            dtStart = newStartDate;
     1493            int nWeeksToApply = dlg.WeeksToApply;
     1494            DateTime dtEnd = dtStart.AddDays(6); // or 7?
     1495
     1496            string sResourceID = this.m_Document.ResourceID.ToString();
     1497            DataTable dt;
     1498
     1499            for (int j = 1; j < nWeeksToApply + 1; j++)
     1500            {
     1501                float fProgressPercentage = ((float)j / (float)nWeeksToApply) * 100;
     1502                int iProgressPercentage = (int)fProgressPercentage;
     1503                worker.ReportProgress(iProgressPercentage);
     1504                //Convert start and end to string
     1505                //string sStart = dtStart.ToString("M/d/yyyy");
     1506                //string sEnd = dtEnd.ToString("M/d/yyyy");
     1507                //i18n
     1508                string sStart = FMDateTime.Create(dtStart).DateOnly.FMDateString;
     1509                string sEnd = FMDateTime.Create(dtEnd).DateOnly.FMDateString;
     1510                //Cancel all existing access blocks in the date range
     1511                string sSql = "BSDX CANCEL AV BY DATE^" + sResourceID + "^" + sStart + "^" + sEnd;
     1512                CGDocumentManager.RPMSDataTableDelegate d = new CGDocumentManager.RPMSDataTableDelegate(m_DocManager.RPMSDataTable);
     1513                //dt = this.m_DocManager.RPMSDataTable(sSql, "Cancelled");
     1514                dt = d(sSql, "Cancelled");
     1515                //for each CGAppointment in AVBlocks, call AddNew
     1516                string sResource = "";
     1517                sResource = (string)this.Document.Resources[0];
     1518                foreach (CGAppointment a in cgaTemp.AppointmentTable.Values)
     1519                {
     1520                    //Change the resource to the current one
     1521                    a.Resource = sResource;
     1522
     1523                    //Change the date to correspond to the GridColumn member
     1524                    int col = a.GridColumn;
     1525                    col--;
     1526                    DateTime dBuildDate = dtStart.Date;
     1527                    dBuildDate = dBuildDate.AddDays(col);
     1528                    dBuildDate = dBuildDate.AddHours(a.StartTime.Hour);
     1529                    dBuildDate = dBuildDate.AddMinutes(a.StartTime.Minute);
     1530                    a.StartTime = dBuildDate;
     1531                    dBuildDate = dtStart.Date;
     1532                    dBuildDate = dBuildDate.AddDays(col);
     1533                    dBuildDate = dBuildDate.AddHours(a.EndTime.Hour);
     1534                    dBuildDate = dBuildDate.AddMinutes(a.EndTime.Minute);
     1535                    a.EndTime = dBuildDate;
     1536
     1537                    //Call Document to add a new appointment
     1538                    this.Document.CreateAppointmentAuto(a);
     1539                }
     1540
     1541                //Increment start and end
     1542                dtStart = dtStart.AddDays(7);
     1543                dtEnd = dtStart.AddDays(6);
     1544
     1545            }
     1546
     1547        }
     1548
     1549        private void saveAccessBlocksWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
     1550        {
     1551            this.statusBar1.Text = "Done saving access blocks.";
     1552        }
     1553
     1554        private void saveAccessBlocksWorker_ProgressChanged(object sender, ProgressChangedEventArgs e)
     1555        {
     1556            this.statusBar1.Text = "Saving Data to VISTA. Progress: " + e.ProgressPercentage + " %";
     1557        }
     1558
     1559        private void mnuDeleteAllAppointments_Click(object sender, EventArgs e)
     1560        {
     1561            MassAppointmentDelete();
     1562        }
    14261563        }
    14271564}
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/CGAVView.resx

    r614 r1011  
    133133    <value>281, 17</value>
    134134  </metadata>
     135  <metadata name="saveAccessBlocksWorker.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     136    <value>398, 17</value>
     137  </metadata>
    135138  <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    136139  <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/CGDocumentManager.cs

    r966 r1011  
    10351035                }
    10361036
    1037                 delegate DataTable RPMSDataTableDelegate(string CommandString, string TableName);
     1037                public delegate DataTable RPMSDataTableDelegate(string CommandString, string TableName);
    10381038
    10391039                public DataTable RPMSDataTable(string sSQL, string sTableName)
     
    10481048                        try
    10491049                        {
    1050                                 System.IntPtr pHandle = this.Handle;
     1050                                //System.IntPtr pHandle = this.Handle;
    10511051                                RPMSDataTableDelegate rdtd = new RPMSDataTableDelegate(ConnectInfo.RPMSDataTable);
    10521052                                dtOut = (DataTable) this.Invoke(rdtd, new object[] {sSQL, sTableName});
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/CGSchedLib.cs

    r853 r1011  
    9595                       
    9696                        string sResName;
     97            // for each resource
    9798                        for (int i = 0; i < nSize; i++)
    9899                        {
    99100                                sResName = saryResourceNames[i].ToString();
    100 
     101                //Gets all the slots (or Availabities, if you like)
    101102                                rsSlotSchedule = CGSchedLib.CreateAssignedSlotSchedule(docManager, sResName, StartTime, EndTime, saryApptTypes,/**/ stType, sSearchInfo);
    102103                                OutputArray(rsSlotSchedule, "rsSlotSchedule");
    103 
     104                //if we have slots
    104105                                if (rsSlotSchedule.Rows.Count > 0 )
    105106                                {
     107                    // Get appointment count to substract from the slots
    106108                                        rsApptSchedule = CGSchedLib.CreateAppointmentSlotSchedule(docManager, sResName, StartTime, EndTime, stType);
    107109                                        OutputArray(rsApptSchedule, "rsApptSchedule");
     110                    // Perform the substraction
    108111                                        rsTemp1 = CGSchedLib.SubtractSlotsRS2(rsSlotSchedule, rsApptSchedule, sResName);
    109112                                        OutputArray(rsTemp1, "rsTemp1");
     
    114117                                        OutputArray(rsTemp1, "rsTemp1");
    115118                                }
     119                // if only one resource was passed in, its availablility is what we want
    116120                                if (i == 0)
    117121                                {
     
    586590                }
    587591
     592        /// <summary>
     593        /// My guess is that this calculates remaining slots
     594        /// </summary>
     595        /// <param name="rsBlocks1"></param>
     596        /// <param name="rsBlocks2"></param>
     597        /// <param name="sResource"></param>
     598        /// <returns></returns>
    588599                public static DataTable SubtractSlotsRS2(DataTable rsBlocks1, DataTable rsBlocks2, string sResource)
    589600                {
     
    770781                }//end IntersectBlocks
    771782
    772 
     783        /// <summary>
     784        /// Number of minutes since Jan 1 1980
     785        /// </summary>
     786        /// <param name="d">Date to compare</param>
     787        /// <returns>Minutes as integer</returns>
    773788                public static int MinSince80(DateTime d)
    774789                {
     
    878893                        rect1.Height = CGSchedLib.MinSince80(dEnd1) - rect1.Y;
    879894
     895            //for each row in the availability schedule
    880896                        foreach (DataRow r in rsBlock.Rows)
    881897                        {
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/CalendarGrid.cs

    r900 r1011  
    677677            else
    678678            {
     679                //columnToPutAppt = (startTime - this.m_dtStart).Days + 1;
     680                //test sam
    679681                columnToPutAppt = (startTime - this.m_dtStart).Days + 1;
    680682            }
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/ClinicalScheduling.csproj.user

    r971 r1011  
    3737    </RemoteDebugMachine>
    3838    <StartAction>Project</StartAction>
    39     <StartArguments>/s=172.16.17.51 /p=9260 /a=shabiel12 /v=abc,123!</StartArguments>
     39    <StartArguments>/s=192.168.56.101 /p=9260 /a=shabiel12 /v=catdog.66</StartArguments>
    4040    <StartPage>
    4141    </StartPage>
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/DAccessTemplate.cs

    r915 r1011  
    3636
    3737                        UpdateDialogData(true);
    38 
     38            //this.cmdSelectTemplate.Focus(); // Focus on first button on form
    3939                }
    4040
     
    113113                        m_bSelectedFile = false;
    114114                        OpenFileDialog openFileDialog1 = new OpenFileDialog();
    115                         string sPath = "";
    116                         sPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
    117 
    118                         openFileDialog1.InitialDirectory = @"c:\" ;
    119                         openFileDialog1.InitialDirectory = sPath ;
    120115                        openFileDialog1.Filter = "Schedule Template Files (*.bsdxa)|*.bsdxa|All files (*.*)|*.*" ;
    121116                        openFileDialog1.FilterIndex = 0 ;
     
    185180            this.cmdCancel.Name = "cmdCancel";
    186181            this.cmdCancel.Size = new System.Drawing.Size(56, 24);
    187             this.cmdCancel.TabIndex = 2;
     182            this.cmdCancel.TabIndex = 5;
    188183            this.cmdCancel.Text = "Cancel";
    189184            //
     
    194189            this.cmdOK.Name = "cmdOK";
    195190            this.cmdOK.Size = new System.Drawing.Size(64, 24);
    196             this.cmdOK.TabIndex = 1;
     191            this.cmdOK.TabIndex = 4;
    197192            this.cmdOK.Text = "OK";
    198193            this.cmdOK.Click += new System.EventHandler(this.cmdOK_Click);
     
    234229            this.cmdSelectTemplate.Name = "cmdSelectTemplate";
    235230            this.cmdSelectTemplate.Size = new System.Drawing.Size(136, 32);
    236             this.cmdSelectTemplate.TabIndex = 9;
     231            this.cmdSelectTemplate.TabIndex = 1;
    237232            this.cmdSelectTemplate.Text = "Select Access Template";
    238233            this.cmdSelectTemplate.Click += new System.EventHandler(this.cmdSelectTemplate_Click);
     
    254249            this.dtpStartDate.Name = "dtpStartDate";
    255250            this.dtpStartDate.Size = new System.Drawing.Size(184, 20);
    256             this.dtpStartDate.TabIndex = 11;
     251            this.dtpStartDate.TabIndex = 2;
    257252            //
    258253            // udWeeksToApply
     
    271266            this.udWeeksToApply.Name = "udWeeksToApply";
    272267            this.udWeeksToApply.Size = new System.Drawing.Size(96, 20);
    273             this.udWeeksToApply.TabIndex = 12;
     268            this.udWeeksToApply.TabIndex = 3;
    274269            this.udWeeksToApply.Value = new decimal(new int[] {
    275270            1,
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/UCPatientAppts.cs

    r824 r1011  
    119119        private void btnPrint_Click(object sender, EventArgs e)
    120120        {
     121            //Fixes bug reported by EHS. Don't print if there are no appointments as this causes null ref
     122            if (dtAppt.Rows.Count == 0)
     123            {
     124                MessageBox.Show("No Appointments to Print", "Nothing to Print");
     125                return;
     126            }
     127
    121128            rowToPrint = 0; //reset row to print
    122129            DialogResult res = printDialog1.ShowDialog();
     
    124131        }
    125132
     133        /// <summary>
     134        /// Sets default page orientation to landscape.
     135        /// </summary>
    126136        private void PrintPtAppts_QueryPageSettings(object sender, System.Drawing.Printing.QueryPageSettingsEventArgs e)
    127137        {
Note: See TracChangeset for help on using the changeset viewer.