duheng
2024-10-24 4812786898dc040fc236e9e00e21b9f4d08f57e3
WinFrmUI/HStation.WinFrmUI.Assets.Core/03-valve/ValveManageMainPage.cs
@@ -147,25 +147,25 @@
        //设置默认值
        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();*/
        }
    }
}