/// <summary> /// Inicializa el modulo con el Login y el Splash /// </summary> /// <history> /// [erosado] 01/06/2016 Modified. Se agrego async /// [vipacheco] 09/Agosto/2016 Modified -> Se agrego el manejador de eventos. /// </history> protected async override void OnStartup(StartupEventArgs e) { base.OnStartup(e); EventManager.RegisterClassHandler(typeof(DataGrid), UIElement.MouseLeftButtonUpEvent, new MouseButtonEventHandler(dataGrid_MouseLeftButtonUp)); //Creamos el Splash Base! frmSplash frmSplash = new frmSplash(); //Creamos el tipo de login que se necesita! var frmLogin = new frmLogin(frmSplash, EnumLoginType.SalesRoom, changePassword: true, autoSign: true, validatePermission: true, permission: EnumPermission.Host, permissionLevel: EnumPermisionLevel.ReadOnly); await frmLogin.getAllPlaces(); //Mostramos el Splash frmSplash.Show(); //Mandamos llamar el Login frmSplash.ShowLogin(ref frmLogin); if (frmLogin.IsAuthenticated) { Context.User = frmLogin.UserData; frmHost frmMain = new frmHost(); frmMain.Title = $"{Context.Module} - [{Context.Environment}]"; frmMain.ShowDialog(); frmSplash.Close(); } }
/// <summary> /// Inicializa el modulo con el Login y el Splash /// </summary> protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); frmSplash frmSplash = new frmSplash(); frmLogin frmLogin = new frmLogin(frmSplash, EnumLoginType.Normal, validateRole: true, role: EnumRole.Manager, changePassword: true); frmSplash.Show(); frmSplash.ShowLogin(ref frmLogin); if (frmLogin.IsAuthenticated) { Context.User = frmLogin.UserData; if (Context.User.HasRole(EnumRole.Manager)) { frmProcessorOuthouse frmMain = new frmProcessorOuthouse(); frmMain.Title = $"{Context.Module} - [{Context.Environment}]"; frmMain.Show(); frmLogin.Close(); frmSplash.Close(); } else { UIHelper.ShowMessage("User doesn't have access"); } } }
/// <summary> /// Inicializa el modulo con el Login y el Splash /// </summary> protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); frmSplash frmSplash = new frmSplash(); frmLogin frmLogin = new frmLogin(frmSplash, EnumLoginType.Normal, validateRole: true, role: EnumRole.Manager, changePassword: true); frmSplash.Show(); frmSplash.ShowLogin(ref frmLogin); if (frmLogin.IsAuthenticated) { Context.User = frmLogin.UserData; if (Context.User.HasRole(EnumRole.Manager)) { EventManager.RegisterClassHandler(typeof(AccessText), AccessKeyManager.AccessKeyPressedEvent, new RoutedEventHandler(keyManager_keyPressed)); EventManager.RegisterClassHandler(typeof(DataGrid), UIElement.MouseLeftButtonUpEvent, new MouseButtonEventHandler(dataGrid_MouseLeftButtonUp)); EventManager.RegisterClassHandler(typeof(ComboBox), UIElement.KeyDownEvent, new KeyEventHandler(cmb_KeyDown)); frmAdmin frmMain = new frmAdmin(); frmMain.Title = $"{Context.Module} - [{Context.Environment}]"; frmMain.ShowDialog(); frmSplash.Close(); } else { // No tiene permiso para ingresar al modulo UIHelper.ShowMessage("User doesn't have access"); } } }
/// <summary> /// Method for button to quit the game. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnQuitGame_Click(object sender, System.EventArgs e) { // Exit the playfield frmSplash form = new frmSplash(); form.Show(); Dispose(); }
public frmMain() { InitializeComponent(); frmSplash f = new frmSplash(); f.Show(); System.Threading.Thread.Sleep(2000); f.Close(); }
public static async Task <ReturnedSaveFuncInfo> RunAsync(IWin32Window owner, string Script, SqlConnection cn, SqlTransaction transaction = null, short tryCount = 2) { var ret = new ReturnedSaveFuncInfo(); try { if (string.IsNullOrEmpty(Script)) { return(ret); } string[] seperator = { "go\r", "go\r\n", "\ngo\n", "\ngo\r\n", "\tgo\t", " go ", "\rgo\r" }; Script = Script.Replace("GO", "go").Replace("Go", "go").Replace("gO", "go"); var scripts = Script.Split(seperator, StringSplitOptions.RemoveEmptyEntries); var cmd = new SqlCommand("", cn) { CommandTimeout = 60 * 1000 * 2,//2دقیقه CommandType = CommandType.Text }; if (transaction != null) { cmd.Transaction = transaction; } if (cn.State != ConnectionState.Open) { cn.Open(); } var frm = new frmSplash(scripts.ToList().Count); frm.Show(owner); var index = 1; foreach (var item in scripts) { index++; frm.Level = index; ret.AddReturnedValue(await ExecuteAsync(item, cmd)); } frm.Close(); } catch (Exception ex) { WebErrorLog.ErrorInstence.StartErrorLog(ex); ret.AddReturnedValue(ex); } if (ret.HasError && tryCount > 0) { await Task.Delay(1000); return(await RunAsync(owner, Script, cn, transaction, --tryCount)); } return(ret); }
static void Main() { Application.EnableVisualStyles(); Application.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture; SetDefaultCulture(System.Globalization.CultureInfo.InvariantCulture); Application.SetCompatibleTextRenderingDefault(false); //init the app object UVDLPApp.Instance().DoAppStartup(); // start the app and load the plug-ins //iterate through the plugins bool showlicensedialog = false; //iterate through all plugins, // if they are un-licensed and enabled - show licensing dialog. foreach (PluginEntry pe in UVDLPApp.Instance().m_plugins) { if (pe.m_licensed == false && pe.m_enabled == true) // if we don't have a license, and it's marked enabled { showlicensedialog = true; } int options = pe.m_plugin.GetInt("Options"); if (options != -1 && pe.m_enabled == true) // check to see if this plugin has options { if ((options & PluginOptions.OPTION_TIMED_TRIAL) != 0) // check for timed trial bit { // check for trial version //start trial version if (!CheckTrial(pe)) { //disable the plug-in pe.m_enabled = false; //exit? Application.Exit(); return; } } } } if (showlicensedialog == true) { frmPluginManager pim = new frmPluginManager(); pim.ShowDialog(); } try { #if !DEBUG // no splash screen under debug release frmSplash splash = new frmSplash(); // should pull from a licensed plug-in if need-be splash.Show(); #endif Application.Run(new frmMain2()); } catch (Exception ex) { DebugLogger.Instance().LogError(ex); } }
public static void ExportLog(IEnumerable <SmsLogBussines> list, IWin32Window owner) { try { var sfd = new SaveFileDialog() { Filter = "Excel Files|*.xls" }; if (sfd.ShowDialog(owner) != DialogResult.OK) { return; } var excel = new Microsoft.Office.Interop.Excel.Application(); var wb = excel.Workbooks.Add(XlSheetType.xlWorksheet); var ws = (Worksheet)excel.ActiveSheet; excel.Visible = false; var index = 1; var frm = new frmSplash(list.ToList().Count); frm.Show(owner); //Add column ws.Cells[1, 1] = "تاریخ ارسال"; ws.Cells[1, 2] = "کاربر ارسال کننده"; ws.Cells[1, 3] = "هزینه به ریال"; ws.Cells[1, 4] = "وضعیت"; ws.Cells[1, 5] = "متن ارسال شده"; foreach (var item in list) { index++; frm.Level = index; ws.Cells[index, 1] = item.DateSh; ws.Cells[index, 2] = item.UserName; ws.Cells[index, 3] = item.Cost.ToString("N0"); ws.Cells[index, 4] = item.StatusText; ws.Cells[index, 5] = item.Message; } ws.SaveAs(sfd.FileName, XlFileFormat.xlWorkbookDefault, Type.Missing, Type.Missing, true, false, XlSaveAsAccessMode.xlNoChange, XlSaveConflictResolution.xlLocalSessionChanges, Type.Missing, Type.Missing); excel.Quit(); frm.Close(); } catch (Exception ex) { WebErrorLog.ErrorInstence.StartErrorLog(ex); } }
static void Main() { Application.EnableVisualStyles(); Application.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture; SetDefaultCulture(System.Globalization.CultureInfo.InvariantCulture); Application.SetCompatibleTextRenderingDefault(false); //init the app object UVDLPApp.Instance().DoAppStartup(); // start the app and load the plug-ins frmSplash splash = new frmSplash(); // should pull from a licensed plug-in if need-be splash.Show(); Application.Run(new frmMain2()); }
static void Main() { Application.EnableVisualStyles(); Application.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture; SetDefaultCulture(System.Globalization.CultureInfo.InvariantCulture); Application.SetCompatibleTextRenderingDefault(false); //init the app object frmSplash splash = new frmSplash(); splash.Show(); UVDLPApp.Instance().DoAppStartup(); Application.Run(new frmMain()); }
static void Main(string[] args) { //SetProcessDPIAware(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); //exception handler Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); //if the exe was passed a filename argument then run the script if (args.Length > 0) { string filePath = args[0]; if (!File.Exists(filePath)) { using (EventLog eventLog = new EventLog("Application")) { eventLog.Source = "Application"; eventLog.WriteEntry("An attempt was made to run an OpenBots script file from '" + filePath + "' but the file was not found. Please verify that the file exists at the path indicated.", EventLogEntryType.Error, 101, 1); } Application.Exit(); return; } //initialize Logger string engineLoggerFilePath = Path.Combine(Folders.GetFolder(FolderType.LogFolder), "OpenBots Engine Logs.txt"); Logger engineLogger = new Logging().CreateFileLogger(engineLoggerFilePath, Serilog.RollingInterval.Day); Application.Run(new frmScriptEngine(filePath, "", null, engineLogger)); } else { //clean up updater var updaterExecutableDestination = Application.StartupPath + "\\OpenBots.Updater.exe"; if (File.Exists(updaterExecutableDestination)) { File.Delete(updaterExecutableDestination); } SplashForm = new frmSplash(); SplashForm.Show(); Application.DoEvents(); Application.Run(new frmScriptBuilder()); } }
private void cmiExport_Click(object sender, EventArgs e) { if (lvDataviews.SelectedItems.Count > 0) { sfdExport.FileName = DateTime.Now.ToString("yyyy_MM_dd_"); if (lvDataviews.SelectedItems.Count == 1) { sfdExport.FileName += lvDataviews.SelectedItems[0].Text; } else { sfdExport.FileName += lvDataviews.SelectedItems.Count; } sfdExport.OverwritePrompt = true; sfdExport.SupportMultiDottedExtensions = true; if (DialogResult.OK == sfdExport.ShowDialog(this)) { var dvs = new List <string>(); var splash = new frmSplash(); foreach (ListViewItem lvi in lvDataviews.SelectedItems) { dvs.Add(lvi.Tag.ToString()); } splash.Show("Exporting " + dvs.Count + " dataview(s)...", false, this); processInBackground( (worker) => { var ds = AdminProxy.ExportDataViewDefinitions(dvs); BinaryFormatter bin = new BinaryFormatter(); using (StreamWriter sw = new StreamWriter(sfdExport.FileName)) { ds.RemotingFormat = SerializationFormat.Binary; bin.Serialize(sw.BaseStream, ds); } }, (worker2, e2) => { splash.ChangeText(getDisplayMember("export{working}", "Still working...")); }, (worker3, e3) => { splash.Close(); MainFormUpdateStatus(getDisplayMember("export{exported}", "Exported {0} dataview(s)", dvs.Count.ToString("###,##0")), true); }); } } }
/// <summary> /// Inicializa el modulo con el Login y el Splash /// </summary> /// <history> /// [erosado] 21/04/2016 Created /// </history> protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); frmSplash frmSplash = new frmSplash(); var frmLogin = new frmLogin(frmSplash, changePassword: true, validatePermission: true, permission: EnumPermission.MailOutsTexts, permissionLevel: EnumPermisionLevel.ReadOnly); frmSplash.Show(); frmSplash.ShowLogin(ref frmLogin); if (frmLogin.IsAuthenticated) { Context.User = frmLogin.UserData; frmMailOutsTexts frmMain = new frmMailOutsTexts(); frmMain.Title = $"{Context.Module} - [{Context.Environment}]"; frmMain.ShowDialog(); frmSplash.Close(); } }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); frmMap map = new frmMap(); frmSplash splash = new frmSplash(Application.ProductName, Application.ProductVersion, map.Icon); splash.Progress = "Iniciando o sistema"; splash.Show(); splash.Wait(2000); splash.Dispose(); Application.Run(map); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.ThreadException += new ThreadExceptionEventHandler(ErrorThread); Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("pt-BR"); Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("pt-BR"); // Leitura de Temas e Paletas BonusSkins.Register(); SkinManager.EnableFormSkins(); var objectoUserSetings = new ObjectoUserSetings(); UserLookAndFeel.Default.SetSkinStyle( objectoUserSetings.DefaultAppSkin, objectoUserSetings.DefaultPalette); WindowsFormsSettings.TouchUIMode = objectoUserSetings.TouchUI == true ? TouchUIMode.True : TouchUIMode.False; WindowsFormsSettings.DefaultFont = objectoUserSetings.DefaultAppFont; WindowsFormsSettings.DefaultPrintFont = objectoUserSetings.DefaultAppFont; var licenceResult = false; // Acessar e verificar a Base de dados using (var frm = new frmSplash(new ILicence())) { frm.Show(); // Licença licenceResult = frm.LecencaOk; Task.Run(async() => { await new BibliotecaContextData(new BiblioteContext()).Seed(); }).Wait(); } if (licenceResult) { Application.Run(new frmLogin(new UserRepository(new BiblioteContext()))); } else { XtraMessageBox.Show("Lamentamos Muito mais o seu Software ainda não foi Registado\nFaçau agora!...\n" , "Licença requerida", MessageBoxButtons.OK, MessageBoxIcon.Warning); Application.Exit(); Application.Run(new frmRegistar(new KeyGenRepository(new BiblioteContext()))); } }
/// <summary> /// Inicializa el modulo con el Login y el Splash /// </summary> /// <history> /// [erosado] 01/06/2016 Modified. se agrego async /// </history> protected async override void OnStartup(StartupEventArgs e) { base.OnStartup(e); frmSplash frmSplash = new frmSplash(); frmLogin frmLogin = new frmLogin(frmSplash, EnumLoginType.Location, EnumProgram.Inhouse, changePassword: true, autoSign: true, permission: EnumPermission.Register, permissionLevel: EnumPermisionLevel.Standard); await frmLogin.getAllPlaces(); frmSplash.Show(); frmSplash.ShowLogin(ref frmLogin); if (frmLogin.IsAuthenticated) { Context.User = frmLogin.UserData; frmMailOuts frmMain = new frmMailOuts(); frmMain.Title = $"{Context.Module} - [{Context.Environment}]"; frmMain.ShowDialog(); frmSplash.Close(); } }
/// <summary> /// Inicializa el modulo con el Login y el Splash /// </summary> protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); frmSplash frmSplash = new frmSplash(); frmLogin frmLogin = new frmLogin(frmSplash, changePassword: true, validatePermission: true, permission: EnumPermission.PRInvitations, permissionLevel: EnumPermisionLevel.Special); frmSplash.Show(); frmSplash.ShowLogin(ref frmLogin); if (frmLogin.IsAuthenticated) { EventManager.RegisterClassHandler(typeof(DataGrid), UIElement.MouseLeftButtonUpEvent, new MouseButtonEventHandler(dataGrid_MouseLeftButtonUp)); Context.User = frmLogin.UserData; frmPRStatistics frmMain = new frmPRStatistics(); frmMain.Title = $"{Context.Module} - [{Context.Environment}]"; frmMain.ShowDialog(); frmSplash.Close(); } }
/// <summary> /// Inicializa el modulo con el Login y el Splash /// </summary> /// [erosado] 23/Mar/2016 Created /// </history> protected async override void OnStartup(StartupEventArgs e) { base.OnStartup(e); frmSplash frmSplash = new frmSplash(); frmLogin frmLogin = new frmLogin(frmSplash, EnumLoginType.SalesRoom, changePassword: true, autoSign: true); await frmLogin.getAllPlaces(); frmSplash.Show(); frmSplash.ShowLogin(ref frmLogin); if (frmLogin.IsAuthenticated) { EventManager.RegisterClassHandler(typeof(DataGrid), UIElement.MouseLeftButtonUpEvent, new MouseButtonEventHandler(dataGrid_MouseLeftButtonUp)); Context.User = frmLogin.UserData; frmSalesCloser frmMain = new frmSalesCloser(); frmMain.Title = $"{Context.Module} - [{Context.Environment}]"; frmMain.ShowDialog(); frmSplash.Close(); } }
/// <summary> /// Inicializa el modulo con el Login y el Splash /// </summary> /// <history> /// [aalcocer] 10/03/2016 Created /// </history> protected override async void OnStartup(StartupEventArgs e) { base.OnStartup(e); frmSplash frmSplash = new frmSplash(); Window frmLS = new frmLS(frmSplash); await((frmLS)frmLS).GetLeadSources(); frmSplash.Show(); frmSplash.ShowLogin(ref frmLS); if (((frmLS)frmLS).IsValidated) { LeadSource leadsource = ((frmLS)frmLS).LeadSource; frmGraph frmMain = new frmGraph(leadsource); frmMain.Title = $"{Context.Module} - [{Context.Environment}]"; frmMain.ShowDialog(); frmSplash.Close(); } }
/// <summary> /// Inicializa el modulo con el Login y el Splash /// </summary> /// <history> /// [erosado] 01/06/2016 Modified. se agrego async /// </history> protected override async void OnStartup(StartupEventArgs e) { base.OnStartup(e); frmSplash frmSplash = new frmSplash(); frmLogin frmLogin = new frmLogin(frmSplash, EnumLoginType.Warehouse, validatePermission: true, permission: EnumPermission.GiftsReceipts, permissionLevel: EnumPermisionLevel.Standard, changePassword: true); await frmLogin.getAllPlaces(); frmSplash.Show(); frmSplash.ShowLogin(ref frmLogin); if (!frmLogin.IsAuthenticated) { return; } Context.User = frmLogin.UserData; frmInventoryMovements frmMain = new frmInventoryMovements(); frmMain.Title = $"{Context.Module} - [{Context.Environment}]"; frmMain.ShowDialog(); frmSplash.Close(); }
/// <summary> /// Inicializa el modulo con el Login y el Splash /// </summary> /// <history> /// [jorcanche] 11/04/2016 created /// [erosado] 01/06/2016 Modified. se agrego async /// </history> protected async override void OnStartup(StartupEventArgs e) { base.OnStartup(e); frmSplash frmSplash = new frmSplash(); frmLogin frmLogin = new frmLogin(frmSplash, EnumLoginType.Normal, validatePermission: true, changePassword: true, permission: EnumPermission.HostInvitations, permissionLevel: EnumPermisionLevel.ReadOnly); await frmLogin.getAllPlaces(); frmSplash.Show(); frmSplash.ShowLogin(ref frmLogin); if (frmLogin.IsAuthenticated) { Context.User = frmLogin.UserData; frmInvitConfig frmMain = new frmInvitConfig(); frmMain.Title = $"{Context.Module} - [{Context.Environment}]"; frmMain.ShowDialog(); frmSplash.Close(); } }
/// <summary> /// Inicializa el modulo con el Login y el Splash /// </summary> /// <history> /// [jorcanche] 11/04/2016 created /// [erosado] 01/06/2016 Modified. se agrego async /// </history> protected override async void OnStartup(StartupEventArgs e) { base.OnStartup(e); frmSplash frmSplash = new frmSplash(); frmLogin frmLogin = new frmLogin(frmSplash, EnumLoginType.Location, EnumProgram.Outhouse, true, changePassword: true, autoSign: true, permission: EnumPermission.PRInvitations, permissionLevel: EnumPermisionLevel.ReadOnly); await frmLogin.getAllPlaces(); frmSplash.Show(); frmSplash.ShowLogin(ref frmLogin); if (frmLogin.IsAuthenticated) { EventManager.RegisterClassHandler(typeof(DataGrid), UIElement.MouseLeftButtonUpEvent, new MouseButtonEventHandler(dataGrid_MouseLeftButtonUp)); Context.User = frmLogin.UserData; frmOuthouse frmMain = new frmOuthouse(); frmMain.Title = $"{Context.Module} - [{Context.Environment}]"; frmMain.ShowDialog(); frmSplash.Close(); } }
private async void btnFinish_Click(object sender, EventArgs e) { try { if (DGrid.RowCount <= 0) { frmNotification.PublicInfo.ShowMessage("هیچ داده ای وجود ندارد"); cmbWithoutGroup.Focus(); return; } btnFinish.Enabled = btnCancel.Enabled = false; var frm = new frmSplash(DGrid.RowCount); frm.Show(this); for (var i = 0; i < DGrid.RowCount; i++) { var x = await GetItemsAsync(i); frm.Level = i; if (x == null) { continue; } await x.SaveAsync(); } DialogResult = DialogResult.OK; frm.Close(); Close(); } catch (Exception ex) { WebErrorLog.ErrorInstence.StartErrorLog(ex); } finally { btnFinish.Enabled = btnCancel.Enabled = true; } }
static void Main() { AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException); Application.EnableVisualStyles(); Application.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture; SetDefaultCulture(System.Globalization.CultureInfo.InvariantCulture); Application.SetCompatibleTextRenderingDefault(false); //init the app object if (UVDLPApp.Instance().DoAppStartup() == false) // start the app and load the plug-ins { Application.Exit(); // by esyeon 20160127 return; } // by esyeon 20151230 try { #if !DEBUG // no splash screen under debug release frmSplash splash = new frmSplash(); // should pull from a licensed plug-in if need-be splash.Show(); #endif Application.Run(new frmMain2()); } catch (Exception ex) { DebugLogger.Instance().LogError(ex); } }
//Analza un mail recibido public void AnalizaMail(Outlook.MailItem mail) { int pos; string elSubject = mail.Subject.ToString(); string[] elBody; //Sincronización if ((pos = Strings.InStr(mail.Subject.ToString(), "Sincronizar:")) > 0) { //Por ahora no hago nada pues el handler del Evento lo copia para la carpeta MailEprende de todos modos... //Si la sincronización es manual no se necesita hacer nada aquí para sincronizar. 19-09-2013 } //Direcciones erróneas if ((pos = Strings.InStr(mail.Subject.ToString(), "Direcciones Erroneas")) > 0) { try { elBody = mail.Body.ToString().Trim().Split('|'); DateTime fecha = mail.ReceivedTime; correosDataSetTableAdapters.bad_mailTableAdapter taBadMail = new correosDataSetTableAdapters.bad_mailTableAdapter(); correosDataSetTableAdapters.usuariosTableAdapter taUsers = new correosDataSetTableAdapters.usuariosTableAdapter(); correosDataSetTableAdapters.accesoTableAdapter taAccess = new correosDataSetTableAdapters.accesoTableAdapter(); int NumBad = Convert.ToInt32(elBody[0]); int NumBorraBad = 0; string elBodyBad = ""; string elBodyBadAccess = ""; string unaDir = ""; string unaDir1 = ""; string unaDir2 = ""; //Consulto si está activo el borrado automático en los settings... Properties.Settings setting = new Properties.Settings(); //Creo variable para acceder a Settings y leer EmailAdmiin //Declaro borrado y preparo el correo para borrar arriba si está establecido el Check de borrado automático for (int i = 0; i < NumBad; i++) { //Tomo la dirección i-esima unaDir = elBody[i + 1]; //Para chequear los usuarios //La arreglo si está en una tupla de direcciones 01-10-2013 tanto de usuarios como de Accesos 08-05-2014 unaDir1 = (taUsers.GetCorreoLikeUnAddress(unaDir).Count > 0)? taUsers.GetCorreoLikeUnAddress(unaDir)[0].correo.ToString() : ""; unaDir2 = (taAccess.GetAccesoSegunCorreo(unaDir).Count > 0)? taAccess.GetAccesoSegunCorreo(unaDir)[0].correo.ToString():""; if (unaDir1 != "" || unaDir2 != "") //Si encontró una dirección { if ((bool)setting["Borrado_Auto_BadMail"])//Si está seteado borrar automático las dir erroneas { //Preparo para mandar a borrar direcciones y declaro borrado en USUARIO if (unaDir1 != "") //Si encontró una dirección en usuarios { taUsers.UpdateEstadoSegunCorreo("Borrado. Dirección rebotada", unaDir); NumBorraBad++; elBodyBad += unaDir + "|"; } //Preparo para mandar a borrar direcciones y declaro borrado en ACCESOS if (unaDir2 != "") //Si encontró una dirección en usuarios { setting = new Properties.Settings(); //Creo variable para acceder a Settings y leer EmailAdmiin string EmailDir = setting["Email_Admin"].ToString(); string EmailSubject = "eliminar-accesos"; taAccess.UpdateEstadoSegunCorreo("Borrado. Dirección rebotada", unaDir); elBodyBadAccess = taAccess.GetAccesoSegunCorreo(unaDir)[0].id_acceso.ToString() + "|"; Globals.ThisAddIn.SendEmailAddressSubjectBody(EmailDir, EmailSubject, elBodyBadAccess); //Si hay más de un acceso con la misma dir de Email se borra solo uno, el otro será en el próximo rebote } } //Escribo en la tabla bad_mail para que sea aconsultada cuando se quiera //Desde aquí se podrá mandar a borrar si se quiere. 07-04-2014 if (taBadMail.GetByCorreo(unaDir).Count == 0) //Si no está ya el correo { //inserto en la tabla bad_mail si el mail está en la tabla USERS if (taUsers.GetDataByUnCorreo(unaDir1).Count > 0 ) { taBadMail.Insert(unaDir, taUsers.GetDataByUnCorreo(unaDir)[0].nombre.ToString(), taUsers.GetDataByUnCorreo(unaDir)[0].apellido1.ToString(), fecha, 1); } //inserto en la tabla bad_mail si el mail está en la tabla ACCESOS if (taAccess.GetAccesoSegunCorreo(unaDir2).Count > 0) { try { taBadMail.Insert(unaDir, taAccess.GetAccesoSegunCorreo(unaDir)[0].nombre.ToString(), taAccess.GetAccesoSegunCorreo(unaDir)[0].apellido1.ToString(), fecha, 1); } catch { //Se captura la excepción de insersión duplicada de registro //Pero no se hace nada con ello, no es necesario } } } else //Si ya está en la tabla BadMail { taBadMail.UpdateNumRebotesSegunCorreo(Convert.ToInt32(taBadMail.GetByCorreo(unaDir)[0]["numrebotes"]) + 1, unaDir); //Sumo uno al número de rebotes taBadMail.UpdateFechaSegunCorreo(fecha, unaDir); //Actualizo la fecha del último rebote } }//Si consiguio la dirección de tupla o simple OK } //For que recorre los NumBad //El Correo if (NumBorraBad > 0 && (bool)setting["Borrado_Auto_BadMail"]) //Si encontré qué borrar y si está activo el borrado automático { setting = new Properties.Settings(); //Creo variable para acceder a Settings y leer EmailAdmiin string EmailDir = setting["Email_Admin"].ToString(); //Preparo y envío string EmailSubject = "eliminar-usuario"; string BodyBorrar = NumBorraBad.ToString() + "|" + elBodyBad; Globals.ThisAddIn.SendEmailAddressSubjectBody(EmailDir, EmailSubject, BodyBorrar); } /* La actual rutina de borrar accesos es borra uno a uno, así que los Emails se generan arriba if (NumBorraBadAccess > 0 && (bool)setting["Borrado_Auto_BadMail"]) //Si encontré qué borrar y si está activo el borrado automático*/ } catch (Exception ex) { if (Strings.InStr(Problemas, "satisfactoria") > 0) Problemas = ""; Problemas += elSubject + ": " + mail.Body.ToString() + ". Registró: " + "\n" + ex.Message.ToString(); } } //Respuesta de comandos if ((pos = Strings.InStr(mail.Subject.ToString(), "Correcto")) > 0) { elSubject = mail.Subject.ToString().Split(' ')[1].Trim(); switch (elSubject) { //Limpiar el Estado en Accesos y Centros porque fue correcta la reconstrucción case "rehacer-bd": try { //Preparo variables de acceso a los TableAdapters correosDataSetTableAdapters.centroTableAdapter taCentrosCl = new correosDataSetTableAdapters.centroTableAdapter(); correosDataSetTableAdapters.accesoTableAdapter taAccesoCl = new correosDataSetTableAdapters.accesoTableAdapter(); correosDataSetTableAdapters.usuariosTableAdapter taUsuarios = new correosDataSetTableAdapters.usuariosTableAdapter(); correosDataSetTableAdapters.listaTableAdapter taListas = new correosDataSetTableAdapters.listaTableAdapter(); correosDataSetTableAdapters.usuario_listaTableAdapter taUsuarioListas = new correosDataSetTableAdapters.usuario_listaTableAdapter(); int ra = Strings.InStr(taCentrosCl.GetData()[0].estado.ToString(), "Rehacer"); if (ra > 0) //Si esta es la BD que mandó a Reahacer { taAccesoCl.LimpiarEstados(); taCentrosCl.LimpiarEstados(); } else //Si no estoy en la BD que mandó a Rehacer, entonces a serruchar { //Preparo separadores y variables numéricas string[] separators = new string[5]; int NumCentros, NumListas, NumAccesos, NumUsuarios, NumUsuarios_listas; string[] BodyCentros, BodyListas, BodyAccesos, BodyUsuarios, BodyUsuarios_listas; separators[0] = "Centros:"; separators[1] = "Listas:"; separators[2] = "Accesos:"; separators[3] = "Usuarios:"; separators[4] = "Usuarios_listas:"; //Obtengo los trozos del Body del mensaje que tienen los comando de creación elBody = mail.Body.ToString().Split(separators, StringSplitOptions.RemoveEmptyEntries); BodyCentros = elBody[0].Split('|'); BodyListas = elBody[1].Split('|'); BodyAccesos = elBody[2].Split('|'); BodyUsuarios = elBody[3].Split('|'); BodyUsuarios_listas = elBody[4].Split('|'); NumCentros = Convert.ToInt32(BodyCentros[0]); NumListas = Convert.ToInt32(BodyListas[0]); NumAccesos = Convert.ToInt32(BodyAccesos[0]); NumUsuarios = Convert.ToInt32(BodyUsuarios[0]); NumUsuarios_listas = Convert.ToInt32(BodyUsuarios_listas[0]); //Elimino las tablas Usuarios y Centros, con esto limpio todo taAccesoCl.DeleteAll(); taCentrosCl.DeleteAll(); taUsuarios.DeleteAll(); //Muestro el Splash (Nueva Instancia) OutlookAddInEmprende.frmSplash theSplashR = new frmSplash(); theSplashR.pbProgress.Step = 1; theSplashR.pbProgress.Value = 1; theSplashR.pbProgress.Maximum = NumAccesos+NumCentros+NumListas+NumUsuarios+NumUsuarios_listas; theSplashR.etAccion.Text = "Reconstruyendo la Base de Datos Local..."; theSplashR.pbProgress.ForeColor = System.Drawing.Color.Brown; theSplashR.Show(); System.Windows.Forms.Application.DoEvents(); //Ejecuto comandos de creación uno por uno //*************************************************** //Crear Centros: id centro|nombre del centro|correo| for (int i = 0; i < NumCentros; i++) { taCentrosCl.InsertUnCentro(Convert.ToInt32(Strings.Replace(BodyCentros[3 * i + 1], " ", "")), Strings.Replace(BodyCentros[3 * i + 2], " ", ""), Strings.Replace(BodyCentros[3 * i + 3], " ", ""), ""); theSplashR.pbProgress.PerformStep(); System.Windows.Forms.Application.DoEvents(); } //Crear Listas: id lista|nombre de la lista|ID del centro| for (int i = 0; i < NumListas; i++) { taListas.Insert(Convert.ToInt32(Strings.Replace(BodyListas[3 * i + 1], " ", "")), Strings.Replace(BodyListas[3 * i + 2], " ", ""), Convert.ToInt32(Strings.Replace(BodyListas[3 * i + 3], " ", "")), ""); theSplashR.pbProgress.PerformStep(); System.Windows.Forms.Application.DoEvents(); } //Crear Accesos: id acceso|correo|clave|nombre|1er apellido|2do apellido|id de la lista|id de tipo de usuario| for (int i = 0; i < NumAccesos; i++) { taAccesoCl.InsertUnAcceso(Convert.ToInt32(Strings.Replace(BodyAccesos[8 * i + 1], " ", "")), Strings.Replace(BodyAccesos[8 * i + 2], " ", ""), Strings.Replace(BodyAccesos[8 * i + 3], " ", ""), BodyAccesos[8 * i + 4], BodyAccesos[8 * i + 5], BodyAccesos[8 * i + 6], Convert.ToInt32(Strings.Replace(BodyAccesos[8 * i + 7], " ", "")), Convert.ToInt32(Strings.Replace(BodyAccesos[8 * i + 8], " ", "")), ""); theSplashR.pbProgress.PerformStep(); System.Windows.Forms.Application.DoEvents(); } //Crear Usuarios for (int i = 0; i < NumUsuarios; i++) { taUsuarios.InsertUnUsuario(Strings.Replace(BodyUsuarios[4 * i + 1]," ",""), BodyUsuarios[4 * i + 2], BodyUsuarios[4 * i + 3], BodyUsuarios[4 * i + 4], ""); theSplashR.pbProgress.PerformStep(); System.Windows.Forms.Application.DoEvents(); } //Crear Usuario-Lista for (int i = 0; i < NumUsuarios_listas ; i++) { try { taUsuarioListas.InsertUsuario_Lista(Convert.ToInt32(Strings.Replace(BodyUsuarios_listas[2 * i + 2]," ","")), Strings.Replace(BodyUsuarios_listas[2 * i + 1]," ",""), ""); theSplashR.pbProgress.PerformStep(); System.Windows.Forms.Application.DoEvents(); } catch { //Evita que explote por un error de no coinsidencia de clave, no se hace nada //Los usuarios quedarían entonces "sueltos" } } theSplashR.Close(); } } catch (Exception ex) { if (Strings.InStr(Problemas, "satisfactoria") > 0) Problemas = ""; Problemas += elSubject + ": " + ". Registró: " + "\n" + ex.Message.ToString(); } break; case "crear-accesos": case "editar-accesos": //id acceso|correo|clave|nombre|1er apellido|2do apellido|id de la lista|id de tipo de usuario| ** try { elBody = mail.Body.ToString().Trim().Split('|'); correosDataSetTableAdapters.accesoTableAdapter taAcceso = new correosDataSetTableAdapters.accesoTableAdapter(); if (taAcceso.GetAccesoSegunCorreo(elBody[1]).Count > 0) //Si ya está lo actualizo { taAcceso.UpdateUnAcceso(elBody[1],elBody[2],elBody[3],elBody[4],elBody[5],Convert.ToInt32(elBody[6]), Convert.ToInt32(elBody[7]),"",elBody[1]); } else //Si no lo inserto { taAcceso.InsertUnAcceso(Convert.ToInt32(elBody[0]), elBody[1], elBody[2], elBody[3], elBody[4], elBody[5], Convert.ToInt32(elBody[6]), Convert.ToInt32(elBody[7]), ""); } } catch (Exception ex) { if (Strings.InStr(Problemas, "satisfactoria") > 0) Problemas = ""; Problemas += elSubject + ": " + mail.Body.ToString() + ". Registró: " + "\n" + ex.Message.ToString(); } break; case "eliminar-accesos": //Cuerpo: id acceso| ** try { elBody = mail.Body.ToString().Trim().Split('|'); correosDataSetTableAdapters.accesoTableAdapter taAcceso = new correosDataSetTableAdapters.accesoTableAdapter(); taAcceso.DeleteUnAccesoByID(Convert.ToInt32(elBody[0])); } catch (Exception ex) { if (Strings.InStr(Problemas, "satisfactoria") > 0) Problemas = ""; Problemas += elSubject + ": " + mail.Body.ToString() + ". Registró: " + "\n" + ex.Message.ToString(); } break; case "enviar-correo": string[] sep = new string[1]; sep[0] = "ID:"; //Extraigo el ID y si no está lo escribo en la tabla string consec = mail.Subject.ToString().Split( sep ,StringSplitOptions.RemoveEmptyEntries)[1].Trim(); correosDataSetTableAdapters.consecutivoTableAdapter taConsecutivo = new correosDataSetTableAdapters.consecutivoTableAdapter(); if (taConsecutivo.CuantosHay(consec) == 0) { taConsecutivo.InserUnConsecutivo(consec); } break; case "crear-centro": case "editar-centro": //cuerpo: id centro|nombre del centro|correo| ** try { elBody = mail.Body.ToString().Trim().Split('|'); correosDataSetTableAdapters.centroTableAdapter taCentros = new correosDataSetTableAdapters.centroTableAdapter(); if (taCentros.GetCentroBySoloID(Convert.ToInt32(elBody[0])).Count > 0) //si ya está el centro { correosDataSetTableAdapters.centroTableAdapter taCentro = new correosDataSetTableAdapters.centroTableAdapter(); taCentro.SetUnCentro(elBody[1], "", elBody[2], Convert.ToInt32(elBody[0])); } else //si no esta el centro { taCentros.InsertUnCentro(Convert.ToInt32(elBody[0]), elBody[1], elBody[2], ""); } } catch (Exception ex) { if (Strings.InStr(Problemas, "satisfactoria") > 0) Problemas = ""; Problemas += elSubject + ": " + mail.Body.ToString() + ". Registró: " + "\n" + ex.Message.ToString(); } break; case "eliminar-centro": //cuerpo: ID del centro|** try { elBody = mail.Body.ToString().Trim().Split('|'); correosDataSetTableAdapters.centroTableAdapter taCentro = new correosDataSetTableAdapters.centroTableAdapter(); taCentro.DeleteUnCentro(Convert.ToInt32(elBody[0])); } catch (Exception ex) { if (Strings.InStr(Problemas, "satisfactoria") > 0) Problemas = ""; Problemas += elSubject + ": " + mail.Body.ToString() + ". Registró: " + "\n" + ex.Message.ToString(); } break; case "crear-lista": case "editar-lista": //cuerpo: id lista|nombre de la lista|ID del centro| ** try { elBody = mail.Body.ToString().Trim().Split('|'); correosDataSetTableAdapters.listaTableAdapter taLista = new correosDataSetTableAdapters.listaTableAdapter(); if (taLista.GetListaByID(Convert.ToInt32(elBody[0])).Count > 0) //Si está la lista { taLista.UpdateUnaLista(elBody[1], "", Convert.ToInt32(elBody[0])); } else //Si no está la lista { taLista.Insert(Convert.ToInt32(elBody[0]), elBody[1], Convert.ToInt32(elBody[2]),""); } } catch (Exception ex) { if (Strings.InStr(Problemas, "satisfactoria") > 0) Problemas = ""; Problemas += elSubject + ": " + mail.Body.ToString() + ". Registró: " + "\n" + ex.Message.ToString(); } break; case "eliminar-lista": //Cuerpo: Id lista| ** try { elBody = mail.Body.ToString().Trim().Split('|'); correosDataSetTableAdapters.listaTableAdapter taLista = new correosDataSetTableAdapters.listaTableAdapter(); taLista.DeleteUnaLista(Convert.ToInt32(elBody[0])); } catch (Exception ex) { if (Strings.InStr(Problemas, "satisfactoria") > 0) Problemas = ""; Problemas += elSubject + ": " + mail.Body.ToString() + ". Registró: " + "\n" + ex.Message.ToString(); } break; case "crear-usuario": //cant_usuarios|correo|nombre|1er apellido|2do apellido| ** //ejem: 2|[email protected]|mario|gles|mtinez|[email protected]|jose|ramirez|prieto| try { string elCorreo = ""; elBody = mail.Body.ToString().Trim().Split('|'); taUsuarios = new correosDataSetTableAdapters.usuariosTableAdapter(); int Num = Convert.ToInt32(elBody[0]); for (int i = 0; i<Num; i++) { elCorreo = elBody[4*i + 1]; if (taUsuarios.GetDataByUnCorreo(elCorreo).Count > 0) //Si está el correo { taUsuarios.UpdateEstadoSegunCorreo("", elCorreo); //Reseteo su estado } else //Si no está lo inserto { taUsuarios.InsertUnUsuario(elCorreo, elBody[4 * i + 2], elBody[4 * i + 3], elBody[4 * i + 4], ""); } } } catch (Exception ex) { if (Strings.InStr(Problemas, "satisfactoria") > 0) Problemas = ""; Problemas += elSubject + ": " + mail.Body.ToString() + ". Registró: " + "\n" + ex.Message.ToString(); } break; case "editar-usuario": //correo_old|correo_new|nombre|1er apellido|2do apellido| ** try { elBody = mail.Body.ToString().Trim().Split('|'); taUsuarios = new correosDataSetTableAdapters.usuariosTableAdapter(); if (taUsuarios.GetDataByUnCorreo(elBody[1]).Count > 0) //Si el correo nuevo está { taUsuarios.UpdateUsuarioSegunCorreo(elBody[2],elBody[3],elBody[4],"",elBody[1]); //Actualizo todo menos el correo } //Si el correo viejo es el que está, y no está el nuevo, actualizo cambiando el correo. if (taUsuarios.GetDataByUnCorreo(elBody[0]).Count > 0 && taUsuarios.GetDataByUnCorreo(elBody[1]).Count ==0) { taUsuarios.UpdateUsuarioSegunCorreoIncCorreo(elBody[1],elBody[2], elBody[3], elBody[4], "", elBody[0]); //Actualizo todo } } catch (Exception ex) { if (Strings.InStr(Problemas, "satisfactoria") > 0) Problemas = ""; Problemas += elSubject + ": " + mail.Body.ToString() + ". Registró: " + "\n" + ex.Message.ToString(); } break; case "editar-usuario-listas": //cuerpo: cant_listas|correo_old|correo_new|nombre|1er apellido|2do apellido|id_lista|id_lista| --** //ejem: 2|[email protected]|[email protected]|Pedro|Pérez|García|7|8| try { elBody = mail.Body.ToString().Trim().Split('|'); taUsuarios = new correosDataSetTableAdapters.usuariosTableAdapter(); correosDataSetTableAdapters.usuario_listaTableAdapter taUsuarioLista = new correosDataSetTableAdapters.usuario_listaTableAdapter(); if(taUsuarios.GetDataByUnCorreo(elBody[1]).Count > 0) //Si el correo_old estaba, lo borro { taUsuarios.DeleteSegunCorreo(elBody[1]); //Borro el correoOld no importa si no está } if (taUsuarios.GetDataByUnCorreo(elBody[2]).Count > 0) //Si ya esta creado el correo_new { taUsuarios.UpdateUsuarioSegunCorreo(elBody[3],elBody[4],elBody[5],"", elBody[2]); //Actualizo los parámetros del usuaro //Ahora actualizo Usuario Lista, actualizando el Estado en este caso int Num = Convert.ToInt32(elBody[0]); //Tomo el número de listas for (int i = 0; i < Num; i++) { if (taUsuarioLista.GetDataByListaYMail(Convert.ToInt32(elBody[i + 6]),elBody[2]).Count > 0 ) //Si el usuario-lista ya está creado { taUsuarioLista.UpdateEstadoSegunIDListaYCorreo("", Convert.ToInt32(elBody[i + 6]), elBody[2]); } else //si el usuario-lista no estaba, lo creo en estado sincronizado { taUsuarioLista.InsertUsuario_Lista(Convert.ToInt32(elBody[i + 6]), elBody[2], ""); } } } else //si no estaba creado el correo_new { taUsuarios.InsertUnUsuario(elBody[2], elBody[3], elBody[4], elBody[5], ""); //Ahora actualizo Usuario Lista, creando en este caso int Num = Convert.ToInt32(elBody[0]); //Tomo el número de listas for (int i = 0; i < Num; i++) { taUsuarioLista.InsertUsuario_Lista(Convert.ToInt32(elBody[i + 6]), elBody[2],""); } } } catch (Exception ex) { if (Strings.InStr(Problemas, "satisfactoria") > 0) Problemas = ""; Problemas += elSubject + ": " + mail.Body.ToString() + ". Registró: " + "\n" + ex.Message.ToString(); } break; case "eliminar-usuario": //Cuerpo: cant_usuarios|correo| y tantos usuarios como cant_usuarios de forma seguida ** //ejem: 2|[email protected]|[email protected]| try { elBody = mail.Body.ToString().Trim().Split('|'); taUsuarios = new correosDataSetTableAdapters.usuariosTableAdapter(); for(int i = 0; i < Convert.ToInt32(elBody[0]); i++) { taUsuarios.DeleteSegunCorreo(elBody[i+1]); } } catch (Exception ex) { if (Strings.InStr(Problemas, "satisfactoria") > 0) Problemas = ""; Problemas += elSubject + ": " + mail.Body.ToString() + ". Registró: " + "\n" + ex.Message.ToString(); } break; case "crear-usuario-lista": //Cuerpo: cant_usuarios|correo|id de la lista| y tantos usuarios como cant_usuarios de forma seguida ** //Implica que los usuarios ya están creados en la BD, sólo se asocian con listas //ejem: 2|[email protected]|1|[email protected]|1| try { elBody = mail.Body.ToString().Trim().Split('|'); correosDataSetTableAdapters.usuario_listaTableAdapter taUsuariosLista = new correosDataSetTableAdapters.usuario_listaTableAdapter(); for (int i = 0; i < Convert.ToInt32(elBody[0]); i++) { if (taUsuariosLista.GetDataByListaYMail(Convert.ToInt32(elBody[2 * i + 2]),elBody[2 * i + 1]).Count > 0) //Si está el usuario lista actualizo el estado { taUsuariosLista.UpdateEstadoSegunIDListaYCorreo("", Convert.ToInt32(elBody[2 * i + 2]), elBody[2 * i + 1]); } else //Si no está lo creo { taUsuariosLista.InsertUsuario_Lista(Convert.ToInt32(elBody[2 * i + 2]), elBody[2 * i + 1], ""); } } } catch (Exception ex) { if (Strings.InStr(Problemas, "satisfactoria") > 0) Problemas = ""; Problemas += elSubject + ": " + mail.Body.ToString() + ". Registró: " + "\n" + ex.Message.ToString(); } break; case "crear-usuario-usuario-lista": //cuerpo: cant_usuarios|correo|nombre|apellido1|apellido2|id lista| y tantos usuarios como cant_usuarios de forma seguida ** //ejem: 2|[email protected]|mario|gles|mtinez|2|[email protected]|jose|ramirez|prieto|1| try { elBody = mail.Body.ToString().Trim().Split('|'); taUsuarios = new correosDataSetTableAdapters.usuariosTableAdapter(); correosDataSetTableAdapters.usuario_listaTableAdapter taUsuariosLista = new correosDataSetTableAdapters.usuario_listaTableAdapter(); for (int i = 0; i < Convert.ToInt32(elBody[0]); i++) { //El usuario if (taUsuarios.GetDataByUnCorreo(elBody[5 * i + 1]).Count > 0) //si está el usuario actualizo el estado { taUsuarios.UpdateEstadoSegunCorreo("", elBody[5 * i + 1]); } else //No está, lo creo { taUsuarios.InsertUnUsuario(elBody[5 * i + 1], elBody[5 * i + 2], elBody[5 * i + 3], elBody[5 * i + 4], ""); } //El usuario-lista if (taUsuariosLista.GetDataByListaYMail(Convert.ToInt32(elBody[5 * i + 5]), elBody[5 * i + 1]).Count > 0) //si está el usuario-lista, actualizo el estado { taUsuariosLista.UpdateEstadoSegunIDListaYCorreo("", Convert.ToInt32(elBody[5 * i + 5]), elBody[5 * i + 1]); } else //Si no está lo creo { taUsuariosLista.InsertUsuario_Lista(Convert.ToInt32(elBody[5 * i + 5]), elBody[5 * i + 1], ""); } } //For que recorre la lista de comandos del body } catch (Exception ex) { if (Strings.InStr(Problemas, "satisfactoria") > 0) Problemas = ""; Problemas += elSubject + ": " + mail.Body.ToString() + ". Registró: " + "\n" + ex.Message.ToString(); } break; case "eliminar-usuario-lista": //Cuerpo: cant_usuarios|correo|id de la lista| y tantos usuarios como cant_usuarios de forma seguida ** //ejem: 2|[email protected]|1|[email protected]|1| try { elBody = mail.Body.ToString().Trim().Split('|'); correosDataSetTableAdapters.usuario_listaTableAdapter taUsuariosLista = new correosDataSetTableAdapters.usuario_listaTableAdapter(); for (int i = 0; i < Convert.ToInt32(elBody[0]); i++) { taUsuariosLista.DeleteUnUsuarioLista(Convert.ToInt32(elBody[2 * i + 2]), elBody[2 * i + 1]); } } catch (Exception ex) { if (Strings.InStr(Problemas, "satisfactoria") > 0) Problemas = ""; Problemas += elSubject + ": " + mail.Body.ToString() + ". Registró: " + "\n" + ex.Message.ToString(); } break; case "mover-usuario-lista": //Cuerpo: cant_usuarios|correo|id de la lista vieja|id lista nueva| y tantos usuarios como cant_usuarios de forma seguida //ejem: 2|[email protected]|1|3|[email protected]|1|4| try { elBody = mail.Body.ToString().Trim().Split('|'); correosDataSetTableAdapters.usuario_listaTableAdapter taUsuariosLista = new correosDataSetTableAdapters.usuario_listaTableAdapter(); for (int i = 0; i < Convert.ToInt32(elBody[0]); i++) { if (taUsuariosLista.EstaEnLista(Convert.ToInt32(elBody[3 * i + 3]), elBody[3 * i + 1]) == 0) { taUsuariosLista.MuevePertenenciaALista(Convert.ToInt32(elBody[3 * i + 3]), "", Convert.ToInt32(elBody[3 * i + 2]), elBody[3 * i + 1]); } else { //Si ya estaba en la otra lista reseteo el estado taUsuariosLista.UpdateEstadoSegunIDListaYCorreo("", Convert.ToInt32(elBody[3 * i + 3]), elBody[3 * i + 1]); } } } catch (Exception ex) { if (Strings.InStr(Problemas, "satisfactoria") > 0) Problemas = ""; Problemas += elSubject + ": " + mail.Body.ToString() + ". Registró: " + "\n" + ex.Message.ToString(); } break; }//Switch elSubjec } }
public Form1(string[] args) { frmSplash splash = new frmSplash(); splash.Show(); System.Windows.Forms.Application.DoEvents(); InitializeComponent(); addWizTuneFilePacks(); // Only have this enabled in debug mode until ready this.barButtonItem29.Visibility = DevExpress.XtraBars.BarItemVisibility.Always; try { RegistryKey TempKeyCM = null; TempKeyCM = Registry.ClassesRoot.CreateSubKey(@"SystemFileAssociations\.bin\shell\Edit in T8 Suite\command"); string StartKey = System.Windows.Forms.Application.ExecutablePath + " \"%1\""; TempKeyCM.SetValue("", StartKey); TempKeyCM.Close(); } catch (Exception E) { logger.Debug(E.Message); } try { RegistryKey TempKeyCM = null; TempKeyCM = Registry.ClassesRoot.CreateSubKey(@"SystemFileAssociations\.bin\shell\Auto detect Trionic file type\command"); string StartKey = System.Windows.Forms.Application.StartupPath + "\\SuiteLauncher.exe" + " \"%1\""; TempKeyCM.SetValue("", StartKey); TempKeyCM.Close(); } catch (Exception E) { logger.Debug(E.Message); } if (args.Length > 0) { if (args[0].ToString().ToUpper().EndsWith(".BIN")) { if (File.Exists(args[0].ToString())) { m_startFromCommandLine = true; m_commandLineFile = args[0].ToString(); } } } try { m_DelegateStartReleaseNotePanel = new DelegateStartReleaseNotePanel(this.StartReleaseNotesViewer); m_DelegateUpdateRealTimeValue = new DelegateUpdateRealTimeValue(this.UpdateRealtimeInformationValue); } catch (Exception E) { logger.Debug(E.Message); } try { sndplayer = new System.Media.SoundPlayer(); t8can.onReadProgress += new ITrionic.ReadProgress(t8can_onReadProgress); t8can.onWriteProgress += new ITrionic.WriteProgress(t8can_onWriteProgress); t8can.onCanInfo += new ITrionic.CanInfo(t8can_onCanInfo); } catch (Exception E) { logger.Debug(E.Message); } splash.Close(); }
public void main() { //===================================================================== // Procedure Name : Main // Parameters Passed : None // Returns : None // Purpose : Start of the software // Description : // Assumptions : // Dependencies : // Author : Deepak B. // Created : 05.09.06 // Revisions : //===================================================================== //'note: //'this is first starting point of software //'this is a function which called first. //'do some software initialisation step here. //'like checking for user, checking for dependencies etc. frmSplash objfrmSplashScreen = new frmSplash(); frmAASInitialisation objfrmAASInitialisation; bool blnResetCmd = false; string strPath; clsTimer objTimeDelay = new clsTimer(null, 5000); bool blnIsUpgradeSessionID; try { //---Initialize error handler subErrorHandlerInitialization(gobjErrorHandler); //'Added by pankaj on 29 Jan 08 INI_SETTINGS_PATH = Application.StartupPath + "\\AAS.ini"; //---Initialize database settings if (funcInitializeAppDatabaseSettings() == true) { //---read configuration settings if (!gobjHardwareLock.gfuncGetConfigurationSetting()) { //display msg -error in configuration settings initialization gobjMessageAdapter.ShowMessage(constConfigurationError); Application.DoEvents(); //'allow application to perfrom its panding work. System.Environment.Exit(0); } } else { //---display msg -error in database initialization gobjMessageAdapter.ShowMessage("AAS ini Error", "Error", MessageHandler.clsMessageHandler.enumMessageType.ErrorMessage); Application.DoEvents(); System.Environment.Exit(0); } //'--------- //---Display Splash screen objfrmSplashScreen.Show(); //'put a delay of 3000 for splash screen. //Call objTimeDelay.subTime_Delay(2000) Application.DoEvents(); //'now allow application to perfrom its panding work ////----- Added by Sachin Dokhale //objTimeDelay = Nothing ////----- //'--- Check for the previous instance of the application if (PrevInstance()) { //'this function will find that ,is there any other instance of software is running //'or not.If running then prompt a message. gobjMessageAdapter.ShowMessage("Application Busy", "One instance of the application is already running" + vbCrLf + "Please close the previous instance", EnumMessageType.Information); System.Environment.Exit(0); } objTimeDelay.subTime_Delay(2000); objTimeDelay = null; Application.DoEvents(); //--------------- //INI_SETTINGS_PATH = Application.StartupPath & "\AAS.ini" //'---Initialize database settings //If funcInitializeAppDatabaseSettings() = True Then // '---read configuration settings // If Not gobjHardwareLock.gfuncGetConfigurationSetting() Then // 'display msg -error in configuration settings initialization // Call gobjMessageAdapter.ShowMessage(constConfigurationError) // Call Application.DoEvents() // ''allow application to perfrom its panding work. // End // End If //Else // '---display msg -error in database initialization // Call gobjMessageAdapter.ShowMessage("AAS ini Error", "Error", MessageHandler.clsMessageHandler.enumMessageType.ErrorMessage) // Call Application.DoEvents() // End //End If //--------- //--path of AAS.ini file //INI_SETTINGS_PATH = Application.StartupPath & "\AAS.ini" //---Initialize database settings //If funcInitializeAppDatabaseSettings() = True Then // '---read configuration settings // If Not gobjHardwareLock.gfuncGetConfigurationSetting() Then // 'display msg -error in configuration settings initialization // Call gobjMessageAdapter.ShowMessage(constConfigurationError) // Call Application.DoEvents() // ''allow application to perfrom its panding work. // End // End If //Else // '---display msg -error in database initialization // Call gobjMessageAdapter.ShowMessage("AAS ini Error", "Error", MessageHandler.clsMessageHandler.enumMessageType.ErrorMessage) // Call Application.DoEvents() // End //End If //---read hardware lock settings if (gobjHardwareLock.gfuncReadHardwareLockSetting() == false) { if (!IsNothing(objfrmSplashScreen)) { objfrmSplashScreen.Close(); objfrmSplashScreen.Dispose(); objfrmSplashScreen = null; } gobjMessageAdapter.ShowMessage("Hardware Lock Error", "Error", MessageHandler.clsMessageHandler.enumMessageType.ErrorMessage); //'prompt a error message if hardware lock failed. System.Environment.Exit(0); } //==========*********Modified by Saurabh**********========= if (gstructSettings.AppMode == EnumAppMode.DemoMode) { //--- To Get A New session ID and write it back to INI file. funcGetSessionID(); //--- To Create Service LogBook Database Connection. gfuncCreateLogBookConnection(); //--- To Create Userinfo Database Connection. gfuncCreateUserInfoConnection(); //---Insert new row with new sessionsID and //---insert current Date , time and day funcInsertLogData(gstructUserDetails.SessionID); } else { //--- To Get A New session ID and write it back to INI file. funcGetSessionID(); gfuncCreateLogBookConnection(); gfuncCreateUserInfoConnection(); gSetInstrumentStartTime = System.DateTime.Now; gSetWStartTime = System.DateTime.Now; gSetD2StartTime = System.DateTime.Now; } //========================================================= //--close and dispose splash screen if (!IsNothing(objfrmSplashScreen)) { objfrmSplashScreen.Close(); Application.DoEvents(); objfrmSplashScreen.Dispose(); objfrmSplashScreen = null; } //Saurabh 31.07.07 to Check for Hydride Mode //---if application is already in hydride mode then display message box. if (gstructSettings.HydrideMode == 1) { gobjMessageAdapter.ShowMessage("HYDRIDE MODE", "CONFIGURATION", MessageHandler.clsMessageHandler.enumMessageType.InformativeMessage); Application.DoEvents(); } //Saurabh 31.07.07 to Check for Hydride Mode if (gstructSettings.Enable21CFR == true) { //'check for 21 CFR frmLogin objfrmLogin = new frmLogin(); if (objfrmLogin.ShowDialog() == DialogResult.OK) { Application.DoEvents(); //If objfrmLogin.DialogResult = DialogResult.OK Then if (!objfrmLogin.LoginSuccessfull) { return; } } else { System.Environment.Exit(0); } Application.DoEvents(); } //'get a application path string strConfigPath; strConfigPath = Application.ExecutablePath; strConfigPath = Right(strConfigPath, Len("AAS_Service.exe")); //---check which executable file to run if (UCase(strConfigPath) == UCase("AAS_Service.exe")) { //'for normal application gstructSettings.EnableServiceUtility = true; gstructSettings.ExeToRun = EnumApplicationMode.ServiceUtility; } else { //'for service utility gstructSettings.EnableServiceUtility = false; gstructSettings.ExeToRun = EnumApplicationMode.AAS; } //---Initialize all global Variable here gobjCommProtocol = new clsCommProtocolFunctions(); gobjfrmStatus = new frmStatus(); //--- Get the global variables from AAS.ini file gFuncLoadGlobals(); //---Initialize gobjinst object if (funcInitInstrumentSettings() == true) { if (gstructSettings.AppMode == EnumAppMode.DemoMode | gstructSettings.AppMode == EnumAppMode.DemoMode_201 | gstructSettings.AppMode == EnumAppMode.DemoMode_203D) { //---if demo mode then load gobjinst object from serialized file funcLoadInstStatus(); } } string strAANameVersion; bool blnFlag; if (gstructSettings.ExeToRun == EnumApplicationMode.ServiceUtility) { //blnFlag = gobjCommProtocol.funcInitInstrument() blnFlag = true; } else { if (gstructSettings.AppMode == EnumAppMode.FullVersion_203 | gstructSettings.AppMode == EnumAppMode.FullVersion_203D | gstructSettings.AppMode == EnumAppMode.FullVersion_201) { //'check for the real mode of application //If Not gstructSettings.EnableServiceUtility Then 'ToChange objfrmAASInitialisation = new frmAASInitialisation(); //'show the initialization form and start the initialization here objfrmAASInitialisation.Show(); if (objfrmAASInitialisation.funcInstrumentInitialization()) { //'start the initialization //objfrmAASInitialisation.Close() //objfrmAASInitialisation.Dispose() } else { objfrmAASInitialisation.Close(); objfrmAASInitialisation.Dispose(); System.Environment.Exit(0); return; } //Else //End If } } Application.DoEvents(); //---Load the Methods from serialized file. if (!funcLoadMethods()) { //---display Msg -error in loading methods //---commented on 10.04.09 for ver 4.85 //Call gobjMessageAdapter.ShowMessage("Error in loading method settings file.", "Error", MessageHandler.clsMessageHandler.enumMessageType.ErrorMessage) //Call Application.DoEvents() //---------------- //End } //---commented on 19.06.07 //'check for the demo mode of application. if (gstructSettings.AppMode == EnumAppMode.DemoMode) { gintInstrumentBeamType = AAS203Library.Instrument.enumInstrumentBeamType.SingleBeam; } else if (gstructSettings.AppMode == EnumAppMode.DemoMode_203D) { gintInstrumentBeamType = AAS203Library.Instrument.enumInstrumentBeamType.DoubleBeam; } else if (gstructSettings.AppMode == EnumAppMode.DemoMode_201) { } //Saurabh 28.07.07 To set Instrument title //'set the instrument title as par application mode. //--4.85 14.04.09 if (gstructSettings.NewModelName == false) { if (gstructSettings.AppMode == EnumAppMode.FullVersion_203) { gstrTitleInstrumentType = CONST_AA203_FullVersion; } else if (gstructSettings.AppMode == EnumAppMode.FullVersion_203D) { gstrTitleInstrumentType = CONST_AA203D_FullVersion; } else if (gstructSettings.AppMode == EnumAppMode.FullVersion_201) { gstrTitleInstrumentType = CONST_AA201_FullVersion; } else if (gstructSettings.AppMode == EnumAppMode.DemoMode) { gstrTitleInstrumentType = CONST_AA203_DemoVersion; } else if (gstructSettings.AppMode == EnumAppMode.DemoMode_203D) { gstrTitleInstrumentType = CONST_AA203D_DemoVersion; } else if (gstructSettings.AppMode == EnumAppMode.DemoMode_201) { gstrTitleInstrumentType = CONST_AA201_DemoVersion; } else { gstrTitleInstrumentType = CONST_AA203; } } else { if (gstructSettings.AppMode == EnumAppMode.FullVersion_203) { gstrTitleInstrumentType = CONST_AA303_FullVersion; } else if (gstructSettings.AppMode == EnumAppMode.FullVersion_203D) { gstrTitleInstrumentType = CONST_AA303D_FullVersion; } else if (gstructSettings.AppMode == EnumAppMode.FullVersion_201) { gstrTitleInstrumentType = CONST_AA301_FullVersion; } else if (gstructSettings.AppMode == EnumAppMode.DemoMode) { gstrTitleInstrumentType = CONST_AA303_DemoVersion; } else if (gstructSettings.AppMode == EnumAppMode.DemoMode_203D) { gstrTitleInstrumentType = CONST_AA303D_DemoVersion; } else if (gstructSettings.AppMode == EnumAppMode.DemoMode_201) { gstrTitleInstrumentType = CONST_AA301_DemoVersion; } else { gstrTitleInstrumentType = CONST_AA303_FullVersion; } } //--4.85 14.04.09 //Saurabh 28.07.07 To set Instrument title if (gstructSettings.EnableServiceUtility) { //'this will check which EXE to be run. either main exe or service exe. gobjMainService = new frmMDIMainService(); Application.Run(gobjMainService); } else { gobjMain = new frmMDIMain(); if (!objfrmAASInitialisation == null) { objfrmAASInitialisation.Close(); objfrmAASInitialisation.Dispose(); } Application.DoEvents(); Application.Run(gobjMain); } funcExitApplicationSettings(); //'fir deinitialise the application setting //'It Exit Application parameters gIntMethodID = 0; //---added by deepak on 19.07.07 to reset the instrument ////----- Modified by Sachin Dokhale if (gobjCommProtocol.mobjCommdll.gFuncIsPortOpen()) { ////----- gobjCommProtocol.funcResetInstrument(); //'serial communication function to Reset the Instrument } System.Environment.Exit(0); } catch (Exception ex) { //--------------------------------------------------------- //Error Handling and logging gobjErrorHandler.ErrorDescription = ex.Message; gobjErrorHandler.ErrorMessage = ex.Message; gobjErrorHandler.WriteErrorLog(ex); //--------------------------------------------------------- } finally { //--------------------------------------------------------- //Writing Execution log if (CONST_CREATE_EXECUTION_LOG == 1) { gobjErrorHandler.WriteExecutionLog(); } Application.DoEvents(); //--------------------------------------------------------- } }
public static void Export(IEnumerable <PeoplesBussines> list, IWin32Window owner) { try { var sfd = new SaveFileDialog() { Filter = "Excel Files|*.xls" }; if (sfd.ShowDialog(owner) != DialogResult.OK) { return; } var excel = new Microsoft.Office.Interop.Excel.Application(); var wb = excel.Workbooks.Add(XlSheetType.xlWorksheet); var ws = (Worksheet)excel.ActiveSheet; excel.Visible = false; var index = 1; var frm = new frmSplash(list.ToList().Count); frm.Show(owner); //Add column ws.Cells[1, 1] = "کد شخص"; ws.Cells[1, 2] = "عنوان"; ws.Cells[1, 3] = "کدملی"; ws.Cells[1, 4] = "ش شناسنامه"; ws.Cells[1, 5] = "نام پدر"; ws.Cells[1, 6] = "محل تولد"; ws.Cells[1, 7] = "تاریخ تولد"; ws.Cells[1, 8] = "آدرس"; ws.Cells[1, 9] = "کدپستی"; ws.Cells[1, 10] = "مانده اول دوره"; ws.Cells[1, 11] = "مانده فعلی"; ws.Cells[1, 12] = "وضعیت حساب"; foreach (var item in list) { index++; frm.Level = index; ws.Cells[index, 1] = item.Code; ws.Cells[index, 2] = item.Name; ws.Cells[index, 3] = item.NationalCode; ws.Cells[index, 4] = item.IdCode; ws.Cells[index, 5] = item.FatherName; ws.Cells[index, 6] = item.PlaceBirth; ws.Cells[index, 7] = item.DateBirth; ws.Cells[index, 8] = item.Address; ws.Cells[index, 9] = item.PostalCode; ws.Cells[index, 10] = item.AccountFirst.ToString("N0"); ws.Cells[index, 11] = item.Account_.ToString("N0"); if (item.Account == 0) { ws.Cells[index, 12] = "بی حساب"; } if (item.Account > 0) { ws.Cells[index, 12] = "بدهکار"; } if (item.Account < 0) { ws.Cells[index, 12] = "بستانکار"; } } ws.SaveAs(sfd.FileName, XlFileFormat.xlWorkbookDefault, Type.Missing, Type.Missing, true, false, XlSaveAsAccessMode.xlNoChange, XlSaveConflictResolution.xlLocalSessionChanges, Type.Missing, Type.Missing); excel.Quit(); frm.Close(); } catch (Exception ex) { WebErrorLog.ErrorInstence.StartErrorLog(ex); } }
private async void btnFinish_Click(object sender, EventArgs e) { try { var ret = await Utilities.PingHostAsync(); if (ret.HasError) { frmNotification.PublicInfo.ShowMessage(ret.ErrorMessage); return; } if (lbxNumbers.Items.Count <= 0) { frmNotification.PublicInfo.ShowMessage("هیچ شماره ای جهت ارسال، وارد نشده است"); txtNumber.Focus(); return; } if (string.IsNullOrWhiteSpace(txtMessage.Text)) { frmNotification.PublicInfo.ShowMessage("متن پیام ارسالی نمی تواند خالی باشد"); txtMessage.Focus(); return; } var list = new List <string>(); foreach (var item in lbxNumbers.Items) { list.Add(item.ToString()); } var panel = SmsPanelsBussines.Get((Guid)cmbPanel.SelectedValue); if (panel == null) { return; } var sApi = new Sms.Api(panel.API.Trim()); var index = 0; var frm = new frmSplash(list.Count); frm.Show(this); var res = sApi.Send(panel.Sender, list, txtMessage.Text); if (res.Count <= 0) { return; } foreach (var result in res) { frm.Level = index; var smsLog = new SmsLogBussines() { Guid = Guid.NewGuid(), UserGuid = UserBussines.CurrentUser.Guid, Cost = result.Cost, Message = result.Message, MessageId = result.Messageid, Reciver = result.Receptor, Sender = result.Sender, StatusText = result.StatusText }; await smsLog.SaveAsync(); index++; } frmNotification.PublicInfo.ShowMessage("ارسال پیامک با موفقیت انجام شد"); Close(); } catch (Exception ex) { WebErrorLog.ErrorInstence.StartErrorLog(ex); } }
public void BuscaMailsDeComandos(int dias) { try { Cursor MyCursor = Cursors.WaitCursor; FindComand = false; Outlook.MailItem mail; //Ahí pongo cada Mail Outlook.NameSpace outlookNameSpace = this.Application.GetNamespace("MAPI"); Outlook.MAPIFolder inbox = outlookNameSpace.GetDefaultFolder(Microsoft.Office.Interop.Outlook.OlDefaultFolders.olFolderInbox); Outlook.Items items = inbox.Items.Restrict("[Unread]=true"); DateTime hacedias = DateTime.Today - new TimeSpan(dias, 0, 0, 0); //Fecha de hace "dias" días //Muestro el splash OutlookAddInEmprende.frmSplash theSplash = new frmSplash(); theSplash.Show(); theSplash.pbProgress.Step = 1; theSplash.pbProgress.Value = 1; theSplash.pbProgress.Maximum = items.Count; System.Windows.Forms.Application.DoEvents(); //Obtengo la dirección de Email del buzón de comandos Properties.Settings setting = new Properties.Settings(); //Creo variable para acceder a Settings y leer EmailAdmiin string EmailDir = setting["Email_Admin"].ToString(); ////Reviso los Unread de la carpeta MailEmprende, y los analizo foreach (Object m in items) { theSplash.pbProgress.PerformStep(); if ((mail = m as Outlook.MailItem) != null) //si el item es un mail { if (mail.MessageClass == "IPM.Note" && mail.SenderEmailAddress.ToUpper().Contains(EmailDir.ToUpper()) && mail.ReceivedTime > hacedias) { FindComand = true; AnalizaMail(mail); mail.UnRead = false; mail.Move(inbox.Folders["MailEmprende"]); } } } if (FindComand) //Si encontré algo { /* Fue comentada porque ya no tiene sentido al hacerse más robusta la rutina precedente * //09-04-2014 //Muevo los mails encontrados repito la rutina para que no quede nada foreach (Object m in items) { if ((mail = m as Outlook.MailItem) != null) //si el item es un mail { if (mail.MessageClass == "IPM.Note" && mail.SenderEmailAddress.ToUpper().Contains(EmailDir.ToUpper()) && mail.ReceivedTime > hacedias) { mail.Move(inbox.Folders["MailEmprende"]); } } }*/ //Pongo cartel de resultados MessageBox.Show(Problemas, "¡Resultados!", MessageBoxButtons.OK); Problemas = "Ejecución satisfactoria " + "\n" + "de comandos MailEmprende " + "\n" + "recibidos de la Web."; //Limpio la varible que guardaba los mensajes de error. } MyCursor = Cursors.Default; theSplash.Close(); //Cierro el splash } catch (Exception ex) { Cursor MyCursor = Cursors.Default; MessageBox.Show(ex.Message + " Se intentaba revisar los mensajes recibidos", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
static void Main(string[] args) { //SetProcessDPIAware(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); //exception handler Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); //get app settings var appSettings = new ApplicationSettings(); appSettings = appSettings.GetOrCreateApplicationSettings(); //if the exe was passed a filename argument then run the script if (args.Length > 0) { string configPath = args[0]; if (!File.Exists(configPath)) { using (EventLog eventLog = new EventLog("Application")) { eventLog.Source = "Application"; eventLog.WriteEntry($"An attempt was made to run an OpenBots project from '{new DirectoryInfo(configPath).Parent}'" + "but the 'project.obconfig' file was not found. Please verify that the file exists at the path indicated.", EventLogEntryType.Error, 101, 1); } Application.Exit(); return; } //initialize Logger string engineLoggerFilePath = Path.Combine(Folders.GetFolder(FolderType.LogFolder), "OpenBots Engine Logs.txt"); Logger engineLogger = new Logging().CreateFileLogger(engineLoggerFilePath, Serilog.RollingInterval.Day); ProjectType projectType = Project.OpenProject(configPath).ProjectType; switch (projectType) { case ProjectType.OpenBots: Application.Run(new frmScriptEngine(configPath, engineLogger)); break; case ProjectType.Python: case ProjectType.TagUI: case ProjectType.CSScript: ExecutionManager.RunTextEditorProject(configPath); break; } } else if (appSettings.ClientSettings.StartupMode == "Builder Mode") { SplashForm = new frmSplash(); SplashForm.Show(); Application.DoEvents(); Application.Run(new frmScriptBuilder()); } else { SplashForm = new frmSplash(); SplashForm.Show(); Application.DoEvents(); Application.Run(new frmAttendedMode()); } }