Index: Scheduling/trunk/cs/bsdx0200GUISourceCode/DAL.cs
===================================================================
--- Scheduling/trunk/cs/bsdx0200GUISourceCode/DAL.cs	(revision 1186)
+++ Scheduling/trunk/cs/bsdx0200GUISourceCode/DAL.cs	(revision 1474)
@@ -16,5 +16,5 @@
     public class DAL
     {
-        private BMXNetConnectInfo _thisConnection; // set in constructor
+        private RemoteSession _thisConnection; // set in constructor
         
         delegate DataTable RPMSDataTableDelegate(string CommandString, string TableName); // for use in calling (Sync and Async)
@@ -25,5 +25,5 @@
         /// </summary>
         /// <param name="conn">The current connection to use</param>
-        public DAL(BMXNetConnectInfo conn)
+        public DAL(RemoteSession conn)
         {
             this._thisConnection = conn;
@@ -39,5 +39,5 @@
         {
             string cmd = String.Format("BMX VERSION INFO^{0}", nmsp);
-            return RPMSDataTable(cmd, "");
+            return _thisConnection.TableFromCommand(cmd);
         }
 
@@ -50,5 +50,5 @@
         {
             string cmd = String.Format("BSDX SCHEDULING USER INFO^{0}", DUZ);
-            return RPMSDataTable(cmd, "");
+            return _thisConnection.TableFromCommand(cmd);
         }
 
@@ -65,8 +65,8 @@
         /// BLUE (NJ3,0), [0;7]
         ///</returns>
-        public DataTable GetAccessTypes()
+        public DataTable GetAccessTypes(DataSet dataSetToTakeTable, string tablename)
         {
             string sCommandText = "SELECT * FROM BSDX_ACCESS_TYPE";
-            DataTable table = RPMSDataTable(sCommandText, "");
+            DataTable table = _thisConnection.TableFromSQL(sCommandText, dataSetToTakeTable, tablename);
             DataColumn dcKey = table.Columns["BMXIEN"];
             DataColumn[] dcKeys = new DataColumn[1];
@@ -93,5 +93,5 @@
             string sEnd = FMDateTime.Create(EndDate).DateOnly.FMDateString;
             string cmd = String.Format("BSDX CLINIC LETTERS^{0}^{1}^{2}", sClinicList, sBegin, sEnd);
-            return RPMSDataTable(cmd, "");
+            return _thisConnection.TableFromCommand(cmd);
         }
 
@@ -107,5 +107,5 @@
         {
             string cmd = String.Format("BSDX RESOURCE LETTERS^{0}", sClinicList);
-            return RPMSDataTable(cmd, "");
+            return _thisConnection.TableFromCommand(cmd);
         }
 
@@ -126,5 +126,5 @@
             string sEnd = FMDateTime.Create(EndDate).DateOnly.FMDateString;
             string cmd = String.Format("BSDX REBOOK CLINIC LIST^{0}^{1}^{2}", sClinicList, sBegin, sEnd);
-            return RPMSDataTable(cmd, "");
+            return _thisConnection.TableFromCommand(cmd);
         }
 
@@ -139,5 +139,5 @@
         {
             string cmd = String.Format("BSDX REBOOK LIST^{0}", sApptList);
-            return RPMSDataTable(cmd, "");
+            return _thisConnection.TableFromCommand(cmd);
         }
 
@@ -157,5 +157,5 @@
             string sEnd = FMDateTime.Create(EndDate).DateOnly.FMDateString;
             string cmd = String.Format("BSDX CANCEL CLINIC LIST^{0}^{1}^{2}", sClinicList, sBegin, sEnd);
-            return RPMSDataTable(cmd, "");
+            return _thisConnection.TableFromCommand(cmd);
         }
 
@@ -173,5 +173,5 @@
             string sEnd = FMDateTime.Create(EndDate).DateOnly.FMDateString;
             string cmd = String.Format("BSDX CANCEL AV BY DATE^{0}^{1}^{2}", sResourceID, sBegin, sEnd);
-            return RPMSDataTable(cmd, "Cancelled");
+            return _thisConnection.TableFromCommand(cmd);
         }
 
@@ -185,5 +185,5 @@
         {
             string cmd = string.Format("BSDX REMOVE CHECK-IN^{0}", ApptID);
-            return RPMSDataTable(cmd, "");
+            return _thisConnection.TableFromCommand(cmd);
         }
 
@@ -197,5 +197,5 @@
         {
             string cmd = string.Format("BSDX GET RAD EXAM FOR PT^{0}^{1}", DFN, SCIEN);
-            DataTable tbl = RPMSDataTable(cmd, "");
+            DataTable tbl = _thisConnection.TableFromCommand(cmd);
             return (from row in tbl.AsEnumerable()
                     select new RadiologyExam
@@ -218,5 +218,5 @@
         {
             string fmStartDate = FMDateTime.Create(dStart).FMDateString;
-            string result = _thisConnection.bmxNetLib.TransmitRPC("BSDX SCHEDULE RAD EXAM", string.Format("{0}^{1}^{2}", DFN, examIEN, fmStartDate));
+            string result = _thisConnection.TransmitRPC("BSDX SCHEDULE RAD EXAM", string.Format("{0}^{1}^{2}", DFN, examIEN, fmStartDate));
             return result == "1" ? true : false;
         }
@@ -230,5 +230,5 @@
         public bool CancelRadiologyExam(int DFN, int examIEN)
         {
-            string result = _thisConnection.bmxNetLib.TransmitRPC("BSDX HOLD RAD EXAM", string.Format("{0}^{1}", DFN, examIEN));
+            string result = _thisConnection.TransmitRPC("BSDX HOLD RAD EXAM", string.Format("{0}^{1}", DFN, examIEN));
             return result == "1" ? true : false;
         }
@@ -241,5 +241,5 @@
         public bool CanCancelRadExam(int examIEN)
         {
-            string result = _thisConnection.bmxNetLib.TransmitRPC("BSDX CAN HOLD RAD EXAM", examIEN.ToString());
+            string result = _thisConnection.TransmitRPC("BSDX CAN HOLD RAD EXAM", examIEN.ToString());
             return result == "1" ? true : false;
         }
@@ -256,10 +256,10 @@
             get
             {
-                string val = _thisConnection.bmxNetLib.TransmitRPC("BSDX GET PARAM", "BSDX AUTO PRINT RS");  //1 = true; 0 = false; "" = not set
+                string val = _thisConnection.TransmitRPC("BSDX GET PARAM", "BSDX AUTO PRINT RS");  //1 = true; 0 = false; "" = not set
                 return val == "1" ? true : false;
             }
             set
             {
-                TransmitRPCAsync _asyncTransmitter = new TransmitRPCAsync(_thisConnection.bmxNetLib.TransmitRPC);
+                TransmitRPCAsync _asyncTransmitter = new TransmitRPCAsync(_thisConnection.TransmitRPC);
                 // 0 = success; anything else is wrong. Not being tested here as its success is not critical to application use.
                 _asyncTransmitter.BeginInvoke("BSDX SET PARAM", String.Format("{0}^{1}", "BSDX AUTO PRINT RS", value ? "1" : "0"), null, null);
@@ -278,10 +278,10 @@
             get
             {
-                string val = _thisConnection.bmxNetLib.TransmitRPC("BSDX GET PARAM", "BSDX AUTO PRINT AS");  //1 = true; 0 = false; "" = not set
+                string val = _thisConnection.TransmitRPC("BSDX GET PARAM", "BSDX AUTO PRINT AS");  //1 = true; 0 = false; "" = not set
                 return val == "1" ? true : false;
             }
             set
             {
-                TransmitRPCAsync _asyncTransmitter = new TransmitRPCAsync(_thisConnection.bmxNetLib.TransmitRPC);
+                TransmitRPCAsync _asyncTransmitter = new TransmitRPCAsync(_thisConnection.TransmitRPC);
                 // 0 = success; anything else is wrong. Not being tested here as its success is not critical to application use.
                 _asyncTransmitter.BeginInvoke("BSDX SET PARAM", String.Format("{0}^{1}", "BSDX AUTO PRINT AS", value ? "1" : "0"), null, null);
@@ -303,10 +303,7 @@
             DataTable dtOut;
 
-#if TRACE
-            DateTime sendTime = DateTime.Now;
-#endif
             try
             {
-                RPMSDataTableDelegate rdtd = new RPMSDataTableDelegate(_thisConnection.RPMSDataTable);
+                RPMSDataTableDelegate rdtd = new RPMSDataTableDelegate(_thisConnection.TableFromSQL);
                 dtOut = (DataTable)rdtd.Invoke(sSQL, sTableName);
             }
@@ -317,10 +314,4 @@
                 throw ex;
             }
-
-#if TRACE
-            DateTime receiveTime = DateTime.Now;
-            TimeSpan executionTime = receiveTime - sendTime;
-            Debug.Write("RPMSDataTable Execution Time: " + executionTime.Milliseconds + " ms.\n");
-#endif
 
             return dtOut;
