- Timestamp:
- Jun 10, 2010, 5:20:08 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Scheduling/trunk/cs/bsdx0200GUISourceCode/CGDocumentManager.cs
r788 r794 240 240 m_ds.Refresh(); 241 241 bool bRetry = true; 242 243 //Try to connect using supplied values for Server and Port 244 //Why am I doing this? The library BMX net uses prompts for access and verify code 245 //whether you can connect or not. Not good. So I test first whether 246 //we can connect at all by doing a simple connection and disconnect. 247 //TODO: Make this more robust by sending a TCPConnect message and seeing if you get a response. 248 249 if (m_Server != "" && m_Port != 0) 250 { 251 System.Net.Sockets.TcpClient tcpClient = new System.Net.Sockets.TcpClient(); 252 try 253 { 254 tcpClient.Connect(m_Server, m_Port); // open it 255 tcpClient.Close(); // then close it 256 } 257 catch (System.Net.Sockets.SocketException ex) 258 { 259 throw ex; 260 } 261 } 242 262 do 243 263 { 244 try 245 246 247 248 249 250 251 252 264 try 265 { 266 if (bReLogin == true) 267 { 268 //Prompt for Access and Verify codes 269 _current.m_ConnectInfo.LoadConnectInfo("", ""); 270 } 271 else 272 { 253 273 if (m_Server != String.Empty && m_Port != 0 && m_AccessCode != String.Empty 254 274 && m_VerifyCode != String.Empty) 275 { 255 276 m_ConnectInfo.LoadConnectInfo(m_Server, m_Port, m_AccessCode, m_VerifyCode); 277 } 256 278 else if (m_Server != String.Empty && m_Port != 0) 257 279 m_ConnectInfo.LoadConnectInfo(m_Server, m_Port, "", ""); … … 259 281 m_ConnectInfo.LoadConnectInfo(); 260 282 } 261 bRetry = false; 262 } 263 catch (Exception ex) 264 { 265 m_ds.Close(); 266 if (MessageBox.Show("Unable to connect to VistA. " + ex.Message , "Clinical Scheduling", MessageBoxButtons.RetryCancel) == DialogResult.Retry) 267 { 268 bRetry = true; 269 _current.m_ConnectInfo.ChangeServerInfo(); 270 } 271 else 272 { 273 bRetry = false; 274 throw ex; 275 } 276 } 283 bRetry = false; 284 } 285 catch (System.Net.Sockets.SocketException) 286 { 287 MessageBox.Show("Cannot connect to VistA. "); 288 } 289 catch (Exception ex) 290 { 291 m_ds.Close(); 292 if (MessageBox.Show("Unable to connect to VistA. " + ex.Message, "Clinical Scheduling", MessageBoxButtons.RetryCancel) == DialogResult.Retry) 293 { 294 bRetry = true; 295 _current.m_ConnectInfo.ChangeServerInfo(); 296 } 297 else 298 { 299 bRetry = false; 300 throw ex; 301 } 302 } 277 303 }while (bRetry == true); 278 304 … … 415 441 } 416 442 443 //TODO:REMOVE THIS 417 444 public void LoadClinicSetupTable() 418 445 { … … 613 640 614 641 //Build active provider table 615 sCommandText = "SELECT BMXIEN, NAME FROM NEW_PERSON WHERE INACTIVE_DATE = '' AND INTERNAL[PROVIDER_CLASS] > 0";642 sCommandText = "SELECT BMXIEN, NAME FROM NEW_PERSON WHERE INACTIVE_DATE = ''"; 616 643 ConnectInfo.RPMSDataTable(sCommandText, "Provider", m_dsGlobal); 617 644 Debug.Write("LoadGlobalRecordsets -- Provider loaded\n"); … … 626 653 sCommandText = "SELECT NAME, DATE FROM HOLIDAY WHERE DATE > '" + DateTime.Today.ToShortDateString() + "'"; 627 654 ConnectInfo.RPMSDataTable(sCommandText, "HOLIDAY", m_dsGlobal); 655 Debug.Write("LoadingGlobalRecordsets -- Holidays loaded\n"); 656 657 sCommandText = @"SELECT HOSPITAL_LOCATION.BMXIEN 'BMXIEN', HOSPITAL_LOCATION.PROVIDER.PROVIDER 'PROVIDER', HOSPITAL_LOCATION.PROVIDER.DEFAULT_PROVIDER 'DEFAULT' FROM HOSPITAL_LOCATION"; 658 ConnectInfo.RPMSDataTable(sCommandText, "ClinicProviders", m_dsGlobal); 659 Debug.Write("LoadingGlobalRecordsets -- ClinicProviders loaded\n"); 628 660 629 661 //Save the xml schema
Note:
See TracChangeset
for help on using the changeset viewer.