lixiaojun
2024-10-23 5dac45fe6402027f1a19f331045c811c9e96b729
WinFrmUI/HStation.WinFrmUI.Assets.Core/01-pump/01-EditPumpPartProp/EditPumpPartPropDlg.cs
@@ -58,8 +58,6 @@
            _partMapping = new Vmo.AssetsPumpMainAndPartMapVmo();
            _partMapping.PumpID = AssetsPumpMain.ID;
            _partMapping.SeriesID = _series.ID;
            //  this.ListBoxPart.DataSource = _allBindingList;
            // this.ListBoxPart.Refresh();
            this.propGroupChoiceViewModelBindingSource.DataSource = _propList;
            this.propGroupChoiceViewModelBindingSource.ResetBindings(false);
        }
@@ -82,10 +80,10 @@
                return;
            }
            _propList.Clear();
            _propList.Add(new PropGroupChoiceViewModel() { PropGroupName = "铭牌参数", PropName = "流量", Value = _pumpMain.RatedFlow.ToString(), KeyWorldType = "Basic" });
            _propList.Add(new PropGroupChoiceViewModel() { PropGroupName = "铭牌参数", PropName = "扬程", Value = _pumpMain.RatedHead.ToString(), KeyWorldType = "Basic" });
            _propList.Add(new PropGroupChoiceViewModel() { PropGroupName = "铭牌参数", PropName = "功率", Value = _pumpMain.RatedPower.ToString(), KeyWorldType = "Basic" });
            _propList.Add(new PropGroupChoiceViewModel() { PropGroupName = "铭牌参数", PropName = "转速", Value = _pumpMain.RatedSpeed.ToString(), KeyWorldType = "Basic" });
            _propList.Add(new PropGroupChoiceViewModel() { PropGroupName = "铭牌参数", PropName = "流量", Value = _pumpMain.RatedFlow.ToString(), KeyWorldType = "Basic_Flow" });
            _propList.Add(new PropGroupChoiceViewModel() { PropGroupName = "铭牌参数", PropName = "扬程", Value = _pumpMain.RatedHead.ToString(), KeyWorldType = "Basic_Head" });
            _propList.Add(new PropGroupChoiceViewModel() { PropGroupName = "铭牌参数", PropName = "功率", Value = _pumpMain.RatedPower.ToString(), KeyWorldType = "Basic_Power" });
            _propList.Add(new PropGroupChoiceViewModel() { PropGroupName = "铭牌参数", PropName = "转速", Value = _pumpMain.RatedSpeed.ToString(), KeyWorldType = "Basic_Speed" });
            foreach (var item in catlog)
            {
                foreach (var prop in item.PropList)
@@ -130,7 +128,8 @@
            updatepart.Code = TextEditProductCode.Text;
            updatepart.SeriesID = _series.ID;
            var updateproplist = new List<UpdateAssetsPumpPropContentInput>();
            foreach (var item in _propList)
            var propList = _propList.Where(x => x.KeyWorldType == "Prop").ToList();
            foreach (var item in propList)
            {
                if (_allPropList != null)
                {
@@ -147,6 +146,28 @@
                    }
                }
            }
            var basicFlow = _propList.Find(x => x.KeyWorldType == "Basic_Flow");
            var basicHead = _propList.Find(x => x.KeyWorldType == "Basic_Head");
            var basicSpeed = _propList.Find(x => x.KeyWorldType == "Basic_Speed");
            var basicPower = _propList.Find(x => x.KeyWorldType == "Basic_Power");
            if (double.TryParse(basicFlow.Value, out double flow))
            {
                _pumpMain.RatedFlow = flow;
            }
            if (double.TryParse(basicHead.Value, out double head))
            {
                _pumpMain.RatedHead = head;
            }
            if (double.TryParse(basicSpeed.Value, out double speed))
            {
                _pumpMain.RatedSpeed = speed;
            }
            if (double.TryParse(basicPower.Value, out double power))
            {
                _pumpMain.RatedPower = power;
            }
            var pumpMainBll = new BLL.AssetsPumpMain();
            await pumpMainBll.Update(_pumpMain);
            if (await _bll.UpdateEx(updatepart, _allPropList))
            {
                vm.Reset(updatepart);
@@ -308,7 +329,7 @@
                    list.Add(new Yw.Vmo.SysPropMappingSetterVmo { PropID = id, UnitName = rhs.UnitName, IsNull = rhs.IsNull });
                    await _sysPropMapping.SetByCatalogID(_series.CatalogID, list);
                    var model = await bll.GetByID(id);
                    var partMain = new PropGroupChoiceViewModel() { PropGroupName = groupName, PropName = model.Name, ID = model.ID, Value = propValue };
                    var partMain = new PropGroupChoiceViewModel() { PropGroupName = groupName, PropName = model.Name, ID = model.ID, Value = propValue, KeyWorldType = "Prop" };
                    _propList.Add(partMain);
                    this.propGroupChoiceViewModelBindingSource.ResetBindings(false);
                    return true;