Beispiel #1
0
        /// <summary>
        /// Método para borrar todos los datos de todas las tablas de la base de Datos
        /// </summary>
        public Boolean restartDataBase(BackgroundWorker worker)
        {
            Boolean result = true;
            Sequences sec = new Sequences();
            CommandDatos cmd = new CommandDatos();
            CategoryDatos cat = new CategoryDatos();

            try
            {
                worker.ReportProgress(4);
                result = result && cmd.DeleteAll();

                worker.ReportProgress(6);
                result = result && cat.DeleteAll();

                worker.ReportProgress(10);
                result = result && sec.restartBothSequences();
            }
            catch (Exception ex)
            {
                result = false;
                this.modLog.Error(ex);
            }

            return result;
        }
Beispiel #2
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;
        }