Пример #1
0
        /// <summary>
        /// Método para borrar todos los datos de las tablas usuarios y comandos usados antes de cargar un nuevo fichero de logs a analizar de la base de Datos
        /// </summary>
        public Boolean clearDataBase(BackgroundWorker worker)
        {
            Boolean result = true;
            Sequences sec = new Sequences();
            UserDatos usr = new UserDatos();
            UsedCommandDatos used = new UsedCommandDatos();

            try
            {
                worker.ReportProgress(2);
                result = result && usr.DeleteAll();

                worker.ReportProgress(4);
                result = result && used.DeleteAll();

                worker.ReportProgress(6);
                result = result && sec.restartSequences();
            }
            catch (Exception ex)
            {
                result = false;
                this.modLog.Error(ex);
            }
            return result;
        }
Пример #2
0
        /// <summary>
        /// Método para dejar las tablas de la base de Datos totalmente limpias
        /// </summary>
        public Boolean clearAllDataBase(BackgroundWorker worker)
        {
            Boolean result = false;
            UserDatos usr = new UserDatos();
            CommandDatos cmd = new CommandDatos();
            CategoryDatos cat = new CategoryDatos();
            UsedCommandDatos used = new UsedCommandDatos();

            result = true;

            try
            {
                worker.ReportProgress(20, Constantes.getMessage("ReportProgress_BU"));
                result = result && usr.DeleteAll();

                worker.ReportProgress(40, Constantes.getMessage("ReportProgress_BCI"));
                result = result && cmd.DeleteAll();

                worker.ReportProgress(60, Constantes.getMessage("ReportProgress_BC"));
                result = result && cat.DeleteAll();

                worker.ReportProgress(80, Constantes.getMessage("ReportProgress_BL"));
                result = result && used.DeleteAll();
            }
            catch (Exception ex)
            {
                result = false;
                this.modLog.Error(ex);
            }
            return result;
        }