From 7b8ae93d47186c442ff890a1a83d108f115924c7 Mon Sep 17 00:00:00 2001
From: ningshuxia <ningshuxia0927@outlook.com>
Date: 星期一, 24 三月 2025 17:25:14 +0800
Subject: [PATCH] 快速建模,模型编辑 差不多

---
 WinFrmUI/PBS.WinFrmUI.Hydro/02-quick-modeling/01-core/QuickModelingHelper.cs |   61 +++++++++++++++++++++++++-----
 1 files changed, 50 insertions(+), 11 deletions(-)

diff --git a/WinFrmUI/PBS.WinFrmUI.Hydro/02-quick-modeling/01-core/QuickModelingHelper.cs b/WinFrmUI/PBS.WinFrmUI.Hydro/02-quick-modeling/01-core/QuickModelingHelper.cs
index 4a4b9de..8fc049d 100644
--- a/WinFrmUI/PBS.WinFrmUI.Hydro/02-quick-modeling/01-core/QuickModelingHelper.cs
+++ b/WinFrmUI/PBS.WinFrmUI.Hydro/02-quick-modeling/01-core/QuickModelingHelper.cs
@@ -8,18 +8,57 @@
 
         /// <summary>
         /// 鍒涘缓
-        /// </summary>
-        /// <param name="vm">閫氱敤瑙嗗浘Model</param>
-        /// <param name="feedBackMsg">淇℃伅鍙嶉</param>
-        /// <param name="feedBackProgress">杩涘害鍙嶉</param>
-        /// <returns></returns>
+        /// </summary>  
         public static async Task<bool> Create(QuickModelingViewModel vm, Action<string, Color> feedBackMsg, Action<int, int> feedBackProgress)
         {
-            var msg = string.Empty;
-            if (vm == null)
-            {
-                return false;
-            }
+
+            //var place = vm.Place;
+            //var facility = vm.Facility;
+
+            //place.ID = await BLLFactory<BLL.Place>.Instance.Insert(place);
+            //if (place.ID < 1)
+            //{
+            //    TipFormHelper.ShowError("鏂板鍦烘墍澶辫触!");
+            //    return false;
+            //}
+            //facility.PlaceID = place.ID;
+            //facility.ID = await BLLFactory<BLL.Facility>.Instance.Insert(facility);
+            //if (facility.ID < 1)
+            //{
+            //    TipFormHelper.ShowError("鏂板璁炬柦澶辫触!");
+            //    return false;
+            //}
+
+            //facility = await BLLFactory<BLL.Facility>.Instance.GetByID(facility.ID);
+
+            //var tempInpFile = facility.ModelPath;
+            //var fullPath = Path.Combine(Directory.GetCurrentDirectory(), "Data\\Inp\\" + facility.ID + ".inp");
+            //File.Copy(tempInpFile, fullPath, true);
+            //var bgFile = _vm.TempBackgroundImageUrl;
+            //if (File.Exists(bgFile))
+            //{
+            //    File.Copy(bgFile, fullPath.Replace(".inp", ".png"), true);
+            //    File.Delete(bgFile);
+            //}
+            //if (File.Exists(tempInpFile))
+            //    File.Delete(tempInpFile);
+            //_template.filePath = fullPath;
+            //_template.BackGroundImg_FullPath = fullPath.Replace(".inp", ".png");
+
+            //facility.ModelInfo = Yw.JsonHelper.Object2Json(_template);
+            //facility.ModelPath = fullPath;
+
+            //if (!await BLLFactory<BLL.Facility>.Instance.Update(facility))
+            //{
+            //    TipFormHelper.ShowError("鏂板妯″瀷淇℃伅澶辫触!");
+            //    return false;
+            //}
+
+            //var msg = string.Empty;
+            //if (vm == null)
+            //{
+            //    return false;
+            //}
 
             //#region 绗竴姝� 澶嶅埗姘村姏淇℃伅
 
@@ -101,7 +140,7 @@
              
         }
 
-
+      
 
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3