Changeset 1097


Ignore:
Timestamp:
Mar 3, 2011, 4:44:18 AM (13 years ago)
Author:
Sam Habiel
Message:

DPatientLookup.cs: Usings Cleanup
DApptSearch: Extensive refactoring. Now uses new algorithm to find appointments. Now outputs CGAvailability
CGView: Appointments checked in now set the Checkin time on the appointment structure; changes to support DApptSearch modified output.
CGSchedLib: Extensive refactoring; only 2 methods remain: CreateAppointmentSchedule and CreateAvailabilitySchedule
CGDocument: SlotsAvailable uses a new algorithm
CGAVView: Uses CalendarGrid.TimesOverlap instead of the removed one in CGSchedLib
CGAVDocument: Uses CalendarGrid.TimesOverlap instead of the removed one in CGSchedLib; CreateAssignedSlotSchedule reassigned to CreateAvailabilitySchedule

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

Legend:

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

    r1095 r1097  
    169169                                        DateTime sStart2 = a.StartTime;
    170170                                        DateTime sEnd2 = a.EndTime;
    171                                         if ((a.AppointmentKey != pAppt.AppointmentKey) && (CGSchedLib.TimesOverlap(dNewStart, dNewEnd, a.StartTime, a.EndTime)))
     171                                        if ((a.AppointmentKey != pAppt.AppointmentKey) && (CalendarGrid.TimesOverlap(dNewStart, dNewEnd, a.StartTime, a.EndTime)))
    172172                                        {
    173173                                                MessageBox.Show("Access blocks may not overlap.","Clinical Scheduling", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     
    298298                                        DateTime sStart2 = a.StartTime;
    299299                                        DateTime sEnd2 = a.EndTime;
    300                                         if (CGSchedLib.TimesOverlap(aCopy.StartTime, aCopy.EndTime, a.StartTime, a.EndTime))
     300                                        if (CalendarGrid.TimesOverlap(aCopy.StartTime, aCopy.EndTime, a.StartTime, a.EndTime))
    301301                                        {
    302302                                                //                                              throw new Exception("Access blocks may not overlap.");
     
    374374                        ArrayList apptTypeIDs = new ArrayList();
    375375
    376                         rAppointmentSchedule = CGSchedLib.CreateAssignedSlotSchedule(m_DocManager, (string) m_sResourcesArray[0], this.m_dStartDate, this.m_dEndDate, apptTypeIDs,/* */ this.m_ScheduleType, "0");
     376                        rAppointmentSchedule = CGSchedLib.CreateAvailabilitySchedule(m_DocManager, m_sResourcesArray, this.m_dStartDate, this.m_dEndDate, apptTypeIDs,/* */ this.m_ScheduleType, "0");
    377377
    378378                        foreach (DataRow r in rAppointmentSchedule.Rows)
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/CGAVView.cs

    r1068 r1097  
    106106            this.panelRight.Location = new System.Drawing.Point(728, 0);
    107107            this.panelRight.Name = "panelRight";
    108             this.panelRight.Size = new System.Drawing.Size(120, 364);
     108            this.panelRight.Size = new System.Drawing.Size(120, 343);
    109109            this.panelRight.TabIndex = 1;
    110110            //
     
    167167            this.panelBottom.Controls.Add(this.statusBar1);
    168168            this.panelBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
    169             this.panelBottom.Location = new System.Drawing.Point(8, 340);
     169            this.panelBottom.Location = new System.Drawing.Point(8, 319);
    170170            this.panelBottom.Name = "panelBottom";
    171171            this.panelBottom.Size = new System.Drawing.Size(720, 24);
     
    195195            this.dateTimePicker1.Dock = System.Windows.Forms.DockStyle.Right;
    196196            this.dateTimePicker1.DropDownAlign = System.Windows.Forms.LeftRightAlignment.Right;
    197             this.dateTimePicker1.Format = System.Windows.Forms.DateTimePickerFormat.Short;
    198             this.dateTimePicker1.Location = new System.Drawing.Point(592, 0);
     197            this.dateTimePicker1.Location = new System.Drawing.Point(517, 0);
    199198            this.dateTimePicker1.Name = "dateTimePicker1";
    200             this.dateTimePicker1.Size = new System.Drawing.Size(128, 20);
     199            this.dateTimePicker1.Size = new System.Drawing.Size(203, 20);
    201200            this.dateTimePicker1.TabIndex = 4;
    202201            this.dateTimePicker1.ValueChanged += new System.EventHandler(this.dateTimePicker1_ValueChanged);
     
    219218            this.panelCenter.Location = new System.Drawing.Point(8, 24);
    220219            this.panelCenter.Name = "panelCenter";
    221             this.panelCenter.Size = new System.Drawing.Size(712, 316);
     220            this.panelCenter.Size = new System.Drawing.Size(712, 295);
    222221            this.panelCenter.TabIndex = 4;
    223222            //
     
    255254            this.tvSchedules.Location = new System.Drawing.Point(0, 0);
    256255            this.tvSchedules.Name = "tvSchedules";
    257             this.tvSchedules.Size = new System.Drawing.Size(8, 364);
     256            this.tvSchedules.Size = new System.Drawing.Size(8, 343);
    258257            this.tvSchedules.Sorted = true;
    259258            this.tvSchedules.TabIndex = 5;
     
    456455            this.splitter1.Location = new System.Drawing.Point(720, 24);
    457456            this.splitter1.Name = "splitter1";
    458             this.splitter1.Size = new System.Drawing.Size(8, 316);
     457            this.splitter1.Size = new System.Drawing.Size(8, 295);
    459458            this.splitter1.TabIndex = 6;
    460459            this.splitter1.TabStop = false;
     
    486485            this.calendarGrid1.Resources = ((System.Collections.ArrayList)(resources.GetObject("calendarGrid1.Resources")));
    487486            this.calendarGrid1.SelectedAppointment = 0;
    488             this.calendarGrid1.Size = new System.Drawing.Size(712, 316);
     487            this.calendarGrid1.Size = new System.Drawing.Size(712, 295);
    489488            this.calendarGrid1.StartDate = new System.DateTime(2003, 1, 27, 0, 0, 0, 0);
    490489            this.calendarGrid1.TabIndex = 2;
    491490            this.calendarGrid1.TimeScale = 20;
    492             this.calendarGrid1.CGAppointmentAdded += new CalendarGrid.CGAppointmentChangedHandler(this.calendarGrid1_CGAppointmentAdded);
    493             this.calendarGrid1.CGAppointmentChanged += new CalendarGrid.CGAppointmentChangedHandler(this.calendarGrid1_CGAppointmentChanged);
    494             this.calendarGrid1.CGSelectionChanged += new CalendarGrid.CGSelectionChangedHandler(this.calendarGrid1_CGSelectionChanged);
     491            this.calendarGrid1.CGAppointmentChanged += new IndianHealthService.ClinicalScheduling.CalendarGrid.CGAppointmentChangedHandler(this.calendarGrid1_CGAppointmentChanged);
     492            this.calendarGrid1.CGAppointmentAdded += new IndianHealthService.ClinicalScheduling.CalendarGrid.CGAppointmentChangedHandler(this.calendarGrid1_CGAppointmentAdded);
     493            this.calendarGrid1.CGSelectionChanged += new IndianHealthService.ClinicalScheduling.CalendarGrid.CGSelectionChangedHandler(this.calendarGrid1_CGSelectionChanged);
    495494            this.calendarGrid1.DoubleClick += new System.EventHandler(this.calendarGrid1_DoubleClick);
    496495            //
     
    498497            //
    499498            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
    500             this.ClientSize = new System.Drawing.Size(848, 364);
     499            this.ClientSize = new System.Drawing.Size(848, 343);
    501500            this.Controls.Add(this.panelCenter);
    502501            this.Controls.Add(this.splitter1);
     
    727726                                        DateTime sStart2 = a.StartTime;
    728727                                        DateTime sEnd2 = a.EndTime;
    729                                         if (CGSchedLib.TimesOverlap(dStart, dEnd, a.StartTime, a.EndTime))
     728                                        if (CalendarGrid.TimesOverlap(dStart, dEnd, a.StartTime, a.EndTime))
    730729                                        {
    731730                                                MessageBox.Show("Access blocks may not overlap.","Clinical Scheduling", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/CGAVView.resx

    r1011 r1097  
    113113  </resheader>
    114114  <resheader name="reader">
    115     <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
     115    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
    116116  </resheader>
    117117  <resheader name="writer">
    118     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
     118    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
    119119  </resheader>
    120   <metadata name="ctxApptClipMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     120  <metadata name="ctxApptClipMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    121121    <value>17, 17</value>
    122122  </metadata>
    123   <metadata name="ctxCalendarGrid.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     123  <metadata name="ctxCalendarGrid.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    124124    <value>151, 17</value>
    125125  </metadata>
     
    130130</value>
    131131  </data>
    132   <metadata name="mainMenu1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     132  <metadata name="mainMenu1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    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">
     135  <metadata name="saveAccessBlocksWorker.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    136136    <value>398, 17</value>
    137137  </metadata>
    138   <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
     138  <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    139139  <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
    140140    <value>
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/CGDocument.cs

    r1095 r1097  
    77using System.Windows.Forms;
    88using IndianHealthService.BMXNet;
     9using System.Linq;
    910
    1011namespace IndianHealthService.ClinicalScheduling
     
    627628        }
    628629
     630        /// <summary>
     631        /// Gets number of slots left in a certain selection on the grid. Used in Multiple Places.
     632        /// </summary>
     633        /// <param name="dSelStart">Selection Start Date</param>
     634        /// <param name="dSelEnd">Selection End Date</param>
     635        /// <param name="sResource">Resource Name</param>
     636        /// <param name="sAccessType">Out: Name of Access Type</param>
     637        /// <param name="sAvailabilityMessage">Out: Access Note</param>
     638        /// <returns>Number of slots</returns>
    629639        public int SlotsAvailable(DateTime dSelStart, DateTime dSelEnd, string sResource, out string sAccessType, out string sAvailabilityMessage)
    630640        {
     641
     642
     643            sAccessType = "";               //default out value
     644            sAvailabilityMessage = "";      //default out value
     645
     646            double slotsAvailable = 0;      //defalut return value
     647
     648            //NOTE: What's this lock? This lock makes sure that nobody is editing the availability array
     649            //when we are looking at it. Since the availability array could potentially be updated on
     650            //a different thread, we are can be potentially left stuck with an empty array.
     651            //
     652            //The other place that uses this lock is the RefershAvailabilitySchedule method
     653            //
     654            //This is a temporary fix until I figure out how to divorce the availbilities here from those drawn
     655            //on the calendar. Appointments are cloned b/c they are in an object that supports that; and b/c I
     656            //don't need to suddenly query them at runtime like I do with Availabilities.
     657
     658            //Let's Try Linq
     659            lock (this.m_pAvArray)
     660            {
     661                //This foreach loop looks for an availability that overlaps where the user clicked.
     662                //There can only be one, as availabilites cannot overlap each other (enforced at the DB level)
     663                //If selection hits multiple blocks, get the block with the most slots (reflected by the sorting here)
     664                CGAvailability[] pAVs = (from pAV in this.m_pAvArray.Cast<CGAvailability>()
     665                                         where (sResource == pAV.ResourceList && CalendarGrid.TimesOverlap(dSelStart, dSelEnd, pAV.StartTime, pAV.EndTime))
     666                                         orderby pAV.Slots descending
     667                                         select pAV)
     668                                         .ToArray<CGAvailability>();
     669
     670                if ((pAVs.Length) == 0) return 0;
     671
     672                slotsAvailable = pAVs[0].Slots;
     673                sAccessType = pAVs[0].AccessTypeName;
     674                sAvailabilityMessage = pAVs[0].Note;
     675
     676                //Subtract total slots current appointments take up.
     677                slotsAvailable -= (from appt in this.Appointments.AppointmentTable.Values.Cast<CGAppointment>()
     678                                   //If the resource is the same and the user selection overlaps, then...
     679                                   where (sResource == appt.Resource && CalendarGrid.TimesOverlap(pAVs[0].StartTime, pAVs[0].EndTime, appt.StartTime, appt.EndTime))
     680                                   // if appt starttime is before avail start time, only count against the avail starting from the availability start time
     681                                   let startTimeToCountAgainstBlock = appt.StartTime < pAVs[0].StartTime ? pAVs[0].StartTime : appt.StartTime
     682                                   // if appt endtime is after the avail ends, only count against the avail up to where the avail ends
     683                                   let endTimeToCountAgainstBlock = appt.EndTime > pAVs[0].EndTime ? pAVs[0].EndTime : appt.EndTime
     684                                   // theoretical minutes per slot for the availability
     685                                   let minPerSlot = (pAVs[0].EndTime - pAVs[0].StartTime).TotalMinutes / pAVs[0].Slots
     686                                   // how many minutes does this appointment take away from the slot
     687                                   let minPerAppt = (endTimeToCountAgainstBlock - startTimeToCountAgainstBlock).TotalMinutes
     688                                   // how many slots the appointment takes up using this availability's scale
     689                                   let slotsConsumed = minPerAppt / minPerSlot
     690                                   select slotsConsumed)
     691                                   // add up SlotsConsumed to substract from slotsAvailable
     692                                   .Sum();
     693            }
     694
     695            return (int)slotsAvailable;
     696
     697            /* OLD ALGOTHRIM 2
     698
     699            lock (this.m_pAvArray)
     700            {
     701                //This foreach loop looks for an availability that overlaps where the user clicked.
     702                //There can only be one, as availabilites cannot overlap each other (enforced at the DB level)
     703                //Therefore, we loop, and once we find it, we break.
     704                foreach (CGAvailability pAV in this.m_pAvArray)
     705                {
     706                    //If the resource is the same and the user selection overlaps, then...
     707                    if (sResource == pAV.ResourceList && CalendarGrid.TimesOverlap(dSelStart, dSelEnd, pAV.StartTime, pAV.EndTime))
     708                    {
     709                        slotsAvailable = pAV.Slots;         //variable now holds the total number of slots
     710                        sAccessType = pAV.AccessTypeName;   //Access Name
     711                        sAvailabilityMessage = pAV.Note;    //Access Block Note
     712                       
     713                        //Here we substract each appointment weight in slots from slotsAvailable
     714                        foreach (DictionaryEntry apptDict in this.m_appointments.AppointmentTable)
     715                        {
     716                            CGAppointment appt = (CGAppointment)apptDict.Value;
     717                            //If the appointment is in the same resource and overlaps with this availablity
     718                            if (sResource == appt.Resource && CalendarGrid.TimesOverlap(pAV.StartTime, pAV.EndTime, appt.StartTime, appt.EndTime))
     719                            {
     720                                // if appt starttime is before avail start time, only count against the avail starting from the availability start time
     721                                DateTime startTimeToCountAgainstBlock = appt.StartTime < pAV.StartTime ? pAV.StartTime : appt.StartTime;
     722                                // if appt endtime is after the avail ends, only count against the avail up to where the avail ends
     723                                DateTime endTimeToCountAgainstBlock = appt.EndTime > pAV.EndTime ? pAV.EndTime : appt.EndTime;
     724                                // theoretical minutes per slot for the availability
     725                                double minPerSlot = (pAV.EndTime - pAV.StartTime).TotalMinutes/pAV.Slots;
     726                                // how many minutes does this appointment take away from the slot
     727                                double minPerAppt = (endTimeToCountAgainstBlock - startTimeToCountAgainstBlock).TotalMinutes;
     728                                // how many slots the appointment takes up using this availability's scale
     729                                double slotsConsumed = minPerAppt / minPerSlot;
     730                                // subscract that from the total slots for the availability
     731                                slotsAvailable -= slotsConsumed;
     732                            } //end if
     733                            //now go to the next appointment in foreach
     734                        }
     735                        // As I said above, we can match only one availability. Once we found it and substracted from it; we are done.
     736                        break;
     737                    }
     738                }
     739                // We return the integer portion of the variable for display to the user or for calculations.
     740                // That means, if 2.11 slots are left, the user sees 2. If 2.66, still 2.
     741                return (int)slotsAvailable;
     742            }
     743            */
     744
     745            /* ORIGINAL ALGORITHM
    631746            sAccessType = "";
    632747            sAvailabilityMessage = "";
     
    695810            }
    696811            return nAvailableSlots;
     812            */
    697813        }
    698814
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/CGSchedLib.cs

    r1095 r1097  
    11using System;
    22using System.Data;
    3 //using System.Data.OleDb;
    43using System.Collections;
    54using System.Diagnostics;
    65using System.Drawing;
    7 using IndianHealthService.BMXNet;
    86
    97namespace IndianHealthService.ClinicalScheduling
     
    2422        /// Gets appointments from VISTA to display in Grid
    2523        /// </summary>
    26         /// <param name="docManager"></param>
    27         /// <param name="saryResNames"></param>
    28         /// <param name="StartTime"></param>
    29         /// <param name="EndTime"></param>
     24        /// <param name="docManager">God Class</param>
     25        /// <param name="saryResNames">Resource Names Array</param>
     26        /// <param name="StartTime">Self Explanatory</param>
     27        /// <param name="EndTime">Self Explanatory</param>
    3028        /// <returns></returns>
    3129                public static DataTable CreateAppointmentSchedule(CGDocumentManager docManager, ArrayList saryResNames, DateTime StartTime, DateTime EndTime)
    3230                {
    33                         string sResName = "";
    34                         for  (int i = 0; i < saryResNames.Count; i++)
    35                         {
    36                                 sResName += saryResNames[i];
    37                                 if ((i+1) < saryResNames.Count)
    38                                         sResName += "|";
    39                         }
    40                        
    41                        
     31            string sResName = string.Join("|", saryResNames.ToArray());                 
    4232            string sStart = FMDateTime.Create(StartTime).DateOnly.FMDateString;
    4333            string sEnd = FMDateTime.Create(EndTime).FMDateString;
     
    4535                        DataTable dtRet = docManager.RPMSDataTable(sSql, "AppointmentSchedule");
    4636                        return dtRet;
    47                        
    4837                }
    4938
     
    5746        /// <param name="EndTime">Self-Explanatory</param>
    5847        /// <param name="saryApptTypes">Array of Access Type IDs</param>
    59         /// <param name="stType"></param>
    60         /// <param name="sSearchInfo"></param>
     48        /// <param name="stType">Not used</param>
     49        /// <param name="sSearchInfo">Specific Search Parameters</param>
    6150        /// <returns></returns>
    62                 public static DataTable CreateAvailabilitySchedule(CGDocumentManager docManager,
    63                         ArrayList saryResourceNames, DateTime StartTime, DateTime EndTime,
    64                         ArrayList saryApptTypes,/**/ ScheduleType stType, string sSearchInfo)
    65                 {
    66                         DataTable rsOut;
    67                         rsOut = new DataTable("AvailabilitySchedule");
    68 
    69                         DataTable rsSlotSchedule;
    70                         DataTable rsApptSchedule;
    71                         DataTable rsTemp1;
    72 
    73                         int nSize = saryResourceNames.Count;
    74                         if (nSize == 0)
    75                         {
    76                                 return rsOut;
    77                         }
    78                        
    79                         string sResName;
     51        public static DataTable CreateAvailabilitySchedule(CGDocumentManager docManager,
     52            ArrayList saryResourceNames, DateTime StartTime, DateTime EndTime,
     53            ArrayList saryApptTypes,/**/ ScheduleType stType, string sSearchInfo)
     54        {
     55            DataTable rsOut = new DataTable("AvailabilitySchedule");
     56            if (saryResourceNames.Count == 0) return rsOut;
     57            string sResNames = string.Join("|", saryResourceNames.ToArray());
     58            string sApptTypeIDs = string.Join("|", saryApptTypes.ToArray());
     59            string sStart = FMDateTime.Create(StartTime).DateOnly.FMDateString;
     60            string sEnd = FMDateTime.Create(EndTime).FMDateString;
     61            string sSql = "BSDX CREATE ASGND SLOT SCHED^" + sResNames + "^" + sStart + "^" + sEnd + "^" + sApptTypeIDs + "^" + sSearchInfo; //+ "^" + sSTType ;
     62            rsOut = docManager.RPMSDataTable(sSql, "AssignedSlotSchedule");
     63
     64            return rsOut;
     65        }
     66
     67            /*NOT USED ANYMORE
    8068            //TODO: Optimize: no need to keep looping through resources.
    8169            // for each resource
     
    8472                                sResName = saryResourceNames[i].ToString();
    8573                //Gets all the slots (or Availabities, or AV Blocks if you like)
    86                                 rsSlotSchedule = CGSchedLib.CreateAssignedSlotSchedule(docManager, sResName, StartTime, EndTime, saryApptTypes,/**/ stType, sSearchInfo);
    87                                
     74                                rsSlotSchedule = CGSchedLib.CreateAssignedSlotSchedule(docManager, sResName, StartTime, EndTime, saryApptTypes, stType, sSearchInfo);
     75                rsTemp1 = rsSlotSchedule;
     76
    8877                //if we have slots
    89                                 if (rsSlotSchedule.Rows.Count > 0 )
    90                                 {
     78                if (rsSlotSchedule.Rows.Count > 0 )
     79                {
    9180                    // Get appointment count to substract from the slots
    92                                         rsApptSchedule = CGSchedLib.CreateAppointmentSlotSchedule(docManager, sResName, StartTime, EndTime, stType);
     81                    rsApptSchedule = CGSchedLib.CreateAppointmentSlotSchedule(docManager, sResName, StartTime, EndTime, stType);
    9382
    9483                    // Perform the substraction
    95                                         rsTemp1 = CGSchedLib.SubtractSlotsRS2(rsSlotSchedule, rsApptSchedule, sResName);
    96 
    97                                 }
     84                    rsTemp1 = CGSchedLib.SubtractSlotsRS2(rsSlotSchedule, rsApptSchedule, sResName);
     85
     86                }
    9887                //otherwise, just return the slot schedule we have.
    99                                 else
    100                                 {
    101                                         rsTemp1 = rsSlotSchedule;
    102 
    103                                 }
     88                else
     89                {
     90                    rsTemp1 = rsSlotSchedule;
     91
     92                }
     93
    10494
    10595                // if only one resource was passed in, its availablility is what we want
     
    117107                        return rsOut;
    118108                }               
    119 
     109                */
    120110
    121111        /* NOT USED ANYMORE!!!
     
    281271        /// D00030START_TIME^D00030END_TIME^I00010SLOTS^T00030RESOURCE^T00010ACCESS_TYPE^T00250NOTE^I00030AVAILABILITYID
    282272        /// </returns>
    283                 public static DataTable CreateAssignedSlotSchedule(CGDocumentManager docManager, string sResourceName, DateTime StartTime,
    284             DateTime EndTime, ArrayList rsaryApptTypeIDs, /**/ ScheduleType stType, string sSearchInfo)
     273                /*
     274         * public static DataTable CreateAssignedSlotSchedule(CGDocumentManager docManager, string sResourceName, DateTime StartTime,
     275            DateTime EndTime, ArrayList rsaryApptTypeIDs, ScheduleType stType, string sSearchInfo)
    285276                {
    286277            //Appointment type ids is now always "" so that all appointment types are returned.
    287                         string sApptTypeIDs = "";
    288                        
    289             //flatten types by '|'
    290                         int nSize = rsaryApptTypeIDs.Count;  //nSize is used to decide where to put the '|' sent in the RPC as we flatten sApptTypeIDs
    291                         for (int i=0; i < nSize; i++)
    292                         {
    293                                 sApptTypeIDs += rsaryApptTypeIDs[i];
    294                                 if (i < (nSize-1))
    295                                         sApptTypeIDs += "|";
    296                         }       
    297        
     278            string sApptTypeIDs = string.Join("|", rsaryApptTypeIDs.ToArray());
    298279            string sStart = FMDateTime.Create(StartTime).DateOnly.FMDateString;
    299280            string sEnd = FMDateTime.Create(EndTime).FMDateString;
     
    303284            return dtRet;
    304285                }
    305 
     286        */
     287
     288        /*
    306289                public static DataTable CreateCopyTable()
    307290                {
     
    358341                        return dtCopy;
    359342                }
     343         */
    360344
    361345        /// <summary>
     
    368352        /// <param name="stType"></param>
    369353        /// <returns>DataTable with 4 columns: START_TIME, END_TIME, SLOTS, RESOURCE </returns>
    370                 public static DataTable CreateAppointmentSlotSchedule(CGDocumentManager docManager, string sResourceName, DateTime StartTime, DateTime EndTime, ScheduleType stType)
     354                /*
     355        public static DataTable CreateAppointmentSlotSchedule(CGDocumentManager docManager, string sResourceName, DateTime StartTime, DateTime EndTime, ScheduleType stType)
    371356                {
    372357            //Change Dates to FM Format
     
    424409                        ScheduleFromArray(cdtArray, StartTime, EndTime, ref ctbApptSchedule);
    425410
    426             /*So far, we have the following:
     411            So far, we have the following:
    427412             * dtRet -> List of Appointments Start and End times, one row per appointment
    428413             * cdtArray -> Linear 1 dimensional Array of dtRet Start and End times, sorted
     
    432417             *      2 appts as 10:10-10:30 and 10:20-10:40 get converted into 10:10-10:20,
    433418             *      10:20-10:30, 10:30-10:40).
    434             */
     419           
    435420
    436421            //Find number of TimeBlocks in ctbApptSchedule that overlap the TimeBlocks in ctbAppointments
     
    498483
    499484                }
    500 
     485        */
     486
     487        /*
    501488                public static int BlocksOverlap(CGAvailability rBlock, ArrayList rTBArray)
    502489                {
     
    542529                        return nCount;
    543530                }
     531        */
    544532
    545533                /// <summary>
     
    552540                /// <returns>true or false</returns>
    553541        /// <remarks>Draws 2 rectangles and sees if they overlap using minutes from 1980 as the start point</remarks>
    554                 public static bool TimesOverlap(DateTime dStart1, DateTime dEnd1, DateTime dStart2, DateTime dEnd2)
     542                /*
     543        public static bool TimesOverlap(DateTime dStart1, DateTime dEnd1, DateTime dStart2, DateTime dEnd2)
    555544                {
    556545                        Rectangle rect1 = new Rectangle();
     
    568557                        return bRet;
    569558                }
    570 
     559        */
     560
     561        /*
    571562                public static void ConsolidateBlocks(ArrayList rTBArray)
    572563                {
     
    607598                        }
    608599                        while (!((bDirty == false) || (rTBArray.Count == 1)));
    609                 }
     600                } */
    610601
    611602        /// <summary>
     
    616607        /// <param name="sResource"></param>
    617608        /// <returns></returns>
    618                 public static DataTable SubtractSlotsRS2(DataTable rsBlocks1, DataTable rsBlocks2, string sResource)
     609                /*
     610        public static DataTable SubtractSlotsRS2(DataTable rsBlocks1, DataTable rsBlocks2, string sResource)
    619611                {
    620612                        //Subtract slots in rsBlocks2 from rsBlocks1
     
    680672
    681673                }
    682 
     674         */
     675
     676        /*
    683677                public static DataTable UnionBlocks(DataTable rs1, DataTable rs2)
    684678                {
     
    714708                        return rsCopy;
    715709                }
    716 
     710        */
     711
     712        /*
    717713                public static DataTable IntersectBlocks(DataTable rs1, DataTable rs2)
    718714                {
     
    770766//                                                      rect2.Height = CGSchedLib.MinSince80(dEnd2) - rect2.Y;
    771767                                                        if (
    772                                                                 /*(rect2.IntersectsWith(rect1) == true)*/
     768                                                                /*(rect2.IntersectsWith(rect1) == true)
    773769                                                                (CGSchedLib.TimesOverlap(dStart1, dEnd1, dStart2, dEnd2) == true)
    774770                                                                &&
     
    797793                        return rsCopy;
    798794                }//end IntersectBlocks
    799 
     795        */
     796       
    800797        /// <summary>
    801798        /// Number of minutes since Jan 1 1980
     
    803800        /// <param name="d">Date to compare</param>
    804801        /// <returns>Minutes as integer</returns>
    805                 public static int MinSince80(DateTime d)
     802                /*
     803        public static int MinSince80(DateTime d)
    806804                {
    807805                        //Returns the total minutes between d and 1 Jan 1980
     
    814812                        return nMinutes;
    815813                }
    816 
     814        */
     815
     816        /*
    817817        /// <summary>
    818818        /// Converts an Array of Times like this:
     
    909909
    910910                }//end ScheduleFromArray
    911 
    912                 //long CResourceLink::SlotsInBlock(CTimeBlock &rTimeBlock, _RecordsetPtr rsBlock)
     911        */
     912               
     913        /*
     914        //long CResourceLink::SlotsInBlock(CTimeBlock &rTimeBlock, _RecordsetPtr rsBlock)
    913915                public static int SlotsInBlock(CGAvailability rTimeBlock, DataTable rsBlock)
    914916                {
     
    952954                        return nSlots;
    953955                }//end SlotsInBlock
    954 
     956        */
     957
     958        /*
    955959                public static string ClinicInBlock(CGAvailability rTimeBlock, DataTable rsBlock)
    956960                {
     
    991995                        return sClinic;
    992996                }//end ClinicInBlock
    993 
     997        */
     998
     999        /*
    9941000                public static bool ResourceRulesInBlock(CGAvailability rTimeBlock, DataTable rsBlock, ref string sResourceList, ref string sAccessRuleList, ref string sNote)
    9951001                {
     
    10591065                        return true;
    10601066                }//End ResourceRulesInBlock
     1067        */
    10611068
    10621069       
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/CGView.cs

    r1095 r1097  
    617617            this.tvSchedules.Location = new System.Drawing.Point(0, 0);
    618618            this.tvSchedules.Name = "tvSchedules";
    619             this.tvSchedules.Size = new System.Drawing.Size(128, 400);
     619            this.tvSchedules.Size = new System.Drawing.Size(128, 358);
    620620            this.tvSchedules.Sorted = true;
    621621            this.tvSchedules.TabIndex = 1;
     
    664664            this.panelRight.Location = new System.Drawing.Point(941, 0);
    665665            this.panelRight.Name = "panelRight";
    666             this.panelRight.Size = new System.Drawing.Size(128, 400);
     666            this.panelRight.Size = new System.Drawing.Size(128, 358);
    667667            this.panelRight.TabIndex = 3;
    668668            this.panelRight.Visible = false;
     
    737737            this.dateTimePicker1.Dock = System.Windows.Forms.DockStyle.Right;
    738738            this.dateTimePicker1.DropDownAlign = System.Windows.Forms.LeftRightAlignment.Right;
    739             this.dateTimePicker1.Format = System.Windows.Forms.DateTimePickerFormat.Short;
    740             this.dateTimePicker1.Location = new System.Drawing.Point(685, 0);
     739            this.dateTimePicker1.Location = new System.Drawing.Point(607, 0);
    741740            this.dateTimePicker1.Name = "dateTimePicker1";
    742             this.dateTimePicker1.Size = new System.Drawing.Size(128, 20);
     741            this.dateTimePicker1.Size = new System.Drawing.Size(206, 20);
    743742            this.dateTimePicker1.TabIndex = 1;
    744743            this.dateTimePicker1.CloseUp += new System.EventHandler(this.dateTimePicker1_CloseUp);
     
    761760            this.panelCenter.Location = new System.Drawing.Point(136, 24);
    762761            this.panelCenter.Name = "panelCenter";
    763             this.panelCenter.Size = new System.Drawing.Size(802, 352);
     762            this.panelCenter.Size = new System.Drawing.Size(802, 310);
    764763            this.panelCenter.TabIndex = 7;
    765764            //
     
    847846            this.panelBottom.Controls.Add(this.statusBar1);
    848847            this.panelBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
    849             this.panelBottom.Location = new System.Drawing.Point(136, 376);
     848            this.panelBottom.Location = new System.Drawing.Point(136, 334);
    850849            this.panelBottom.Name = "panelBottom";
    851850            this.panelBottom.Size = new System.Drawing.Size(802, 24);
     
    865864            this.splitter1.Location = new System.Drawing.Point(128, 24);
    866865            this.splitter1.Name = "splitter1";
    867             this.splitter1.Size = new System.Drawing.Size(8, 376);
     866            this.splitter1.Size = new System.Drawing.Size(8, 334);
    868867            this.splitter1.TabIndex = 9;
    869868            this.splitter1.TabStop = false;
     
    874873            this.splitter2.Location = new System.Drawing.Point(938, 24);
    875874            this.splitter2.Name = "splitter2";
    876             this.splitter2.Size = new System.Drawing.Size(3, 376);
     875            this.splitter2.Size = new System.Drawing.Size(3, 334);
    877876            this.splitter2.TabIndex = 10;
    878877            this.splitter2.TabStop = false;
     
    902901            this.calendarGrid1.Resources = ((System.Collections.ArrayList)(resources.GetObject("calendarGrid1.Resources")));
    903902            this.calendarGrid1.SelectedAppointment = 0;
    904             this.calendarGrid1.Size = new System.Drawing.Size(802, 352);
     903            this.calendarGrid1.Size = new System.Drawing.Size(802, 310);
    905904            this.calendarGrid1.StartDate = new System.DateTime(2003, 1, 27, 0, 0, 0, 0);
    906905            this.calendarGrid1.TabIndex = 0;
     
    915914            //
    916915            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
    917             this.ClientSize = new System.Drawing.Size(1069, 400);
     916            this.ClientSize = new System.Drawing.Size(1069, 358);
    918917            this.Controls.Add(this.panelCenter);
    919918            this.Controls.Add(this.panelBottom);
     
    19881987                this.Document.CheckInAppointment(nApptID, dtCheckIn);
    19891988
    1990                 //Tell appointment that it is checked in--smh cancel that!
    1991                 //a.CheckInTime = DateTime.Now;
     1989                //Tell appointment that it is checked in
     1990                a.CheckInTime = DateTime.Now;
    19921991
    19931992                //smh new code
     
    19961995                // end new code
    19971996
    1998                 //redraw grid (would this work???)
     1997                //redraw grid
    19991998                                this.calendarGrid1.Invalidate();
    20001999                        }
     
    24752474                return;
    24762475
    2477             string sResource = dSearch.SelectedResource;
     2476            CGAvailability av = dSearch.SelectedAvailability;
     2477
    24782478            ArrayList alResource = new ArrayList();
    2479             alResource.Add(sResource);
    2480             DateTime sDate = dSearch.SelectedDate;
    2481             m_sDocName = sResource;
     2479            alResource.Add(av.ResourceList);
     2480            DateTime sDate = av.StartTime;
     2481            m_sDocName = av.ResourceList;
    24822482            OpenSelectedSchedule(alResource, sDate);
    24832483
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/ClinicalScheduling.csproj.user

    r1095 r1097  
    3737    </RemoteDebugMachine>
    3838    <StartAction>Project</StartAction>
    39     <StartArguments>/s=192.168.56.101 /p=9260 /a=shabiel12 /v=catdog.77</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

    r1095 r1097  
    11using System;
    2 using System.Drawing;
    32using System.Collections;
    4 using System.ComponentModel;
     3using System.Collections.Generic;
    54using System.Windows.Forms;
    65using System.Data;
     6using System.Linq;
    77//using System.Data.OleDb;
    8 using IndianHealthService.BMXNet;
    98
    109namespace IndianHealthService.ClinicalScheduling
    1110{
    1211        /// <summary>
    13         /// Summary description for DApptSearch.
     12        /// Modal Dialog for searching for Patient Slots
    1413        /// </summary>
    1514        public class DApptSearch : System.Windows.Forms.Form
     
    1716                private System.Windows.Forms.Panel panel1;
    1817                private System.Windows.Forms.Button cmdCancel;
    19                 private System.Windows.Forms.Button cmdOK;
     18                private System.Windows.Forms.Button btnAccept;
    2019                private System.Windows.Forms.Panel pnlDescription;
    2120                private System.Windows.Forms.GroupBox grpDescription;
     
    3837                private System.Windows.Forms.RadioButton rdoPM;
    3938                private System.Windows.Forms.RadioButton rdoAM;
    40                 private System.Windows.Forms.Label label1;
    41                 private System.Windows.Forms.MonthCalendar calStartDate;
    42                 private System.Windows.Forms.GroupBox groupBox2;
    43                 private System.Windows.Forms.DataGrid grdResult;
    44                 private System.Windows.Forms.Button cmdSearch;
    45                 /// <summary>
    46                 /// Required designer variable.
    47                 /// </summary>
    48                 private System.ComponentModel.Container components = null;
     39        private System.Windows.Forms.Label label1;
     40        private System.Windows.Forms.GroupBox groupBox2;
     41        private System.Windows.Forms.Button cmdSearch;
     42        private ListView lstResults;
     43        private ColumnHeader colStartTime;
     44        private ColumnHeader colEndTime;
     45        private ColumnHeader colResource;
     46        private ColumnHeader colSlots;
     47        private ColumnHeader colAccessType;
     48        private ColumnHeader colDate;
     49        private Label lblEnd;
     50        private Label lblStart;
     51        private DateTimePicker dtEnd;
     52        private DateTimePicker dtStart;
     53        private ColumnHeader colDOW;
     54        private ColumnHeader colID;
     55     
     56        private System.ComponentModel.IContainer components;
    4957
    5058                public DApptSearch()
     
    6068                DataTable               m_dtTypes;
    6169                DataView                m_dvTypes;
    62 
     70        List<CGAvailability> lstResultantAvailabilities;
     71        private CGAvailability _selectedAvailability;
    6372                DateTime                m_dStart;
    6473                DateTime                m_dEnd;
    6574                ArrayList               m_alResources;
    6675                ArrayList               m_alAccessTypes;
    67                 string                  m_sWeekDays;
    68                 string                  m_sAmpm;
    69 
    70                 DataTable               m_dtResult;
    71                 DataView                m_dvResult;
    72 
    73                 string                  m_sSelectedResource;
    74                 DateTime                m_sSelectedDate;
     76                string                  m_sWeekDays; //only practical use now is for sending to server
     77                string                  m_sAmpm; // same here.
    7578
    7679                #endregion Fields
     
    110113                {
    111114
    112                         this.m_DocManager = docManager;
     115            this.Text = "Searching for Appointments in: " + string.Join(" | ", alResources.Cast<string>());
     116           
     117            this.m_DocManager = docManager;
    113118                        this.m_dsGlobal = m_DocManager.GlobalDataSet;
    114                         System.IntPtr pHandle = this.Handle;
     119                       
    115120                        LoadListBox("ALL");
    116121
     
    136141                        cboAccessTypeFilter.Refresh();
    137142
    138                         //Create DataGridTableStyle for Result grid
     143
     144            /* OLD CODE
     145            //Create DataGridTableStyle for Result grid
    139146                        DataGridTableStyle tsResult = new DataGridTableStyle();
    140147                        tsResult.MappingName = "Result";
    141148                        tsResult.ReadOnly = true;
     149
    142150                        // Add START_TIME column style.
    143151                        DataGridTextBoxColumn colStartTime = new DataGridTextBoxColumn();
    144                         colStartTime.MappingName = "START_TIME";
     152            colStartTime.MappingName = "StartTime";
    145153                        colStartTime.HeaderText = "Start Time";
    146154                        colStartTime.Width = 200;
     
    150158                        // Add END_TIME column style.
    151159                        DataGridTextBoxColumn colEndTime = new DataGridTextBoxColumn();
    152                         colEndTime.MappingName = "END_TIME";
     160            colEndTime.MappingName = "EndTime";
    153161                        colEndTime.HeaderText = "End Time";
    154162                        colEndTime.Width = 75;
     
    158166                        // Add RESOURCE column style.
    159167                        DataGridTextBoxColumn colResource = new DataGridTextBoxColumn();
    160                         colResource.MappingName = "RESOURCE";
     168            colResource.MappingName = "ResourceList";
    161169                        colResource.HeaderText = "Resource";
    162170                        colResource.Width = 200;
     
    176184                        colAccess.Width = 200;
    177185                        tsResult.GridColumnStyles.Add(colAccess);
    178                         grdResult.TableStyles.Add(tsResult);
    179 
     186                        //grdResult.TableStyles.Add(tsResult);
     187            */
     188           
    180189                        this.UpdateDialogData(true);
    181190               
     
    232241
    233242                                //Start
    234                                 this.m_dStart = this.calStartDate.SelectionStart;
     243                this.m_dStart = this.dtStart.Value;
    235244
    236245                                //End
    237                                 m_dEnd = calStartDate.SelectionEnd;
    238                                 m_dEnd = m_dEnd.AddHours(23);
    239                                 m_dEnd = m_dEnd.AddMinutes(59);
    240 
     246                                this.m_dEnd = this.dtEnd.Value;
    241247                        }               
    242248                }
     
    270276            this.cmdSearch = new System.Windows.Forms.Button();
    271277            this.cmdCancel = new System.Windows.Forms.Button();
    272             this.cmdOK = new System.Windows.Forms.Button();
     278            this.btnAccept = new System.Windows.Forms.Button();
    273279            this.pnlDescription = new System.Windows.Forms.Panel();
    274280            this.grpDescription = new System.Windows.Forms.GroupBox();
    275281            this.lblDescription = new System.Windows.Forms.Label();
    276282            this.groupBox1 = new System.Windows.Forms.GroupBox();
     283            this.lblEnd = new System.Windows.Forms.Label();
     284            this.lblStart = new System.Windows.Forms.Label();
     285            this.dtEnd = new System.Windows.Forms.DateTimePicker();
     286            this.dtStart = new System.Windows.Forms.DateTimePicker();
    277287            this.label3 = new System.Windows.Forms.Label();
    278288            this.label2 = new System.Windows.Forms.Label();
     
    292302            this.rdoAM = new System.Windows.Forms.RadioButton();
    293303            this.label1 = new System.Windows.Forms.Label();
    294             this.calStartDate = new System.Windows.Forms.MonthCalendar();
    295304            this.groupBox2 = new System.Windows.Forms.GroupBox();
    296             this.grdResult = new System.Windows.Forms.DataGrid();
     305            this.lstResults = new System.Windows.Forms.ListView();
     306            this.colID = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
     307            this.colDate = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
     308            this.colDOW = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
     309            this.colStartTime = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
     310            this.colEndTime = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
     311            this.colResource = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
     312            this.colSlots = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
     313            this.colAccessType = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
    297314            this.panel1.SuspendLayout();
    298315            this.pnlDescription.SuspendLayout();
     
    302319            this.grpTimeOfDay.SuspendLayout();
    303320            this.groupBox2.SuspendLayout();
    304             ((System.ComponentModel.ISupportInitialize)(this.grdResult)).BeginInit();
    305321            this.SuspendLayout();
    306322            //
     
    309325            this.panel1.Controls.Add(this.cmdSearch);
    310326            this.panel1.Controls.Add(this.cmdCancel);
    311             this.panel1.Controls.Add(this.cmdOK);
     327            this.panel1.Controls.Add(this.btnAccept);
    312328            this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom;
    313329            this.panel1.Location = new System.Drawing.Point(0, 461);
     
    334350            this.cmdCancel.Text = "Cancel";
    335351            //
    336             // cmdOK
    337             //
    338             this.cmdOK.DialogResult = System.Windows.Forms.DialogResult.OK;
    339             this.cmdOK.Location = new System.Drawing.Point(128, 8);
    340             this.cmdOK.Name = "cmdOK";
    341             this.cmdOK.Size = new System.Drawing.Size(64, 24);
    342             this.cmdOK.TabIndex = 0;
    343             this.cmdOK.Text = "OK";
    344             this.cmdOK.Visible = false;
    345             this.cmdOK.Click += new System.EventHandler(this.cmdOK_Click);
     352            // btnAccept
     353            //
     354            this.btnAccept.DialogResult = System.Windows.Forms.DialogResult.OK;
     355            this.btnAccept.Location = new System.Drawing.Point(128, 8);
     356            this.btnAccept.Name = "btnAccept";
     357            this.btnAccept.Size = new System.Drawing.Size(176, 24);
     358            this.btnAccept.TabIndex = 0;
     359            this.btnAccept.Text = "Select Slot for Appointment";
     360            this.btnAccept.Click += new System.EventHandler(this.btnAccept_Click);
    346361            //
    347362            // pnlDescription
     
    378393            // groupBox1
    379394            //
     395            this.groupBox1.Controls.Add(this.lblEnd);
     396            this.groupBox1.Controls.Add(this.lblStart);
     397            this.groupBox1.Controls.Add(this.dtEnd);
     398            this.groupBox1.Controls.Add(this.dtStart);
    380399            this.groupBox1.Controls.Add(this.label3);
    381400            this.groupBox1.Controls.Add(this.label2);
     
    385404            this.groupBox1.Controls.Add(this.grpTimeOfDay);
    386405            this.groupBox1.Controls.Add(this.label1);
    387             this.groupBox1.Controls.Add(this.calStartDate);
    388406            this.groupBox1.Dock = System.Windows.Forms.DockStyle.Top;
    389407            this.groupBox1.Location = new System.Drawing.Point(0, 0);
     
    393411            this.groupBox1.TabStop = false;
    394412            this.groupBox1.Text = "Search Parameters";
     413            //
     414            // lblEnd
     415            //
     416            this.lblEnd.AutoSize = true;
     417            this.lblEnd.Location = new System.Drawing.Point(12, 124);
     418            this.lblEnd.Name = "lblEnd";
     419            this.lblEnd.Size = new System.Drawing.Size(153, 13);
     420            this.lblEnd.TabIndex = 67;
     421            this.lblEnd.Text = "End Date to Search (Inclusive)";
     422            //
     423            // lblStart
     424            //
     425            this.lblStart.AutoSize = true;
     426            this.lblStart.Location = new System.Drawing.Point(12, 35);
     427            this.lblStart.Name = "lblStart";
     428            this.lblStart.Size = new System.Drawing.Size(159, 13);
     429            this.lblStart.TabIndex = 66;
     430            this.lblStart.Text = "Start Date to Search (Inclusive)";
     431            //
     432            // dtEnd
     433            //
     434            this.dtEnd.Location = new System.Drawing.Point(12, 141);
     435            this.dtEnd.Name = "dtEnd";
     436            this.dtEnd.Size = new System.Drawing.Size(200, 20);
     437            this.dtEnd.TabIndex = 65;
     438            //
     439            // dtStart
     440            //
     441            this.dtStart.Location = new System.Drawing.Point(12, 54);
     442            this.dtStart.Name = "dtStart";
     443            this.dtStart.Size = new System.Drawing.Size(200, 20);
     444            this.dtStart.TabIndex = 64;
    395445            //
    396446            // label3
     
    542592            //
    543593            this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
    544             this.label1.Location = new System.Drawing.Point(16, 24);
     594            this.label1.Location = new System.Drawing.Point(6, 16);
    545595            this.label1.Name = "label1";
    546596            this.label1.Size = new System.Drawing.Size(136, 16);
     
    548598            this.label1.Text = "Date Range:";
    549599            //
    550             // calStartDate
    551             //
    552             this.calStartDate.Location = new System.Drawing.Point(16, 40);
    553             this.calStartDate.MaxSelectionCount = 62;
    554             this.calStartDate.Name = "calStartDate";
    555             this.calStartDate.TabIndex = 56;
    556             //
    557600            // groupBox2
    558601            //
    559             this.groupBox2.Controls.Add(this.grdResult);
     602            this.groupBox2.Controls.Add(this.lstResults);
    560603            this.groupBox2.Dock = System.Windows.Forms.DockStyle.Fill;
    561604            this.groupBox2.Location = new System.Drawing.Point(0, 208);
     
    566609            this.groupBox2.Text = "Search Result";
    567610            //
    568             // grdResult
    569             //
    570             this.grdResult.CaptionVisible = false;
    571             this.grdResult.DataMember = "";
    572             this.grdResult.Dock = System.Windows.Forms.DockStyle.Fill;
    573             this.grdResult.HeaderForeColor = System.Drawing.SystemColors.ControlText;
    574             this.grdResult.Location = new System.Drawing.Point(3, 16);
    575             this.grdResult.Name = "grdResult";
    576             this.grdResult.ReadOnly = true;
    577             this.grdResult.Size = new System.Drawing.Size(917, 170);
    578             this.grdResult.TabIndex = 0;
    579             this.grdResult.DoubleClick += new System.EventHandler(this.grdResult_DoubleClick);
    580             this.grdResult.CurrentCellChanged += new System.EventHandler(this.grdResult_CurrentCellChanged);
     611            // lstResults
     612            //
     613            this.lstResults.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
     614            this.colID,
     615            this.colDate,
     616            this.colDOW,
     617            this.colStartTime,
     618            this.colEndTime,
     619            this.colResource,
     620            this.colSlots,
     621            this.colAccessType});
     622            this.lstResults.Dock = System.Windows.Forms.DockStyle.Fill;
     623            this.lstResults.FullRowSelect = true;
     624            this.lstResults.GridLines = true;
     625            this.lstResults.Location = new System.Drawing.Point(3, 16);
     626            this.lstResults.MultiSelect = false;
     627            this.lstResults.Name = "lstResults";
     628            this.lstResults.Size = new System.Drawing.Size(917, 170);
     629            this.lstResults.TabIndex = 0;
     630            this.lstResults.UseCompatibleStateImageBehavior = false;
     631            this.lstResults.View = System.Windows.Forms.View.Details;
     632            this.lstResults.DoubleClick += new System.EventHandler(this.lstResults_DoubleClick);
     633            //
     634            // colID
     635            //
     636            this.colID.Text = "ID";
     637            this.colID.Width = 0;
     638            //
     639            // colDate
     640            //
     641            this.colDate.Text = "Date";
     642            this.colDate.Width = 91;
     643            //
     644            // colDOW
     645            //
     646            this.colDOW.Text = "Day of Week";
     647            this.colDOW.Width = 80;
     648            //
     649            // colStartTime
     650            //
     651            this.colStartTime.Text = "Start Time";
     652            this.colStartTime.Width = 87;
     653            //
     654            // colEndTime
     655            //
     656            this.colEndTime.Text = "End Time";
     657            this.colEndTime.Width = 116;
     658            //
     659            // colResource
     660            //
     661            this.colResource.Text = "Resource";
     662            this.colResource.Width = 370;
     663            //
     664            // colSlots
     665            //
     666            this.colSlots.Text = "Slots";
     667            this.colSlots.Width = 47;
     668            //
     669            // colAccessType
     670            //
     671            this.colAccessType.Text = "Access Type";
     672            this.colAccessType.Width = 101;
    581673            //
    582674            // DApptSearch
     
    596688            this.grpDescription.ResumeLayout(false);
    597689            this.groupBox1.ResumeLayout(false);
     690            this.groupBox1.PerformLayout();
    598691            this.grpDayOfWeek.ResumeLayout(false);
    599692            this.grpTimeOfDay.ResumeLayout(false);
    600693            this.groupBox2.ResumeLayout(false);
    601             ((System.ComponentModel.ISupportInitialize)(this.grdResult)).EndInit();
    602694            this.ResumeLayout(false);
    603695
     
    606698
    607699        #region Event Handlers
    608         private void cmdOK_Click(object sender, System.EventArgs e)
    609                 {
    610 
    611                 }
    612700
    613701                private void cmdSearch_Click(object sender, System.EventArgs e)
    614702                {
    615                         //Get the control data into local vars
     703                        //Tell user we are processing
     704            this.Cursor = Cursors.WaitCursor;
     705           
     706            //Get the control data into local vars
    616707                        UpdateDialogData(false);
    617708                        //Resource array, Begin date, Access type array, MTWTF , AM PM
    618                         //Assemble |-delimited resource string
    619                         string sResources = "";
    620                         for (int j=0; j < m_alResources.Count; j++)
    621                         {
    622                                 sResources = sResources + m_alResources[j];
    623                                 if (j < (m_alResources.Count - 1))
    624                                         sResources = sResources + "|";
    625                         }
    626 
    627                         //Access Types Array
    628                         string sTypes = "";
    629                         if (m_alAccessTypes.Count > 0)
    630                         {
    631                                 for (int j=0; j < m_alAccessTypes.Count; j++)
    632                                 {
    633                                         sTypes = sTypes + (string) m_alAccessTypes[j];
    634                                         if (j < (m_alAccessTypes.Count-1))
    635                                                 sTypes = sTypes + "|";
    636                                 }
    637                         }
    638 
     709
     710            //Get Availabilities and Appointments from the DB
     711            //NB: m_sAmpm and m_sWeekDays don't have an effect on the M side side right now
    639712                        string sSearchInfo = "1|" + m_sAmpm + "|" + m_sWeekDays;
    640                         m_dtResult = CGSchedLib.CreateAvailabilitySchedule(m_DocManager, m_alResources, m_dStart, m_dEnd, m_alAccessTypes, ScheduleType.Resource, sSearchInfo);
    641 
    642                         if (m_dtResult.Rows.Count == 0)
    643                         {
    644                                 MessageBox.Show("No availability found.");
    645                                 return;
    646                         }
    647 
    648                         m_dtResult.TableName = "Result";
    649                         m_dtResult.Columns.Add("AMPM", System.Type.GetType("System.String") ,"Convert(START_TIME, 'System.String')" );
    650                         m_dtResult.Columns.Add("DAYOFWEEK", System.Type.GetType("System.String"));
    651                         m_dtResult.Columns.Add("ACCESSNAME", System.Type.GetType("System.String"));
    652 
    653                         DataRow drAT;
    654                         DateTime dt;
    655                         string sDOW;
    656                         int nAccessTypeID;
    657                         string sAccessType;
    658 
    659                         foreach (DataRow dr in m_dtResult.Rows)
    660                         {
    661                                 dt = (DateTime) dr["START_TIME"];
    662                                 sDOW = dt.DayOfWeek.ToString();
    663                                 dr["DAYOFWEEK"] = sDOW;
    664                                 if (dr["ACCESS_TYPE"].ToString() != "")
    665                                 {
    666                                         nAccessTypeID =Convert.ToInt16(dr["ACCESS_TYPE"].ToString());
    667                                         drAT = m_dsGlobal.Tables["AccessTypes"].Rows.Find(nAccessTypeID);
    668                                         if (drAT != null)
    669                                         {
    670                                                 sAccessType = drAT["ACCESS_TYPE_NAME"].ToString();
    671                                                 dr["ACCESSNAME"] = sAccessType;
    672                                         }
    673                                 }
    674                         }
    675 
    676 
    677                         m_dvResult = new DataView(m_dtResult);
    678 
    679                         string sFilter = "(SLOTS > 0)";
    680                         if (m_sAmpm != "")
    681                         {
    682                                 if (m_sAmpm == "AM")
    683                                         sFilter = sFilter + " AND (AMPM LIKE '*AM*')";
    684                                 if (m_sAmpm == "PM")
    685                                         sFilter = sFilter + " AND (AMPM LIKE '*PM*')";
    686                         }
    687 
    688                         bool sOr = false;
    689                         if (m_sWeekDays != "")
    690                         {
    691                                 sFilter += " AND (";
    692                                 if (chkMon.Checked == true)
    693                                 {
    694                                         sFilter = sFilter + "(DAYOFWEEK LIKE '*Monday*')";
    695                                         sOr = true;
    696                                 }
    697                                 if (chkTue.Checked == true)
    698                                 {
    699                                         sFilter = (sOr == true)?sFilter + " OR ":sFilter;
    700                                         sFilter = sFilter + "(DAYOFWEEK LIKE '*Tuesday*')";
    701                                         sOr = true;
    702                                 }
    703                                 if (chkWed.Checked == true)
    704                                 {
    705                                         sFilter = (sOr == true)?sFilter + " OR ":sFilter;
    706                                         sFilter = sFilter + "(DAYOFWEEK LIKE '*Wednesday*')";
    707                                         sOr = true;
    708                                 }
    709                                 if (chkThu.Checked == true)
    710                                 {
    711                                         sFilter = (sOr == true)?sFilter + " OR ":sFilter;
    712                                         sFilter = sFilter + "(DAYOFWEEK LIKE '*Thursday*')";
    713                                         sOr = true;
    714                                 }
    715                                 if (chkFri.Checked == true)
    716                                 {
    717                                         sFilter = (sOr == true)?sFilter + " OR ":sFilter;
    718                                         sFilter = sFilter + "(DAYOFWEEK LIKE '*Friday*')";
    719                                         sOr = true;
    720                                 }
    721                                 if (chkSat.Checked == true)
    722                                 {
    723                                         sFilter = (sOr == true)?sFilter + " OR ":sFilter;
    724                                         sFilter = sFilter + "(DAYOFWEEK LIKE '*Saturday*')";
    725                                         sOr = true;
    726                                 }
    727                                 if (chkSun.Checked == true)
    728                                 {
    729                                         sFilter = (sOr == true)?sFilter + " OR ":sFilter;
    730                                         sFilter = sFilter + "(DAYOFWEEK LIKE '*Sunday*')";
    731                                         sOr = true;
    732                                 }
    733                                 sFilter += ")";
    734                         }
    735 
    736                         if (m_alAccessTypes.Count > 0)
    737                         {
    738                                 sFilter += " AND (";
    739                                 sOr = false;
    740                                 foreach (string sType in m_alAccessTypes)
    741                                 {
    742                                         if (sOr == true)
    743                                                 sFilter += " OR ";
    744                                         sOr = true;
    745                                         sFilter += "(ACCESSNAME = '" + sType + "')";
    746                                 }
    747                                 sFilter += ")";
    748                         }       
    749 
    750                         m_dvResult.RowFilter = sFilter;
    751                         this.grdResult.DataSource = m_dvResult;
    752 
     713                        DataTable m_availTable = CGSchedLib.CreateAvailabilitySchedule(m_DocManager, m_alResources, m_dStart, m_dEnd, m_alAccessTypes, ScheduleType.Resource, sSearchInfo);
     714            DataTable m_apptTable = CGSchedLib.CreateAppointmentSchedule(m_DocManager, m_alResources, m_dStart, m_dEnd);
     715
     716#if DEBUG           
     717            System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch();
     718            stopwatch.Start();
     719#endif
     720            lstResultantAvailabilities = (from rowAV in m_availTable.AsEnumerable()
     721                         
     722                         // Calculate the number of slots consumed in this availability by appointments
     723                         let slotsConsumed = (from appt in m_apptTable.AsEnumerable()
     724                                              //If the resource is the same and the user selection overlaps, then...
     725                                              where (rowAV.Field<string>("RESOURCE") == appt.Field<string>("RESOURCENAME")
     726                                                && CalendarGrid.TimesOverlap(rowAV.Field<DateTime>("START_TIME"), rowAV.Field<DateTime>("END_TIME"), appt.Field<DateTime>("START_TIME"), appt.Field<DateTime>("END_TIME")))
     727                                              // if appt starttime is before avail start time, only count against the avail starting from the availability start time
     728                                              let startTimeToCountAgainstBlock = appt.Field<DateTime>("START_TIME") < rowAV.Field<DateTime>("START_TIME") ? rowAV.Field<DateTime>("START_TIME") : appt.Field<DateTime>("START_TIME")
     729                                              // if appt endtime is after the avail ends, only count against the avail up to where the avail ends
     730                                              let endTimeToCountAgainstBlock = appt.Field<DateTime>("END_TIME") > rowAV.Field<DateTime>("END_TIME") ? rowAV.Field<DateTime>("END_TIME") : appt.Field<DateTime>("END_TIME")
     731                                              // theoretical minutes per slot for the availability
     732                                              let minPerSlot = (rowAV.Field<DateTime>("END_TIME") - rowAV.Field<DateTime>("START_TIME")).TotalMinutes / rowAV.Field<int>("SLOTS")
     733                                              // how many minutes does this appointment take away from the slot
     734                                              let minPerAppt = (endTimeToCountAgainstBlock - startTimeToCountAgainstBlock).TotalMinutes
     735                                              // how many slots the appointment takes up using this availability's scale
     736                                              let slotsConsumed = minPerAppt / minPerSlot
     737                                              select slotsConsumed).Sum()
     738                         
     739                         // Subtract the number consumed from the original ones
     740                         let slotsLeft = (float)rowAV.Field<int>("SLOTS") - slotsConsumed
     741                         // filter by that value if it is at least one slot
     742                         where slotsLeft >= 1
     743                         // Sort by Start Time, then by Resource Name
     744                         orderby rowAV.Field<DateTime>("START_TIME"), rowAV.Field<string>("RESOURCE")
     745                          //return as a CGAvailability
     746                          select new CGAvailability
     747                         {
     748                             ResourceList = rowAV.Field<string>("RESOURCE"),
     749                             StartTime = rowAV.Field<DateTime>("START_TIME"),
     750                             EndTime = rowAV.Field<DateTime>("END_TIME"),
     751                             Slots = (int)slotsLeft,
     752                             // AccessTypeName is grabbed from the Access Type Table using a psuedojoin syntax.
     753                             // "ACCESS_TYPE" is the IEN of the AcceesType.
     754                             // Single or default is b/c we are expecting one result.
     755                             AccessTypeName = (from at in m_dsGlobal.Tables["AccessTypes"].AsEnumerable()
     756                                              where at.Field<int>("BMXIEN")==Int32.Parse(rowAV.Field<string>("ACCESS_TYPE"))
     757                                              select at.Field<string>("ACCESS_TYPE_NAME")).SingleOrDefault<string>(),
     758                             AvailabilityType = rowAV.Field<int>("AVAILABILITYID")
     759                         })
     760                         // convert to Generic List
     761                         .ToList<CGAvailability>();
     762
     763            // if specific access types are chosen, filter the results based on a join against them.
     764            if (m_alAccessTypes.Count > 0)
     765                lstResultantAvailabilities = (from av in lstResultantAvailabilities
     766                                              join at in m_alAccessTypes.Cast<string>() on av.AccessTypeName equals at
     767                                              select av).ToList<CGAvailability>();
     768
     769            // if user chose AM radio button, get morning appointments
     770            // TimeSpan.FromHours(12) gets the number of ticks since Midnight
     771            if (rdoAM.Checked) // less than 12 pm
     772            {
     773                lstResultantAvailabilities = (from av in lstResultantAvailabilities
     774                                              where av.StartTime.TimeOfDay < TimeSpan.FromHours(12)
     775                                              select av).ToList<CGAvailability>();
     776            }
     777            // if user chose PM radio button, get morning appointments
     778            if (rdoPM.Checked) // after or equal to 12 pm
     779            {
     780                lstResultantAvailabilities = (from av in lstResultantAvailabilities
     781                                              where av.StartTime.TimeOfDay >= TimeSpan.FromHours(12)
     782                                              select av).ToList<CGAvailability>();
     783            }
     784
     785            // if any of the days of week are checked, create a new list based on them
     786            // and clear the original list, and join the new lists together
     787            if (chkMon.Checked || chkTue.Checked || chkWed.Checked || chkThu.Checked || chkFri.Checked || chkSat.Checked || chkSun.Checked)
     788            {
     789
     790                var lstMonday = new List<CGAvailability>();
     791                var lstTuesday = new List<CGAvailability>();
     792                var lstWednesday = new List<CGAvailability>();
     793                var lstThursday = new List<CGAvailability>();
     794                var lstFriday = new List<CGAvailability>();
     795                var lstSaturday = new List<CGAvailability>();
     796                var lstSunday = new List<CGAvailability>();
     797
     798                if (chkMon.Checked == true)
     799                {
     800                    lstMonday = (from av in lstResultantAvailabilities
     801                                 where av.StartTime.DayOfWeek == DayOfWeek.Monday
     802                                 select av).ToList<CGAvailability>();
     803                }
     804
     805                if (chkTue.Checked == true)
     806                {
     807                    lstTuesday = (from av in lstResultantAvailabilities
     808                                  where av.StartTime.DayOfWeek == DayOfWeek.Tuesday
     809                                  select av).ToList<CGAvailability>();
     810                }
     811
     812                if (chkWed.Checked == true)
     813                {
     814                    lstWednesday = (from av in lstResultantAvailabilities
     815                                    where av.StartTime.DayOfWeek == DayOfWeek.Wednesday
     816                                    select av).ToList<CGAvailability>();
     817
     818                }
     819
     820                if (chkThu.Checked == true)
     821                {
     822                    lstThursday = (from av in lstResultantAvailabilities
     823                                   where av.StartTime.DayOfWeek == DayOfWeek.Thursday
     824                                   select av).ToList<CGAvailability>();
     825
     826                }
     827
     828                if (chkFri.Checked == true)
     829                {
     830                    lstFriday = (from av in lstResultantAvailabilities
     831                                 where av.StartTime.DayOfWeek == DayOfWeek.Friday
     832                                 select av).ToList<CGAvailability>();
     833                }
     834
     835                if (chkSat.Checked == true)
     836                {
     837                    lstSaturday = (from av in lstResultantAvailabilities
     838                                   where av.StartTime.DayOfWeek == DayOfWeek.Saturday
     839                                   select av).ToList<CGAvailability>();
     840
     841                }
     842
     843                if (chkSun.Checked == true)
     844                {
     845                    lstSunday = (from av in lstResultantAvailabilities
     846                                 where av.StartTime.DayOfWeek == DayOfWeek.Sunday
     847                                 select av).ToList<CGAvailability>();
     848
     849                }
     850
     851
     852                lstResultantAvailabilities.Clear();
     853                lstResultantAvailabilities.AddRange(lstMonday);
     854                lstResultantAvailabilities.AddRange(lstTuesday);
     855                lstResultantAvailabilities.AddRange(lstWednesday);
     856                lstResultantAvailabilities.AddRange(lstThursday);
     857                lstResultantAvailabilities.AddRange(lstFriday);
     858                lstResultantAvailabilities.AddRange(lstSaturday);
     859                lstResultantAvailabilities.AddRange(lstSunday);
     860
     861                lstResultantAvailabilities.OrderBy(av => av.StartTime).ThenBy(av => av.ResourceList);
     862            }
     863
     864           
     865
     866#if DEBUG
     867            System.Diagnostics.Debug.Write("LINQ took this long: " + stopwatch.ElapsedMilliseconds + "\n");
     868            stopwatch = null;
     869#endif
     870           
     871            //Then, convert the availabilities to ListViewItems
     872            var items = (from item in lstResultantAvailabilities
     873                        let s = new string[] {item.AvailabilityType.ToString(), item.StartTime.ToShortDateString(), item.StartTime.DayOfWeek.ToString(),item.StartTime.ToShortTimeString() ,item.EndTime.ToShortTimeString() ,item.ResourceList,item.Slots.ToString(),item.AccessTypeName}
     874                        let lvItem = new ListViewItem(s)
     875                        select lvItem).ToArray<ListViewItem>();
     876
     877            //--Updating Listview
     878            lstResults.BeginUpdate(); //tell listview to suspend drawing for now
     879            lstResults.Items.Clear(); //empty it from old data
     880
     881            //if (items.Length == 0) lstResults.Items.Add(new ListViewItem(new string[] { "", "", "", "" , "", "No Slots found", "", "" })); // no results
     882            if (items.Length > 0) lstResults.Items.AddRange(items); // add new data
     883
     884            lstResults.EndUpdate(); // ok done adding items, draw now.
     885            //--End Update Listview
     886
     887            //We are done
     888            this.Cursor = Cursors.Default;
    753889                }
    754890
     
    770906                private void grdResult_DoubleClick(object sender, System.EventArgs e)
    771907                {
    772                         if (grdResult.DataSource == null)
     908                        /*
     909            if (lstResults.DataSource == null)
    773910                                return;
    774911
    775                         DataGridCell dgCell;
     912                        DataGridViewCell dgCell;
    776913                        dgCell = this.grdResult.CurrentCell;
    777                         dgCell.ColumnNumber = 2;
    778                         this.m_sSelectedResource = grdResult[dgCell.RowNumber, dgCell.ColumnNumber].ToString();
    779                         this.m_sSelectedDate = (DateTime) grdResult[dgCell.RowNumber,0];
     914            this.m_sSelectedResource = grdResult.SelectedRows[0].Cells[2].ToString();
     915            this.m_sSelectedDate = (DateTime)grdResult.SelectedRows[0].Cells[0].Value;
    780916                        this.DialogResult = DialogResult.OK;
    781917                        this.Close();
     918             */
    782919                }
    783920
    784921                private void grdResult_CurrentCellChanged(object sender, System.EventArgs e)
    785922                {
    786                         DataGridCell dgCell;
    787                         dgCell = this.grdResult.CurrentCell;
    788                         this.grdResult.Select(dgCell.RowNumber);
    789 
     923                        /*
     924            DataGridViewCell dgCell;
     925            dgCell = this.grdResult.CurrentCell;
     926             */
    790927        }
    791928
     929        /// <summary>
     930        /// BAAAAAAAAAAAAAAAAAD. Use a shared method instead.
     931        /// </summary>
     932        /// <param name="sender"></param>
     933        /// <param name="e"></param>
     934        private void lstResults_DoubleClick(object sender, EventArgs e)
     935        {
     936            btnAccept_Click(sender, e);
     937        }
     938
     939        private void btnAccept_Click(object sender, EventArgs e)
     940        {
     941            if (lstResults.SelectedIndices.Count == 0)
     942            {
     943                this.DialogResult = DialogResult.None;
     944                return;
     945            }
     946
     947            long availabilityKey = long.Parse(lstResults.SelectedItems[0].SubItems[0].Text);
     948            _selectedAvailability = (from av in lstResultantAvailabilities
     949                                     where av.AvailabilityType == availabilityKey
     950                                     select av).Single<CGAvailability>();
     951            this.DialogResult = DialogResult.OK;
     952        }
     953
    792954        #endregion  Event Handlers
    793955
    794956        #region Properties
     957
     958       
    795959        /// <summary>
    796                 /// Gets the resource selected by the user
    797                 /// </summary>
    798                 public string SelectedResource
    799                 {
    800                         get
    801                         {
    802                                 return this.m_sSelectedResource;
    803                         }
    804                 }
    805 
    806                 /// <summary>
    807                 /// Gets the date selected by the user
    808                 /// </summary>
    809                 public DateTime SelectedDate
    810                 {
    811                         get
    812                         {
    813                                 return this.m_sSelectedDate;
    814                         }
    815                 }
     960        /// Gets the Availability Selected by the User in which to put an appointment
     961        /// </summary>
     962        public CGAvailability SelectedAvailability
     963        {
     964            get { return this._selectedAvailability; }
     965        }
     966
    816967                #endregion Properties
    817 
    818         }
     968    }
    819969}
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/DApptSearch.resx

    r908 r1097  
    113113  </resheader>
    114114  <resheader name="reader">
    115     <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
     115    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
    116116  </resheader>
    117117  <resheader name="writer">
    118     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
     118    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
    119119  </resheader>
    120120</root>
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/DPatientLookup.cs

    r868 r1097  
    11using System;
    2 using System.Drawing;
    3 using System.Collections;
    4 using System.ComponentModel;
    52using System.Windows.Forms;
    63using System.Data;
    7 //using System.Data.OleDb;
    8 using IndianHealthService.BMXNet;
     4
    95
    106namespace IndianHealthService.ClinicalScheduling
Note: See TracChangeset for help on using the changeset viewer.