/// <summary>
        /// 创建工作流实例
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="entity">流程实例实体</param>
        /// <returns>主键</returns>
        public string CreateWorkFlowInstance(UserInfo userInfo, WorkFlowInstanceEntity entity)
        {
            string returnValue = string.Empty;
            var    parameter   = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.WorkFlowInstanceService_CreateWorkFlowInstance);

            ServiceUtil.ProcessWorkFlowDbWithTransaction(userInfo, parameter, dbProvider =>
            {
                var manager = new WorkFlowInstanceManager(dbProvider, userInfo);
                // 调用方法,并且返回运行结果
                returnValue = manager.Create(entity);
            });
            return(returnValue);
        }
コード例 #2
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);
        }
コード例 #3
0
        /// <summary>
        /// 撤销模块菜单与操作权限项的关联
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="moduleId">模块主键</param>
        /// <param name="permissionItemIds">权限主键</param>
        /// <returns>影响行数</returns>
        public int BatchDeletePermissions(UserInfo userInfo, string moduleId, string[] permissionItemIds)
        {
            int returnValue = 0;
            var parameter   = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.ModuleService_BatchDletePermissions);

            ServiceUtil.ProcessRDIReadDb(userInfo, parameter, dbProvider =>
            {
                var modulePermissionManager = new PermissionModuleManager(dbProvider, userInfo);
                returnValue = modulePermissionManager.Delete(moduleId, permissionItemIds);
            });

            return(returnValue);
        }
コード例 #4
0
        /// <summary>
        /// 批量设置删除标志
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="ids">主键陣列</param>
        /// <returns>影响行数</returns>
        public int SetDeleted(UserInfo userInfo, string[] ids)
        {
            var returnValue = 0;
            var parameter   = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, string.Empty);

            ServiceUtil.ProcessRDIWriteDbWithTran(userInfo, parameter, dbProvider =>
            {
                var manager = new CiDbLinkDefineManager(dbProvider, userInfo);
                returnValue = manager.SetDeleted(ids);
            });

            return(returnValue);
        }
コード例 #5
0
        /// <summary>
        /// 批量移动数据
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="moduleIds">模块主键数组</param>
        /// <param name="parentId">父结点主键</param>
        /// <returns>数据表</returns>
        public int BatchMoveTo(UserInfo userInfo, string[] moduleIds, string parentId)
        {
            int returnValue = 0;
            var parameter   = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.ModuleService_BatchMoveTo, "模块主键数组:" + BusinessLogic.ArrayToList(moduleIds) + ",父结点主键:" + parentId);

            ServiceUtil.ProcessRDIReadDb(userInfo, parameter, dbProvider =>
            {
                var moduleManager = new PiModuleManager(dbProvider, userInfo);
                returnValue      += moduleIds.Sum(t => moduleManager.SetProperty(t, PiModuleTable.FieldParentId, parentId));
            });

            return(returnValue);
        }
コード例 #6
0
        /// <summary>
        /// 根据主键值取得数据库连接定义
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="ids">主键</param>
        /// <returns>数据表</returns>
        public DataTable GetDTByIds(UserInfo userInfo, string[] ids)
        {
            var dataTable = new DataTable(CiDbLinkDefineTable.TableName);
            var parameter = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, string.Empty);

            ServiceUtil.ProcessRDIReadDb(userInfo, parameter, dbProvider =>
            {
                var manager         = new CiDbLinkDefineManager(dbProvider, userInfo);
                dataTable           = manager.GetDT(CiDbLinkDefineTable.FieldId, ids, CiDbLinkDefineTable.FieldSortCode);
                dataTable.TableName = CiDbLinkDefineTable.TableName;
            });
            return(dataTable);
        }
コード例 #7
0
        /// <summary>
        /// 取得实体
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="id">主键</param>
        /// <returns>实体</returns>
        public CiDbLinkDefineEntity GetEntity(UserInfo userInfo, string id)
        {
            CiDbLinkDefineEntity entity = null;

            var parameter = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, string.Empty);

            ServiceUtil.ProcessRDIReadDb(userInfo, parameter, dbProvider =>
            {
                var manager = new CiDbLinkDefineManager(dbProvider, userInfo);
                entity      = manager.GetEntity(id);
            });
            return(entity);
        }
コード例 #8
0
        /// <summary>
        /// 获取实体
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="id">主键</param>
        /// <returns>实体</returns>
        public CiFileEntity GetEntity(UserInfo userInfo, string id)
        {
            CiFileEntity fileEntity = null;
            var          parameter  = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.FileService_GetEntity);

            parameter.IsAddLog = false;
            ServiceUtil.ProcessRDIReadDb(userInfo, parameter, dbProvider =>
            {
                var fileManager = new CiFileManager(dbProvider, userInfo);
                fileEntity      = fileManager.GetEntity(id);
            });
            return(fileEntity);
        }
        /// <summary>
        /// 设定流程实例的当前位置
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="workflowInsId">工作流程实例Id</param>
        /// <param name="nowtaskId"></param>
        /// <returns></returns>
        public int SetCurrTaskId(UserInfo userInfo, string workflowInsId, string nowtaskId)
        {
            int returnValue = -1;
            var parameter   = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.WorkFlowInstanceService_SetCurrTaskId);

            ServiceUtil.ProcessWorkFlowDbWithTransaction(userInfo, parameter, dbProvider =>
            {
                var manager = new WorkFlowInstanceManager(dbProvider, userInfo);
                // 调用方法,并且返回运行结果
                returnValue = manager.SetCurrTaskId(workflowInsId, nowtaskId);
            });
            return(returnValue);
        }
コード例 #10
0
        /// <summary>
        /// 批量移动实体
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="permissionItemIds">权限项主键数组</param>
        /// <param name="parentId">父主键</param>
        /// <returns>影响行数</returns>
        public int BatchMoveTo(UserInfo userInfo, string[] permissionItemIds, string parentId)
        {
            var returnValue = 0;
            var parameter   = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.PermissionItemService_BatchMoveTo);

            ServiceUtil.ProcessRDIReadDb(userInfo, parameter, dbProvider =>
            {
                var permissionItemManager = new PiPermissionItemManager(dbProvider, userInfo);
                returnValue += permissionItemIds.Sum(t => permissionItemManager.MoveTo(t, parentId));
            });

            return(returnValue);
        }
コード例 #11
0
        /// <summary>
        /// 按文件夹删除文件
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="folderId">文件夹主键</param>
        /// <returns>影响行数</returns>
        public int DeleteByFolder(UserInfo userInfo, string folderId)
        {
            int returnValue = 0;
            var parameter   = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.FileService_DeleteByFolder);

            ServiceUtil.ProcessRDIReadDb(userInfo, parameter, dbProvider =>
            {
                var fileManager = new CiFileManager(dbProvider, userInfo);
                returnValue     = fileManager.DeleteByFolder(folderId);
            });

            return(returnValue);
        }
コード例 #12
0
        /// <summary>
        /// 移动文件到指定文件夹
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="id">文件主键</param>
        /// <param name="folderId">文件夹主键</param>
        /// <returns>受影响的行数</returns>
        public int MoveTo(UserInfo userInfo, string id, string folderId)
        {
            int returnValue = 0;
            var parameter   = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, string.Empty);

            parameter.IsAddLog = false;
            ServiceUtil.ProcessRDIReadDb(userInfo, parameter, dbProvider =>
            {
                var fileManager = new CiFileManager(dbProvider, userInfo);
                returnValue     = fileManager.MoveTo(id, folderId);
            });
            return(returnValue);
        }
コード例 #13
0
        /// <summary>
        /// 按主键数组获取列表
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="ids">角色主键</param>
        /// <returns>数据表</returns>
        public DataTable GetDTByIds(UserInfo userInfo, string[] ids)
        {
            var dataTable = new DataTable(PiRoleTable.TableName);
            var parameter = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.PermissionItemService_GetDTByIds);

            ServiceUtil.ProcessRDIReadDb(userInfo, parameter, dbProvider =>
            {
                dataTable           = new PiPermissionItemManager(dbProvider, userInfo).GetDT(PiPermissionItemTable.FieldId, ids, PiPermissionItemTable.FieldSortCode);
                dataTable           = BusinessLogic.SetFilter(dataTable, PiPermissionItemTable.FieldDeleteMark, "0");
                dataTable.TableName = PiPermissionItemTable.TableName;
            });
            return(dataTable);
        }
コード例 #14
0
        /// <summary>
        /// 批量授予角色的操作权限
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="roleIds">角色主键数组</param>
        /// <param name="grantPermissionItemIds">授予操作权限主键数组</param>
        /// <returns>影响的行数</returns>
        public int GrantRolePermissions(UserInfo userInfo, string[] roleIds, string[] grantPermissionItemIds)
        {
            var returnValue = 0;
            var parameter   = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.PermissionService_GrantRolePermissions);

            ServiceUtil.ProcessRDIReadDb(userInfo, parameter, dbProvider =>
            {
                if (roleIds != null && grantPermissionItemIds != null)
                {
                    returnValue += new RolePermissionManager(dbProvider, userInfo).Grant(roleIds, grantPermissionItemIds);
                }
            });
            return(returnValue);
        }
コード例 #15
0
        /// <summary>
        /// 撤消指定角色某个权限域的模块授权范围
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="roleId">角色主键</param>
        /// <param name="permissionItemCode">操作权限编号</param>
        /// <param name="revokeModuleId">撤消模块主键数组</param>
        /// <returns>影响的行数</returns>
        public int RevokeRoleModuleScope(UserInfo userInfo, string roleId, string permissionItemCode, string revokeModuleId)
        {
            var returnValue = 0;
            var parameter   = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.PermissionService_RevokeRoleModuleScope, "角色主键:" + roleId + ",模块主键:" + revokeModuleId);

            ServiceUtil.ProcessRDIReadDb(userInfo, parameter, dbProvider =>
            {
                if (revokeModuleId != null)
                {
                    returnValue += new RoleScopeManager(dbProvider, userInfo).RevokeModule(roleId, permissionItemCode, revokeModuleId);
                }
            });
            return(returnValue);
        }
コード例 #16
0
        /// <summary>
        /// 授予角色某个权限域的模块授权范围
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="roleId">角色主键</param>
        /// <param name="permissionItemCode">操作权限编号</param>
        /// <param name="grantModuleIds">授予模块主键数组</param>
        /// <returns>影响的行数</returns>
        public int GrantRoleModuleScope(UserInfo userInfo, string roleId, string permissionItemCode, string[] grantModuleIds)
        {
            var returnValue = 0;
            var parameter   = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.PermissionService_GrantRoleModuleScope, "角色主键:" + roleId + ",授予模块主键数组:" + BusinessLogic.ArrayToList(grantModuleIds));

            ServiceUtil.ProcessRDIReadDb(userInfo, parameter, dbProvider =>
            {
                if (grantModuleIds != null)
                {
                    returnValue += new RoleScopeManager(dbProvider, userInfo).GrantModules(roleId, permissionItemCode, grantModuleIds);
                }
            });
            return(returnValue);
        }
コード例 #17
0
        /// <summary>
        /// 撤消角色的某个权限域的组织范围
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="roleId">角色主键</param>
        /// <param name="permissionItemId">操作权限主键</param>
        /// <param name="revokeOrganizeIds">撤消的组织主键数组</param>
        /// <returns>影响的行数</returns>
        public int RevokeRoleOrganizeScope(UserInfo userInfo, string roleId, string permissionItemId, string[] revokeOrganizeIds)
        {
            var returnValue = 0;
            var parameter   = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.PermissionService_RevokeRoleOrganizeScope, "角色主键:" + roleId + ",撤消的组织主键数组:" + BusinessLogic.ArrayToList(revokeOrganizeIds));

            ServiceUtil.ProcessRDIReadDb(userInfo, parameter, dbProvider =>
            {
                if (revokeOrganizeIds != null && revokeOrganizeIds.Length > 0)
                {
                    returnValue += new RoleScopeManager(dbProvider, userInfo).RevokeOrganizes(roleId, permissionItemId, revokeOrganizeIds);
                }
            });
            return(returnValue);
        }
コード例 #18
0
        /// <summary>
        /// 授予指定角色特定的操作权限
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="roleId">角色主键</param>
        /// <param name="grantPermissionItemId">授予权限数组</param>
        /// <returns>影响的行数</returns>
        public string GrantRolePermissionById(UserInfo userInfo, string roleId, string grantPermissionItemId)
        {
            string returnValue = string.Empty;
            var    parameter   = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.PermissionService_GrantRolePermissionById);

            ServiceUtil.ProcessRDIReadDb(userInfo, parameter, dbProvider =>
            {
                if (grantPermissionItemId != null)
                {
                    returnValue = new RolePermissionManager(dbProvider, userInfo).Grant(roleId, grantPermissionItemId);
                }
            });
            return(returnValue);
        }
コード例 #19
0
        /// <summary>
        /// 获取特定用户的新信息
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="receiverId">当前交互的用户</param>
        /// <returns>数据表</returns>
        public DataTable ReadFromReceiver(UserInfo userInfo, string receiverId)
        {
            var dataTable = new DataTable(CiMessageTable.TableName);
            var parameter = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.MessageService_ReadFromReceiver);

            ServiceUtil.ProcessRDIReadDb(userInfo, parameter, dbProvider =>
            {
                var messageManager  = new CiMessageManager(dbProvider, userInfo);
                dataTable           = messageManager.ReadFromReceiver(receiverId);
                dataTable.TableName = CiMessageTable.TableName;
            });

            return(dataTable);
        }
コード例 #20
0
        /// <summary>
        /// 获得指定用户有权限访问的模块
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="userId">用户主键</param>
        /// <returns>模块数据表</returns>
        public DataTable GetModuleDTByUserId(UserInfo userInfo, string userId)
        {
            var dataTable = new DataTable(PiModuleTable.TableName);
            var parameter = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.PermissionService_GetModuleDTByUserId);

            ServiceUtil.ProcessRDIReadDb(userInfo, parameter, dbProvider =>
            {
                var moduleManager   = new PiModuleManager(dbProvider, userInfo);
                dataTable           = userInfo.IsAdministrator ? moduleManager.GetDT(PiModuleTable.FieldDeleteMark, 0, PiModuleTable.FieldEnabled, 1, PiModuleTable.FieldSortCode) : moduleManager.GetDTByUser(userId);
                dataTable.TableName = PiModuleTable.TableName;
            });

            return(dataTable);
        }
コード例 #21
0
        /// <summary>
        /// 得到当前用户所在部门的用户列表
        /// </summary>
        /// <param name="userInfo">当前用户</param>
        /// <returns>数据表</returns>
        public DataTable GetDepartmentUser(UserInfo userInfo)
        {
            DataTable result    = null;
            var       parameter = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.UserService_GetDepartmentUser);

            ServiceUtil.ProcessRDIReadDb(userInfo, parameter, dbProvider =>
            {
                var manager        = new PiUserManager(dbProvider, userInfo);
                string commandText = "SELECT " + PiUserTable.FieldId + "," + PiUserTable.FieldRealName + "," + PiUserTable.FieldCompanyName + "," + PiUserTable.FieldDepartmentName + "  FROM " + PiUserTable.TableName + " WHERE " + PiUserTable.FieldCompanyName + " = '" + userInfo.CompanyName + "' AND " + PiUserTable.FieldDepartmentName + " = '" + userInfo.DepartmentName + "' AND " + PiUserTable.FieldDeleteMark + " = 0  AND " + PiUserTable.FieldEnabled + " = 1   AND " + PiUserTable.FieldIsVisible + " = 1  ORDER BY " + PiUserTable.FieldSortCode;
                result             = manager.Fill(commandText);
                result.TableName   = PiUserTable.TableName;
            });
            return(result);
        }
コード例 #22
0
        /// <summary>
        /// 获取用户列表
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <returns>数据表</returns>
        public DataTable GetDT(UserInfo userInfo)
        {
            var dataTable = new DataTable(PiUserTable.TableName);
            var parameter = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.UserService_GetDT);

            ServiceUtil.ProcessRDIReadDb(userInfo, parameter, dbProvider =>
            {
                string[] names      = { PiUserTable.FieldDeleteMark };
                Object[] values     = { 0 };
                dataTable           = new PiUserManager(dbProvider, userInfo).GetDT(names, values, PiUserTable.FieldSortCode);
                dataTable.TableName = PiUserTable.TableName;
            });
            return(dataTable);
        }
コード例 #23
0
        /// <summary>
        /// 按某个权限范围获取特定用户可访问的组织机构主键数组
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="userId">用户主键</param>
        /// <param name="permissionItemCode">操作权限编号</param>
        /// <returns>主键数组</returns>
        public string[] GetOrganizeIdsByPermissionScope(UserInfo userInfo, string userId, string permissionItemCode)
        {
            string[] returnValue = null;
            var      parameter   = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.PermissionService_GetOrganizeIdsByPermissionScope);

            ServiceUtil.ProcessRDIReadDb(userInfo, parameter, dbProvider =>
            {
                if (!String.IsNullOrEmpty(permissionItemCode))
                {
                    returnValue = new PiPermissionScopeManager(dbProvider, userInfo).GetOrganizeIds(userId, permissionItemCode);
                }
            });
            return(returnValue);
        }
コード例 #24
0
        /// <summary>
        /// 获取实体
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="id">主键</param>
        /// <returns>实体</returns>
        public PiPermissionItemEntity GetEntity(UserInfo userInfo, string id)
        {
            var permissionItemEntity = new PiPermissionItemEntity();
            var parameter            = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.PermissionItemService_GetEntity);

            ServiceUtil.ProcessRDIReadDb(userInfo, parameter, dbProvider =>
            {
                var permissionItemManager = new PiPermissionItemManager(dbProvider, userInfo);
                var returnDataTable       = new DataTable(PiPermissionItemTable.TableName);
                returnDataTable           = permissionItemManager.GetDTById(id);
                permissionItemEntity      = BaseEntity.Create <PiPermissionItemEntity>(returnDataTable);
            });
            return(permissionItemEntity);
        }
コード例 #25
0
        /// <summary>
        /// 用户从角色中移除
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="userId">用户主键</param>
        /// <param name="removeRoleIds">移除角色</param>
        /// <returns></returns>
        public int RemoveUserFromRole(UserInfo userInfo, string userId, string[] removeRoleIds)
        {
            int returnValue = 0;
            var parameter   = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.UserService_RemoveUserFromRole);

            ServiceUtil.ProcessRDIReadDb(userInfo, parameter, dbProvider =>
            {
                if (removeRoleIds != null)
                {
                    returnValue += new PiUserRoleManager(dbProvider, userInfo).RemoveFormRole(userId, removeRoleIds);
                }
            });
            return(returnValue);
        }
コード例 #26
0
        /// <summary>
        /// 按表名获取字段列表
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="tableCode">表名</param>
        /// <returns>数据表</returns>
        public DataTable GetDTByTable(UserInfo userInfo, string tableCode)
        {
            var dataTable = new DataTable(CiTableColumnsTable.TableName);
            var parameter = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.TableColumnsService_GetDTByTable);

            ServiceUtil.ProcessRDIReadDb(userInfo, parameter, dbProvider =>
            {
                string[] names      = { CiTableColumnsTable.FieldTableCode, CiTableColumnsTable.FieldDeleteMark };
                Object[] values     = { tableCode, 0 };
                dataTable           = new TableColumnsManager(dbProvider, userInfo).GetDT(names, values, CiTableColumnsTable.FieldSortCode);
                dataTable.TableName = CiTableColumnsTable.TableName;
            });
            return(dataTable);
        }
コード例 #27
0
        /// <summary>
        /// 按目录获取列表
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="id">主键</param>
        /// <returns>数据表</returns>
        public DataTable GetDTByParent(UserInfo userInfo, string id)
        {
            DataTable dataTable = new DataTable(CiFolderTable.TableName);
            var       parameter = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, string.Empty);

            parameter.IsAddLog = false;
            ServiceUtil.ProcessRDIReadDb(userInfo, parameter, dbProvider =>
            {
                var folderManager   = new CiFolderManager(dbProvider, userInfo);
                dataTable           = folderManager.GetDTByParent(id);
                dataTable.TableName = CiFolderTable.TableName;
            });
            return(dataTable);
        }
コード例 #28
0
        /// <summary>
        /// 获取序列号列表
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <returns>数据表</returns>
        public DataTable GetDT(UserInfo userInfo)
        {
            var dataTable = new DataTable(CiSequenceTable.TableName);
            var parameter = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.SequenceService_GetDT);

            ServiceUtil.ProcessRDIReadDb(userInfo, parameter, dbProvider =>
            {
                var sequenceManager = new CiSequenceManager(dbProvider);
                dataTable           = sequenceManager.GetDT();
                dataTable.TableName = CiSequenceTable.TableName;
            });

            return(dataTable);
        }
        /// <summary>
        /// 撤消指定组织机构指定的操作权限
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="organizeId">组织机构主键</param>
        /// <param name="revokePermissionItemId">撤消操作权限主键数组</param>
        /// <returns>影响的行数</returns>
        public int RevokeOrganizePermissionById(UserInfo userInfo, string organizeId, string revokePermissionItemId)
        {
            var returnValue = 0;
            var parameter   = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.PermissionService_RevokeOrganizePermissionById, "组织机构主键:" + organizeId + ",撤消操作权限主键数组:" + revokePermissionItemId);

            ServiceUtil.ProcessRDIReadDb(userInfo, parameter, dbProvider =>
            {
                if (revokePermissionItemId != null)
                {
                    returnValue += new OrganizePermissionManager(dbProvider, userInfo, PiPermissionTable.TableName).Revoke(organizeId, revokePermissionItemId);
                }
            });
            return(returnValue);
        }
コード例 #30
0
        /// <summary>
        /// 按父节点获取列表
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="parentId">父节点</param>
        /// <returns>数据表</returns>
        public DataTable GetDTByParent(UserInfo userInfo, string parentId)
        {
            var dataTable = new DataTable(PiOrganizeTable.TableName);
            var parameter = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.OrganizeService_GetDTByParent);

            ServiceUtil.ProcessRDIReadDb(userInfo, parameter, dbProvider =>
            {
                var organizeManager        = new PiOrganizeManager(dbProvider, userInfo);
                dataTable                  = organizeManager.GetDT(PiOrganizeTable.FieldParentId, parentId, PiOrganizeTable.FieldDeleteMark, 0, PiOrganizeTable.FieldSortCode);
                dataTable.DefaultView.Sort = PiOrganizeTable.FieldSortCode;
                dataTable.TableName        = PiOrganizeTable.TableName;
            });
            return(dataTable);
        }