From 17a0baa0ef883689c73e3141d148a28a48d62cd6 Mon Sep 17 00:00:00 2001 From: duheng <2784771470@qq.com> Date: 星期三, 11 十二月 2024 10:31:04 +0800 Subject: [PATCH] 报告修改 --- WinFrmUI/HStation.WinFrmUI.Assets.Core/01-pump/01-EditPumpPartProp/EditPumpPartPropDlg.cs | 53 ++++++++++++++++++++++++++++++++++------------------- 1 files changed, 34 insertions(+), 19 deletions(-) diff --git a/WinFrmUI/HStation.WinFrmUI.Assets.Core/01-pump/01-EditPumpPartProp/EditPumpPartPropDlg.cs b/WinFrmUI/HStation.WinFrmUI.Assets.Core/01-pump/01-EditPumpPartProp/EditPumpPartPropDlg.cs index 14114fe..813ef0a 100644 --- a/WinFrmUI/HStation.WinFrmUI.Assets.Core/01-pump/01-EditPumpPartProp/EditPumpPartPropDlg.cs +++ b/WinFrmUI/HStation.WinFrmUI.Assets.Core/01-pump/01-EditPumpPartProp/EditPumpPartPropDlg.cs @@ -84,21 +84,20 @@ return; } _propList.Clear(); - _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" }); + _propList.Add(new PropGroupChoiceViewModel() { PropGroupName = "閾墝鍙傛暟", PropName = "娴侀噺", Value = _pumpMain.RatedFlow.ToString(), TagName = "Basic_Flow" }); + _propList.Add(new PropGroupChoiceViewModel() { PropGroupName = "閾墝鍙傛暟", PropName = "鎵▼", Value = _pumpMain.RatedHead.ToString(), TagName = "Basic_Head" }); + _propList.Add(new PropGroupChoiceViewModel() { PropGroupName = "閾墝鍙傛暟", PropName = "鍔熺巼", Value = _pumpMain.RatedPower.ToString(), TagName = "Basic_Power" }); + _propList.Add(new PropGroupChoiceViewModel() { PropGroupName = "閾墝鍙傛暟", PropName = "杞��", Value = _pumpMain.RatedSpeed.ToString(), TagName = "Basic_Speed" }); foreach (var item in catlog) { foreach (var prop in item.PropList) { - _propList.Add(new PropGroupChoiceViewModel() { PropGroupName = item.Name, PropName = prop.Name, ID = prop.ID, KeyWorldType = "Prop" }); + _propList.Add(new PropGroupChoiceViewModel() { PropGroupName = item.Name, PropName = prop.Name, ID = prop.ID,TagName= prop.Code }); } } - var propbll = new BLL.PumpPartPropContent(); - var alllist = await propbll.GetByPumpPartID(model.ID); - _allPropList = alllist; - foreach (var item in alllist) + var propbll = new BLL.AssetsPumpPropContent(); + _allPropList = await propbll.GetByPumpPartID(model.ID); + foreach (var item in _allPropList) { var selectProp = _propList.Find(x => x.ID == item.PropID); if (selectProp != null) @@ -131,7 +130,7 @@ updatepart.NO = TextEditNo.Text; updatepart.Code = TextEditProductCode.Text; updatepart.SeriesID = _series.ID; - var propList = _propList.Where(x => x.KeyWorldType == "Prop").ToList(); //鎵惧埌鎵�鏈夌殑棰濆灞炴�� + var propList = _propList.Where(x => x.TagName == "Prop").ToList(); //鎵惧埌鎵�鏈夌殑棰濆灞炴�� foreach (var item in propList) { if (_allPropList != null) @@ -142,17 +141,23 @@ if (prop != null) { prop.PropValue = item.Value; - } + } else { - _allPropList.Add(new Vmo.AssetsPumpPropContentVmo() { SeriesID = _allPropList.First().SeriesID, PartID = _allPropList.First().PartID, PropID = item.ID, PropValue = item.Value }); + _allPropList.Add(new Vmo.AssetsPumpPropContentVmo() { + SeriesID = _allPropList.First().SeriesID, + PartID = _allPropList.First().PartID, + PropID = item.ID, + PropValue = item.Value, + TagName=item.TagName + }); } } } - 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"); + var basicFlow = _propList.Find(x => x.TagName == "Basic_Flow"); + var basicHead = _propList.Find(x => x.TagName == "Basic_Head"); + var basicSpeed = _propList.Find(x => x.TagName == "Basic_Speed"); + var basicPower = _propList.Find(x => x.TagName == "Basic_Power"); if (double.TryParse(basicFlow.Value, out double flow)) { _pumpMain.RatedFlow = flow; @@ -217,7 +222,11 @@ var AssetsPumpPropContent = new List<Vmo.AssetsPumpPropContentVmo>(); foreach (var item in _propList) { - AssetsPumpPropContent.Add(new Vmo.AssetsPumpPropContentVmo { PropID = item.ID, PropValue = item.Value, SeriesID = _pumpPart.SeriesID }); + AssetsPumpPropContent.Add(new Vmo.AssetsPumpPropContentVmo { + PropID = item.ID, + PropValue = item.Value, + SeriesID = _pumpPart.SeriesID , + TagName=item.TagName}); } var id = await _bll.InsertEx(_pumpPart, AssetsPumpPropContent, _partMapping); if (id > 0) @@ -258,7 +267,13 @@ { foreach (var prop in item.PropList) { - _propList.Add(new PropGroupChoiceViewModel() { PropGroupName = item.Name, PropName = prop.Name, ID = prop.ID, Value = prop.DefaultValue }); + _propList.Add(new PropGroupChoiceViewModel() { + PropGroupName = item.Name, + PropName = prop.Name, + ID = prop.ID, + Value = prop.DefaultValue, + TagName = prop.Code, + }); } } this.propGroupChoiceViewModelBindingSource.ResetBindings(false); @@ -332,7 +347,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, KeyWorldType = "Prop" }; + var partMain = new PropGroupChoiceViewModel() { PropGroupName = groupName, PropName = model.Name, ID = model.ID, Value = propValue, TagName = "Prop" }; _propList.Add(partMain); this.propGroupChoiceViewModelBindingSource.ResetBindings(false); return true; -- Gitblit v1.9.3