| | |
| | | this.phartDiagramRelationListCtrl1.SetBindingData(_allBindingList); |
| | | } |
| | | |
| | | private async Task<bool> PumpChartViewCtrl1_DataChangedEvent(Yw.Vmo.PhartDiagramExGraphListVmo vmo) |
| | | { |
| | | var bol = await BLLFactory<Yw.BLL.PhartDiagramExtensions>.Instance.Update(vmo); |
| | | if (!bol) |
| | | { |
| | | TipFormHelper.ShowError("更新失败!"); |
| | | } |
| | | else |
| | | { |
| | | TipFormHelper.ShowSucceed("更新成功!"); |
| | | } |
| | | return bol; |
| | | } |
| | | |
| | | //选择改变 |
| | | private void PhartDiagramRelationListCtrl1_SelectedChangedEvent(PhartDiagramRelationVmo obj) |
| | | { |
| | |
| | | private void barBtnImportByExcel_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | var dlg = new ImportPumpPerform2dByExcelDlg(); |
| | | dlg.ReloadDataEvent += async (rhs, name, importance) => |
| | | dlg.SetBindingData(_vmo); |
| | | dlg.ReloadDataEvent += (rhs) => |
| | | { |
| | | var bll = new BLL.PhartDiagramRelation(); |
| | | var id = await bll.InsertEx(rhs); |
| | | if (id > 0) |
| | | { |
| | | var vmo = new PhartDiagramRelationVmo(rhs); |
| | | vmo.OtherName = name; |
| | | if (!string.IsNullOrEmpty(importance)) |
| | | { |
| | | vmo.Importance = Convert.ToInt32(importance); |
| | | } |
| | | var relationId = await BLLFactory<HStation.BLL.PhartDiagramRelation>.Instance.Insert(vmo); |
| | | if (relationId > 0) |
| | | { |
| | | _allBindingList.Add(rhs); |
| | | this.phartDiagramRelationListCtrl1.SetBindingData(_allBindingList); |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | return false; |
| | | _allBindingList.Add(rhs); |
| | | this.phartDiagramRelationListCtrl1.SetBindingData(_allBindingList); |
| | | }; |
| | | dlg.ShowDialog(); |
| | | } |
| | |
| | | private void barBtnImportByPicture_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | var dlg = new ImportPumpPerform2dByImageDlg(); |
| | | dlg.ReloadDataEvent += async (rhs, name, importance) => |
| | | { |
| | | var bll = new BLL.PhartDiagramRelation(); |
| | | var id = await bll.InsertEx(rhs); |
| | | if (id > 0) |
| | | { |
| | | var vmo = new PhartDiagramRelationVmo(rhs); |
| | | vmo.OtherName = name; |
| | | if (!string.IsNullOrEmpty(importance)) |
| | | { |
| | | vmo.Importance = Convert.ToInt32(importance); |
| | | } |
| | | var relationId = await BLLFactory<HStation.BLL.PhartDiagramRelation>.Instance.Insert(vmo); |
| | | if (relationId > 0) |
| | | { |
| | | _allBindingList.Add(rhs); |
| | | this.phartDiagramRelationListCtrl1.SetBindingData(_allBindingList); |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | return false; |
| | | }; |
| | | dlg.SetBindingData(_vmo); |
| | | dlg.ReloadDataEvent += (rhs) => |
| | | { |
| | | _allBindingList.Add(rhs); |
| | | this.phartDiagramRelationListCtrl1.SetBindingData(_allBindingList); |
| | | }; |
| | | dlg.ShowDialog(); |
| | | } |
| | | |
| | | //单点 |
| | | private void barBtnImportByPoint_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | var dlg = new ImportPumpChartPoint(); |
| | | dlg.SetBindingData(_vmo); |
| | | dlg.ReloadDataEvent += (rhs) => |
| | | { |
| | | _allBindingList.Add(rhs); |
| | | this.phartDiagramRelationListCtrl1.SetBindingData(_allBindingList); |
| | | }; |
| | | dlg.ShowDialog(); |
| | | } |
| | | |
| | |
| | | { |
| | | return; |
| | | } |
| | | var diagram = await BLLFactory<Yw.BLL.PhartDiagramExtensions>.Instance.GetByID(vm.DiagramID); |
| | | var dlg = new EditAssetsPumpPerform2dDlg(); |
| | | var vmo = await BLLFactory<HStation.BLL.PhartDiagramRelation>.Instance.GetExByID(vm.DiagramID); |
| | | dlg.SetBindingData(vmo); |
| | | dlg.ReloadDataEvent += async (rhs) => |
| | | dlg.SetBindingData(diagram, _vmo); |
| | | dlg.ReloadDataEvent += (rhs) => |
| | | { |
| | | var bll = new BLL.PhartDiagramRelation(); |
| | | var bol = await bll.Update(rhs); |
| | | if (bol) |
| | | { |
| | | vm.Reset(rhs); |
| | | return true; |
| | | } |
| | | return true; |
| | | this.pumpChartViewCtrl1.SetBindingData(rhs, _vmo.RatedSpeed); |
| | | }; |
| | | dlg.ShowDialog(); |
| | | } |
| | |
| | | //别名 |
| | | private void barBtnOtherName_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | if (_relation == null) |
| | | return; |
| | | var dlg = new SetPumpOtherNameDlg(); |
| | | dlg.SetBindingData(_relation.OtherName); |
| | | dlg.VerifyValueChanged += async (name) => |
| | | { |
| | | _relation.OtherName = name; |
| | | var bol = await BLLFactory<HStation.BLL.PhartDiagramRelation>.Instance.Update(_relation); |
| | | if (bol) |
| | | { |
| | | this.phartDiagramRelationListCtrl1.SetBindingData(_allBindingList); |
| | | return true; |
| | | } |
| | | return false; |
| | | }; |
| | | dlg.ShowDialog(); |
| | | } |
| | | |
| | | //重要度 |
| | | private void barBtnUpdateimportance_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | if (_relation == null) |
| | | return; |
| | | var dlg = new SetPumpImportanceDlg(); |
| | | dlg.SetBindingData(_relation.Importance); |
| | | dlg.VerifyValueChanged += async (Importance) => |
| | | { |
| | | _relation.Importance = Importance; |
| | | var bol = await BLLFactory<HStation.BLL.PhartDiagramRelation>.Instance.Update(_relation); |
| | | if (bol) |
| | | { |
| | | this.phartDiagramRelationListCtrl1.SetBindingData(_allBindingList); |
| | | return true; |
| | | } |
| | | return false; |
| | | }; |
| | | dlg.ShowDialog(); |
| | | } |
| | | |
| | | //删除 |
| | |
| | | return; |
| | | } |
| | | _allBindingList.Remove(vm); |
| | | this.pumpChartViewCtrl1.ClearBindingData(); |
| | | this.phartDiagramRelationListCtrl1.SetBindingData(_allBindingList); |
| | | TipFormHelper.ShowSucceed("删除成功!"); |
| | | } |