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); } }
void m_Concrete_OnStartConnection(object sender, ApplicationEventArgs e) { if (OnStartConnection != null) { OnStartConnection(sender, e); } }
void m_Concrete_OnStartCreateMenu(object sender, ApplicationEventArgs e) { if (OnStartCreateMenu != null) { OnStartCreateMenu(sender, e); } }
void m_Concrete_OnShutDown(object sender, ApplicationEventArgs e) { if (OnShutDown != null) { OnShutDown(sender, e); } }
void m_Concrete_OnChangeCompany(object sender, ApplicationEventArgs e) { if (OnChangeCompany != null) { OnChangeCompany(sender, e); } }
void m_MainForm_OnReseiveMenuEvent(MenuEvent pEvent) { if (MenuEvent != null) { MenuEventArgs myMenuEventArgs = new MenuEventArgs(pEvent); ApplicationEventArgs myApplicationEventArgs = new ApplicationEventArgs(); myApplicationEventArgs.MenuEvent = myMenuEventArgs; MenuEvent(this, myApplicationEventArgs); } }
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; }
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); } } }
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); } } }
private static void App_OnShutDown(object sender, Nampula.UI.ApplicationEventArgs e) { Application.Exit(); }