/// <summary>
        /// 得到指定模块的操作权限主健数组
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="moduleId">模块主键</param>
        /// <returns>主键数组</returns>
        public string[] GetIdsByModule(UserInfo userInfo, string moduleId)
        {
            string[] returnValue = null;
            var      parameter   = ParameterUtil.CreateWithLog(userInfo, MethodBase.GetCurrentMethod());

            ServiceUtil.ProcessRDIReadDb(userInfo, parameter, dbProvider =>
            {
                returnValue = new PermissionModuleManager(dbProvider, userInfo).GetPermissionIds(moduleId);
            });
            return(returnValue);
        }
Exemple #2
0
        /// <summary>
        /// 撤销操作权限项与模块菜单的关联
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="permissionItemId">权限主键</param>
        /// <param name="modulesIds">模块主键</param>
        /// <returns>影响行数</returns>
        public int BatchDeleteModules(UserInfo userInfo, string permissionItemId, string[] modulesIds)
        {
            int returnValue = 0;
            var parameter   = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.ModuleService_BatchDleteModules);

            ServiceUtil.ProcessRDIReadDb(userInfo, parameter, dbProvider =>
            {
                var modulePermissionManager = new PermissionModuleManager(dbProvider, userInfo);
                returnValue = modulePermissionManager.Delete(modulesIds, permissionItemId);
            });
            return(returnValue);
        }
Exemple #3
0
        /// <summary>
        /// 菜单主健数组
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="permissionItemId">操作权限主键</param>
        /// <returns>主键数组</returns>
        public string[] GetIdsByPermission(UserInfo userInfo, string permissionItemId)
        {
            string[] returnValue = null;
            var      parameter   = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.ModuleService_GetIdsByPermission);

            ServiceUtil.ProcessRDIReadDb(userInfo, parameter, dbProvider =>
            {
                var modulePermissionManager = new PermissionModuleManager(dbProvider, userInfo);
                returnValue = modulePermissionManager.GetModuleIds(permissionItemId);
            });

            return(returnValue);
        }
Exemple #4
0
        /// <summary>
        /// 获取关联的权限项列表
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="moduleId">主键</param>
        /// <returns>数据表</returns>
        public DataTable GetPermissionDT(UserInfo userInfo, string moduleId)
        {
            DataTable dataTable = new DataTable(PiPermissionTable.TableName);
            var       parameter = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.ModuleService_GetPermissionDT);

            ServiceUtil.ProcessRDIReadDb(userInfo, parameter, dbProvider =>
            {
                var modulePermissionManager = new PermissionModuleManager(dbProvider, userInfo);
                string[] ids = modulePermissionManager.GetPermissionIds(moduleId);
                var permissionAdminManager = new PiPermissionItemManager(dbProvider, userInfo);
                dataTable           = permissionAdminManager.GetDT(ids);
                dataTable.TableName = PiPermissionItemTable.TableName;
            });
            return(dataTable);
        }