static void Main(string[] args) { try { HighlightingManager.Manager.AddSyntaxModeFileProvider( new SyntaxEditor()); if (ConfigHelper.IsStandalone) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new PringManagerForm()); } else { app = Nampula.UI.Application.GetInstance(); app.OnStartCreateMenu += App_OnStartCreateMenu; app.OnStartConnection += App_OnStartConnection; app.OnShutDown += App_OnShutDown; if (app.StartApplication("LP", Nampula.UI.eAppType.SAPForms)) { var mainForm = app.MainForm(); Application.Run(mainForm); } } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
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); } }
static void Main() { try { Nampula.UI.Application myApplication = Nampula.UI.Application.GetInstance(); myApplication.AddonIdentiers.AddRange(new List <string> { "5645523035496D706C656D656E746174696F6E3A4231373132393034363130CA3C0824B7491067F52C0540BA97BC0972C718D5", "5645523035496D706C656D656E746174696F6E3A4231373132393034363130CA3C0824B7491067F52C0540BA97BC0972C718D5", "5645523035496D706C656D656E746174696F6E3A4231373132393034363130CA3C0824B7491067F52C0540BA97BC0972C718D5", "5645523035496D706C656D656E746174696F6E3A543230343431393939343369C97BAE2962F5CB368BF09B76E5AAB060239818", "5645523035496D706C656D656E746174696F6E3A4231373132393034363130CA3C0824B7491067F52C0540BA97BC0972C718D5", "5645523035496D706C656D656E746174696F6E3A5531313638303630393739A58DC7616FFDA9767315987630F5679A4CA310C8", }); myApplication.OnStartCreateMenu += myApplication_OnStartCreateMenu; myApplication.OnStartConnection += myApplication_OnStartConnection; myApplication.OnShutDown += myApplication_OnShutDown; myApplication.CheckHostedEnvironment = false; if (myApplication.StartApplication("DO", eAppType.SAPForms)) { Nampula.Framework.LogHelper.EnableLog(); Log.Debug("Application Start Sucessfull"); System.Windows.Forms.Application.Run(myApplication.MainForm()); } } catch (Exception ex) { MessageExceptionForm.Show(ex); } }