duheng
2025-01-09 a91c47d4ae8ad414e492a66f10eafce678892503
WinFrmUI/HStation.WinFrmUI.Auth.Core/02-role/RoleMgrPage.cs
@@ -13,6 +13,7 @@
            InitializeComponent();
            this.gridView1.SetNormalView(30);
            this.PageTitle.Caption = "角色管理";
            flyoutPanel1.Options.AnchorType = DevExpress.Utils.Win.PopupToolWindowAnchor.Right;
            this.PageTitle.SvgImageSize = new Size(24, 24);
        }
@@ -32,7 +33,7 @@
        private async void InitialData()
        {
            var overlay = this.ShowOverlay();
            var allBindingList = await BLLFactory<Yw.BLL.Role>.Instance.GetByCorpID(0);
            var allBindingList = await BLLFactory<Yw.BLL.Role>.Instance.GetByCorpID(GlobalParas._GlobalParas.CorpID);
            _allBindingList = new List<RoleViewModel>();
            if (allBindingList != null && allBindingList.Count > 0)
            {
@@ -123,14 +124,14 @@
        //查看
        private void View()
        {
            /*       var vm = GetCurrentViewModel();
                   if (vm == null)
                   {
                       return;
                   }
                   var dlg = new ViewAssetsRoleDlg();
                   dlg.SetBindingData(vm.Vmo);
                   dlg.ShowDialog();*/
            var vm = GetCurrentViewModel();
            if (vm == null)
            {
                return;
            }
            var dlg = new ViewRoleDlg();
            dlg.SetBindingData(vm);
            dlg.ShowDialog();
        }
        //上移
@@ -455,5 +456,29 @@
                flyoutPanel1.HidePopup();
            }
        }
        //使用状态
        private void BtnEditStatus_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            var vm = GetCurrentViewModel();
            if (vm == null)
            {
                return;
            }
            var dlg = new SetUseStatusDlg();
            dlg.SetBindingData((Yw.Model.eUseStatus)vm.UseStatus);
            dlg.ReloadDataEvent += async (status) =>
            {
                var bol = await BLLFactory<Yw.BLL.Role>.Instance.UpdateUseStatus(vm.ID, (int)status);
                if (bol)
                {
                    vm.UseStatus = (eUseStatus)status;
                    this.gridView1.RefreshRow(this.gridView1.FocusedRowHandle);
                    return true;
                }
                return false;
            };
            dlg.ShowDialog();
        }
    }
}