private void OApplication_AppEvent(SAPbouiCOM.BoAppEventTypes EventType)
        {
            switch (EventType)
            {
            case SAPbouiCOM.BoAppEventTypes.aet_CompanyChanged:
                oApplication.MessageBox("A Empresa foi trocada");
                System.Windows.Forms.Application.Exit();
                break;

            case SAPbouiCOM.BoAppEventTypes.aet_ShutDown:
                oApplication.MessageBox("O evento Shut Down foi chamado!!"
                                        + Environment.NewLine
                                        + "Fechando o Addon...", 1, "OK", "", "");
                System.Windows.Forms.Application.Exit();
                break;

            case SAPbouiCOM.BoAppEventTypes.aet_LanguageChanged:
                oApplication.MessageBox("O Idioma Foi modificado");
                break;

            case SAPbouiCOM.BoAppEventTypes.aet_FontChanged:
                oApplication.MessageBox("A fonte foi alterada");
                break;

            case SAPbouiCOM.BoAppEventTypes.aet_ServerTerminition:
                oApplication.MessageBox("O Servidor Caiu");
                System.Windows.Forms.Application.Exit();
                break;
            }
        }
Exemple #2
0
        public void AppEvent(SAPbouiCOM.BoAppEventTypes EventType)
        {
            switch (EventType)
            {
            case BoAppEventTypes.aet_CompanyChanged:
                Log.Logger.getInstance().log("Compania alterada, terminado execucao do addon.", Log.Logger.LogType.INFO, null, false);
                ExitAddon();

                break;

            case BoAppEventTypes.aet_FontChanged:
                break;

            case BoAppEventTypes.aet_LanguageChanged:
                //oApp.SetStatusBarMessage("Linguagem do sistema modificada.", SAPbouiCOM.BoMessageTime.bmt_Short, false);
                Log.Logger.getInstance().log("Linguagem do sistema modificada.", Log.Logger.LogType.INFO, null, false);
                break;

            case BoAppEventTypes.aet_ServerTerminition:
                Log.Logger.getInstance().log("Servidor encerrado, terminado execucao do addon.", Log.Logger.LogType.INFO, null, false);
                ExitAddon();
                break;

            case BoAppEventTypes.aet_ShutDown:
                Log.Logger.getInstance().log("Sistema finalizado, terminando execucao do addon.", Log.Logger.LogType.INFO, null, false);
                ExitAddon();
                break;
            }
        }
Exemple #3
0
        void IAppEventHandler.sapApp_AppEvent(SAPbouiCOM.BoAppEventTypes EventType)
        {
            try
            {
                switch (EventType)
                {
                case SAPbouiCOM.BoAppEventTypes.aet_ServerTerminition:
                    try
                    {
                        ShutDown();
                    }
                    catch (Exception er)
                    {
                        Logger.Error(Messages.ServerTerminationError, er);
                    }
                    break;

                case SAPbouiCOM.BoAppEventTypes.aet_LanguageChanged:
                    try
                    {
                        ConfigureI18N();
                    }
                    catch (Exception er)
                    {
                        Logger.Error(Messages.EventLanguageChangedError, er);
                    }
                    break;

                case SAPbouiCOM.BoAppEventTypes.aet_CompanyChanged:
                    try
                    {
                        ShutDown();
                    }
                    catch (Exception er)
                    {
                        Logger.Error(Messages.EventCompanyChangedError, er);
                    }
                    break;

                case SAPbouiCOM.BoAppEventTypes.aet_ShutDown:
                    try
                    {
                        ShutDown();
                    }
                    catch (Exception er)
                    {
                        Logger.Error(Messages.ShutdownError, er);
                    }
                    break;
                }
            }
            catch (Exception e)
            {
                Logger.Error(e.Message, e);
                Environment.Exit(20);
            }
        }
Exemple #4
0
 /// <summary>
 /// Maneja los eventos para terminar la aplicación y cuando cambia de compañia
 /// </summary>
 /// <param name="eventType"></param>
 private void SBO_Application_AppEvent(SAPbouiCOM.BoAppEventTypes eventType)
 {
     //Finaliza la Aplicación
     if (eventType == SAPbouiCOM.BoAppEventTypes.aet_ShutDown)
     {
         salirAddon();
     }
     //Cambiar Empresa
     if (eventType == SAPbouiCOM.BoAppEventTypes.aet_CompanyChanged)
     {
         salirAddon();
     }
 }
        private static void oApplication_AppEvent(SAPbouiCOM.BoAppEventTypes EventType)
        {
            // ********************************************************************************
            //  the following are the events sent by the application
            //  (Ignore aet_ServerTermination)
            //  in order to implement your own code upon each of the events
            //  place you code instead of the matching message box statement
            // ********************************************************************************


            switch (EventType)
            {
            case SAPbouiCOM.BoAppEventTypes.aet_ShutDown:

                //AddOnUtilities.MsgBoxWrapper("A Shut Down Event has been caught");

                // **************************************************************
                //
                //  Take care of terminating your AddOn application
                //
                // **************************************************************

                System.Windows.Forms.Application.Exit();


                break;

            case SAPbouiCOM.BoAppEventTypes.aet_CompanyChanged:

                //AddOnUtilities.MsgBoxWrapper("A Company Change Event has been caught");

                // **************************************************************
                //  Check the new company name, if your add on was not meant for
                //  the new company terminate your AddOn
                //     If oApplication.Company.Name Is Not "Company1" then
                //          Close
                //     End If
                // **************************************************************

                break;

            case SAPbouiCOM.BoAppEventTypes.aet_LanguageChanged:

                //AddOnUtilities.MsgBoxWrapper("A Languge Change Event has been caught");

                break;
            }
        }
Exemple #6
0
        /// <summary>
        /// Handle App Event
        /// </summary>
        public void HandleAppEvent(SAPbouiCOM.BoAppEventTypes EventType)
        {
            switch (EventType)
            {
            case SAPbouiCOM.BoAppEventTypes.aet_ShutDown:
                if (oSBOCompany.Connected)
                {
                    oSBOCompany.Disconnect();
                }
                System.Windows.Forms.Application.Exit();
                break;

            case SAPbouiCOM.BoAppEventTypes.aet_CompanyChanged:
                if (oSBOCompany.Connected)
                {
                    oSBOCompany.Disconnect();
                }
                System.Windows.Forms.Application.Exit();
                break;

            case SAPbouiCOM.BoAppEventTypes.aet_LanguageChanged:
                if (oSBOCompany.Connected)
                {
                    oSBOCompany.Disconnect();
                }
                System.Windows.Forms.Application.Exit();
                break;

            case SAPbouiCOM.BoAppEventTypes.aet_ServerTerminition:
                if (oSBOCompany.Connected)
                {
                    oSBOCompany.Disconnect();
                }
                System.Windows.Forms.Application.Exit();
                break;
            }
        }
Exemple #7
0
        static void SBO_Application_AppEvent(SAPbouiCOM.BoAppEventTypes EventType)
        {
            switch (EventType)
            {
            case SAPbouiCOM.BoAppEventTypes.aet_ShutDown:
                System.Windows.Forms.Application.Exit();
                break;

            case SAPbouiCOM.BoAppEventTypes.aet_CompanyChanged:
                break;

            case SAPbouiCOM.BoAppEventTypes.aet_FontChanged:
                break;

            case SAPbouiCOM.BoAppEventTypes.aet_LanguageChanged:
                break;

            case SAPbouiCOM.BoAppEventTypes.aet_ServerTerminition:
                break;

            default:
                break;
            }
        }
        private void SBOApplication_AppEvent(SAPbouiCOM.BoAppEventTypes EventType)
        {
            SBOEventHandler oSBOEventHandler = new SBOEventHandler(oSBOApplication, oSBOCompany);

            oSBOEventHandler.HandleAppEvent(EventType);
        }