ningshuxia
2025-03-24 7b8ae93d47186c442ff890a1a83d108f115924c7
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 @@
             
        }
    }
}