文件名从 WinFrmUI/HStation.WinFrmUI.Assets.Core/00-PumpProductManage/PumpProductMainPanel.cs 修改 |
| | |
| | | this.gridView1.SetNormalView(); |
| | | this.gridView1.RegistCustomDrawRowIndicator(); |
| | | this.pumpSeriesTreeListCtrl1.FocusedChangedEvent += PumpSeriesTreeListCtrl1_FocusedChangedEvent; |
| | | this.pumpSeriesTreeListCtrl1.AddPumpMain += BtnAdd_ItemClick; |
| | | this.pumpSeriesTreeListCtrl1.AddPumpMain += BtnAdd_ItemClickAsync; |
| | | } |
| | | |
| | | private readonly List<PumpMainViewModel> _allBindingList = new(); |
| | |
| | | } |
| | | |
| | | //澧炲姞 |
| | | private void BtnAdd_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | private async void BtnAdd_ItemClickAsync(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | var dlg = new AddPumpProductMainDlg(); |
| | | //绯诲垪ID |
| | |
| | | return; |
| | | } |
| | | var groupid = this.pumpSeriesTreeListCtrl1.GetCurrentGroupID(); |
| | | Vmo.PumpGroupAndMainMap map = null; |
| | | Vmo.PumpGroupAndMainMapVmo map = null; |
| | | if (groupid > 0) |
| | | { |
| | | map = new Vmo.PumpGroupAndMainMap(); |
| | | map = new Vmo.PumpGroupAndMainMapVmo(); |
| | | map.PumpGroupID = groupid; |
| | | } |
| | | dlg.SetBindingData(id); |
| | | var pumpseries = await new BLL.PumpSeries().GetByID(id); |
| | | if (pumpseries == null) |
| | | return; |
| | | dlg.SetBindingData(pumpseries); |
| | | dlg.ReloadDataEvent += async (main) => |
| | | { |
| | | var id = await _bll.InsertEx(main, map); |
| | |
| | | } |
| | | |
| | | //淇敼 |
| | | private void BtnEdit_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | private async void BtnEdit_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | var currentVm = this.gridView1.GetCurrentViewModel(_allBindingList); |
| | | if (currentVm == null) |
| | |
| | | return; |
| | | } |
| | | var dlg = new EditPumpProductMainDlg(); |
| | | dlg.SetBindingData(currentVm.ID); |
| | | var model = await new BLL.PumpMain().GetByID(currentVm.ID); |
| | | if (model == null) |
| | | return; |
| | | dlg.SetBindingData(model); |
| | | dlg.ReloadDataEvent += async (rhs) => |
| | | { |
| | | if (await _bll.Update(rhs)) |
| | |
| | | return; |
| | | } |
| | | var dlg = new EditPumpPartPropDlg(); |
| | | // var pumpmain = currentVm.Model as Vmo.PumpMain; |
| | | // var pumpmain = currentVm.Model as Vmo.PumpMainVmo; |
| | | dlg.SetBindingData(currentVm.Model); |
| | | dlg.ReloadEvent += async (part, content, map) => |
| | | { |