static void Main() { Trace.Listeners.RemoveAt(0); DefaultTraceListener defaultListener; defaultListener = new DefaultTraceListener(); defaultListener.LogFileName = "Application.log"; Trace.Listeners.Add(defaultListener); if (!EventLog.SourceExists("Medlem3060uc")) { EventLog.CreateEventSource("Medlem3060uc", "Application"); } //Trace.Listeners.Add(new EventLogTraceListener("Medlem3060uc")); Program.Log("Starter Medlem3060uc"); System.Diagnostics.Process[] p = System.Diagnostics.Process.GetProcessesByName("Medlem3060uc"); if (p.Length > 1) { clsUtil.SetForegroundWindow(p[0].MainWindowHandle); } else { Uniconta.ClientTools.Localization.SetLocalizationStrings(System.Threading.Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName); Uniconta.WindowsAPI.Startup.OnLoad(); UCInitializer.InitUniconta(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new FrmMain()); } }
static void Main(string[] args) { Uniconta.ClientTools.Localization.SetLocalizationStrings(System.Threading.Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName); Uniconta.WindowsAPI.Startup.OnLoad(); UCInitializer.InitUniconta(); try { var objAppQueue = new clsAppQueue(); } catch { } }
//************************************************************************************************************* //************************************************************************************************************* public clsAppQueue() { try { UCInitializer.UnicontaLogin(); } catch { } queueClient = new QueueClient(ServiceBusConnectionString, QueueName); //Schedule(); var cts = new CancellationTokenSource(); this.ReceiveMessagesAsync(ServiceBusConnectionString, QueueName, cts.Token).Wait(); }
private void FrmMain_Load(object sender, EventArgs e) { try { UCInitializer.UnicontaLogin(); var CurrentCompany = UCInitializer.CurrentCompany; this.toolStripStatusLabel1.Text = "Firma: " + CurrentCompany.CompanyId + " " + CurrentCompany.Name; this.toolStripStatusLabel1.Alignment = ToolStripItemAlignment.Right; this.toolStripStatusLabel2.Text = Program.ConnectStringWithoutPassword; this.toolStripStatusLabel2.Alignment = ToolStripItemAlignment.Right; this.toolStripStatusLabel2.AutoSize = true; } catch (Exception) { this.toolStripStatusLabel1.Text = "LogIn to UniConta Failed"; this.toolStripStatusLabel1.Alignment = ToolStripItemAlignment.Right; this.toolStripStatusLabel2.Text = Program.ConnectStringWithoutPassword; this.toolStripStatusLabel2.Alignment = ToolStripItemAlignment.Right; this.toolStripStatusLabel2.AutoSize = true; } try { var antalBogføringer = Program.dbData3060.tblbets.Where(b => b.bogforingsdato > DateTime.Now.AddDays(-30)).Count(); } catch { DialogResult result = DotNetPerls.BetterDialog.ShowDialog( "Medlem3060uc", //titleString "Ingen forbindelse til Database Server", //bigString null, //smallString null, //leftButton "OK", //rightButton global::Medlem3060uc.Properties.Resources.Message_info); //iconSet } #if (DEBUG) testToolStripMenuItem.Visible = true; #endif }