| | |
| | | namespace HStation.WinFrmUI.Assets |
| | | using DevExpress.XtraEditors; |
| | | |
| | | namespace HStation.WinFrmUI.Assets |
| | | { |
| | | public partial class PumpProductListBox : DevExpress.XtraEditors.XtraUserControl |
| | | { |
| | |
| | | |
| | | public List<CurrentPartMainViewModel> _allBindingList = null; |
| | | |
| | | public BLL.AssetsPumpPartMain _Bll; |
| | | |
| | | public event Action<object, MouseEventArgs> MouseUp; |
| | | |
| | | public async void SetBindingData(Vmo.AssetsPumpMainVmo AssetsPumpMain) |
| | | { |
| | | _allBindingList = new List<CurrentPartMainViewModel>(); |
| | | var _bll = new BLL.AssetsPumpPartMain(); |
| | | var allpartlist = await _bll.GetByPumpMainID(AssetsPumpMain.ID); //获取所有产品 |
| | | _Bll = new BLL.AssetsPumpPartMain(); |
| | | var allpartlist = await _Bll.GetByPumpMainID(AssetsPumpMain.ID); //获取所有产品 |
| | | var series = await new BLL.AssetsPumpSeries().GetByID(AssetsPumpMain.PumpSeriesID); //获取系列 |
| | | if (allpartlist != null) |
| | | { |
| | |
| | | { |
| | | SelectReloadEvent.Invoke(); |
| | | } |
| | | |
| | | private void listBoxControl1_MouseUp(object sender, MouseEventArgs e) |
| | | { |
| | | MouseUp.Invoke(sender, e); |
| | | } |
| | | |
| | | //删除属性 |
| | | private async void barBtnDelete_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | var vm = this.listBoxControl1.GetCurrentViewModel(_allBindingList); |
| | | if (vm == null) |
| | | { |
| | | TipFormHelper.ShowWarn("请选择数据行!"); |
| | | return; |
| | | } |
| | | if (MessageBoxHelper.IsClickOk($"确认删除数据行?", "提示")) |
| | | return; |
| | | if (await _Bll.DeleteEx(vm.ID)) |
| | | { |
| | | _allBindingList.Remove(vm); |
| | | this.listBoxControl1.Refresh(); |
| | | TipFormHelper.ShowSucceed("删除成功!"); |
| | | } |
| | | else |
| | | { |
| | | TipFormHelper.ShowError("删除失败!"); |
| | | } |
| | | } |
| | | } |
| | | } |