Exemple #1
0
        /// <summary>
        /// 添加对象
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnAddControl_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            tb_Sys_Roles         role    = GvRoles.GetFocusedRow() as tb_Sys_Roles;
            A004_RoleControlEdit frmedit = new A004_RoleControlEdit("AddControl", role.Id);

            if (frmedit.ShowDialog() == DialogResult.OK)
            {
                gridControlControl.DataSource = controlService.GetlistByRolesId(role.Id);
            }
        }
Exemple #2
0
        /// <summary>
        /// 添加用户
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnAddUser_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            tb_Sys_Roles         role    = GvRoles.GetFocusedRow() as tb_Sys_Roles;
            A004_RoleControlEdit frmedit = new A004_RoleControlEdit("AddUser", role.Id);

            if (frmedit.ShowDialog() == DialogResult.OK)
            {
                List <Guid> listUserID = userRoleService.GetByRoleId(role.Id).Select(i => i.UserId).ToList();                 //ServiceHelper.Current.DbSession.Itb_Sys_UserRoleDAL.GetListBy(r => r.RoleID == role.RoleID).Select(r => r.UserID).ToList();
                gridcontrolUser.DataSource = userService.Gettb_Sys_UserList().Where(i => listUserID.Contains(i.Id)).ToList(); //ServiceHelper.Current.DbSession.Itb_Sys_UserDAL.GetListBy(r => listUserID.Contains(r.UserID));
            }
        }
Exemple #3
0
        /// <summary>
        /// 添加菜单
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnAddMenu_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            tb_Sys_Roles role = GvRoles.GetFocusedRow() as tb_Sys_Roles;

            if (role == null)
            {
                XtraMessageBox.Show("请先选择角色");
                return;
            }
            A004_RoleControlEdit frmedit = new A004_RoleControlEdit("AddMenu", role.Id);

            if (frmedit.ShowDialog() == DialogResult.OK)
            {
                GvRoles_FocusedRowChanged(this.GvRoles, null);
            }
        }
Exemple #4
0
        /// <summary>
        /// 添加按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnAddBtn_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            tb_Sys_Roles role   = GvRoles.GetFocusedRow() as tb_Sys_Roles;
            Guid?        menuId = this.treeMenu.FocusedNode.GetValue(treeListColumn1).ToString().ToGuidOrNull();

            if (menuId == null)
            {
                XtraMessageBox.Show("请先选择菜单模块");
                return;
            }
            A004_RoleControlEdit frmedit = new A004_RoleControlEdit("AddAction", role.Id, menuId ?? new Guid());

            if (frmedit.ShowDialog() == DialogResult.OK)
            {
                gridcontrolAction.DataSource = buttonService.GetButtonsByMenu(menuId ?? new Guid(), role.Id);
            }
        }