From db26311246d1c1cecadf4a22dc44ffa570ee40f2 Mon Sep 17 00:00:00 2001
From: lixiaojun <1287241240@qq.com>
Date: 星期二, 07 一月 2025 11:35:55 +0800
Subject: [PATCH] 批量修改数据同步修改

---
 WinFrmUI/Yw.WinFrmUI.Hydro.Core/14-matching/00-core/HydroMatchingHelper.cs |  417 +++++++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 391 insertions(+), 26 deletions(-)

diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/14-matching/00-core/HydroMatchingHelper.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/14-matching/00-core/HydroMatchingHelper.cs
index b83614e..dea626a 100644
--- a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/14-matching/00-core/HydroMatchingHelper.cs
+++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/14-matching/00-core/HydroMatchingHelper.cs
@@ -2,6 +2,7 @@
 using System.Windows.Media.Imaging;
 using Yw.DAL.Basic;
 using Yw.EPAnet;
+using Yw.Hydro;
 using Yw.Model;
 
 namespace Yw.WinFrmUI
@@ -66,6 +67,12 @@
             #region 娑堢伀鏍�
 
             vm.Hydrants = hydroInfo.Hydrants?.Select(x => Create(x, hydroInfo)).ToList();
+
+            #endregion
+
+            #region 鍐峰嵈濉�
+
+            vm.Coolings = hydroInfo.Coolings?.Select(x => Create(x, hydroInfo)).ToList();
 
             #endregion
 
@@ -346,6 +353,38 @@
                 return default;
             }
             return new HydroHydrantMatchingViewModel(visualViewModel);
+        }
+
+        #endregion
+
+        #region 鍐峰嵈濉�
+
+        /// <summary>
+        /// 鍒涘缓鍐峰嵈濉旇嚜鍔ㄥ尮閰峍iewModel
+        /// </summary>
+        public static HydroCoolingMatchingViewModel Create(HydroCoolingInfo visualInfo, HydroModelInfo hydroInfo)
+        {
+            if (visualInfo == null)
+            {
+                return default;
+            }
+            if (hydroInfo == null)
+            {
+                return default;
+            }
+            return new HydroCoolingMatchingViewModel(visualInfo, hydroInfo);
+        }
+
+        /// <summary>
+        /// 鍒涘缓鍐峰嵈濉旇嚜鍔ㄥ尮閰峍iewModel
+        /// </summary>
+        public static HydroCoolingMatchingViewModel Create(HydroCoolingViewModel visualViewModel)
+        {
+            if (visualViewModel == null)
+            {
+                return default;
+            }
+            return new HydroCoolingMatchingViewModel(visualViewModel);
         }
 
         #endregion
@@ -793,6 +832,25 @@
 
             #endregion
 
+            #region 娑堢伀鏍�
+
+            if (hydroInfo.Coolings != null && hydroInfo.Coolings.Count > 0)
+            {
+                if (matchingInfo.Coolings != null && matchingInfo.Coolings.Count > 0)
+                {
+                    hydroInfo.Coolings.ForEach(x =>
+                    {
+                        var matching = matchingInfo.Coolings.Find(t => t.Code == x.Code);
+                        if (Apply(hydroInfo, x, matching))
+                        {
+                            result = true;
+                        }
+                    });
+                }
+            }
+
+            #endregion
+
             #region 姘磋〃
 
             if (hydroInfo.Meters != null && hydroInfo.Meters.Count > 0)
@@ -888,6 +946,25 @@
 
             #endregion
 
+            #region 姘存车
+
+            if (hydroInfo.Pumps != null && hydroInfo.Pumps.Count > 0)
+            {
+                if (matchingInfo.Pumps != null && matchingInfo.Pumps.Count > 0)
+                {
+                    hydroInfo.Pumps.ForEach(x =>
+                    {
+                        var matching = matchingInfo.Pumps.Find(t => t.Code == x.Code);
+                        if (Apply(hydroInfo, x, matching))
+                        {
+                            result = true;
+                        }
+                    });
+                }
+            }
+
+            #endregion
+
             #region 闃�闂�
 
             if (hydroInfo.Valves != null && hydroInfo.Valves.Count > 0)
@@ -953,7 +1030,30 @@
         /// <summary>
         /// 搴旂敤
         /// </summary>
-        public static bool Apply(Yw.Model.HydroModelInfo hydroInfo, Yw.Model.HydroTankInfo visual, HydroTankMatchingViewModel matching)
+        public static bool Apply
+            (
+                HydroTankViewModel visualViewModel,
+                HydroTankMatchingViewModel matching,
+                HydroPropStatusHelper propStatusHelper = null,
+                HydroChangeHelper changeHelper = null
+            )
+        {
+            var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching, propStatusHelper, changeHelper);
+            visualViewModel.UpdateProperty();
+            return bol;
+        }
+
+        /// <summary>
+        /// 搴旂敤
+        /// </summary>
+        public static bool Apply
+            (
+                Yw.Model.HydroModelInfo hydroInfo,
+                Yw.Model.HydroTankInfo visual,
+                HydroTankMatchingViewModel matching,
+                HydroPropStatusHelper propStatusHelper = null,
+                HydroChangeHelper changeHelper = null
+            )
         {
             if (hydroInfo == null)
             {
@@ -967,51 +1067,65 @@
             {
                 return false;
             }
-            visual.Name = matching.Name;
-            visual.DbLocked = matching.DbLocked;
-            visual.DbId = matching.DbId;
-            visual.ModelType = matching.ModelType;
-            visual.MinLevel = matching.MinLevel;
-            visual.MaxLevel = matching.MaxLevel;
-            visual.DN = matching.DN;
-            visual.MinVol = matching.MinVol;
-            visual.OverFlow = matching.OverFlow;
+            //visual.Name = matching.Name;
+            //visual.DbLocked = matching.DbLocked;
+            //visual.DbId = matching.DbId;
+            //visual.ModelType = matching.ModelType;
+            //visual.MinLevel = matching.MinLevel;
+            //visual.MaxLevel = matching.MaxLevel;
+            //visual.DN = matching.DN;
+            //visual.MinVol = matching.MinVol;
+            //visual.OverFlow = matching.OverFlow;
 
             bool result = false;
             if (!visual.DbLocked)
             {
                 if (!string.IsNullOrEmpty(matching.MatchingModelType))
                 {
+                    propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.ModelType), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇");
+                    changeHelper?.Append(visual, eChangeType.Update);
                     visual.ModelType = matching.MatchingModelType;
                     result = true;
                 }
                 if (!string.IsNullOrEmpty(matching.MatchingDbId))
                 {
+                    propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.DbId), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇");
+                    changeHelper?.Append(visual, eChangeType.Update);
                     visual.DbId = matching.MatchingDbId;
                     result = true;
                 }
                 if (matching.MatchingMinLevel.HasValue)
                 {
+                    propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.MinLevel), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇");
+                    changeHelper?.Append(visual, eChangeType.Update);
                     visual.MinLevel = matching.MatchingMinLevel.Value;
                     result = true;
                 }
                 if (matching.MatchingMaxLevel.HasValue)
                 {
+                    propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.MaxLevel), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇");
+                    changeHelper?.Append(visual, eChangeType.Update);
                     visual.MaxLevel = matching.MatchingMaxLevel.Value;
                     result = true;
                 }
                 if (matching.MatchingDN.HasValue)
                 {
+                    propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.DN), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇");
+                    changeHelper?.Append(visual, eChangeType.Update);
                     visual.DN = matching.MatchingDN.Value;
                     result = true;
                 }
                 if (matching.MatchingMinVol.HasValue)
                 {
+                    propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.MinVol), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇");
+                    changeHelper?.Append(visual, eChangeType.Update);
                     visual.MinVol = matching.MatchingMinVol.Value;
                     result = true;
                 }
                 if (matching.MatchingOverFlow.HasValue)
                 {
+                    propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.OverFlow), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇");
+                    changeHelper?.Append(visual, eChangeType.Update);
                     visual.OverFlow = matching.MatchingOverFlow.Value;
                     result = true;
                 }
@@ -1027,7 +1141,7 @@
                         curvevol.ModelType = string.Empty;
                         curvevol.DbLocked = false;
                         curvevol.DbId = matching.MatchingCurveDbId;
-                        curvevol.CurveType = Yw.WinFrmUI.HydroCurve.TankVol;
+                        curvevol.CurveType = Yw.WinFrmUI.HydroCurveType.CurveVol;
                         curvevol.CurveData = matching.MatchingVolCurve?.Select(x => new Yw.Model.Hydro.CurvePoint(x.X, x.Y)).ToList();
                         if (hydroInfo.Curves == null)
                         {
@@ -1035,6 +1149,7 @@
                         }
                         hydroInfo.Curves.Add(curvevol);
                         visual.VolCurve = curvevol.Code;
+                        changeHelper?.Append(curvevol, eChangeType.Add);
                         result = true;
                     }
                     else
@@ -1043,7 +1158,22 @@
                         {
                             curvevol.DbId = matching.MatchingCurveDbId;
                             curvevol.CurveData = matching.MatchingVolCurve?.Select(x => new Yw.Model.Hydro.CurvePoint(x.X, x.Y)).ToList();
+                            changeHelper?.Append(curvevol, eChangeType.Update);
                             result = true;
+                        }
+                    }
+                    propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.VolCurve), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}閫氳繃浜у搧閰嶇疆鍖归厤淇");
+                }
+                else
+                {
+                    if (!string.IsNullOrEmpty(visual.VolCurve))
+                    {
+                        var volCurve = hydroInfo?.Curves?.Find(x => x.Code == visual.VolCurve);
+                        if (volCurve != null)
+                        {
+                            hydroInfo.Curves?.RemoveAll(x => x.Code == visual.VolCurve);
+                            visual.VolCurve = string.Empty;
+                            changeHelper?.Append(volCurve, eChangeType.Remove);
                         }
                     }
                 }
@@ -1054,6 +1184,16 @@
         #endregion
 
         #region 闂峰ご
+
+        /// <summary>
+        /// 搴旂敤
+        /// </summary>
+        public static bool Apply(HydroBluntheadViewModel visualViewModel, HydroBluntheadMatchingViewModel matching)
+        {
+            var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching);
+            visualViewModel.UpdateProperty();
+            return bol;
+        }
 
         /// <summary>
         /// 搴旂敤
@@ -1072,13 +1212,13 @@
             {
                 return false;
             }
-            visual.Name = matching.Name;
-            visual.DbLocked = matching.DbLocked;
-            visual.DbId = matching.DbId;
-            visual.ModelType = matching.ModelType;
-            visual.Caliber = matching.Caliber;
-            visual.Material = matching.Material;
-            visual.MinorLoss = matching.MinorLoss;
+            //visual.Name = matching.Name;
+            //visual.DbLocked = matching.DbLocked;
+            //visual.DbId = matching.DbId;
+            //visual.ModelType = matching.ModelType;
+            //visual.Caliber = matching.Caliber;
+            //visual.Material = matching.Material;
+            //visual.MinorLoss = matching.MinorLoss;
 
             bool result = false;
             if (!visual.DbLocked)
@@ -1115,6 +1255,16 @@
         #endregion
 
         #region 寮ご
+
+        /// <summary>
+        /// 搴旂敤
+        /// </summary>
+        public static bool Apply(HydroElbowViewModel visualViewModel, HydroElbowMatchingViewModel matching)
+        {
+            var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching);
+            visualViewModel.UpdateProperty();
+            return bol;
+        }
 
         /// <summary>
         /// 搴旂敤
@@ -1195,6 +1345,16 @@
         /// <summary>
         /// 搴旂敤
         /// </summary>
+        public static bool Apply(HydroThreelinkViewModel visualViewModel, HydroThreelinkMatchingViewModel matching)
+        {
+            var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching);
+            visualViewModel.UpdateProperty();
+            return bol;
+        }
+
+        /// <summary>
+        /// 搴旂敤
+        /// </summary>
         public static bool Apply(Yw.Model.HydroModelInfo hydroInfo, Yw.Model.HydroThreelinkInfo visual, HydroThreelinkMatchingViewModel matching)
         {
             if (hydroInfo == null)
@@ -1268,6 +1428,16 @@
         /// <summary>
         /// 搴旂敤
         /// </summary>
+        public static bool Apply(HydroFourlinkViewModel visualViewModel, HydroFourlinkMatchingViewModel matching)
+        {
+            var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching);
+            visualViewModel.UpdateProperty();
+            return bol;
+        }
+
+        /// <summary>
+        /// 搴旂敤
+        /// </summary>
         public static bool Apply(Yw.Model.HydroModelInfo hydroInfo, Yw.Model.HydroFourlinkInfo visual, HydroFourlinkMatchingViewModel matching)
         {
             if (hydroInfo == null)
@@ -1325,6 +1495,16 @@
         #endregion
 
         #region 鍠峰ご
+
+        /// <summary>
+        /// 搴旂敤
+        /// </summary>
+        public static bool Apply(HydroNozzleViewModel visualViewModel, HydroNozzleMatchingViewModel matching)
+        {
+            var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching);
+            visualViewModel.UpdateProperty();
+            return bol;
+        }
 
         /// <summary>
         /// 搴旂敤
@@ -1396,6 +1576,16 @@
         /// <summary>
         /// 搴旂敤
         /// </summary>
+        public static bool Apply(HydroHydrantViewModel visualViewModel, HydroHydrantMatchingViewModel matching)
+        {
+            var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching);
+            visualViewModel.UpdateProperty();
+            return bol;
+        }
+
+        /// <summary>
+        /// 搴旂敤
+        /// </summary>
         public static bool Apply(Yw.Model.HydroModelInfo hydroInfo, Yw.Model.HydroHydrantInfo visual, HydroHydrantMatchingViewModel matching)
         {
             if (hydroInfo == null)
@@ -1458,7 +1648,100 @@
 
         #endregion
 
+        #region 鍐峰嵈濉�
+
+        /// <summary>
+        /// 搴旂敤
+        /// </summary>
+        public static bool Apply(HydroCoolingViewModel visualViewModel, HydroCoolingMatchingViewModel matching)
+        {
+            var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching);
+            visualViewModel.UpdateProperty();
+            return bol;
+        }
+
+        /// <summary>
+        /// 搴旂敤
+        /// </summary>
+        public static bool Apply(Yw.Model.HydroModelInfo hydroInfo, Yw.Model.HydroCoolingInfo visual, HydroCoolingMatchingViewModel matching)
+        {
+            if (hydroInfo == null)
+            {
+                return false;
+            }
+            if (visual == null)
+            {
+                return false;
+            }
+            if (matching == null)
+            {
+                return false;
+            }
+            visual.Name = matching.Name;
+            visual.DbLocked = matching.DbLocked;
+            visual.DbId = matching.DbId;
+            visual.ModelType = matching.ModelType;
+            visual.Material = matching.Material;
+            visual.Caliber = matching.Caliber;
+            visual.MinorLoss = matching.MinorLoss;
+            visual.Coefficient = matching.Coefficient;
+            visual.LowerLimit = matching.LowerLimit;
+
+            bool result = false;
+            if (!visual.DbLocked)
+            {
+                if (!string.IsNullOrEmpty(matching.MatchingModelType))
+                {
+                    visual.ModelType = matching.MatchingModelType;
+                    result = true;
+                }
+                if (!string.IsNullOrEmpty(matching.MatchingDbId))
+                {
+                    visual.DbId = matching.MatchingDbId;
+                    result = true;
+                }
+                if (matching.MatchingCaliber.HasValue)
+                {
+                    visual.Caliber = matching.MatchingCaliber.Value;
+                    result = true;
+                }
+                if (!string.IsNullOrEmpty(matching.MatchingMaterial))
+                {
+                    visual.Material = matching.MatchingMaterial;
+                    result = true;
+                }
+                if (matching.MatchingMinorLoss.HasValue)
+                {
+                    visual.MinorLoss = matching.MatchingMinorLoss.Value;
+                    result = true;
+                }
+                if (matching.MatchingCoefficient.HasValue)
+                {
+                    visual.Coefficient = matching.MatchingCoefficient.Value;
+                    result = true;
+                }
+                if (matching.MatchingLowerLimit.HasValue)
+                {
+                    visual.LowerLimit = matching.MatchingLowerLimit.Value;
+                    result = true;
+                }
+            }
+            return result;
+        }
+
+        #endregion
+
         #region 姘磋〃
+
+        /// <summary>
+        /// 搴旂敤
+        /// </summary>
+        public static bool Apply(HydroMeterViewModel visualViewModel, HydroMeterMatchingViewModel matching)
+        {
+            var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching);
+            visualViewModel.UpdateProperty();
+            return bol;
+        }
 
         /// <summary>
         /// 搴旂敤
@@ -1512,6 +1795,16 @@
         /// <summary>
         /// 搴旂敤
         /// </summary>
+        public static bool Apply(HydroFlowmeterViewModel visualViewModel, HydroFlowmeterMatchingViewModel matching)
+        {
+            var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching);
+            visualViewModel.UpdateProperty();
+            return bol;
+        }
+
+        /// <summary>
+        /// 搴旂敤
+        /// </summary>
         public static bool Apply(Yw.Model.HydroModelInfo hydroInfo, Yw.Model.HydroFlowmeterInfo visual, HydroFlowmeterMatchingViewModel matching)
         {
             if (hydroInfo == null)
@@ -1561,6 +1854,16 @@
         /// <summary>
         /// 搴旂敤
         /// </summary>
+        public static bool Apply(HydroPressmeterViewModel visualViewModel, HydroPressmeterMatchingViewModel matching)
+        {
+            var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching);
+            visualViewModel.UpdateProperty();
+            return bol;
+        }
+
+        /// <summary>
+        /// 搴旂敤
+        /// </summary>
         public static bool Apply(Yw.Model.HydroModelInfo hydroInfo, Yw.Model.HydroPressmeterInfo visual, HydroPressmeterMatchingViewModel matching)
         {
             if (hydroInfo == null)
@@ -1606,6 +1909,16 @@
         #endregion
 
         #region 绠¢亾
+
+        /// <summary>
+        /// 搴旂敤
+        /// </summary>
+        public static bool Apply(HydroPipeViewModel visualViewModel, HydroPipeMatchingViewModel matching)
+        {
+            var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching);
+            visualViewModel.UpdateProperty();
+            return bol;
+        }
 
         /// <summary>
         /// 搴旂敤
@@ -1675,6 +1988,16 @@
         #endregion
 
         #region 杩囨浮浠�
+
+        /// <summary>
+        /// 搴旂敤
+        /// </summary>
+        public static bool Apply(HydroTranslationViewModel visualViewModel, HydroTranslationMatchingViewModel matching)
+        {
+            var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching);
+            visualViewModel.UpdateProperty();
+            return bol;
+        }
 
         /// <summary>
         /// 搴旂敤
@@ -1756,6 +2079,16 @@
         #endregion
 
         #region 姘存车
+
+        /// <summary>
+        /// 搴旂敤
+        /// </summary>
+        public static bool Apply(HydroPumpViewModel visualViewModel, HydroPumpMatchingViewModel matching)
+        {
+            var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching);
+            visualViewModel.UpdateProperty();
+            return bol;
+        }
 
         /// <summary>
         /// 搴旂敤
@@ -1843,7 +2176,7 @@
                         curveqh.ModelType = string.Empty;
                         curveqh.DbLocked = false;
                         curveqh.DbId = matching.MatchingCurveDbId;
-                        curveqh.CurveType = Yw.WinFrmUI.HydroCurve.PumpQH;
+                        curveqh.CurveType = Yw.WinFrmUI.HydroCurveType.CurveQH;
                         curveqh.CurveData = matching.MatchingCurveQH?.Select(x => new Yw.Model.Hydro.CurvePoint(x.X, x.Y)).ToList();
                         if (hydroInfo.Curves == null)
                         {
@@ -1874,7 +2207,7 @@
                         curveqp.ModelType = string.Empty;
                         curveqp.DbLocked = false;
                         curveqp.DbId = matching.MatchingCurveDbId;
-                        curveqp.CurveType = Yw.WinFrmUI.HydroCurve.PumpQP;
+                        curveqp.CurveType = Yw.WinFrmUI.HydroCurveType.CurveQP;
                         curveqp.CurveData = matching.MatchingCurveQP?.Select(x => new Yw.Model.Hydro.CurvePoint(x.X, x.Y)).ToList();
                         if (hydroInfo.Curves == null)
                         {
@@ -1905,7 +2238,7 @@
                         curveqe.ModelType = string.Empty;
                         curveqe.DbLocked = false;
                         curveqe.DbId = matching.MatchingCurveDbId;
-                        curveqe.CurveType = Yw.WinFrmUI.HydroCurve.PumpQE;
+                        curveqe.CurveType = Yw.WinFrmUI.HydroCurveType.CurveQE;
                         curveqe.CurveData = matching.MatchingCurveQE?.Select(x => new Yw.Model.Hydro.CurvePoint(x.X, x.Y)).ToList();
                         if (hydroInfo.Curves == null)
                         {
@@ -1933,6 +2266,16 @@
         #endregion
 
         #region 闃�闂�
+
+        /// <summary>
+        /// 搴旂敤
+        /// </summary>
+        public static bool Apply(HydroValveViewModel visualViewModel, HydroValveMatchingViewModel matching)
+        {
+            var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching);
+            visualViewModel.UpdateProperty();
+            return bol;
+        }
 
         /// <summary>
         /// 搴旂敤
@@ -2049,7 +2392,7 @@
                                     curveol.ModelType = visual.ModelType;
                                     curveol.DbLocked = false;
                                     curveol.DbId = matching.MatchingCurveDbId;
-                                    curveol.CurveType = Yw.WinFrmUI.HydroCurve.ValveOL;
+                                    curveol.CurveType = Yw.WinFrmUI.HydroCurveType.CurveOL;
                                     curveol.CurveData = matching.MatchingCurveOL?.Select(x => new Yw.Model.Hydro.CurvePoint(x.X, x.Y)).ToList();
                                     if (hydroInfo.Curves == null)
                                     {
@@ -2064,6 +2407,7 @@
                                     if (!curveol.DbLocked)
                                     {
                                         curveol.DbId = matching.MatchingCurveDbId;
+                                        curveol.CurveType = Yw.WinFrmUI.HydroCurveType.CurveOL;
                                         curveol.CurveData = matching.MatchingCurveOL?.Select(x => new Yw.Model.Hydro.CurvePoint(x.X, x.Y)).ToList();
                                         result = true;
                                     }
@@ -2075,7 +2419,7 @@
                         {
                             if (!string.IsNullOrEmpty(matching.MatchingCurveDbId))
                             {
-                                //闃�闂ㄥ紑搴︽崯澶辩郴鏁版洸绾�
+                                //姘村ご鎹熷け鏇茬嚎
                                 var curveql = hydroInfo.Curves?.Find(x => x.Code == visual.ValveSetting);
                                 if (curveql == null)
                                 {
@@ -2086,7 +2430,7 @@
                                     curveql.ModelType = visual.ModelType;
                                     curveql.DbLocked = false;
                                     curveql.DbId = matching.MatchingCurveDbId;
-                                    curveql.CurveType = Yw.WinFrmUI.HydroCurve.ValveOL;
+                                    curveql.CurveType = Yw.WinFrmUI.HydroCurveType.CurveQL;
                                     curveql.CurveData = matching.MatchingCurveQL?.Select(x => new Yw.Model.Hydro.CurvePoint(x.X, x.Y)).ToList();
                                     if (hydroInfo.Curves == null)
                                     {
@@ -2101,6 +2445,7 @@
                                     if (!curveql.DbLocked)
                                     {
                                         curveql.DbId = matching.MatchingCurveDbId;
+                                        curveql.CurveType = Yw.WinFrmUI.HydroCurveType.CurveQL;
                                         curveql.CurveData = matching.MatchingCurveQL?.Select(x => new Yw.Model.Hydro.CurvePoint(x.X, x.Y)).ToList();
                                         result = true;
                                     }
@@ -2121,6 +2466,16 @@
         #endregion
 
         #region 鎹㈢儹鍣�
+
+        /// <summary>
+        /// 搴旂敤
+        /// </summary>
+        public static bool Apply(HydroExchangerViewModel visualViewModel, HydroExchangerMatchingViewModel matching)
+        {
+            var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching);
+            visualViewModel.UpdateProperty();
+            return bol;
+        }
 
         /// <summary>
         /// 搴旂敤
@@ -2188,7 +2543,7 @@
                         curvevql.ModelType = string.Empty;
                         curvevql.DbLocked = false;
                         curvevql.DbId = matching.MatchingCurveDbId;
-                        curvevql.CurveType = Yw.WinFrmUI.HydroCurve.ExchangerQL;
+                        curvevql.CurveType = Yw.WinFrmUI.HydroCurveType.CurveQL;
                         curvevql.CurveData = matching.MatchingCurveQL?.Select(x => new Yw.Model.Hydro.CurvePoint(x.X, x.Y)).ToList();
                         if (hydroInfo.Curves == null)
                         {
@@ -2215,6 +2570,16 @@
         #endregion
 
         #region 绌哄帇鏈�
+
+        /// <summary>
+        /// 搴旂敤
+        /// </summary>
+        public static bool Apply(HydroCompressorViewModel visualViewModel, HydroCompressorMatchingViewModel matching)
+        {
+            var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching);
+            visualViewModel.UpdateProperty();
+            return bol;
+        }
 
         /// <summary>
         /// 搴旂敤
@@ -2282,7 +2647,7 @@
                         curvevql.ModelType = string.Empty;
                         curvevql.DbLocked = false;
                         curvevql.DbId = matching.MatchingCurveDbId;
-                        curvevql.CurveType = Yw.WinFrmUI.HydroCurve.CompressorQL;
+                        curvevql.CurveType = Yw.WinFrmUI.HydroCurveType.CurveQL;
                         curvevql.CurveData = matching.MatchingCurveQL?.Select(x => new Yw.Model.Hydro.CurvePoint(x.X, x.Y)).ToList();
                         if (hydroInfo.Curves == null)
                         {

--
Gitblit v1.9.3