Changeset 1474 for Scheduling/trunk/cs/bsdx0200GUISourceCode/DAL.cs
- Timestamp:
- Jul 6, 2012, 3:37:41 PM (12 years ago)
- Location:
- Scheduling/trunk/cs/bsdx0200GUISourceCode
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
Scheduling/trunk/cs/bsdx0200GUISourceCode
- Property svn:mergeinfo changed
/Scheduling/branches/BMX4Support (added) merged: 1175,1194-1195,1197,1453,1471
- Property svn:mergeinfo changed
-
Scheduling/trunk/cs/bsdx0200GUISourceCode/DAL.cs
r1186 r1474 16 16 public class DAL 17 17 { 18 private BMXNetConnectInfo_thisConnection; // set in constructor18 private RemoteSession _thisConnection; // set in constructor 19 19 20 20 delegate DataTable RPMSDataTableDelegate(string CommandString, string TableName); // for use in calling (Sync and Async) … … 25 25 /// </summary> 26 26 /// <param name="conn">The current connection to use</param> 27 public DAL( BMXNetConnectInfoconn)27 public DAL(RemoteSession conn) 28 28 { 29 29 this._thisConnection = conn; … … 39 39 { 40 40 string cmd = String.Format("BMX VERSION INFO^{0}", nmsp); 41 return RPMSDataTable(cmd, "");41 return _thisConnection.TableFromCommand(cmd); 42 42 } 43 43 … … 50 50 { 51 51 string cmd = String.Format("BSDX SCHEDULING USER INFO^{0}", DUZ); 52 return RPMSDataTable(cmd, "");52 return _thisConnection.TableFromCommand(cmd); 53 53 } 54 54 … … 65 65 /// BLUE (NJ3,0), [0;7] 66 66 ///</returns> 67 public DataTable GetAccessTypes( )67 public DataTable GetAccessTypes(DataSet dataSetToTakeTable, string tablename) 68 68 { 69 69 string sCommandText = "SELECT * FROM BSDX_ACCESS_TYPE"; 70 DataTable table = RPMSDataTable(sCommandText, "");70 DataTable table = _thisConnection.TableFromSQL(sCommandText, dataSetToTakeTable, tablename); 71 71 DataColumn dcKey = table.Columns["BMXIEN"]; 72 72 DataColumn[] dcKeys = new DataColumn[1]; … … 93 93 string sEnd = FMDateTime.Create(EndDate).DateOnly.FMDateString; 94 94 string cmd = String.Format("BSDX CLINIC LETTERS^{0}^{1}^{2}", sClinicList, sBegin, sEnd); 95 return RPMSDataTable(cmd, "");95 return _thisConnection.TableFromCommand(cmd); 96 96 } 97 97 … … 107 107 { 108 108 string cmd = String.Format("BSDX RESOURCE LETTERS^{0}", sClinicList); 109 return RPMSDataTable(cmd, "");109 return _thisConnection.TableFromCommand(cmd); 110 110 } 111 111 … … 126 126 string sEnd = FMDateTime.Create(EndDate).DateOnly.FMDateString; 127 127 string cmd = String.Format("BSDX REBOOK CLINIC LIST^{0}^{1}^{2}", sClinicList, sBegin, sEnd); 128 return RPMSDataTable(cmd, "");128 return _thisConnection.TableFromCommand(cmd); 129 129 } 130 130 … … 139 139 { 140 140 string cmd = String.Format("BSDX REBOOK LIST^{0}", sApptList); 141 return RPMSDataTable(cmd, "");141 return _thisConnection.TableFromCommand(cmd); 142 142 } 143 143 … … 157 157 string sEnd = FMDateTime.Create(EndDate).DateOnly.FMDateString; 158 158 string cmd = String.Format("BSDX CANCEL CLINIC LIST^{0}^{1}^{2}", sClinicList, sBegin, sEnd); 159 return RPMSDataTable(cmd, "");159 return _thisConnection.TableFromCommand(cmd); 160 160 } 161 161 … … 173 173 string sEnd = FMDateTime.Create(EndDate).DateOnly.FMDateString; 174 174 string cmd = String.Format("BSDX CANCEL AV BY DATE^{0}^{1}^{2}", sResourceID, sBegin, sEnd); 175 return RPMSDataTable(cmd, "Cancelled");175 return _thisConnection.TableFromCommand(cmd); 176 176 } 177 177 … … 185 185 { 186 186 string cmd = string.Format("BSDX REMOVE CHECK-IN^{0}", ApptID); 187 return RPMSDataTable(cmd, "");187 return _thisConnection.TableFromCommand(cmd); 188 188 } 189 189 … … 197 197 { 198 198 string cmd = string.Format("BSDX GET RAD EXAM FOR PT^{0}^{1}", DFN, SCIEN); 199 DataTable tbl = RPMSDataTable(cmd, "");199 DataTable tbl = _thisConnection.TableFromCommand(cmd); 200 200 return (from row in tbl.AsEnumerable() 201 201 select new RadiologyExam … … 218 218 { 219 219 string fmStartDate = FMDateTime.Create(dStart).FMDateString; 220 string result = _thisConnection. bmxNetLib.TransmitRPC("BSDX SCHEDULE RAD EXAM", string.Format("{0}^{1}^{2}", DFN, examIEN, fmStartDate));220 string result = _thisConnection.TransmitRPC("BSDX SCHEDULE RAD EXAM", string.Format("{0}^{1}^{2}", DFN, examIEN, fmStartDate)); 221 221 return result == "1" ? true : false; 222 222 } … … 230 230 public bool CancelRadiologyExam(int DFN, int examIEN) 231 231 { 232 string result = _thisConnection. bmxNetLib.TransmitRPC("BSDX HOLD RAD EXAM", string.Format("{0}^{1}", DFN, examIEN));232 string result = _thisConnection.TransmitRPC("BSDX HOLD RAD EXAM", string.Format("{0}^{1}", DFN, examIEN)); 233 233 return result == "1" ? true : false; 234 234 } … … 241 241 public bool CanCancelRadExam(int examIEN) 242 242 { 243 string result = _thisConnection. bmxNetLib.TransmitRPC("BSDX CAN HOLD RAD EXAM", examIEN.ToString());243 string result = _thisConnection.TransmitRPC("BSDX CAN HOLD RAD EXAM", examIEN.ToString()); 244 244 return result == "1" ? true : false; 245 245 } … … 256 256 get 257 257 { 258 string val = _thisConnection. bmxNetLib.TransmitRPC("BSDX GET PARAM", "BSDX AUTO PRINT RS"); //1 = true; 0 = false; "" = not set258 string val = _thisConnection.TransmitRPC("BSDX GET PARAM", "BSDX AUTO PRINT RS"); //1 = true; 0 = false; "" = not set 259 259 return val == "1" ? true : false; 260 260 } 261 261 set 262 262 { 263 TransmitRPCAsync _asyncTransmitter = new TransmitRPCAsync(_thisConnection. bmxNetLib.TransmitRPC);263 TransmitRPCAsync _asyncTransmitter = new TransmitRPCAsync(_thisConnection.TransmitRPC); 264 264 // 0 = success; anything else is wrong. Not being tested here as its success is not critical to application use. 265 265 _asyncTransmitter.BeginInvoke("BSDX SET PARAM", String.Format("{0}^{1}", "BSDX AUTO PRINT RS", value ? "1" : "0"), null, null); … … 278 278 get 279 279 { 280 string val = _thisConnection. bmxNetLib.TransmitRPC("BSDX GET PARAM", "BSDX AUTO PRINT AS"); //1 = true; 0 = false; "" = not set280 string val = _thisConnection.TransmitRPC("BSDX GET PARAM", "BSDX AUTO PRINT AS"); //1 = true; 0 = false; "" = not set 281 281 return val == "1" ? true : false; 282 282 } 283 283 set 284 284 { 285 TransmitRPCAsync _asyncTransmitter = new TransmitRPCAsync(_thisConnection. bmxNetLib.TransmitRPC);285 TransmitRPCAsync _asyncTransmitter = new TransmitRPCAsync(_thisConnection.TransmitRPC); 286 286 // 0 = success; anything else is wrong. Not being tested here as its success is not critical to application use. 287 287 _asyncTransmitter.BeginInvoke("BSDX SET PARAM", String.Format("{0}^{1}", "BSDX AUTO PRINT AS", value ? "1" : "0"), null, null); … … 303 303 DataTable dtOut; 304 304 305 #if TRACE306 DateTime sendTime = DateTime.Now;307 #endif308 305 try 309 306 { 310 RPMSDataTableDelegate rdtd = new RPMSDataTableDelegate(_thisConnection. RPMSDataTable);307 RPMSDataTableDelegate rdtd = new RPMSDataTableDelegate(_thisConnection.TableFromSQL); 311 308 dtOut = (DataTable)rdtd.Invoke(sSQL, sTableName); 312 309 } … … 317 314 throw ex; 318 315 } 319 320 #if TRACE321 DateTime receiveTime = DateTime.Now;322 TimeSpan executionTime = receiveTime - sendTime;323 Debug.Write("RPMSDataTable Execution Time: " + executionTime.Milliseconds + " ms.\n");324 #endif325 316 326 317 return dtOut;
Note:
See TracChangeset
for help on using the changeset viewer.