- 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/CGDocumentManager.cs
r1143 r1474 1 /* Main Class...: 2 * Original Author: Horace Whitt 3 * Current Author and Maintainer: Sam Habiel 4 * License: LGPL. http://www.gnu.org/licenses/lgpl-2.1.html 5 */ 6 1 7 using System; 2 8 using System.Windows.Forms; … … 6 12 using System.Threading; 7 13 using IndianHealthService.BMXNet; 14 using IndianHealthService.BMXNet.WinForm; 15 using IndianHealthService.BMXNet.WinForm.Configuration; //grrrr... too many namespaces here... 8 16 using Mono.Options; 9 17 using System.Runtime.InteropServices; … … 42 50 //M Connection member variables 43 51 private DataSet m_dsGlobal = null; // Holds all user data 44 private BMXNetConnectInfo m_ConnectInfo = null; // Connection to VISTA object45 private BMXNetConnectInfo.BMXNetEventDelegate CDocMgrEventDelegate; // Delegate to respond to messages from VISTA. Responds to event: BMXNetConnectInfo.BMXNetEvent46 52 47 53 //Custom Printing … … 51 57 #region Properties 52 58 53 /// <summary> 54 /// Returns the document manager's BMXNetConnectInfo member 55 /// </summary> 56 public BMXNetConnectInfo ConnectInfo 57 { 58 get 59 { 60 return m_ConnectInfo; 61 } 62 } 59 public WinFramework WinFramework { get; private set; } // Login Manager 60 public RemoteSession RemoteSession { get; private set; } // Data Sesssion against the RPMS/VISTA server 61 public RPCLogger RPCLogger { get; private set; } // Logger for RPCs 63 62 64 63 /// <summary> … … 153 152 154 153 /// <summary> 155 /// Constructor. Does absolutely nothing at this point.154 /// Private constructor for singleton instance. 156 155 /// </summary> 157 p ublicCGDocumentManager()156 private CGDocumentManager() 158 157 { 159 158 } … … 218 217 opset.Parse(args); 219 218 220 //Init app 221 bool isEverythingOkay = _current.InitializeApp(); 222 223 //if an error occurred, break out. 219 //Init app. Catch Login Exceptions if they happen. 220 bool isEverythingOkay = false; 221 try 222 { 223 isEverythingOkay = _current.InitializeApp(); 224 } 225 catch (Exception ex) 226 { 227 228 MessageBox.Show("Booboo: An Error Happened: " + ex.Message); 229 return; // exit application 230 } 231 232 233 //if something yucky happened, break out. 224 234 if (!isEverythingOkay) return; 225 235 … … 235 245 view.InitializeDocView(doc, _current, doc.StartDate, _current.WindowText); 236 246 237 //Handle BMX Event247 //Handle Message Queue 238 248 Application.DoEvents(); 239 249 … … 295 305 296 306 #region BMXNet Event Handler 297 private void CDocMgrEventHandler(Object obj, BMXNet.BMXNetEventArgs e)298 { 299 if (e. BMXEvent== "BSDX CALL WORKSTATIONS")307 private void CDocMgrEventHandler(Object obj, RemoteEventArgs e) 308 { 309 if (e.EventType == "BSDX CALL WORKSTATIONS") 300 310 { 301 311 string sParam = ""; 302 312 string sDelim="~"; 303 sParam += this. m_ConnectInfo.UserName + sDelim;313 sParam += this.RemoteSession.User.Name + sDelim; 304 314 sParam += this.m_sHandle + sDelim; 305 315 sParam += Application.ProductVersion + sDelim; 306 316 sParam += this._views.Count.ToString(); 307 _current. m_ConnectInfo.RaiseEvent("BSDX WORKSTATION REPORT", sParam, true);308 } 309 if (e. BMXEvent== "BSDX ADMIN MESSAGE")310 { 311 string sMsg = e. BMXParam;317 _current.RemoteSession.EventServices.TriggerEvent("BSDX WORKSTATION REPORT", sParam, true); 318 } 319 if (e.EventType == "BSDX ADMIN MESSAGE") 320 { 321 string sMsg = e.EventType; 312 322 ShowAdminMsgDelegate samd = new ShowAdminMsgDelegate(ShowAdminMsg); 313 //this.Invoke(samd, new object [] {sMsg});314 323 samd.Invoke(sMsg); 315 324 } 316 if (e. BMXEvent== "BSDX ADMIN SHUTDOWN")317 { 318 string sMsg = e. BMXParam;325 if (e.EventType == "BSDX ADMIN SHUTDOWN") 326 { 327 string sMsg = e.Details; 319 328 CloseAllDelegate cad = new CloseAllDelegate(CloseAll); 320 //this.Invoke(cad, new object [] {sMsg});321 329 cad.Invoke(sMsg); 322 330 } … … 353 361 private bool InitializeApp(bool bReLogin) 354 362 { 355 //Set M connection info 356 m_ConnectInfo = new BMXNetConnectInfo(m_Encoding); // Encoding is "" unless passed in command line 357 _dal = new DAL(m_ConnectInfo); // Data access layer 358 //m_ConnectInfo.bmxNetLib.StartLog(); //This line turns on logging of messages 363 //Note: There are 2 splashes -- one for being the parent of the log in forms 364 // the next is invoked async and updated async while the GUI is loading 365 // The reason is b/c an async form cannot be the parent of another that lies on the main thread 366 367 RPCLogger = new RPCLogger(); 368 369 DSplash firstSplash = new DSplash(); 370 371 firstSplash.Show(); 359 372 360 //Create a delegate to process events raised by BMX. 361 CDocMgrEventDelegate = new BMXNetConnectInfo.BMXNetEventDelegate(CDocMgrEventHandler); 373 /* IMPORTANT NOTE 374 * LOGIN CODE IS COPIED ALMOST VERBATIM FROM THE SCHEMABUILDER APPLICAITON; 375 * THE ONLY ONE I CAN FIND WHICH RELIES ON BMX 4 NEW WAYS WHICH I CAN'T FIGURE OUT 376 */ 377 LoginProcess login; 378 this.WinFramework = WinFramework.CreateWithNetworkBroker(true, RPCLogger); 379 380 if (bReLogin) // if logging in again... 381 { 382 this.WinFramework.LoadConnectionSpecs(LocalPersistentStore.CreateDefaultStorage(true), "BSDX"); 383 login = this.WinFramework.CreateLoginProcess(); 384 login.AttemptUserInputLogin("Clincal Scheduling Log-in", 3, true, firstSplash); 385 goto DoneTrying; 386 } 387 388 // If server,port,ac,vc are supplied on command line, then try to connect... 389 else if (!String.IsNullOrEmpty(m_Server) && m_Port != 0 && !String.IsNullOrEmpty(m_AccessCode) && !String.IsNullOrEmpty(m_VerifyCode)) 390 { 391 RpmsConnectionSpec spec = new RpmsConnectionSpec(); 392 spec.IsDefault = true; 393 spec.Name = "Command Line Server"; 394 spec.Port = m_Port; 395 spec.Server = m_Server; 396 spec.UseWindowsAuthentication = false; //for now 397 spec.UseDefaultNamespace = true; //for now 398 login = this.WinFramework.CreateLoginProcess(); 399 login.AutoSetDivisionToLastLookup = false; 400 login.AttemptAccessVerifyLogin(spec, m_AccessCode, m_VerifyCode); 401 goto DoneTrying; 402 } 403 404 // if only server, port is supplied, then use these instead 405 else if (!String.IsNullOrEmpty(m_Server) && m_Port != 0) 406 { 407 RpmsConnectionSpec spec = new RpmsConnectionSpec(); 408 spec.IsDefault = true; 409 spec.Name = "Command Line Server"; 410 spec.Port = m_Port; 411 spec.Server = m_Server; 412 spec.UseWindowsAuthentication = false; //for now 413 spec.UseDefaultNamespace = true; //for now 414 415 RpmsConnectionSettings cxnSettings = new RpmsConnectionSettings 416 { 417 CommandLineConnectionSpec = spec 418 }; 419 420 this.WinFramework.ConnectionSettings = cxnSettings; 421 422 login = this.WinFramework.CreateLoginProcess(); 423 login.AutoSetDivisionToLastLookup = false; 424 //test 425 //spec.UseWindowsAuthentication = true; 426 login.AttemptUserInputLogin("Clinical Scheduling Log-in", 3, false, firstSplash); 427 //login.AttemptWindowsAuthLogin(); 428 //test 429 goto DoneTrying; 430 } 431 432 // if nothing is supplied, fall back on the original dialog 433 else 434 { 435 this.WinFramework.LoadConnectionSpecs(LocalPersistentStore.CreateDefaultStorage(true), "BSDX"); 436 login = this.WinFramework.CreateLoginProcess(); 437 login.AutoSetDivisionToLastLookup = false; 438 login.AttemptUserInputLogin("Clincal Scheduling Log-in", 3, true, firstSplash); 439 440 goto DoneTrying; 441 } 442 443 DoneTrying: 444 if (!login.WasSuccessful) 445 { 446 return false; 447 } 448 449 LocalSession local = this.WinFramework.LocalSession; 450 451 if ((this.WinFramework.Context.User.Division == null) && !this.WinFramework.AttemptUserInputSetDivision("Set Initial Division", firstSplash)) 452 { 453 return false; 454 } 455 456 457 458 this.RemoteSession = this.WinFramework.PrimaryRemoteSession; 459 362 460 //Tie delegate to Events generated by BMX. 363 m_ConnectInfo.BMXNetEvent += CDocMgrEventDelegate; 364 //Disable polling (But does this really work???? I don't see how it gets disabled) 365 m_ConnectInfo.EventPollingEnabled = false; 366 461 this.RemoteSession.EventServices.RpmsEvent += this.CDocMgrEventHandler; 462 //Disable polling 463 this.RemoteSession.EventServices.IsEventPollingEnabled = false; 464 465 //Second splash screens 367 466 //Show a splash screen while initializing; define delegates to remote thread 368 DSplash m_ds= new DSplash();369 DSplash.dSetStatus setStatusDelegate = new DSplash.dSetStatus( m_ds.SetStatus);370 DSplash.dAny closeSplashDelegate = new DSplash.dAny( m_ds.RemoteClose);371 DSplash.dProgressBarSet setMaxProgressDelegate = new DSplash.dProgressBarSet( m_ds.RemoteProgressBarMaxSet);372 DSplash.dProgressBarSet setProgressDelegate = new DSplash.dProgressBarSet( m_ds.RemoteProgressBarValueSet);467 DSplash secondSplash = new DSplash(); 468 DSplash.dSetStatus setStatusDelegate = new DSplash.dSetStatus(secondSplash.SetStatus); 469 DSplash.dAny closeSplashDelegate = new DSplash.dAny(secondSplash.RemoteClose); 470 DSplash.dProgressBarSet setMaxProgressDelegate = new DSplash.dProgressBarSet(secondSplash.RemoteProgressBarMaxSet); 471 DSplash.dProgressBarSet setProgressDelegate = new DSplash.dProgressBarSet(secondSplash.RemoteProgressBarValueSet); 373 472 374 473 //Start new thread for the Splash screen. … … 376 475 threadSplash.IsBackground = true; //expendable thread -- exit even if still running. 377 476 threadSplash.Name = "Splash Thread"; 378 threadSplash.Start(m_ds); // pass form as parameter. 477 threadSplash.Start(secondSplash); 478 479 firstSplash.Close(); // close temporary splash now that the new one is up and running 379 480 380 481 //There are 21 steps to load the application. That's max for the progress bar. 381 482 setMaxProgressDelegate(21); 483 484 // smh--not used: System.Configuration.ConfigurationManager.GetSection("appSettings"); 485 setStatusDelegate("Connecting to VISTA"); 486 382 487 383 // smh--not used: System.Configuration.ConfigurationManager.GetSection("appSettings"); 384 385 setStatusDelegate("Connecting to VISTA"); 386 488 /* 387 489 //Try to connect using supplied values for Server and Port 388 490 //Why am I doing this? The library BMX net uses prompts for access and verify code … … 462 564 } 463 565 }while (bRetry == true); 464 465 //Printing 466 566 */ 567 568 //Printing Custom DLL. Perfect place for code injection!!! 569 //************************************************* 467 570 string DllLocation = string.Empty; 468 571 System.IO.DirectoryInfo di = new System.IO.DirectoryInfo(Application.StartupPath + @"\Printing\"); … … 495 598 this.m_PrintingObject = Creator.PrintFactory(); 496 599 } 497 600 //************************************************ 498 601 499 602 //User Interface Culture (m_CultureName is set from the command line flag /culture) … … 512 615 } 513 616 617 _dal = new DAL(RemoteSession); // Data access layer 618 514 619 //Create global dataset 515 620 _current.m_dsGlobal = new DataSet("GlobalDataSet"); … … 553 658 setProgressDelegate(2); 554 659 setStatusDelegate("Setting encoding..."); 555 660 //PORT TODO: Set encoding 556 661 if (m_Encoding == String.Empty) 557 662 { 558 string utf8_server_support = m_ConnectInfo.bmxNetLib.TransmitRPC("BMX UTF-8", ""); 663 string utf8_server_support = RemoteSession.TransmitRPC("BMX UTF-8", ""); 664 559 665 if (utf8_server_support == "1") 560 m_ConnectInfo.bmxNetLib.Encoder = System.Text.UTF8Encoding.UTF8; 666 RemoteSession.ConnectionEncoding = System.Text.UTF8Encoding.UTF8; 667 561 668 } 562 669 … … 565 672 setProgressDelegate(3); 566 673 setStatusDelegate("Setting Application Context to BSDXRPC..."); 567 m_ConnectInfo.AppContext = "BSDXRPC";674 RemoteSession.AppContext = "BSDXRPC"; 568 675 569 676 //User Preferences Object … … 571 678 setStatusDelegate("Getting User Preferences from the Server..."); 572 679 573 _current.UserPreferences = new UserPreferences(); // Does the calling to do that...680 _current.UserPreferences = new UserPreferences(); // Constructor Does the calling to do that... 574 681 575 682 //Load global recordsets … … 583 690 setProgressDelegate(6); 584 691 setStatusDelegate(statusConst + " Schedule User"); 585 DataTable dtUser = _dal.GetUserInfo( m_ConnectInfo.DUZ);692 DataTable dtUser = _dal.GetUserInfo(RemoteSession.User.Duz); 586 693 dtUser.TableName = "SchedulingUser"; 587 694 m_dsGlobal.Tables.Add(dtUser); … … 598 705 setProgressDelegate(7); 599 706 setStatusDelegate(statusConst + " Access Types"); 600 DataTable dtAccessTypes = _dal.GetAccessTypes(); 601 dtAccessTypes.TableName = "AccessTypes"; 602 m_dsGlobal.Tables.Add(dtAccessTypes); 707 DataTable dtAccessTypes = _dal.GetAccessTypes(m_dsGlobal, "AccessTypes"); 603 708 604 709 //Get Access Groups … … 680 785 //cmd.CommandText = "SELECT BMXIEN 'HOSPITAL_LOCATION_ID', NAME 'HOSPITAL_LOCATION', DEFAULT_PROVIDER, STOP_CODE_NUMBER, INACTIVATE_DATE, REACTIVATE_DATE FROM HOSPITAL_LOCATION"; 681 786 sCommandText = "BSDX HOSPITAL LOCATION"; 682 ConnectInfo.RPMSDataTable(sCommandText, "HospitalLocation", m_dsGlobal);787 RemoteSession.TableFromCommand(sCommandText, m_dsGlobal, "HospitalLocation"); 683 788 Debug.Write("LoadGlobalRecordsets -- HospitalLocation loaded\n"); 684 789 … … 732 837 setStatusDelegate(statusConst + " Providers"); 733 838 sCommandText = "SELECT BMXIEN, NAME FROM NEW_PERSON WHERE INACTIVE_DATE = '' AND BMXIEN > 1"; 734 ConnectInfo.RPMSDataTable(sCommandText, "Provider", m_dsGlobal);839 RemoteSession.TableFromSQL(sCommandText, m_dsGlobal, "Provider"); 735 840 Debug.Write("LoadGlobalRecordsets -- Provider loaded\n"); 736 841 … … 740 845 setStatusDelegate(statusConst + " Holiday"); 741 846 sCommandText = "SELECT NAME, DATE FROM HOLIDAY WHERE INTERNAL[DATE] > '" + FMDateTime.Create(DateTime.Today).DateOnly.FMDateString + "'"; 742 ConnectInfo.RPMSDataTable(sCommandText, "HOLIDAY", m_dsGlobal);847 RemoteSession.TableFromSQL(sCommandText, m_dsGlobal, "HOLIDAY"); 743 848 Debug.Write("LoadingGlobalRecordsets -- Holidays loaded\n"); 744 849 … … 749 854 750 855 setStatusDelegate("Setting Receive Timeout"); 751 _current. m_ConnectInfo.ReceiveTimeout = 30000; //30-second timeout856 _current.RemoteSession.ReceiveTimeout = 30000; //30-second timeout 752 857 753 858 #if DEBUG 754 _current. m_ConnectInfo.ReceiveTimeout = 600000; //longer timeout for debugging859 _current.RemoteSession.ReceiveTimeout = 600000; //longer timeout for debugging 755 860 #endif 756 861 // Event Subsriptions … … 758 863 //Table #16 759 864 setProgressDelegate(18); 760 _current. m_ConnectInfo.SubscribeEvent("BSDX SCHEDULE");865 _current.RemoteSession.EventServices.Subscribe("BSDX SCHEDULE"); 761 866 //Table #17 762 867 setProgressDelegate(19); 763 _current. m_ConnectInfo.SubscribeEvent("BSDX CALL WORKSTATIONS");868 _current.RemoteSession.EventServices.Subscribe("BSDX CALL WORKSTATIONS"); 764 869 //Table #18 765 870 setProgressDelegate(20); 766 _current. m_ConnectInfo.SubscribeEvent("BSDX ADMIN MESSAGE");871 _current.RemoteSession.EventServices.Subscribe("BSDX ADMIN MESSAGE"); 767 872 //Table #19 768 873 setProgressDelegate(21); 769 _current.m_ConnectInfo.SubscribeEvent("BSDX ADMIN SHUTDOWN"); 770 771 _current.m_ConnectInfo.EventPollingInterval = 5000; //in milliseconds 772 _current.m_ConnectInfo.EventPollingEnabled = true; 773 _current.m_ConnectInfo.AutoFire = 12; //AutoFire every 12*5 seconds 874 _current.RemoteSession.EventServices.Subscribe("BSDX ADMIN SHUTDOWN"); 875 876 _current.RemoteSession.EventServices.EventPollingInterval = 5000; //in milliseconds 877 _current.RemoteSession.EventServices.IsEventPollingEnabled = true; 878 879 //PORT TODO: No Autofire in BMX 4.0 880 //_current.RemoteSession.EventServices. = 12; //AutoFire every 12*5 seconds 774 881 775 882 //Close Splash Screen … … 785 892 { 786 893 string sCommandText = "SELECT * FROM BSDX_ACCESS_GROUP"; 787 ConnectInfo.RPMSDataTable(sCommandText, "AccessGroup", m_dsGlobal);894 RemoteSession.TableFromSQL(sCommandText, m_dsGlobal, "AccessGroup"); 788 895 Debug.Write("LoadGlobalRecordsets -- AccessGroups loaded\n"); 789 896 } … … 792 899 { 793 900 string sCommandText = "BSDX GET ACCESS GROUP TYPES"; 794 ConnectInfo.RPMSDataTable(sCommandText, "AccessGroupType", m_dsGlobal);901 RemoteSession.TableFromCommand(sCommandText, m_dsGlobal, "AccessGroupType"); 795 902 Debug.Write("LoadGlobalRecordsets -- AccessGroupTypes loaded\n"); 796 903 } … … 798 905 public void LoadBSDXResourcesTable() 799 906 { 800 string sCommandText = "BSDX RESOURCES^" + m_ConnectInfo.DUZ;801 ConnectInfo.RPMSDataTable(sCommandText, "Resources", m_dsGlobal);907 string sCommandText = "BSDX RESOURCES^" + RemoteSession.User.Duz; 908 RemoteSession.TableFromCommand(sCommandText, m_dsGlobal, "Resources"); 802 909 Debug.Write("LoadGlobalRecordsets -- Resources loaded\n"); 803 910 } … … 809 916 //to which user has access 810 917 //Fields are: RESOURCE_GROUPID, RESOURCE_GROUP 811 string sCommandText = "BSDX RESOURCE GROUPS BY USER^" + m_ConnectInfo.DUZ;812 ConnectInfo.RPMSDataTable(sCommandText, "ResourceGroup", m_dsGlobal);918 string sCommandText = "BSDX RESOURCE GROUPS BY USER^" + RemoteSession.User.Duz; 919 RemoteSession.TableFromCommand(sCommandText, m_dsGlobal, "ResourceGroup"); 813 920 Debug.Write("LoadGlobalRecordsets -- ResourceGroup loaded\n"); 814 921 } … … 821 928 //are returned. 822 929 //Fields are: RESOURCE_GROUPID, RESOURCE_GROUP, RESOURCE_GROUP_ITEMID, RESOURCE_NAME, RESOURCE_ID 823 string sCommandText = "BSDX GROUP RESOURCE^" + m_ConnectInfo.DUZ;824 ConnectInfo.RPMSDataTable(sCommandText, "GroupResources", m_dsGlobal);930 string sCommandText = "BSDX GROUP RESOURCE^" + RemoteSession.User.Duz; 931 RemoteSession.TableFromCommand(sCommandText, m_dsGlobal, "GroupResources"); 825 932 Debug.Write("LoadGlobalRecordsets -- GroupResources loaded\n"); 826 933 } … … 831 938 //who possesses the BSDXZMENU security key. 832 939 string sCommandText = "BSDX SCHEDULE USER"; 833 ConnectInfo.RPMSDataTable(sCommandText, "ScheduleUser", m_dsGlobal);940 RemoteSession.TableFromCommand(sCommandText, m_dsGlobal, "ScheduleUser"); 834 941 Debug.Write("LoadGlobalRecordsets -- ScheduleUser loaded\n"); 835 942 } … … 850 957 if (!bAllUsers) 851 958 { 852 sCommandText += String.Format(" WHERE INTERNAL[USERNAME] = {0}", m_ConnectInfo.DUZ);853 } 854 855 ConnectInfo.RPMSDataTable(sCommandText, "ResourceUser", m_dsGlobal);959 sCommandText += String.Format(" WHERE INTERNAL[USERNAME] = {0}", RemoteSession.User.Duz); 960 } 961 962 RemoteSession.TableFromSQL(sCommandText, m_dsGlobal, "ResourceUser"); 856 963 Debug.Write("LoadGlobalRecordsets -- ResourceUser loaded\n"); 857 964 } … … 968 1075 if ((Views.Count == 0)&&(this.AvailabilityViews.Count == 0)&&(m_bExitOK == true)) 969 1076 { 970 m_ConnectInfo.EventPollingEnabled = false;971 m_ConnectInfo.UnSubscribeEvent("BSDX SCHEDULE");972 m_ConnectInfo.CloseConnection();1077 RemoteSession.EventServices.IsEventPollingEnabled = false; 1078 RemoteSession.EventServices.Unsubscribe("BSDX SCHEDULE"); 1079 RemoteSession.Close(); 973 1080 Application.Exit(); 974 1081 } … … 983 1090 if ((Views.Count == 0)&&(this.AvailabilityViews.Count == 0)&&(m_bExitOK == true)) 984 1091 { 985 m_ConnectInfo.bmxNetLib.CloseConnection();1092 RemoteSession.Close(); 986 1093 Application.Exit(); 987 1094 } … … 1123 1230 1124 1231 //Used in Do loop 1125 bool bRetry = true;1232 //bool bRetry = true; 1126 1233 1127 / / Do Loop to deal with changing the server and the vagaries of user choices.1234 /*// Do Loop to deal with changing the server and the vagaries of user choices. 1128 1235 do 1129 1236 { … … 1134 1241 //so it can be re-used when BMX tries to log in again. 1135 1242 //Access and Verify code are prompted for in InitializeApp 1136 m_ConnectInfo.ChangeServerInfo(); 1243 LoginProcess login = this.WinFramework.CreateLoginProcess(); 1244 login.AttemptUserInputLogin("ReLog-in", 3, true, null); 1137 1245 bRetry = false; 1138 1246 } … … 1157 1265 } 1158 1266 } while (bRetry == true); 1159 1267 */ 1268 1160 1269 //Parameter for initialize app tells it that this is a re-login and forces a new access and verify code. 1161 1270 bool isEverythingOkay = this.InitializeApp(true); … … 1194 1303 private void mnuRPMSLogin_Click(object sender, EventArgs e) 1195 1304 { 1196 //Warn that changing login will close all schedules 1305 mnuRPMSServer_Click(sender, e); 1306 1307 /* v 1.7 to support BMX 4 -- commented out -- smh 1308 //Warn that changing login will close all schedules 1197 1309 if (MessageBox.Show("Are you sure you want to close all schedules and login to VistA?", "Clinical Scheduling", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) != DialogResult.OK) 1198 1310 return; … … 1206 1318 CloseAll(); 1207 1319 m_bExitOK = true; 1320 1321 LoginProcess login = this.WinFramework.CreateLoginProcess(); 1322 login.AttemptUserInputLogin("Clincal Scheduling", 3, true, null); 1323 //m_ConnectInfo.bmxNetLib.StartLog(); //This line turns on logging of messages 1324 1325 if (!login.WasSuccessful) 1326 { 1327 return; 1328 } 1329 1330 LocalSession local = this.WinFramework.LocalSession; 1331 1332 if ((this.WinFramework.Context.User.Division == null) && !this.WinFramework.AttemptUserInputSetDivision("Set Initial Division", null)) 1333 { 1334 return; 1335 } 1336 1337 this.RemoteSession = this.WinFramework.PrimaryRemoteSession; 1208 1338 1209 1339 //Parameter for initialize app tells it that this is a re-login and forces a new access and verify code. … … 1233 1363 throw ex; 1234 1364 } 1235 1365 */ 1236 1366 } 1237 1367 … … 1290 1420 { 1291 1421 //System.IntPtr pHandle = this.Handle; 1292 RPMSDataTableDelegate rdtd = new RPMSDataTableDelegate( ConnectInfo.RPMSDataTable);1422 RPMSDataTableDelegate rdtd = new RPMSDataTableDelegate(RemoteSession.TableFromCommand); 1293 1423 //dtOut = (DataTable) this.Invoke(rdtd, new object[] {sSQL, sTableName}); 1294 dtOut = rdtd.Invoke(sSQL, sTableName); 1424 dtOut = RemoteSession.TableFromCommand(sSQL); 1425 dtOut.TableName = sTableName; 1426 1295 1427 } 1296 1428 … … 1307 1439 public void ChangeDivision(System.Windows.Forms.Form frmCaller) 1308 1440 { 1309 this.ConnectInfo.ChangeDivision(frmCaller); 1441 WinFramework.AttemptUserInputSetDivision("Change Division", frmCaller); 1442 1443 RemoteSession = WinFramework.PrimaryRemoteSession; 1444 1310 1445 foreach (CGView v in _views.Keys) 1311 1446 {
Note:
See TracChangeset
for help on using the changeset viewer.