コード例 #1
0
        private static void App_OnStartConnection(object sender, Nampula.UI.ApplicationEventArgs e)
        {
            try
            {
                var param = App.GetInstance().GetParam();
                Nampula.DI.Connection.Instance.ConnectionParameter = param;
                var conn = Connection.Instance.SqlDialect.GetDbConnection();
                if (ConfigHelper.ReplaceSingleQuote)
                {
                    conn.ConnectionString = param.ToString().Replace('\'', ' ');
                }
                else
                {
                    conn.ConnectionString = param.ToString();
                }

                SboConnection.Init(Nampula.UI.ApplicationSAP.GetInstance().CompanySbo, conn);
                var sboConn = new SboConnection();
                sboConn.CreateUserTables();
                new AppSession(sboConn);
            }
            catch (COMException ex)
            {
                MessageBox.Show("Provel problema de DI API ou SAP bloqueou criação das tabelas do Add-on. Tente reiniciar o client");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
コード例 #2
0
 void m_Concrete_OnStartConnection(object sender, ApplicationEventArgs e)
 {
     if (OnStartConnection != null)
     {
         OnStartConnection(sender, e);
     }
 }
コード例 #3
0
 void m_Concrete_OnStartCreateMenu(object sender, ApplicationEventArgs e)
 {
     if (OnStartCreateMenu != null)
     {
         OnStartCreateMenu(sender, e);
     }
 }
コード例 #4
0
 void m_Concrete_OnShutDown(object sender, ApplicationEventArgs e)
 {
     if (OnShutDown != null)
     {
         OnShutDown(sender, e);
     }
 }
コード例 #5
0
 void m_Concrete_OnChangeCompany(object sender, ApplicationEventArgs e)
 {
     if (OnChangeCompany != null)
     {
         OnChangeCompany(sender, e);
     }
 }
コード例 #6
0
        void m_MainForm_OnReseiveMenuEvent(MenuEvent pEvent)
        {
            if (MenuEvent != null)
            {
                MenuEventArgs        myMenuEventArgs        = new MenuEventArgs(pEvent);
                ApplicationEventArgs myApplicationEventArgs = new ApplicationEventArgs();
                myApplicationEventArgs.MenuEvent = myMenuEventArgs;

                MenuEvent(this, myApplicationEventArgs);
            }
        }
コード例 #7
0
        private static void App_OnStartCreateMenu(object sender, Nampula.UI.ApplicationEventArgs e)
        {
            var module    = Nampula.UI.Application.GetInstance().GetMenu(MenuID.cBoUIModulesMenu);
            var menuAddon = new Nampula.UI.MenuItem(module, BoMenuType.mt_POPUP, "Impressão de etiquetas", UI.Properties.Resources.label);

            var menuLabelPrinting = new MenuItem(menuAddon, BoMenuType.mt_STRING, "Impressão");

            menuLabelPrinting.OnAfterClick += MenuLabelPrinting_OnAfterClick;

            var menuConfig        = new MenuItem(menuAddon, BoMenuType.mt_POPUP, "Configurações");
            var menuGeneralConfig = new MenuItem(menuConfig, BoMenuType.mt_STRING, "Configurações Gerais");

            menuGeneralConfig.OnAfterClick += MenuGeneralConfig_OnAfterClick;
        }
コード例 #8
0
        void ConcreteMenuEvent(object sender, ApplicationEventArgs e)
        {
            var menu = m_Concrete.Menus.FirstOrDefault(p => p.UID == e.MenuEvent.MenuUID);

            if (menu != null)
            {
                menu.DoOnClick(e.MenuEvent);
            }
            else
            {
                if (OnMenuClick != null)
                {
                    OnMenuClick(this, e);
                }
            }
        }
コード例 #9
0
 void ConcreteAppEvent(object sender, ApplicationEventArgs e)
 {
     if (e.BoAppEventTypes == BoAppEventTypes.aet_ShutDown)
     {
         if (OnShutDown != null)
         {
             OnShutDown(sender, e);
         }
     }
     else if (e.BoAppEventTypes == BoAppEventTypes.aet_CompanyChanged)
     {
         if (OnChangeCompany != null)
         {
             OnChangeCompany(sender, e);
         }
     }
 }
コード例 #10
0
 private static void App_OnShutDown(object sender, Nampula.UI.ApplicationEventArgs e)
 {
     Application.Exit();
 }