|
@@ -19,7 +19,7 @@ namespace UniformMaterialManagementSystem.Utils
|
|
private const string Password = "88384e6a-07e0-47e9-8214-4470a16e78da";
|
|
private const string Password = "88384e6a-07e0-47e9-8214-4470a16e78da";
|
|
private static readonly string SourcePath = $"{DataBasePath}\\UniformMaterialManagementSystem.db";
|
|
private static readonly string SourcePath = $"{DataBasePath}\\UniformMaterialManagementSystem.db";
|
|
|
|
|
|
- public static void ExportData()
|
|
|
|
|
|
+ public static async Task ExportData()
|
|
{
|
|
{
|
|
// 创建 SaveFileDialog 实例
|
|
// 创建 SaveFileDialog 实例
|
|
var saveFileDialog = new SaveFileDialog
|
|
var saveFileDialog = new SaveFileDialog
|
|
@@ -39,6 +39,17 @@ namespace UniformMaterialManagementSystem.Utils
|
|
targetPath = saveFileDialog.FileName;
|
|
targetPath = saveFileDialog.FileName;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // 手动合并数据库
|
|
|
|
+ await using var connection = new SqliteConnection($"Data Source={SourcePath}");
|
|
|
|
+ connection.Open();
|
|
|
|
+
|
|
|
|
+ await using (var command = connection.CreateCommand())
|
|
|
|
+ {
|
|
|
|
+ command.CommandText = "PRAGMA wal_checkpoint(FULL);";
|
|
|
|
+ command.ExecuteNonQuery();
|
|
|
|
+ }
|
|
|
|
+ connection.Close();
|
|
|
|
+
|
|
EncryptFile(SourcePath, targetPath);
|
|
EncryptFile(SourcePath, targetPath);
|
|
}
|
|
}
|
|
|
|
|