Ejemplo n.º 1
0
        public static bool DatabaseExists()
        {
            if (File.Exists(SqliteDataAccess.LoadDatabaseName()))
            {
                Log.Write.Info("Database exists in precheck");
                DBFileExists = true;

                if (SqliteDataAccess.IsTableEmpty())
                {
                    Log.Write.Info("Database exists but is empty in precheck");
                    SqliteDataAccess.ClearTable();
                    return(false);
                }
                else
                {
                    PostLoadUpdateTask.Start();
                    return(true);
                }
            }
            else
            {
                DBFileExists = false;
                return(false);
            }
        }
Ejemplo n.º 2
0
        private static void DatabaseProcessing()
        {
            Log.Write.Info("Database update now pending");
            Stopwatch stopwatch = new Stopwatch();

            stopwatch.Start();

            Data.UpdatePending = true;
            SqliteDataAccess.ClearTable();
            SqliteDataAccess.BuildTable();

            WriteToDatabase();
            Data.UpdatePending = false;

            stopwatch.Stop();
            Log.Write.Info($"Database updated [Pending for {stopwatch.Elapsed.Seconds}.{stopwatch.Elapsed.Milliseconds} seconds]");
        }