duheng
2025-03-28 b266e82b9a377fa35a766f7a3a2f5aa95f3c9125
WinFrmUI/HStation.WinFrmUI.Auth.Core/04-role-projcet-menu/RoleProjectMenuPage.cs
@@ -1,15 +1,4 @@
using DevExpress.XtraEditors;
using NetTaste;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Yw;
using Yw;
using Yw.WinFrmUI;
namespace HStation.WinFrmUI
@@ -32,17 +21,16 @@
        private List<RoleProjcetMenuViewModel> _allBindingList;
        private long _roleID;
        private Yw.Vmo.RoleVmo _lastRole;
        /// <summary>
        /// 聚焦改变事件
        /// </summary>
        private async void RoleTreeListCtrl1_FocusedChangedEvent(Yw.Vmo.Role obj)
        private async void RoleTreeListCtrl1_FocusedChangedEvent(Yw.Vmo.RoleVmo obj)
        {
            _roleID = obj.ID;
            _lastRole = obj;
            _allBindingList = new List<RoleProjcetMenuViewModel>();
            var allList = await BLLFactory<Yw.BLL.RoleProjectMenuMapping>.Instance.GetAuthorizeMenuList(GlobalParas._GlobalParas.ProjectID, obj.ID);
            var allList = await BLLFactory<Yw.BLL.RoleProjectMenuMapping>.Instance.GetAuthorizeMenuList(LoginUserInfo.ProjectID, obj.ID);
            foreach (var item in allList)
            {
                _allBindingList.Add(new RoleProjcetMenuViewModel(item));
@@ -62,9 +50,9 @@
                    menuList.Add(item.ID);
                }
            }
            var vmo = new Yw.Vmo.SetRoleProjectMenu();
            vmo.ProjectID = GlobalParas._GlobalParas.ProjectID;
            vmo.RoleID = _roleID;
            var vmo = new Yw.Vmo.SetRoleProjectMenuVmo();
            vmo.ProjectID = LoginUserInfo.ProjectID;
            vmo.RoleID = _lastRole.ID;
            vmo.MenuIds = menuList;
            var bol = await BLLFactory<Yw.BLL.RoleProjectMenuMapping>.Instance.Set(vmo);
            if (bol)
@@ -102,5 +90,10 @@
                _isCheck = parentNode.Checked;
            }
        }
        private void barBtnRefresh_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            RoleTreeListCtrl1_FocusedChangedEvent(_lastRole);
        }
    }
}