Index: Scheduling/trunk/cs/bsdx0200GUISourceCode/DAL.cs
===================================================================
--- Scheduling/trunk/cs/bsdx0200GUISourceCode/DAL.cs	(revision 846)
+++ Scheduling/trunk/cs/bsdx0200GUISourceCode/DAL.cs	(revision 848)
@@ -15,4 +15,5 @@
     {
         private BMXNetConnectInfo _thisConnection; // set in constructor
+        
         delegate DataTable RPMSDataTableDelegate(string CommandString, string TableName); // for use in calling (Sync and Async)
 
@@ -49,5 +50,57 @@
         }
 
+        /// <summary>
+        /// Get the Patients who have appointments in between dates for the clinics requested
+        /// </summary>
+        /// <param name="sClinicList">| delimited resource list (resource IENS, not names)</param>
+        /// <param name="BeginDate">Self Explanatory</param>
+        /// <param name="EndDate">Self Explanatory</param>
+        /// <returns>DataTable with the following columns:
+        /// T00030Name^D00020DOB^T00030Sex^T00030HRN^D00030ApptDate^T00030Clinic^T00030TypeStatus
+        /// I00010RESOURCEID^T00030APPT_MADE_BY^D00020DATE_APPT_MADE^T00250NOTE^T00030STREET^
+        /// T00030CITY^T00030STATE^T00030ZIP^T00030HOMEPHONE
+        ///</returns>
+        ///<remarks>Mirrors dsPatientApptDisplay2.PatientAppts Schema in this project. Can merge table into schema.</remarks>
+        public DataTable GetClinicSchedules(string sClinicList, DateTime BeginDate, DateTime EndDate)
+        {
+            string sBegin = FMDateTime.Create(BeginDate).DateOnly.FMDateString;
+            string sEnd = FMDateTime.Create(EndDate).DateOnly.FMDateString;
+            string cmd = String.Format("BSDX CLINIC LETTERS^{0}^{1}^{2}", sClinicList, sBegin, sEnd);
+            return RPMSDataTable(cmd, "");
+        }
 
+        /// <summary>
+        /// Get the letter templates associated with the requested clinics (reminder letter, cancellation letter etc)
+        /// </summary>
+        /// <param name="sClinicList">| delimited resource list (resource IENS, not names)</param>
+        /// <returns>DataTable with the following columns:
+        /// I00010RESOURCEID^T00030RESOURCE_NAME^T00030LETTER_TEXT^T00030NO_SHOW_LETTER^T00030CLINIC_CANCELLATION_LETTER
+        /// </returns>
+        /// <remarks>Mirrors dsPatientApptDisplay2.BSDXResource Schema. Can merge table into schema.</remarks>
+        public DataTable GetResourceLetters(string sClinicList)
+        {
+            string cmd = String.Format("BSDX RESOURCE LETTERS^{0}", sClinicList);
+            return RPMSDataTable(cmd, "");
+        }
+
+        /// <summary>
+        /// Get the list of Patients who have Rebooked Appointments
+        /// </summary>
+        /// <param name="sClinicList">| delimited resource list (resource IENS, not names)</param>
+        /// <param name="BeginDate">Self Explanatory</param>
+        /// <param name="EndDate">Self Explanatory</param>
+        /// <returns>T00030Name^D00020DOB^T00030Sex^T00030HRN^D00030NewApptDate^T00030Clinic^T00030TypeStatus
+        /// ^I00010RESOURCEID^T00030APPT_MADE_BY^D00020DATE_APPT_MADE^T00250NOTE^T00030STREET^T00030CITY
+        /// ^T00030STATE^T00030ZIP^T00030HOMEPHONE^D00030OldApptDate
+        ///</returns>
+        /// <remarks>Not sure if this works yet</remarks>
+        /// <remarks>Mirrors dsRebookAppts.PatientAppt Schema. Can merge table into schema.</remarks>
+        public DataTable GetRebookedAppointments(string sClinicList, DateTime BeginDate, DateTime EndDate)
+        {
+            string sBegin = FMDateTime.Create(BeginDate).DateOnly.FMDateString;
+            string sEnd = FMDateTime.Create(EndDate).DateOnly.FMDateString;
+            string cmd = String.Format("BSDX REBOOK CLINIC LIST^{0}^{1}^{2}", sClinicList, sBegin, sEnd);
+            return RPMSDataTable(cmd, "");
+        }
 
         /// <summary>
@@ -56,5 +109,4 @@
         /// <param name="sSQL"></param>
         /// <param name="sTableName"></param>
-        /// <param name="ds"></param>
         /// <returns></returns>
         private DataTable RPMSDataTable(string sSQL, string sTableName)
@@ -75,5 +127,5 @@
             catch (Exception ex)
             {
-                sErrorMessage = "CGDocumentManager.RPMSDataTable error: " + ex.Message;
+                sErrorMessage = "DAL.RPMSDataTable error: " + ex.Message;
                 throw ex;
             }
Index: Scheduling/trunk/cs/bsdx0200GUISourceCode/DPatientLetter.cs
===================================================================
--- Scheduling/trunk/cs/bsdx0200GUISourceCode/DPatientLetter.cs	(revision 846)
+++ Scheduling/trunk/cs/bsdx0200GUISourceCode/DPatientLetter.cs	(revision 848)
@@ -53,16 +53,18 @@
 					throw new Exception("At least one clinic must be selected.");
 				}
-                _dtBegin = dtBegin;
-                _dtEnd = dtEnd;
-				string sBegin = dtBegin.ToShortDateString();
-				string sEnd = dtEnd.ToShortDateString();
-				this.Text="Clinic Schedules";
-
-				string sSql = "BSDX CLINIC LETTERS^" + sClinicList + "^" + sBegin + "^" + sEnd;
-                string sSql2 = "BSDX RESOURCE LETTERS^" + sClinicList;
-
+
+                _dtBegin = dtBegin; // Global variable to use in Printing method below
+                _dtEnd = dtEnd; // ditto
+
+                this.Text="Clinic Schedules";
+
+                // Get Data
+                DataTable PatientAppts = docManager.DAL.GetClinicSchedules(sClinicList, dtBegin, dtEnd);
+                DataTable Resources = docManager.DAL.GetResourceLetters(sClinicList);
+
+                // Merge tables into typed dataset
                 _dsApptDisplay = new dsPatientApptDisplay2();
-                _dsApptDisplay.BSDXResource.Merge(docManager.RPMSDataTable(sSql2, "Resources"));
-                _dsApptDisplay.PatientAppts.Merge(docManager.RPMSDataTable(sSql, "PatientAppts"));
+                _dsApptDisplay.PatientAppts.Merge(PatientAppts);
+                _dsApptDisplay.BSDXResource.Merge(Resources);
 
                 this.PrintPreviewControl.Document = printAppts;
@@ -81,4 +83,5 @@
         /// <param name="dtBegin">Beginning Date</param>
         /// <param name="dtEnd">End Date</param>
+        /// working on moving this over...
         public void InitializeFormRebookLetters(CGDocumentManager docManager,
 			string sClinicList,
