foreach (string arg in Environment.GetCommandLineArgs()) { if (arg == "–Auto_BlueGrass") { for (int i = 0; i < 2; i++) { if (i==0) { mstrSwitch = "BluegrassCH"; AllocConsole(); Console.WriteLine("BlueGrass Chargeable Claims Job started in Auto mode - " + DateTime.Now + " "); mblnAutomode = true; goto AutoModePoint; } else if(i==1) { mstrSwitch = "BluegrassRP"; AllocConsole(); Console.WriteLine("BlueGrass Reporting Claims Job started in Auto mode - " + DateTime.Now + " "); mblnAutomode = true; goto AutoModePoint; } } } AutoModePoint: if (!IsUserAuthorized()) { if (mblnAutomode) { Console.WriteLine("You do not have permissions to run this application. This application will now close." + " " + DateTime.Now); Application.Current.Shutdown(); } else { MessageBox.Show("You do not have permissions to run this application. This application will now close.", "No Access", MessageBoxButton.OK, MessageBoxImage.Stop); Application.Current.Shutdown(); } } else { this.DataContext = this; DefinePacificareStateCodes(); ReadApplicationSettings(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)