Changeset 1474 for Scheduling/trunk


Ignore:
Timestamp:
Jul 6, 2012, 3:37:41 PM (12 years ago)
Author:
Sam Habiel
Message:

Finally, v 1.7 to the main repo. I will delete the branch after this.

This commit merges all the BMX4 changes in the Scheduling GUI back to the main trunk.

Location:
Scheduling/trunk/cs/bsdx0200GUISourceCode
Files:
1 deleted
14 edited
6 copied

Legend:

Unmodified
Added
Removed
  • Scheduling/trunk/cs/bsdx0200GUISourceCode

  • Scheduling/trunk/cs/bsdx0200GUISourceCode/AssemblyInfo.cs

    r1248 r1474  
    2828// by using the '*' as shown below:
    2929
    30 [assembly: AssemblyVersion("1.6.1.*")]
     30[assembly: AssemblyVersion("1.7.0.*")]
    3131
    3232//
     
    5858[assembly: AssemblyKeyFile("")]
    5959[assembly: AssemblyKeyName("")]
    60 [assembly: AssemblyFileVersionAttribute("1.6.1.0")]
     60[assembly: AssemblyFileVersionAttribute("1.7.0.0")]
    6161[assembly: ComVisibleAttribute(false)]
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/CGAVView.cs

    r1117 r1474  
    654654//                              sSql = "BSDX RAISE EVENT^" + sEvent + "^" + sParams + "^^";
    655655//                              DataTable dtAppt =m_DocManager.RPMSDataTable(sSql, "RaiseEvent");
    656                                 this.m_DocManager.ConnectInfo.RaiseEvent(sEvent, sParams, true);
     656                                CGDocumentManager.Current.RemoteSession.EventServices.TriggerEvent(sEvent, sParams, true);
    657657                        }
    658658                        catch (Exception ex)
     
    809809                {
    810810                        calendarGrid1.CGToolTip.Active = false;
    811                         string sMsg = " this access block?";
     811                        string sMsg;
    812812                        if (calendarGrid1.SelectedAppointments.AppointmentTable.Count > 1)
    813813                                sMsg = " these access blocks?";
     
    859859                        try
    860860                        {
    861                                 bool bLock = DocManager.ConnectInfo.bmxNetLib.Lock("^BSDXMGR", "+");
     861                                bool bLock = CGDocumentManager.Current.RemoteSession.Lock("^BSDXMGR", "+");
    862862                                if (bLock == false)
    863863                                {
     
    872872                                        return;
    873873                                }
    874                                 bLock = DocManager.ConnectInfo.bmxNetLib.Lock("^BSDXMGR", "-");
     874                bLock = CGDocumentManager.Current.RemoteSession.Lock("^BSDXMGR", "-");
    875875                        }
    876876                        catch (Exception ex)
     
    947947                {
    948948                        this.calendarGrid1.CloseGrid();
    949                         DocManager.ConnectInfo.bmxNetLib.Lock("^BSDXRES(" + Document.ResourceID.ToString() + ")", "-");
     949            CGDocumentManager.Current.RemoteSession.Lock("^BSDXRES(" + Document.ResourceID.ToString() + ")", "-");
    950950                }
    951951
  • 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
    17using System;
    28using System.Windows.Forms;
     
    612using System.Threading;
    713using IndianHealthService.BMXNet;
     14using IndianHealthService.BMXNet.WinForm;
     15using IndianHealthService.BMXNet.WinForm.Configuration; //grrrr... too many namespaces here...
    816using Mono.Options;
    917using System.Runtime.InteropServices;
     
    4250                //M Connection member variables
    4351                private DataSet                                                                 m_dsGlobal = null;      // Holds all user data
    44                 private BMXNetConnectInfo                                               m_ConnectInfo = null;   // Connection to VISTA object
    45         private BMXNetConnectInfo.BMXNetEventDelegate CDocMgrEventDelegate;     // Delegate to respond to messages from VISTA. Responds to event: BMXNetConnectInfo.BMXNetEvent
    4652
    4753        //Custom Printing
     
    5157        #region Properties
    5258
    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
    6362
    6463        /// <summary>
     
    153152
    154153        /// <summary>
    155         /// Constructor. Does absolutely nothing at this point.
     154        /// Private constructor for singleton instance.
    156155        /// </summary>
    157                 public CGDocumentManager()
     156                private CGDocumentManager()
    158157                {
    159158        }
     
    218217            opset.Parse(args);
    219218           
    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.
    224234            if (!isEverythingOkay) return;
    225235
     
    235245            view.InitializeDocView(doc, _current, doc.StartDate, _current.WindowText);
    236246
    237             //Handle BMX Event
     247            //Handle Message Queue
    238248            Application.DoEvents();
    239249
     
    295305
    296306        #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")
    300310                        {
    301311                                string sParam = "";
    302312                                string sDelim="~";
    303                                 sParam += this.m_ConnectInfo.UserName + sDelim;
     313                                sParam += this.RemoteSession.User.Name + sDelim;
    304314                                sParam += this.m_sHandle + sDelim;
    305315                                sParam += Application.ProductVersion + sDelim;
    306316                                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;
    312322                                ShowAdminMsgDelegate samd = new ShowAdminMsgDelegate(ShowAdminMsg);
    313                                 //this.Invoke(samd, new object [] {sMsg});
    314323                samd.Invoke(sMsg);
    315324                        }
    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;
    319328                                CloseAllDelegate cad = new CloseAllDelegate(CloseAll);
    320                                 //this.Invoke(cad, new object [] {sMsg});
    321329                cad.Invoke(sMsg);
    322330                        }
     
    353361        private bool InitializeApp(bool bReLogin)
    354362                {
    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();
    359372           
    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
     443DoneTrying:
     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
    362460            //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
    367466            //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);
    373472
    374473            //Start new thread for the Splash screen.
     
    376475            threadSplash.IsBackground = true; //expendable thread -- exit even if still running.
    377476            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
    379480
    380481            //There are 21 steps to load the application. That's max for the progress bar.
    381482            setMaxProgressDelegate(21);
     483
     484            // smh--not used: System.Configuration.ConfigurationManager.GetSection("appSettings");
     485            setStatusDelegate("Connecting to VISTA");
     486
    382487           
    383             // smh--not used: System.Configuration.ConfigurationManager.GetSection("appSettings");
    384            
    385             setStatusDelegate("Connecting to VISTA");
    386            
     488            /*
    387489            //Try to connect using supplied values for Server and Port
    388490            //Why am I doing this? The library BMX net uses prompts for access and verify code
     
    462564                }
    463565                        }while (bRetry == true);
    464            
    465             //Printing
    466 
     566            */
     567
     568            //Printing Custom DLL. Perfect place for code injection!!!
     569            //*************************************************
    467570            string DllLocation = string.Empty;
    468571            System.IO.DirectoryInfo di = new System.IO.DirectoryInfo(Application.StartupPath + @"\Printing\");
     
    495598                this.m_PrintingObject = Creator.PrintFactory();
    496599            }
    497            
     600           //************************************************
    498601           
    499602            //User Interface Culture (m_CultureName is set from the command line flag /culture)
     
    512615            }
    513616
     617            _dal = new DAL(RemoteSession);   // Data access layer
     618           
    514619            //Create global dataset
    515620                        _current.m_dsGlobal = new DataSet("GlobalDataSet");
     
    553658            setProgressDelegate(2);
    554659            setStatusDelegate("Setting encoding...");
    555 
     660            //PORT TODO: Set encoding
    556661            if (m_Encoding == String.Empty)
    557662            {
    558                 string utf8_server_support = m_ConnectInfo.bmxNetLib.TransmitRPC("BMX UTF-8", "");
     663                string utf8_server_support = RemoteSession.TransmitRPC("BMX UTF-8", "");
     664               
    559665                if (utf8_server_support == "1")
    560                     m_ConnectInfo.bmxNetLib.Encoder = System.Text.UTF8Encoding.UTF8;
     666                    RemoteSession.ConnectionEncoding = System.Text.UTF8Encoding.UTF8;
     667               
    561668            }
    562669                       
     
    565672            setProgressDelegate(3);
    566673                        setStatusDelegate("Setting Application Context to BSDXRPC...");
    567                         m_ConnectInfo.AppContext = "BSDXRPC";
     674                        RemoteSession.AppContext = "BSDXRPC";
    568675
    569676            //User Preferences Object
     
    571678            setStatusDelegate("Getting User Preferences from the Server...");
    572679
    573             _current.UserPreferences = new UserPreferences(); // Does the calling to do that...
     680            _current.UserPreferences = new UserPreferences(); // Constructor Does the calling to do that...
    574681           
    575682            //Load global recordsets
     
    583690            setProgressDelegate(6);
    584691            setStatusDelegate(statusConst + " Schedule User");
    585             DataTable dtUser = _dal.GetUserInfo(m_ConnectInfo.DUZ);
     692            DataTable dtUser = _dal.GetUserInfo(RemoteSession.User.Duz);
    586693            dtUser.TableName = "SchedulingUser";
    587694            m_dsGlobal.Tables.Add(dtUser);
     
    598705            setProgressDelegate(7);
    599706            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");
    603708
    604709            //Get Access Groups
     
    680785            //cmd.CommandText = "SELECT BMXIEN 'HOSPITAL_LOCATION_ID', NAME 'HOSPITAL_LOCATION', DEFAULT_PROVIDER, STOP_CODE_NUMBER, INACTIVATE_DATE, REACTIVATE_DATE FROM HOSPITAL_LOCATION";
    681786            sCommandText = "BSDX HOSPITAL LOCATION";
    682             ConnectInfo.RPMSDataTable(sCommandText, "HospitalLocation", m_dsGlobal);
     787            RemoteSession.TableFromCommand(sCommandText, m_dsGlobal, "HospitalLocation");
    683788            Debug.Write("LoadGlobalRecordsets -- HospitalLocation loaded\n");
    684789
     
    732837            setStatusDelegate(statusConst + " Providers");
    733838            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");
    735840            Debug.Write("LoadGlobalRecordsets -- Provider loaded\n");
    736841
     
    740845            setStatusDelegate(statusConst + " Holiday");
    741846            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");
    743848            Debug.Write("LoadingGlobalRecordsets -- Holidays loaded\n");
    744849
     
    749854
    750855            setStatusDelegate("Setting Receive Timeout");
    751             _current.m_ConnectInfo.ReceiveTimeout = 30000; //30-second timeout
     856            _current.RemoteSession.ReceiveTimeout = 30000; //30-second timeout
    752857
    753858#if DEBUG
    754             _current.m_ConnectInfo.ReceiveTimeout = 600000; //longer timeout for debugging
     859            _current.RemoteSession.ReceiveTimeout = 600000; //longer timeout for debugging
    755860#endif
    756861                        // Event Subsriptions
     
    758863            //Table #16
    759864            setProgressDelegate(18);
    760             _current.m_ConnectInfo.SubscribeEvent("BSDX SCHEDULE");
     865            _current.RemoteSession.EventServices.Subscribe("BSDX SCHEDULE");
    761866                        //Table #17
    762867            setProgressDelegate(19);
    763             _current.m_ConnectInfo.SubscribeEvent("BSDX CALL WORKSTATIONS");
     868            _current.RemoteSession.EventServices.Subscribe("BSDX CALL WORKSTATIONS");
    764869                        //Table #18
    765870            setProgressDelegate(20);
    766             _current.m_ConnectInfo.SubscribeEvent("BSDX ADMIN MESSAGE");
     871            _current.RemoteSession.EventServices.Subscribe("BSDX ADMIN MESSAGE");
    767872                        //Table #19
    768873            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
    774881
    775882            //Close Splash Screen
     
    785892                {
    786893                        string sCommandText = "SELECT * FROM BSDX_ACCESS_GROUP";
    787                         ConnectInfo.RPMSDataTable(sCommandText, "AccessGroup", m_dsGlobal);
     894                        RemoteSession.TableFromSQL(sCommandText, m_dsGlobal, "AccessGroup");
    788895                        Debug.Write("LoadGlobalRecordsets -- AccessGroups loaded\n");
    789896                }
     
    792899                {
    793900                        string sCommandText = "BSDX GET ACCESS GROUP TYPES";
    794                         ConnectInfo.RPMSDataTable(sCommandText, "AccessGroupType", m_dsGlobal);
     901            RemoteSession.TableFromCommand(sCommandText, m_dsGlobal, "AccessGroupType");
    795902                        Debug.Write("LoadGlobalRecordsets -- AccessGroupTypes loaded\n");
    796903                }
     
    798905                public void LoadBSDXResourcesTable()
    799906                {
    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");
    802909                        Debug.Write("LoadGlobalRecordsets -- Resources loaded\n");
    803910                }
     
    809916                        //to which user has access
    810917                        //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");
    813920                        Debug.Write("LoadGlobalRecordsets -- ResourceGroup loaded\n");
    814921                }
     
    821928                        //are returned.
    822929                        //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");
    825932                        Debug.Write("LoadGlobalRecordsets -- GroupResources loaded\n");
    826933                }
     
    831938                        //who possesses the BSDXZMENU security key.
    832939                        string sCommandText = "BSDX SCHEDULE USER";
    833                         ConnectInfo.RPMSDataTable(sCommandText, "ScheduleUser", m_dsGlobal);
     940            RemoteSession.TableFromCommand(sCommandText, m_dsGlobal, "ScheduleUser");
    834941                        Debug.Write("LoadGlobalRecordsets -- ScheduleUser loaded\n");
    835942                }
     
    850957            if (!bAllUsers)
    851958            {
    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");
    856963                        Debug.Write("LoadGlobalRecordsets -- ResourceUser loaded\n");
    857964                }
     
    9681075                        if ((Views.Count == 0)&&(this.AvailabilityViews.Count == 0)&&(m_bExitOK == true))
    9691076                        {
    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();
    9731080                                Application.Exit();
    9741081                        }
     
    9831090                        if ((Views.Count == 0)&&(this.AvailabilityViews.Count == 0)&&(m_bExitOK == true))
    9841091                        {
    985                                 m_ConnectInfo.bmxNetLib.CloseConnection();
     1092                RemoteSession.Close();
    9861093                                Application.Exit();
    9871094                        }
     
    11231230               
    11241231                //Used in Do loop
    1125                 bool bRetry = true;
     1232                //bool bRetry = true;
    11261233                               
    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.
    11281235                                do
    11291236                                {
     
    11341241                        //so it can be re-used when BMX tries to log in again.
    11351242                        //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);
    11371245                                                bRetry = false;
    11381246                                        }
     
    11571265                                        }
    11581266                                } while (bRetry == true);
    1159 
     1267                */
     1268               
    11601269                //Parameter for initialize app tells it that this is a re-login and forces a new access and verify code.
    11611270                bool isEverythingOkay = this.InitializeApp(true);
     
    11941303                private void mnuRPMSLogin_Click(object sender, EventArgs e)
    11951304                {
    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
    11971309                        if (MessageBox.Show("Are you sure you want to close all schedules and login to VistA?", "Clinical Scheduling", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) != DialogResult.OK)
    11981310                                return;
     
    12061318                                CloseAll();
    12071319                                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;
    12081338
    12091339                //Parameter for initialize app tells it that this is a re-login and forces a new access and verify code.
     
    12331363                                throw ex;
    12341364                        }
    1235        
     1365                */
    12361366                }
    12371367
     
    12901420                        {
    12911421                                //System.IntPtr pHandle = this.Handle;
    1292                                 RPMSDataTableDelegate rdtd = new RPMSDataTableDelegate(ConnectInfo.RPMSDataTable);
     1422                                RPMSDataTableDelegate rdtd = new RPMSDataTableDelegate(RemoteSession.TableFromCommand);
    12931423                                //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
    12951427                        }
    12961428
     
    13071439                public void ChangeDivision(System.Windows.Forms.Form frmCaller)
    13081440                {
    1309                         this.ConnectInfo.ChangeDivision(frmCaller);
     1441            WinFramework.AttemptUserInputSetDivision("Change Division", frmCaller);
     1442
     1443            RemoteSession = WinFramework.PrimaryRemoteSession;
     1444
    13101445                        foreach (CGView v in _views.Keys)
    13111446                        {
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/CGView.cs

    r1233 r1474  
    114114        private MenuItem sepApptMenu3;
    115115        private MenuItem mnuReprintApptSlip;
     116        private MenuItem mnuViewBrokerLog;
    116117        private IContainer components;
    117118
     
    132133                public void InitializeDocView(string sText)
    133134                {
    134                         this.Text = this.DocManager.ConnectInfo.UserName;
     135            this.Text = CGDocumentManager.Current.RemoteSession.User.Name;
    135136                        if (sText != null)
    136137                                this.Text += " - " + sText;
    137                         if (DocManager.ConnectInfo.DivisionName != null)
    138                                 this.Text += " - " + DocManager.ConnectInfo.DivisionName;
     138            if (CGDocumentManager.Current.RemoteSession.User.Division.Name != null)
     139                this.Text += " - " + CGDocumentManager.Current.RemoteSession.User.Division.Name;
    139140                }
    140141
     
    157158
    158159            // Set username and division up top
    159             this.Text = this.DocManager.ConnectInfo.UserName;
     160            this.Text = CGDocumentManager.Current.RemoteSession.User.Name;
    160161                        if (sText != null)
    161162                                this.Text += " - " + sText;
    162                         if (DocManager.ConnectInfo.DivisionName != null)
    163                                 this.Text += " - " + DocManager.ConnectInfo.DivisionName;
    164 
    165                         this.m_ConnectInfo = m_DocManager.ConnectInfo;
    166                         m_bmxDelegate = new BMXNetConnectInfo.BMXNetEventDelegate(BMXNetEventHandler);
    167                         m_ConnectInfo.BMXNetEvent += m_bmxDelegate;
    168                 }
    169 
    170                 private BMXNetConnectInfo.BMXNetEventDelegate m_bmxDelegate;
     163                        if (CGDocumentManager.Current.RemoteSession.User.Division.Name != null)
     164                this.Text += " - " + CGDocumentManager.Current.RemoteSession.User.Division.Name;
     165
     166            CGDocumentManager.Current.RemoteSession.EventServices.RpmsEvent += BMXNetEventHandler;
     167                }
    171168               
    172169
     
    235232            this.mnuHelp = new System.Windows.Forms.MenuItem();
    236233            this.mnuHelpAbout = new System.Windows.Forms.MenuItem();
     234            this.mnuViewBrokerLog = new System.Windows.Forms.MenuItem();
    237235            this.mnuTest = new System.Windows.Forms.MenuItem();
    238236            this.mnuTest1 = new System.Windows.Forms.MenuItem();
     
    680678            this.mnuHelp.Index = 3;
    681679            this.mnuHelp.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
    682             this.mnuHelpAbout});
     680            this.mnuHelpAbout,
     681            this.mnuViewBrokerLog});
    683682            this.mnuHelp.Text = "&Help";
    684683            //
     
    688687            this.mnuHelpAbout.Text = "&About";
    689688            this.mnuHelpAbout.Click += new System.EventHandler(this.mnuHelpAbout_Click);
     689            //
     690            // mnuViewBrokerLog
     691            //
     692            this.mnuViewBrokerLog.Index = 1;
     693            this.mnuViewBrokerLog.Text = "&View Broker Log";
     694            this.mnuViewBrokerLog.Click += new System.EventHandler(this.mnuViewBrokerLog_Click);
    690695            //
    691696            // mnuTest
     
    702707            this.mnuTest1.Index = 0;
    703708            this.mnuTest1.Text = "Test1";
    704             this.mnuTest1.Click += new System.EventHandler(this.mnuTest1_Click);
    705709            //
    706710            // tvSchedules
     
    712716            this.tvSchedules.Location = new System.Drawing.Point(0, 0);
    713717            this.tvSchedules.Name = "tvSchedules";
    714             this.tvSchedules.Size = new System.Drawing.Size(128, 392);
     718            this.tvSchedules.Size = new System.Drawing.Size(128, 389);
    715719            this.tvSchedules.Sorted = true;
    716720            this.tvSchedules.TabIndex = 1;
     
    781785            this.panelRight.Location = new System.Drawing.Point(996, 0);
    782786            this.panelRight.Name = "panelRight";
    783             this.panelRight.Size = new System.Drawing.Size(128, 392);
     787            this.panelRight.Size = new System.Drawing.Size(128, 389);
    784788            this.panelRight.TabIndex = 3;
    785789            this.panelRight.Visible = false;
     
    877881            this.panelCenter.Location = new System.Drawing.Point(136, 24);
    878882            this.panelCenter.Name = "panelCenter";
    879             this.panelCenter.Size = new System.Drawing.Size(857, 344);
     883            this.panelCenter.Size = new System.Drawing.Size(857, 341);
    880884            this.panelCenter.TabIndex = 7;
     885            //
     886            // ctxCalendarGrid
     887            //
     888            this.ctxCalendarGrid.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
     889            this.ctxCalGridAdd,
     890            this.ctxCalGridMkRadAppt,
     891            this.ctxCalGridEdit,
     892            this.ctxCalGridDelete,
     893            this.ctxCalGridCancelRadAppt,
     894            this.ctxCalGridCheckIn,
     895            this.ctxCalGridUndoCheckin,
     896            this.ctxCalGridSep1,
     897            this.ctxCalGridNoShow,
     898            this.ctxCalGridNoShowUndo,
     899            this.ctxCalGridSep2,
     900            this.ctxCalGridWalkin,
     901            this.ctxCalGridSep3,
     902            this.ctxCalGridReprintApptSlip});
     903            this.ctxCalendarGrid.Popup += new System.EventHandler(this.ctxCalendarGrid_Popup);
     904            //
     905            // ctxCalGridAdd
     906            //
     907            this.ctxCalGridAdd.Index = 0;
     908            this.ctxCalGridAdd.Text = "Add Appointment";
     909            this.ctxCalGridAdd.Click += new System.EventHandler(this.ctxCalGridAdd_Click);
     910            //
     911            // ctxCalGridMkRadAppt
     912            //
     913            this.ctxCalGridMkRadAppt.Index = 1;
     914            this.ctxCalGridMkRadAppt.Text = "Make Radiology Appointment";
     915            this.ctxCalGridMkRadAppt.Click += new System.EventHandler(this.ctxCalGridMkRadAppt_Click);
     916            //
     917            // ctxCalGridEdit
     918            //
     919            this.ctxCalGridEdit.Index = 2;
     920            this.ctxCalGridEdit.Text = "Edit Appointment";
     921            this.ctxCalGridEdit.Click += new System.EventHandler(this.ctxCalGridEdit_Click);
     922            //
     923            // ctxCalGridDelete
     924            //
     925            this.ctxCalGridDelete.Index = 3;
     926            this.ctxCalGridDelete.Text = "Cancel Appointment";
     927            this.ctxCalGridDelete.Click += new System.EventHandler(this.ctxCalGridDelete_Click);
     928            //
     929            // ctxCalGridCancelRadAppt
     930            //
     931            this.ctxCalGridCancelRadAppt.Index = 4;
     932            this.ctxCalGridCancelRadAppt.Text = "Cancel Radiology Appointment";
     933            this.ctxCalGridCancelRadAppt.Click += new System.EventHandler(this.ctxCalGridCancelRadAppt_Click);
     934            //
     935            // ctxCalGridCheckIn
     936            //
     937            this.ctxCalGridCheckIn.Index = 5;
     938            this.ctxCalGridCheckIn.Text = "Check In Patient";
     939            this.ctxCalGridCheckIn.Click += new System.EventHandler(this.ctxCalGridCheckIn_Click);
     940            //
     941            // ctxCalGridUndoCheckin
     942            //
     943            this.ctxCalGridUndoCheckin.Index = 6;
     944            this.ctxCalGridUndoCheckin.Text = "&Undo Check In";
     945            this.ctxCalGridUndoCheckin.Click += new System.EventHandler(this.ctxCalGridUndoCheckin_Click);
     946            //
     947            // ctxCalGridSep1
     948            //
     949            this.ctxCalGridSep1.Index = 7;
     950            this.ctxCalGridSep1.Text = "-";
     951            //
     952            // ctxCalGridNoShow
     953            //
     954            this.ctxCalGridNoShow.Index = 8;
     955            this.ctxCalGridNoShow.Text = "Mark as No Show";
     956            this.ctxCalGridNoShow.Click += new System.EventHandler(this.ctxCalGridNoShow_Click);
     957            //
     958            // ctxCalGridNoShowUndo
     959            //
     960            this.ctxCalGridNoShowUndo.Index = 9;
     961            this.ctxCalGridNoShowUndo.Text = "Undo NoShow";
     962            this.ctxCalGridNoShowUndo.Click += new System.EventHandler(this.ctxCalGridNoShowUndo_Click);
     963            //
     964            // ctxCalGridSep2
     965            //
     966            this.ctxCalGridSep2.Index = 10;
     967            this.ctxCalGridSep2.Text = "-";
     968            //
     969            // ctxCalGridWalkin
     970            //
     971            this.ctxCalGridWalkin.Index = 11;
     972            this.ctxCalGridWalkin.Text = "Create Wal&k-In Appointment";
     973            this.ctxCalGridWalkin.Click += new System.EventHandler(this.ctxCalGridWalkin_Click);
     974            //
     975            // ctxCalGridSep3
     976            //
     977            this.ctxCalGridSep3.Index = 12;
     978            this.ctxCalGridSep3.Text = "-";
     979            //
     980            // ctxCalGridReprintApptSlip
     981            //
     982            this.ctxCalGridReprintApptSlip.Index = 13;
     983            this.ctxCalGridReprintApptSlip.Text = "&Reprint Appointment Slip";
     984            this.ctxCalGridReprintApptSlip.Click += new System.EventHandler(this.ctxCalGridReprintApptSlip_Click);
     985            //
     986            // panelBottom
     987            //
     988            this.panelBottom.Controls.Add(this.statusBar1);
     989            this.panelBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
     990            this.panelBottom.Location = new System.Drawing.Point(136, 365);
     991            this.panelBottom.Name = "panelBottom";
     992            this.panelBottom.Size = new System.Drawing.Size(857, 24);
     993            this.panelBottom.TabIndex = 8;
     994            //
     995            // statusBar1
     996            //
     997            this.statusBar1.Dock = System.Windows.Forms.DockStyle.Fill;
     998            this.statusBar1.Location = new System.Drawing.Point(0, 0);
     999            this.statusBar1.Name = "statusBar1";
     1000            this.statusBar1.Size = new System.Drawing.Size(857, 24);
     1001            this.statusBar1.SizingGrip = false;
     1002            this.statusBar1.TabIndex = 0;
     1003            //
     1004            // splitter1
     1005            //
     1006            this.splitter1.Location = new System.Drawing.Point(128, 24);
     1007            this.splitter1.Name = "splitter1";
     1008            this.splitter1.Size = new System.Drawing.Size(8, 365);
     1009            this.splitter1.TabIndex = 9;
     1010            this.splitter1.TabStop = false;
     1011            //
     1012            // splitter2
     1013            //
     1014            this.splitter2.Dock = System.Windows.Forms.DockStyle.Right;
     1015            this.splitter2.Location = new System.Drawing.Point(993, 24);
     1016            this.splitter2.Name = "splitter2";
     1017            this.splitter2.Size = new System.Drawing.Size(3, 365);
     1018            this.splitter2.TabIndex = 10;
     1019            this.splitter2.TabStop = false;
    8811020            //
    8821021            // calendarGrid1
     
    8991038            this.calendarGrid1.Resources = ((System.Collections.ArrayList)(resources.GetObject("calendarGrid1.Resources")));
    9001039            this.calendarGrid1.SelectedAppointment = 0;
    901             this.calendarGrid1.Size = new System.Drawing.Size(857, 344);
     1040            this.calendarGrid1.Size = new System.Drawing.Size(857, 341);
    9021041            this.calendarGrid1.StartDate = new System.DateTime(2003, 1, 27, 0, 0, 0, 0);
    9031042            this.calendarGrid1.TabIndex = 0;
     
    9091048            this.calendarGrid1.MouseEnter += new System.EventHandler(this.calendarGrid1_MouseEnter);
    9101049            //
    911             // ctxCalendarGrid
    912             //
    913             this.ctxCalendarGrid.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
    914             this.ctxCalGridAdd,
    915             this.ctxCalGridMkRadAppt,
    916             this.ctxCalGridEdit,
    917             this.ctxCalGridDelete,
    918             this.ctxCalGridCancelRadAppt,
    919             this.ctxCalGridCheckIn,
    920             this.ctxCalGridUndoCheckin,
    921             this.ctxCalGridSep1,
    922             this.ctxCalGridNoShow,
    923             this.ctxCalGridNoShowUndo,
    924             this.ctxCalGridSep2,
    925             this.ctxCalGridWalkin,
    926             this.ctxCalGridSep3,
    927             this.ctxCalGridReprintApptSlip});
    928             this.ctxCalendarGrid.Popup += new System.EventHandler(this.ctxCalendarGrid_Popup);
    929             //
    930             // ctxCalGridAdd
    931             //
    932             this.ctxCalGridAdd.Index = 0;
    933             this.ctxCalGridAdd.Text = "Add Appointment";
    934             this.ctxCalGridAdd.Click += new System.EventHandler(this.ctxCalGridAdd_Click);
    935             //
    936             // ctxCalGridMkRadAppt
    937             //
    938             this.ctxCalGridMkRadAppt.Index = 1;
    939             this.ctxCalGridMkRadAppt.Text = "Make Radiology Appointment";
    940             this.ctxCalGridMkRadAppt.Click += new System.EventHandler(this.ctxCalGridMkRadAppt_Click);
    941             //
    942             // ctxCalGridEdit
    943             //
    944             this.ctxCalGridEdit.Index = 2;
    945             this.ctxCalGridEdit.Text = "Edit Appointment";
    946             this.ctxCalGridEdit.Click += new System.EventHandler(this.ctxCalGridEdit_Click);
    947             //
    948             // ctxCalGridDelete
    949             //
    950             this.ctxCalGridDelete.Index = 3;
    951             this.ctxCalGridDelete.Text = "Cancel Appointment";
    952             this.ctxCalGridDelete.Click += new System.EventHandler(this.ctxCalGridDelete_Click);
    953             //
    954             // ctxCalGridCancelRadAppt
    955             //
    956             this.ctxCalGridCancelRadAppt.Index = 4;
    957             this.ctxCalGridCancelRadAppt.Text = "Cancel Radiology Appointment";
    958             this.ctxCalGridCancelRadAppt.Click += new System.EventHandler(this.ctxCalGridCancelRadAppt_Click);
    959             //
    960             // ctxCalGridCheckIn
    961             //
    962             this.ctxCalGridCheckIn.Index = 5;
    963             this.ctxCalGridCheckIn.Text = "Check In Patient";
    964             this.ctxCalGridCheckIn.Click += new System.EventHandler(this.ctxCalGridCheckIn_Click);
    965             //
    966             // ctxCalGridUndoCheckin
    967             //
    968             this.ctxCalGridUndoCheckin.Index = 6;
    969             this.ctxCalGridUndoCheckin.Text = "&Undo Check In";
    970             this.ctxCalGridUndoCheckin.Click += new System.EventHandler(this.ctxCalGridUndoCheckin_Click);
    971             //
    972             // ctxCalGridSep1
    973             //
    974             this.ctxCalGridSep1.Index = 7;
    975             this.ctxCalGridSep1.Text = "-";
    976             //
    977             // ctxCalGridNoShow
    978             //
    979             this.ctxCalGridNoShow.Index = 8;
    980             this.ctxCalGridNoShow.Text = "Mark as No Show";
    981             this.ctxCalGridNoShow.Click += new System.EventHandler(this.ctxCalGridNoShow_Click);
    982             //
    983             // ctxCalGridNoShowUndo
    984             //
    985             this.ctxCalGridNoShowUndo.Index = 9;
    986             this.ctxCalGridNoShowUndo.Text = "Undo NoShow";
    987             this.ctxCalGridNoShowUndo.Click += new System.EventHandler(this.ctxCalGridNoShowUndo_Click);
    988             //
    989             // ctxCalGridSep2
    990             //
    991             this.ctxCalGridSep2.Index = 10;
    992             this.ctxCalGridSep2.Text = "-";
    993             //
    994             // ctxCalGridWalkin
    995             //
    996             this.ctxCalGridWalkin.Index = 11;
    997             this.ctxCalGridWalkin.Text = "Create Wal&k-In Appointment";
    998             this.ctxCalGridWalkin.Click += new System.EventHandler(this.ctxCalGridWalkin_Click);
    999             //
    1000             // ctxCalGridSep3
    1001             //
    1002             this.ctxCalGridSep3.Index = 12;
    1003             this.ctxCalGridSep3.Text = "-";
    1004             //
    1005             // ctxCalGridReprintApptSlip
    1006             //
    1007             this.ctxCalGridReprintApptSlip.Index = 13;
    1008             this.ctxCalGridReprintApptSlip.Text = "&Reprint Appointment Slip";
    1009             this.ctxCalGridReprintApptSlip.Click += new System.EventHandler(this.ctxCalGridReprintApptSlip_Click);
    1010             //
    1011             // panelBottom
    1012             //
    1013             this.panelBottom.Controls.Add(this.statusBar1);
    1014             this.panelBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
    1015             this.panelBottom.Location = new System.Drawing.Point(136, 368);
    1016             this.panelBottom.Name = "panelBottom";
    1017             this.panelBottom.Size = new System.Drawing.Size(857, 24);
    1018             this.panelBottom.TabIndex = 8;
    1019             //
    1020             // statusBar1
    1021             //
    1022             this.statusBar1.Dock = System.Windows.Forms.DockStyle.Fill;
    1023             this.statusBar1.Location = new System.Drawing.Point(0, 0);
    1024             this.statusBar1.Name = "statusBar1";
    1025             this.statusBar1.Size = new System.Drawing.Size(857, 24);
    1026             this.statusBar1.SizingGrip = false;
    1027             this.statusBar1.TabIndex = 0;
    1028             //
    1029             // splitter1
    1030             //
    1031             this.splitter1.Location = new System.Drawing.Point(128, 24);
    1032             this.splitter1.Name = "splitter1";
    1033             this.splitter1.Size = new System.Drawing.Size(8, 368);
    1034             this.splitter1.TabIndex = 9;
    1035             this.splitter1.TabStop = false;
    1036             //
    1037             // splitter2
    1038             //
    1039             this.splitter2.Dock = System.Windows.Forms.DockStyle.Right;
    1040             this.splitter2.Location = new System.Drawing.Point(993, 24);
    1041             this.splitter2.Name = "splitter2";
    1042             this.splitter2.Size = new System.Drawing.Size(3, 368);
    1043             this.splitter2.TabIndex = 10;
    1044             this.splitter2.TabStop = false;
    1045             //
    10461050            // CGView
    10471051            //
    10481052            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
    1049             this.ClientSize = new System.Drawing.Size(1124, 392);
     1053            this.ClientSize = new System.Drawing.Size(1124, 389);
    10501054            this.Controls.Add(this.panelCenter);
    10511055            this.Controls.Add(this.panelBottom);
     
    10861090                private Hashtable                       m_htModifySchedule;
    10871091                private Hashtable                       m_htChangeAppts;
    1088                 private BMXNetConnectInfo       m_ConnectInfo = null;
    1089                 public BMXNetConnectInfo.BMXNetEventDelegate    BMXNetEvent;
    10901092
    10911093                #endregion Fields
     
    13081310                        DataTable dt = this.DocManager.GlobalDataSet.Tables["ResourceUser"];
    13091311                        DataView dv = new DataView(dt, "", "RESOURCENAME ASC", DataViewRowState.OriginalRows);
    1310                         string sDuz = this.DocManager.ConnectInfo.DUZ;
     1312            string sDuz = CGDocumentManager.Current.RemoteSession.User.Duz;
    13111313                        bool bModSchedule = false;
    13121314                        DataRowView[] drvA = dv.FindRows(sResource);
     
    15691571        private bool IsThisARadiologyResource(string sResource)
    15701572        {
     1573            //smh - change in v 1.7... if the resource is not linked to a PIMS clinic, this method fails.
     1574            //This happens if there is just one resource that is not linked, which makes it impossible to
     1575            //make any appointments, because this method gets called at any time a menu is opened.
     1576            //So we change res.Field<int> to res.Field<int?>
     1577           
    15711578            // see if resource is mapped to a Radiology Hospital Location.
    15721579            return (   //select all Hospital Locations which are radiology locations
     
    15751582                       //join this to the resources table using the foreign ID (plain jane relational join)
    15761583                       join res in CGDocumentManager.Current.GlobalDataSet.Tables["Resources"].AsEnumerable()
    1577                        on hl.Field<int>("HOSPITAL_LOCATION_ID") equals res.Field<int>("HOSPITAL_LOCATION_ID")
     1584                       //on hl.Field<int>("HOSPITAL_LOCATION_ID") equals res.Field<int>("HOSPITAL_LOCATION_ID") //change in 1.7
     1585                       on hl.Field<int>("HOSPITAL_LOCATION_ID") equals res.Field<int?>("HOSPITAL_LOCATION_ID")
    15781586                       //then filter this down to the resource that we have
    15791587                       where res.Field<string>("RESOURCE_NAME") == sResource
     
    17661774                                        doc.ResourceID = Convert.ToInt32(sResourceID);
    17671775
    1768                                         bool bLock = DocManager.ConnectInfo.bmxNetLib.Lock("^BSDXRES(" + sResourceID + ")", "+");
     1776                    bool bLock = CGDocumentManager.Current.RemoteSession.Lock("^BSDXRES(" + sResourceID + ")", "+");
    17691777                                        if (bLock == false)
    17701778                                        {
     
    19391947                        dt = this.DocManager.GlobalDataSet.Tables["ResourceUser"];
    19401948                        dv = new DataView(dt, "", "RESOURCENAME ASC", DataViewRowState.OriginalRows);
    1941 
    1942             //dv.RowFilter = "USERNAME = '" + filte_name + "'";
    1943             dv.RowFilter = String.Format("USERNAME = '{0}'", this.DocManager.ConnectInfo.UserName.Replace("'", "''"));
     1949            dv.RowFilter = String.Format("USERNAME = '{0}'", CGDocumentManager.Current.RemoteSession.User.Name.Replace("'", "''"));
    19441950
    19451951                        for (int j=0; j < dv.Count; j++)
     
    25292535                        {
    25302536                string msg;
    2531                 if (BMXNetLib.Piece(ex.Message, "~", 1) == "-10") // -10 means that BSDXAPI reported an error.
    2532                     msg = BMXNetLib.Piece(ex.Message, "~", 4);
     2537                if (M.Piece(ex.Message, "~", 1) == "-10") // -10 means that BSDXAPI reported an error.
     2538                    msg = M.Piece(ex.Message, "~", 4);
    25332539                else
    25342540                    msg = ex.Message;
     
    26402646                        {   
    26412647                string msg;
    2642                 if (BMXNetLib.Piece(ex.Message, "~", 1) == "-10") // -10 means that BSDXAPI reported an error.
    2643                     msg = BMXNetLib.Piece(ex.Message, "~", 4);
     2648                if (M.Piece(ex.Message, "~", 1) == "-10") // -10 means that BSDXAPI reported an error.
     2649                    msg = M.Piece(ex.Message, "~", 4);
    26442650                else
    26452651                    msg = ex.Message;
     
    27482754            {
    27492755                string msg;
    2750                 if (BMXNetLib.Piece(ex.Message, "~", 1) == "-10") // -10 means that BSDXAPI reported an error.
    2751                     msg = BMXNetLib.Piece(ex.Message, "~", 4);
     2756                if (M.Piece(ex.Message, "~", 1) == "-10") // -10 means that BSDXAPI reported an error.
     2757                    msg = M.Piece(ex.Message, "~", 4);
    27522758                else
    27532759                    msg = ex.Message;
     
    27712777        /// <param name="e">BMXEvent Args:
    27722778        /// e.BMXEvent is free text for Event Type; e.BMXParam is free text for Event Arguments</param>
    2773         private void BMXNetEventHandler(Object obj, BMXNet.BMXNetEventArgs e)
     2779        private void BMXNetEventHandler(Object obj, RemoteEventArgs e)
    27742780        {
    27752781            try
     
    27792785
    27802786                // if event is Autofire event
    2781                 if (e.BMXEvent == "BMXNet AutoFire")
     2787                if (e.EventType == "BMXNet AutoFire")
    27822788                {
    27832789                    Debug.Write("CGView caught AutoFire event.\n");
     
    27922798
    27932799                // if event is BSDX SCHEDULE
    2794                 else if (e.BMXEvent == "BSDX SCHEDULE")
     2800                else if (e.EventType == "BSDX SCHEDULE")
    27952801                {
    27962802                    //See if any of the resources in the event argument matches BSDX Schedule.
     
    28002806                    {
    28012807                        sResourceName = m_Document.m_sResourcesArray[j].ToString();
    2802                         if (e.BMXParam == sResourceName)
     2808                        if (e.Details == sResourceName)
    28032809                        {
    28042810                            Debug.Write("CGView caught BSDX SCHEDULE event.\n");
     
    28682874            {
    28692875                //Signal RPMS to raise an event
    2870                 m_ConnectInfo.RaiseEvent(sEvent, sParams, false);
     2876                CGDocumentManager.Current.RemoteSession.EventServices.TriggerEvent(sEvent, sParams, false);
    28712877            }
    28722878            catch (Exception ex)
     
    29142920            try
    29152921            {
    2916                 bool bLock = DocManager.ConnectInfo.Lock("^BSDXMGR", "+", "");
     2922                bool bLock = CGDocumentManager.Current.RemoteSession.Lock("^BSDXMGR", "+");
    29172923                if (bLock == false)
    29182924                {
     
    29292935                m_DocManager.GlobalDataSet.Tables["ResourceUser"].Clear();
    29302936                m_DocManager.LoadResourceUserTable(false);
    2931                 bLock = DocManager.ConnectInfo.bmxNetLib.Lock("^BSDXMGR", "-");
     2937                bLock = CGDocumentManager.Current.RemoteSession.Lock("^BSDXMGR", "-");
    29322938            }
    29332939            catch (ApplicationException aex)
     
    31953201        }
    31963202
    3197         /// <summary>
    3198         /// Useless code now... Good place to test something.
    3199         /// </summary>
    3200         /// <param name="sender"></param>
    3201         /// <param name="e"></param>
    3202                 private void mnuTest1_Click(object sender, System.EventArgs e)
    3203                 {
    3204                         ReaderWriterLock m_rwl = this.DocManager.ConnectInfo.bmxNetLib.BMXRWL;
     3203                private void CGView_Closing(object sender, System.ComponentModel.CancelEventArgs e)
     3204                {
    32053205                        try
    32063206                        {
    3207                                 m_rwl.AcquireWriterLock(50);
    3208                                 Debug.Write("\nTest Button 1 Acquired first lock\n");
    3209                                 m_rwl.AcquireWriterLock(50);
    3210                                 Debug.Write("Test Button 1 Acquired second lock\n");
    3211                                 this.DocManager.ViewRefresh();
    3212                                 Thread.Sleep(5000);
    3213                                 try
    3214                                 {
    3215                                 }
    3216                                 catch
    3217                                 {
    3218                                 }
    3219                                 finally
    3220                                 {
    3221                                         m_rwl.ReleaseWriterLock();
    3222                                         Debug.Write ("Test Button 1 released first lock.\n");
    3223                                         m_rwl.ReleaseWriterLock();
    3224                                         Debug.Write ("Test Button 1 released second lock.\n");
    3225                                 }
    3226 
    3227                                 return;
    3228                         }
    3229                         catch (Exception ex)
    3230                         {
    3231                                 Debug.Write("Test Button 1 exception: " + ex.Message + "\n");
    3232                         }
    3233                 }
    3234 
    3235                 private void CGView_Closing(object sender, System.ComponentModel.CancelEventArgs e)
    3236                 {
    3237                         try
    3238                         {
    3239                                 m_ConnectInfo.BMXNetEvent -= m_bmxDelegate;
     3207                                CGDocumentManager.Current.RemoteSession.EventServices.RpmsEvent -= BMXNetEventHandler;
    32403208                                this.calendarGrid1.CloseGrid();
    32413209                        }
     
    39663934        }
    39673935
     3936        private void mnuViewBrokerLog_Click(object sender, EventArgs e)
     3937        {
     3938            var view = new RPCLoggerView();
     3939            view.Show();
     3940        }
     3941
    39683942
    39693943    }//End class
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/ClinicalScheduling.csproj

    r1473 r1474  
    110110  </PropertyGroup>
    111111  <ItemGroup>
     112    <Reference Include="BMXNET40, Version=4.0.0.1, Culture=neutral, processorArchitecture=MSIL">
     113      <SpecificVersion>False</SpecificVersion>
     114      <HintPath>bin\Release\BMXNET40.dll</HintPath>
     115    </Reference>
     116    <Reference Include="BMXWIN40, Version=4.0.0.1, Culture=neutral, processorArchitecture=MSIL">
     117      <SpecificVersion>False</SpecificVersion>
     118      <HintPath>bin\Release\BMXWIN40.dll</HintPath>
     119    </Reference>
     120    <Reference Include="PrintPreview, Version=1.0.4570.15574, Culture=neutral, processorArchitecture=MSIL">
     121      <SpecificVersion>False</SpecificVersion>
     122      <HintPath>bin\Release\PrintPreview.dll</HintPath>
     123    </Reference>
    112124    <Reference Include="System">
    113125      <Name>System</Name>
     
    148160    <Compile Include="Provider.cs" />
    149161    <Compile Include="RadiologyExam.cs" />
     162    <Compile Include="RPCLogger.cs" />
     163    <Compile Include="RPCLoggerView.cs">
     164      <SubType>Form</SubType>
     165    </Compile>
     166    <Compile Include="RPCLoggerView.Designer.cs">
     167      <DependentUpon>RPCLoggerView.cs</DependentUpon>
     168    </Compile>
    150169    <Compile Include="strings.ar.Designer.cs">
    151170      <AutoGen>True</AutoGen>
     
    431450    <EmbeddedResource Include="LoadingSplash.resx">
    432451      <DependentUpon>LoadingSplash.cs</DependentUpon>
     452    </EmbeddedResource>
     453    <EmbeddedResource Include="RPCLoggerView.resx">
     454      <DependentUpon>RPCLoggerView.cs</DependentUpon>
    433455    </EmbeddedResource>
    434456    <EmbeddedResource Include="strings.ar.resx">
     
    478500    <Folder Include="Properties\" />
    479501  </ItemGroup>
    480   <ItemGroup>
    481     <ProjectReference Include="..\..\BMX2\BMXNet\BMXNet.csproj">
    482       <Project>{DE8E4CC9-4F3A-4E32-8DFE-EE5692E8FC45}</Project>
    483       <Name>BMXNet</Name>
    484     </ProjectReference>
    485     <ProjectReference Include="..\EnhancedPrintPreview\PrintPreview\PrintPreview.csproj">
    486       <Project>{9E8D433B-EFD1-4253-BD2C-C4E0DB0BFD0E}</Project>
    487       <Name>PrintPreview</Name>
    488     </ProjectReference>
    489   </ItemGroup>
    490502  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
    491503  <PropertyGroup>
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/ClinicalScheduling.csproj.user

    r1473 r1474  
    3737    </RemoteDebugMachine>
    3838    <StartAction>Project</StartAction>
    39     <StartArguments>/s=10.0.1.13 /p=9261 /a=shabiel12 /v=catdog.22</StartArguments>
     39    <StartArguments>/s=10.0.1.13 /p=9431 /a=shabiel12 /v=catdog.22</StartArguments>
    4040    <StartPage>
    4141    </StartPage>
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/ClinicalScheduling.sln

    r1473 r1474  
    77        EndProjectSection
    88EndProject
    9 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PrintPreview", "..\EnhancedPrintPreview\PrintPreview\PrintPreview.csproj", "{9E8D433B-EFD1-4253-BD2C-C4E0DB0BFD0E}"
     9Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IndianHealthService.BMXNet", "..\BMX4\IndianHealthService.BMXNet\IndianHealthService.BMXNet.csproj", "{DE8E4CC9-4F3A-4E32-8DFE-EE5692E8FC45}"
    1010EndProject
    11 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BMXNet", "..\..\BMX2\BMXNet\BMXNet.csproj", "{DE8E4CC9-4F3A-4E32-8DFE-EE5692E8FC45}"
     11Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IndianHealthService.BMXNet.WinForm", "..\BMX4\IndianHealthService.BMXNet.WinForm\IndianHealthService.BMXNet.WinForm.csproj", "{3B9011B5-59F4-4F6B-ADC7-54ADC6948F4D}"
    1212EndProject
    1313Global
     
    2929                {DE8E4CC9-4F3A-4E32-8DFE-EE5692E8FC45}.Release|Any CPU.ActiveCfg = Release|Any CPU
    3030                {DE8E4CC9-4F3A-4E32-8DFE-EE5692E8FC45}.Release|Any CPU.Build.0 = Release|Any CPU
     31                {3B9011B5-59F4-4F6B-ADC7-54ADC6948F4D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
     32                {3B9011B5-59F4-4F6B-ADC7-54ADC6948F4D}.Debug|Any CPU.Build.0 = Debug|Any CPU
     33                {3B9011B5-59F4-4F6B-ADC7-54ADC6948F4D}.Release|Any CPU.ActiveCfg = Release|Any CPU
     34                {3B9011B5-59F4-4F6B-ADC7-54ADC6948F4D}.Release|Any CPU.Build.0 = Release|Any CPU
    3135        EndGlobalSection
    3236        GlobalSection(SolutionProperties) = preSolution
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/DAL.cs

    r1186 r1474  
    1616    public class DAL
    1717    {
    18         private BMXNetConnectInfo _thisConnection; // set in constructor
     18        private RemoteSession _thisConnection; // set in constructor
    1919       
    2020        delegate DataTable RPMSDataTableDelegate(string CommandString, string TableName); // for use in calling (Sync and Async)
     
    2525        /// </summary>
    2626        /// <param name="conn">The current connection to use</param>
    27         public DAL(BMXNetConnectInfo conn)
     27        public DAL(RemoteSession conn)
    2828        {
    2929            this._thisConnection = conn;
     
    3939        {
    4040            string cmd = String.Format("BMX VERSION INFO^{0}", nmsp);
    41             return RPMSDataTable(cmd, "");
     41            return _thisConnection.TableFromCommand(cmd);
    4242        }
    4343
     
    5050        {
    5151            string cmd = String.Format("BSDX SCHEDULING USER INFO^{0}", DUZ);
    52             return RPMSDataTable(cmd, "");
     52            return _thisConnection.TableFromCommand(cmd);
    5353        }
    5454
     
    6565        /// BLUE (NJ3,0), [0;7]
    6666        ///</returns>
    67         public DataTable GetAccessTypes()
     67        public DataTable GetAccessTypes(DataSet dataSetToTakeTable, string tablename)
    6868        {
    6969            string sCommandText = "SELECT * FROM BSDX_ACCESS_TYPE";
    70             DataTable table = RPMSDataTable(sCommandText, "");
     70            DataTable table = _thisConnection.TableFromSQL(sCommandText, dataSetToTakeTable, tablename);
    7171            DataColumn dcKey = table.Columns["BMXIEN"];
    7272            DataColumn[] dcKeys = new DataColumn[1];
     
    9393            string sEnd = FMDateTime.Create(EndDate).DateOnly.FMDateString;
    9494            string cmd = String.Format("BSDX CLINIC LETTERS^{0}^{1}^{2}", sClinicList, sBegin, sEnd);
    95             return RPMSDataTable(cmd, "");
     95            return _thisConnection.TableFromCommand(cmd);
    9696        }
    9797
     
    107107        {
    108108            string cmd = String.Format("BSDX RESOURCE LETTERS^{0}", sClinicList);
    109             return RPMSDataTable(cmd, "");
     109            return _thisConnection.TableFromCommand(cmd);
    110110        }
    111111
     
    126126            string sEnd = FMDateTime.Create(EndDate).DateOnly.FMDateString;
    127127            string cmd = String.Format("BSDX REBOOK CLINIC LIST^{0}^{1}^{2}", sClinicList, sBegin, sEnd);
    128             return RPMSDataTable(cmd, "");
     128            return _thisConnection.TableFromCommand(cmd);
    129129        }
    130130
     
    139139        {
    140140            string cmd = String.Format("BSDX REBOOK LIST^{0}", sApptList);
    141             return RPMSDataTable(cmd, "");
     141            return _thisConnection.TableFromCommand(cmd);
    142142        }
    143143
     
    157157            string sEnd = FMDateTime.Create(EndDate).DateOnly.FMDateString;
    158158            string cmd = String.Format("BSDX CANCEL CLINIC LIST^{0}^{1}^{2}", sClinicList, sBegin, sEnd);
    159             return RPMSDataTable(cmd, "");
     159            return _thisConnection.TableFromCommand(cmd);
    160160        }
    161161
     
    173173            string sEnd = FMDateTime.Create(EndDate).DateOnly.FMDateString;
    174174            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);
    176176        }
    177177
     
    185185        {
    186186            string cmd = string.Format("BSDX REMOVE CHECK-IN^{0}", ApptID);
    187             return RPMSDataTable(cmd, "");
     187            return _thisConnection.TableFromCommand(cmd);
    188188        }
    189189
     
    197197        {
    198198            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);
    200200            return (from row in tbl.AsEnumerable()
    201201                    select new RadiologyExam
     
    218218        {
    219219            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));
    221221            return result == "1" ? true : false;
    222222        }
     
    230230        public bool CancelRadiologyExam(int DFN, int examIEN)
    231231        {
    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));
    233233            return result == "1" ? true : false;
    234234        }
     
    241241        public bool CanCancelRadExam(int examIEN)
    242242        {
    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());
    244244            return result == "1" ? true : false;
    245245        }
     
    256256            get
    257257            {
    258                 string val = _thisConnection.bmxNetLib.TransmitRPC("BSDX GET PARAM", "BSDX AUTO PRINT RS");  //1 = true; 0 = false; "" = not set
     258                string val = _thisConnection.TransmitRPC("BSDX GET PARAM", "BSDX AUTO PRINT RS");  //1 = true; 0 = false; "" = not set
    259259                return val == "1" ? true : false;
    260260            }
    261261            set
    262262            {
    263                 TransmitRPCAsync _asyncTransmitter = new TransmitRPCAsync(_thisConnection.bmxNetLib.TransmitRPC);
     263                TransmitRPCAsync _asyncTransmitter = new TransmitRPCAsync(_thisConnection.TransmitRPC);
    264264                // 0 = success; anything else is wrong. Not being tested here as its success is not critical to application use.
    265265                _asyncTransmitter.BeginInvoke("BSDX SET PARAM", String.Format("{0}^{1}", "BSDX AUTO PRINT RS", value ? "1" : "0"), null, null);
     
    278278            get
    279279            {
    280                 string val = _thisConnection.bmxNetLib.TransmitRPC("BSDX GET PARAM", "BSDX AUTO PRINT AS");  //1 = true; 0 = false; "" = not set
     280                string val = _thisConnection.TransmitRPC("BSDX GET PARAM", "BSDX AUTO PRINT AS");  //1 = true; 0 = false; "" = not set
    281281                return val == "1" ? true : false;
    282282            }
    283283            set
    284284            {
    285                 TransmitRPCAsync _asyncTransmitter = new TransmitRPCAsync(_thisConnection.bmxNetLib.TransmitRPC);
     285                TransmitRPCAsync _asyncTransmitter = new TransmitRPCAsync(_thisConnection.TransmitRPC);
    286286                // 0 = success; anything else is wrong. Not being tested here as its success is not critical to application use.
    287287                _asyncTransmitter.BeginInvoke("BSDX SET PARAM", String.Format("{0}^{1}", "BSDX AUTO PRINT AS", value ? "1" : "0"), null, null);
     
    303303            DataTable dtOut;
    304304
    305 #if TRACE
    306             DateTime sendTime = DateTime.Now;
    307 #endif
    308305            try
    309306            {
    310                 RPMSDataTableDelegate rdtd = new RPMSDataTableDelegate(_thisConnection.RPMSDataTable);
     307                RPMSDataTableDelegate rdtd = new RPMSDataTableDelegate(_thisConnection.TableFromSQL);
    311308                dtOut = (DataTable)rdtd.Invoke(sSQL, sTableName);
    312309            }
     
    317314                throw ex;
    318315            }
    319 
    320 #if TRACE
    321             DateTime receiveTime = DateTime.Now;
    322             TimeSpan executionTime = receiveTime - sendTime;
    323             Debug.Write("RPMSDataTable Execution Time: " + executionTime.Milliseconds + " ms.\n");
    324 #endif
    325316
    326317            return dtOut;
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/DManagement.cs

    r1075 r1474  
    140140                        this.m_dsGlobal = m_DocManager.GlobalDataSet;
    141141
    142                         MgrEventDelegate = new BMXNetConnectInfo.BMXNetEventDelegate(MgrEventHandler);
    143                         m_DocManager.ConnectInfo.BMXNetEvent += MgrEventDelegate;
    144                         m_DocManager.ConnectInfo.SubscribeEvent("BSDX WORKSTATION REPORT");
     142            m_DocManager.RemoteSession.EventServices.RpmsEvent += MgrEventHandler;
     143                        m_DocManager.RemoteSession.EventServices.Subscribe("BSDX WORKSTATION REPORT");
    145144                        m_dtWSGrid = new DataTable("WSGrid");
    146145                        m_dtWSGrid.Columns.Add("UserName", typeof(System.String));
     
    18991898            m_dsGlobal.Tables["AccessTypes"].Clear();
    19001899            m_dsGlobal.Tables["AccessGroupType"].Clear();
    1901             DataTable dt1 = m_DocManager.DAL.GetAccessTypes();
    1902             m_dsGlobal.Tables["AccessTypes"].Merge(dt1);
    1903             m_dsGlobal.Tables.Add(dt1);
     1900            //PORT TODO: This may fail.
     1901            DataTable dt1 = m_DocManager.DAL.GetAccessTypes(m_dsGlobal, "AccessTypes");
     1902            //m_dsGlobal.Tables["AccessTypes"].Merge(dt1); //smh -commented out for BMX4
     1903            //m_dsGlobal.Tables.Add(dt1);                  //smh -commented out for BMX4
    19041904            //Fix Groups
    19051905            //m_DocManager.LoadAccessTypesTable();
     
    23292329                {
    23302330                        this.m_dtWSGrid.Clear();
    2331                         this.m_DocManager.ConnectInfo.RaiseEvent("BSDX CALL WORKSTATIONS", "A", true);
    2332                 }
    2333 
    2334                 private BMXNetConnectInfo.BMXNetEventDelegate   MgrEventDelegate;
     2331                        this.m_DocManager.RemoteSession.EventServices.TriggerEvent("BSDX CALL WORKSTATIONS", "A", true);
     2332                }
     2333
    23352334                delegate void UpdateWorkstationGridDelegate(string sParam);
    23362335
    2337                 private void MgrEventHandler(Object obj, BMXNet.BMXNetEventArgs e)
     2336                private void MgrEventHandler(Object obj, RemoteEventArgs e)
    23382337                {
    23392338                        try
    23402339                        {
    2341                                 if (e.BMXEvent == "BSDX WORKSTATION REPORT")
     2340                                if (e.EventType == "BSDX WORKSTATION REPORT")
    23422341                                {
    23432342                                        Debug.Write("DManagement Got Workstation Report\n");
     
    23452344                    if (this.InvokeRequired == true) //ensures that handle is created
    23462345                    {
    2347                         this.Invoke(uWSGd, new object[] { e.BMXParam });
     2346                        this.Invoke(uWSGd, new object[] { e.Details });
    23482347                    }
    23492348                    else
    23502349                    {
    2351                         UpdateWorkstationGrid(e.BMXParam);
     2350                        UpdateWorkstationGrid(e.Details);
    23522351                    }
    23532352                                }
     
    23632362                        string sDelim = "~";
    23642363                        DataRow dr = this.m_dtWSGrid.NewRow();
    2365                         dr["UserName"] = BMXNetLib.Piece(sParam,sDelim,1);
    2366                         dr["Handle"] = BMXNetLib.Piece(sParam,sDelim,2);
    2367                         dr["Version"] = BMXNetLib.Piece(sParam,sDelim,3);               
    2368                         dr["Views"] = BMXNetLib.Piece(sParam,sDelim,4);
     2364                        dr["UserName"] = M.Piece(sParam,sDelim,1);
     2365                        dr["Handle"] = M.Piece(sParam,sDelim,2);
     2366                        dr["Version"] = M.Piece(sParam,sDelim,3);               
     2367                        dr["Views"] = M.Piece(sParam,sDelim,4);
    23692368                        m_dtWSGrid.Rows.Add(dr);
    23702369                }
     
    23722371                private void DManagement_Closing(object sender, System.ComponentModel.CancelEventArgs e)
    23732372                {
    2374                         m_DocManager.ConnectInfo.UnSubscribeEvent("BSDX WORKSTATION REPORT");
     2373                        CGDocumentManager.Current.RemoteSession.EventServices.Unsubscribe("BSDX WORKSTATION REPORT");
    23752374                }
    23762375
     
    23892388                                return;
    23902389
    2391                         this.m_DocManager.ConnectInfo.RaiseEvent("BSDX ADMIN MESSAGE", sMessage, false);
     2390            this.m_DocManager.RemoteSession.EventServices.TriggerEvent("BSDX ADMIN MESSAGE", sMessage, false);
    23922391                }
    23932392
     
    23982397                                return;
    23992398                        }
    2400                         this.m_DocManager.ConnectInfo.RaiseEvent("BSDX ADMIN SHUTDOWN", txtSendMessage.Text, false);
     2399            this.m_DocManager.RemoteSession.EventServices.TriggerEvent("BSDX ADMIN SHUTDOWN", txtSendMessage.Text, false);
    24012400        }
    24022401        #endregion Workstations
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/Printing.cs

    r1469 r1474  
    217217            // Draw Header
    218218
    219             string division = CGDocumentManager.Current.ConnectInfo.DivisionName;
     219            string division = CGDocumentManager.Current.RemoteSession.User.Division.Name;
    220220            int divisionStringHeight = (int)g.MeasureString(division.ToString(), fontBody, e.PageBounds.Width - (int)(10 * widthRatio) - HardMarginX).Height;
    221221           
     
    691691
    692692            // Draw Header
    693             string division = CGDocumentManager.Current.ConnectInfo.DivisionName;
     693            string division = CGDocumentManager.Current.RemoteSession.User.Division.Name;
    694694            int divisionStringHeight = (int)g.MeasureString(division.ToString(), fontBody, e.MarginBounds.Width).Height;
    695695            Rectangle headerArea = new Rectangle()
Note: See TracChangeset for help on using the changeset viewer.