From 278e94cb1b045288d1205f36b67f60cb5224754c Mon Sep 17 00:00:00 2001
From: lixiaojun <1287241240@qq.com>
Date: 星期三, 06 十一月 2024 11:50:19 +0800
Subject: [PATCH] 属性调整

---
 WinFrmUI/Yw.WinFrmUI.Hydro.Core/06-parter/12-flowmeter/HydroFlowmeterListCtrl.cs |   99 ++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 81 insertions(+), 18 deletions(-)

diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/06-parter/12-flowmeter/HydroFlowmeterListCtrl.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/06-parter/12-flowmeter/HydroFlowmeterListCtrl.cs
index 97973ee..aa1081d 100644
--- a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/06-parter/12-flowmeter/HydroFlowmeterListCtrl.cs
+++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/06-parter/12-flowmeter/HydroFlowmeterListCtrl.cs
@@ -86,6 +86,87 @@
             Search();
         }
 
+        /// <summary>
+        /// 鏇存柊灞炴��
+        /// </summary>
+        public void UpdateProperty()
+        {
+            if (_allList == null || _allList.Count < 1)
+            {
+                return;
+            }
+            _allList.ForEach(x => x.UpdateProperty());
+            this.hydroFlowmeterViewModelBindingSource.ResetBindings(false);
+        }
+
+        /// <summary>
+        /// 鏇存柊灞炴��
+        /// </summary>
+        public void UpdateProperty(Yw.Model.HydroParterInfo parter)
+        {
+            if (_allList == null || _allList.Count < 1)
+            {
+                return;
+            }
+            if (parter == null)
+            {
+                return;
+            }
+            var vm = _allList.Find(x => x.Code == parter.Code);
+            if (vm == null)
+            {
+                return;
+            }
+            vm.UpdateProperty();
+            this.hydroFlowmeterViewModelBindingSource.ResetBindings(false);
+        }
+
+        /// <summary>
+        /// 鏇存柊灞炴��
+        /// </summary>
+        public void UpdateProperty(List<Yw.Model.HydroParterInfo> parterList)
+        {
+            if (_allList == null || _allList.Count < 1)
+            {
+                return;
+            }
+            if (parterList == null || parterList.Count < 1)
+            {
+                return;
+            }
+            parterList.ForEach(x =>
+            {
+                var vm = _allList.Find(t => x.Code == x.Code);
+                if (vm != null)
+                {
+                    vm.UpdateProperty();
+                }
+            });
+            this.hydroFlowmeterViewModelBindingSource.ResetBindings(false);
+        }
+
+        /// <summary>
+        /// 鏇存柊璁$畻灞炴��
+        /// </summary>
+        public void UpdateCalcuProperty(List<HydroCalcuResult> allCalcuResultList)
+        {
+            if (allCalcuResultList != null && allCalcuResultList.Count > 0)
+            {
+                if (_allList != null && _allList.Count > 0)
+                {
+                    foreach (var parter in _allList)
+                    {
+                        var calcuResult = allCalcuResultList.Find(x => x.Code == parter.Code);
+                        if (calcuResult != null)
+                        {
+                            parter.UpdateCalcuProperty(calcuResult);
+                        }
+                    }
+                    this.hydroFlowmeterViewModelBindingSource.ResetBindings(false);
+                }
+            }
+        }
+
         //鏌ヨ
         private void Search()
         {
@@ -255,24 +336,6 @@
             }
         }
 
-        public void UpdateProperty()
-        {
-            throw new NotImplementedException();
-        }
 
-        public void UpdateProperty(HydroParterInfo parter)
-        {
-            throw new NotImplementedException();
-        }
-
-        public void UpdateProperty(List<HydroParterInfo> parterList)
-        {
-            throw new NotImplementedException();
-        }
-
-        public void UpdateCalcuProperty(List<HydroCalcuResult> allCalcuResultList)
-        {
-            throw new NotImplementedException();
-        }
     }
 }

--
Gitblit v1.9.3