| | |
| | | namespace HStation.WinFrmUI |
| | | using HStation.Vmo; |
| | | |
| | | namespace HStation.WinFrmUI |
| | | { |
| | | public partial class PumpPropViewCtrl : DevExpress.XtraEditors.XtraUserControl |
| | | { |
| | |
| | | InitializeComponent(); |
| | | this.gridView1.SetNormalView(); |
| | | this.gridView1.RegistCustomDrawRowIndicator(); |
| | | AddPumpPropDlg.ReloadRefreshData += RefreshData; |
| | | } |
| | | |
| | | private List<PropGroupChoiceViewModel> _allBindingList; |
| | | |
| | | public static long _typeId; |
| | | |
| | | public long _pumpId; |
| | | public static long _pumpId; |
| | | |
| | | public static Vmo.AssetsPumpMainVmo _assetsPumpMainVmo; |
| | | |
| | | public static Vmo.AssetsPumpMainVmo GetPumpMainVmo() |
| | | { |
| | | return _assetsPumpMainVmo; |
| | | } |
| | | |
| | | public static long GetPumpTypeId() |
| | | { |
| | | return _typeId; |
| | | } |
| | | |
| | | public async void SetBindingData(string DbId) |
| | | { |
| | |
| | | _pumpId = pumpId; |
| | | var pumpBll = new BLL.AssetsPumpMain(); |
| | | var pump = await pumpBll.GetByID(pumpId); |
| | | _assetsPumpMainVmo = pump; |
| | | var series = await new BLL.AssetsPumpSeries().GetByID(pump.PumpSeriesID); |
| | | _allBindingList = new List<PropGroupChoiceViewModel>(); |
| | | var catlog = await new Yw.BLL.SysPropStruct().GetByCatalogID(series.CatalogID); |
| | |
| | | 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(); |
| | |
| | | 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); |
| | | } |
| | | |
| | | private void RefreshData() |
| | | public void RefreshData() |
| | | { |
| | | SetBindingData(_pumpId.ToString()); |
| | | } |