duheng
2024-10-22 36c4ee4f56763ba96d37ff9f89bbf9440fb8be9f
WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-pump/01-Prop/PumpPropViewCtrl.cs
@@ -50,11 +50,16 @@
                return;
            }
            _typeId = catlog.First().TypeID;
            _allBindingList.Add(new PropGroupChoiceViewModel() { PropGroupName = "铭牌参数", PropName = "流量", Value = pump.RatedFlow.ToString(), KeyWorldType = "Basic" });
            _allBindingList.Add(new PropGroupChoiceViewModel() { PropGroupName = "铭牌参数", PropName = "扬程", Value = pump.RatedHead.ToString(), KeyWorldType = "Basic" });
            _allBindingList.Add(new PropGroupChoiceViewModel() { PropGroupName = "铭牌参数", PropName = "功率", Value = pump.RatedPower.ToString(), KeyWorldType = "Basic" });
            _allBindingList.Add(new PropGroupChoiceViewModel() { PropGroupName = "铭牌参数", PropName = "转速", Value = pump.RatedSpeed.ToString(), KeyWorldType = "Basic" });
            foreach (var item in catlog)
            {
                foreach (var prop in item.PropList)
                {
                    _allBindingList.Add(new PropGroupChoiceViewModel() { PropGroupName = item.Name, PropName = prop.Name, ID = prop.ID });
                    _allBindingList.Add(new PropGroupChoiceViewModel() { PropGroupName = item.Name, PropName = prop.Name, ID = prop.ID, KeyWorldType = "Prop" });
                }
            }
            var propbll = new BLL.PumpPartPropContent();
@@ -64,7 +69,11 @@
            var alllist = await propbll.GetByPumpPartID(partList.First().ID);
            foreach (var item in alllist)
            {
                _allBindingList.Find(x => x.ID == item.PropID).Value = item.PropValue;
                var selectProp = _allBindingList.Find(x => x.ID == item.PropID);
                if (selectProp != null)
                {
                    selectProp.Value = item.PropValue;
                }
            }
            this.propGroupChoiceViewModelBindingSource.DataSource = _allBindingList;
            this.propGroupChoiceViewModelBindingSource.ResetBindings(false);