Procházet zdrojové kódy

修改导出返回值

宝臣 王 před 2 měsíci
rodič
revize
2e8a7a63ad

+ 3 - 3
UniformMaterialManagementSystem/Utils/DataBaseUtil.cs

@@ -19,7 +19,7 @@ namespace UniformMaterialManagementSystem.Utils
         private const string Password = "88384e6a-07e0-47e9-8214-4470a16e78da";
         private static readonly string SourcePath = $"{DataBasePath}\\UniformMaterialManagementSystem.db";
 
-        public static async Task<bool> ExportData()
+        public static string ExportData()
         {
             // 创建 SaveFileDialog 实例
             var saveFileDialog = new SaveFileDialog
@@ -33,14 +33,14 @@ namespace UniformMaterialManagementSystem.Utils
 
             // 显示对话框并检查用户是否选择了文件
             if (saveFileDialog.ShowDialog() == false)
-                return false;
+                return string.Empty;
 
             // 获取选中的文件路径
             var targetPath = saveFileDialog.FileName;
 
             EncryptFile(SourcePath, targetPath);
 
-            return true;
+            return targetPath;
         }
 
         public static async void ExportTable<T>(IEnumerable<T> sourceData, string tableName, bool isExecMigrate = false) where T : class?