| | |
| | | { |
| | | var alllist = await _bll.GetBySeriesID(SeriesID); |
| | | _allBindingList.Clear(); |
| | | foreach (var item in alllist) |
| | | if (alllist != null) |
| | | { |
| | | _allBindingList.Add(new AssetsValveMainViewModel(item)); |
| | | foreach (var item in alllist) |
| | | { |
| | | _allBindingList.Add(new AssetsValveMainViewModel(item)); |
| | | } |
| | | } |
| | | this.AssetsValveMainViewModelBindingSource.ResetBindings(false); |
| | | } |
| | |
| | | var series = this.valveTypeTreeListCtrl1.GetCurrentSeries(); |
| | | if (series == null) |
| | | { |
| | | MessageBoxHelper.ShowWarning("请先选择阀门系列!"); |
| | | MessageBoxHelper.ShowWarning("请先选择系列!"); |
| | | return; |
| | | } |
| | | dlg.SetBindingData(series.ID, series.Type); |
| | | dlg.SetBindingData(series.ID); |
| | | dlg.ReloadDataEvent += async (rhs) => |
| | | { |
| | | var id = await _bll.Insert(rhs); |
| | |
| | | |
| | | var guid = new PageGuid() |
| | | { |
| | | Function = "阀门型号曲线", |
| | | Function = "阀门水头损失曲线", |
| | | TagName = currentVm.ID.ToString(), |
| | | Modular = "" |
| | | }; |
| | |
| | | MessageBoxHelper.ShowWarning($"{currentVm.Name}:AssetsValveMainDto is null!"); |
| | | return; |
| | | } |
| | | var page = new HStation.WinFrmUI.PhartRelation.XhsValveMainPhartPanel(); |
| | | page.InitialDataSource(currentVm.ID); |
| | | page.PageTitle.Caption = guid.Function; |
| | | page.PageGuid = guid; |
| | | CreatePage(page, guid); |
| | | if (currentVm.ValveType == HStation.Assets.eValveType.TCV) |
| | | { |
| | | var page = new HStation.WinFrmUI.PhartRelation.XhsValveMainPhartMinorLossPanel(); |
| | | page.InitialDataSource(currentVm.ID); |
| | | guid.Function = "阀门开度系数曲线"; |
| | | page.PageTitle.Caption = guid.Function; |
| | | page.PageGuid = guid; |
| | | CreatePage(page, guid); |
| | | } |
| | | else |
| | | { |
| | | var page = new HStation.WinFrmUI.PhartRelation.XhsValveMainPhartPanel(); |
| | | page.InitialDataSource(currentVm.ID); |
| | | guid.Function = "阀门水头损失曲线"; |
| | | page.PageTitle.Caption = guid.Function; |
| | | page.PageGuid = guid; |
| | | CreatePage(page, guid); |
| | | } |
| | | } |
| | | } |
| | | |
| | | //设置默认值 |
| | | private void barBtnSetDefaultStatus_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | var dlg = new SetDefaultStatusDlg(); |
| | | /* var dlg = new SetDefaultStatusDlg(); |
| | | var vm = this.gridView1.GetCurrentViewModel(_allBindingList); |
| | | if (vm == null) |
| | | { |
| | | MessageBoxHelper.ShowWarning("请选择数据行!"); |
| | | return; |
| | | } |
| | | dlg.SetBindingData(vm.IsDefault); |
| | | dlg.ReloadDataEvent += async (rhs) => |
| | | { |
| | | if (await _bll.UpdateDefaultStatus(vm.ID, rhs)) |
| | | { |
| | | vm.Reset(await _bll.GetByID(vm.ID)); |
| | | this.AssetsValveMainViewModelBindingSource.ResetBindings(false); |
| | | return true; |
| | | } |
| | | return false; |
| | | }; |
| | | dlg.ShowDialog();*/ |
| | | } |
| | | |
| | | private void gridView1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e) |
| | | { |
| | | var vm = this.gridView1.GetCurrentViewModel(_allBindingList); |
| | | if (vm == null) |
| | | return; |
| | | if (vm.ValveType == HStation.Assets.eValveType.TCV || vm.ValveType == HStation.Assets.eValveType.GPV) |
| | | { |
| | | MessageBoxHelper.ShowWarning("请选择数据行!"); |
| | | ribbonPageGroup2.Visible = true; |
| | | return; |
| | | } |
| | | dlg.SetBindingData(vm.IsDefault); |
| | | dlg.ReloadDataEvent += async (rhs) => |
| | | { |
| | | if (await _bll.UpdateDefaultStatus(vm.ID, rhs)) |
| | | { |
| | | vm.Reset(await _bll.GetByID(vm.ID)); |
| | | this.AssetsValveMainViewModelBindingSource.ResetBindings(false); |
| | | return true; |
| | | } |
| | | return false; |
| | | }; |
| | | ribbonPageGroup2.Visible = false; |
| | | } |
| | | |
| | | //设置系数 |
| | | private void barBtnSetcoefficient_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | var dlg = new SetValveCoefficientDlg(); |
| | | dlg.SetBindingData(); |
| | | dlg.ShowDialog(); |
| | | } |
| | | } |