Ejemplo n.º 1
0
        /// <summary>
        /// 选中项发生更改
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void _RecordListView_SelectionChanged(object sender, EventArgs e)
        {
            if (this._RecordListView.SelectedObjects != null && this._RecordListView.SelectedObjects.Count > 0)
            {
                _SelUser = (KPS.Model.UserInfo) this._RecordListView.SelectedObjects[0];

                KPS.BLL.PermissionManager Pmanager = new BLL.PermissionManager();
                UserListPerms = Pmanager.GetModelList(string.Format("userName='******'", _SelUser.userName));

                ShowUserAuthMenu(UserListPerms, _SelUser);//显示用户权限菜单
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 菜单初始化显示
        /// </summary>
        private void MenuInitShow()
        {
            LoginUserInfo _user = LoginManager.Instance.GetThisUserLoginInfo();//当前登录用户

            //if (!_user.IsAdministrator)
            //{
            #region 菜单禁用
            foreach (ToolStripItem _item in HeadInsertDataMenu.DropDownItems)
            {
                _item.Enabled = false;
            }
            foreach (ToolStripItem _item in HeadDataQueryMenu.DropDownItems)
            {
                _item.Enabled = false;
            }
            foreach (ToolStripItem _item in HeadTolMenu.DropDownItems)
            {
                _item.Enabled = false;
            }
            foreach (ToolStripItem _item in TolMenuData.DropDownItems)
            {
                _item.Enabled = false;
            }

            btnBuyInsert.Enabled           = false;
            btnBuyQuery.Enabled            = false;
            btnSellInsert.Enabled          = false;
            btnSellQuery.Enabled           = false;
            btnInventoryQuery.Enabled      = false;
            btnInventoryQueryTotal.Enabled = false;

            #endregion
            KPS.BLL.PermissionManager       Pmanager = new BLL.PermissionManager();
            List <KPS.Model.PermissionInfo> Authlist = Pmanager.GetModelList(string.Format("userName='******'", _user.LoginName));
            if (Authlist != null && Authlist.Count > 0)
            {
                foreach (KPS.Model.PermissionInfo _pinfo in Authlist)
                {
                    MenuEnableTrue(_pinfo);
                }
            }
            //}
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 菜单初始化显示
        /// </summary>
        private void MenuInitShow()
        {
            LoginUserInfo _user = LoginManager.Instance.GetThisUserLoginInfo();//当前登录用户
            //if (!_user.IsAdministrator)
            //{
                #region 菜单禁用
                foreach (ToolStripItem _item in HeadInsertDataMenu.DropDownItems)
                {
                    _item.Enabled = false;
                }
                foreach (ToolStripItem _item in HeadDataQueryMenu.DropDownItems)
                {
                    _item.Enabled = false;
                }
                foreach (ToolStripItem _item in HeadTolMenu.DropDownItems)
                {
                    _item.Enabled = false;
                }
                foreach (ToolStripItem _item in TolMenuData.DropDownItems)
                {
                    _item.Enabled = false;
                }

                btnBuyInsert.Enabled = false;
                btnBuyQuery.Enabled = false;
                btnSellInsert.Enabled = false;
                btnSellQuery.Enabled = false;
                btnInventoryQuery.Enabled = false;
                btnInventoryQueryTotal.Enabled = false;

                #endregion
                KPS.BLL.PermissionManager Pmanager = new BLL.PermissionManager();
                List<KPS.Model.PermissionInfo> Authlist = Pmanager.GetModelList(string.Format("userName='******'", _user.LoginName));
                if (Authlist != null && Authlist.Count > 0)
                {
                    foreach (KPS.Model.PermissionInfo _pinfo in Authlist)
                    {
                        MenuEnableTrue(_pinfo);
                    }
                }
            //}
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 选中项发生更改
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void _RecordListView_SelectionChanged(object sender, EventArgs e)
        {
            if (this._RecordListView.SelectedObjects != null && this._RecordListView.SelectedObjects.Count > 0)
            {
                _SelUser = (KPS.Model.UserInfo)this._RecordListView.SelectedObjects[0];

                KPS.BLL.PermissionManager Pmanager = new BLL.PermissionManager();
                UserListPerms = Pmanager.GetModelList(string.Format("userName='******'", _SelUser.userName));

                ShowUserAuthMenu(UserListPerms, _SelUser);//显示用户权限菜单
            }
        }