| | |
| | | //设置默认值 |
| | | private void barBtnSetDefaultStatus_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | 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(); |
| | | /* 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();*/ |
| | | } |
| | | } |
| | | } |