/// <summary>
        /// 取得实体
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="id">主键</param>
        /// <returns>实体</returns>
        public CiMessageEntity GetEntity(UserInfo userInfo, string id)
        {
            CiMessageEntity entity    = null;
            var             parameter = ParameterUtil.CreateWithOutMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName);

            ServiceUtil.ProcessRDIReadDb(userInfo, parameter, dbProvider =>
            {
                entity = new CiMessageManager(dbProvider, userInfo).GetEntity(id);
            });
            return(entity);
        }
        /// <summary>
        /// 更新任务授权
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="entity">实体</param>
        /// <returns>大于0成功</returns>
        public int UpdateAccreditUser(UserInfo userInfo, AccreditUserEntity entity)
        {
            var returnValue = -1;
            var parameter   = ParameterUtil.CreateWithOutMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName);

            ServiceUtil.ProcessWorkFlowDbWithTransaction(userInfo, parameter, dbProvider =>
            {
                var manager = new AccreditUserManager(dbProvider, userInfo);
                returnValue = manager.UpdateAccreditUser(entity);
            });
            return(returnValue);
        }
        /// <summary>
        /// 依据主键获得任务授权列表
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="auserId">主键</param>
        /// <returns>任务授权列表</returns>
        public DataTable GetAccreditUserTable(UserInfo userInfo, string auserId)
        {
            var parameter = ParameterUtil.CreateWithOutMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName);
            var dataTable = new DataTable(AccreditUserTable.TableName);

            ServiceUtil.ProcessWorkFlowDb(userInfo, parameter, dbProvider =>
            {
                var manager = new AccreditUserManager(dbProvider, userInfo);
                dataTable   = manager.GetAccreditUserTable(auserId);
            });
            return(dataTable);
        }
        /// <summary>
        /// 获得子表单隶属的主表单
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="userControlId">子表单id</param>
        /// <returns>子表单隶属的主表单列表</returns>
        public DataTable GetMainCtrlsOfChild(UserInfo userInfo, string userControlId)
        {
            var parameter = ParameterUtil.CreateWithOutMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName);
            var dataTable = new DataTable(UserControlsTable.TableName);

            ServiceUtil.ProcessWorkFlowDb(userInfo, parameter, dbProvider =>
            {
                var manager = new UserControlsManager(dbProvider, userInfo);
                dataTable   = manager.GetMainCtrlsOfChild(userControlId);
            });
            return(dataTable);
        }
Esempio n. 5
0
        /// <summary>
        /// 判断任务实例是否已完成,以此来判断避免重复提交
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="worktaskInsId">任务实例Id</param>
        /// <returns></returns>
        public bool IsTaskInsCompleted(UserInfo userInfo, string worktaskInsId)
        {
            bool returnValue = false;
            var  parameter   = ParameterUtil.CreateWithOutMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName);

            ServiceUtil.ProcessWorkFlowDb(userInfo, parameter, dbProvider =>
            {
                var manager = new WorkFlowHelperManager(dbProvider, userInfo);
                returnValue = manager.IsTaskInsCompleted(worktaskInsId);
            });
            return(returnValue);
        }
Esempio n. 6
0
        /// <summary>
        /// 是否存在指定主子表单关联
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="ctrlLinkId">关联Id</param>
        /// <returns>
        /// true:存在
        /// false:不存在
        /// </returns>
        public bool ExistsControlsLink(UserInfo userInfo, string ctrlLinkId)
        {
            var parameter   = ParameterUtil.CreateWithOutMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName);
            var returnValue = false;

            ServiceUtil.ProcessWorkFlowDb(userInfo, parameter, dbProvider =>
            {
                var manager = new MainUserControlManager(dbProvider, userInfo);
                returnValue = manager.ExistsControlsLink(ctrlLinkId);
            });
            return(returnValue);
        }
Esempio n. 7
0
        /// <summary>
        /// 根据条件获取数据
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="parameters">参数</param>
        /// <returns>数据表</returns>
        public DataTable GetDTByValues(UserInfo userInfo, List <KeyValuePair <string, object> > parameters)
        {
            var dataTable = new DataTable(testdemoTable.TableName);
            var parameter = ParameterUtil.CreateWithOutMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName);

            ServiceUtil.ProcessBusinessDb(userInfo, parameter, dbProvider =>
            {
                dataTable           = new testdemoManager(dbProvider, userInfo).GetDT(parameters);
                dataTable.TableName = testdemoTable.TableName;
            });
            return(dataTable);
        }
        /// <summary>
        /// 依据主键获得附件列表
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="id">主键</param>
        /// <returns>任务附件列表</returns>
        public DataTable GetAttachmentTable(UserInfo userInfo, string id)
        {
            var parameter = ParameterUtil.CreateWithOutMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName);
            var dataTable = new DataTable(AttachmentTable.TableName);

            ServiceUtil.ProcessWorkFlowDb(userInfo, parameter, dbProvider =>
            {
                var manager = new AttachmentManager(dbProvider, userInfo);
                dataTable   = manager.GetDT(AttachmentTable.FieldId, id, AttachmentTable.FieldDeleteMark, 0);
            });
            return(dataTable);
        }
Esempio n. 9
0
        /// <summary>
        /// 判断节点实例是否都完成
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="workFlowId">工作流模板Id</param>
        /// <param name="workFlowInstanceId">工作流实例Id</param>
        /// <param name="judgeTaskId">待判断力的节点Id</param>
        /// <param name="taskTypeAndOr">节点类型:and、or</param>
        /// <returns></returns>
        public bool IsPassJudge(UserInfo userInfo, string workFlowId, string workFlowInstanceId, string judgeTaskId, string taskTypeAndOr)
        {
            bool returnValue = false;
            var  parameter   = ParameterUtil.CreateWithOutMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName);

            ServiceUtil.ProcessWorkFlowDb(userInfo, parameter, dbProvider =>
            {
                var manager = new WorkFlowHelperManager(dbProvider, userInfo);
                returnValue = manager.IsPassJudge(workFlowId, workFlowInstanceId, judgeTaskId, taskTypeAndOr);
            });
            return(returnValue);
        }
        /// <summary>
        /// 根据条件获得附件列表
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="names">字段</param>
        /// <param name="values">值</param>
        /// <returns>数据表</returns>
        public DataTable GetAttachmentByValues(UserInfo userInfo, string[] names, string[] values)
        {
            var dataTable = new DataTable(AttachmentTable.TableName);
            var parameter = ParameterUtil.CreateWithOutMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName);

            ServiceUtil.ProcessWorkFlowDb(userInfo, parameter, dbProvider =>
            {
                dataTable           = new AttachmentManager(dbProvider, userInfo).GetDT(names, values);
                dataTable.TableName = AttachmentTable.TableName;
            });
            return(dataTable);
        }
        /// <summary>
        /// 根据主键删除附件
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="id">主键</param>
        /// <returns>大于0成功</returns>
        public int DeleteAttachment(UserInfo userInfo, string id)
        {
            var returnValue = -1;
            var parameter   = ParameterUtil.CreateWithOutMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName);

            ServiceUtil.ProcessWorkFlowDbWithTransaction(userInfo, parameter, dbProvider =>
            {
                var manager = new AttachmentManager(dbProvider, userInfo);
                returnValue = manager.Delete(id);
            });
            return(returnValue);
        }
        /// <summary>
        /// 增加附件
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="entity">实体</param>
        /// <returns>增加成功后的主键</returns>
        public string InsertAttachment(UserInfo userInfo, AttachmentEntity entity)
        {
            var returnValue = string.Empty;
            var parameter   = ParameterUtil.CreateWithOutMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName);

            ServiceUtil.ProcessWorkFlowDbWithTransaction(userInfo, parameter, dbProvider =>
            {
                var manager = new AttachmentManager(dbProvider, userInfo);
                returnValue = manager.AddEntity(entity);
            });
            return(returnValue);
        }
Esempio n. 13
0
        /// <summary>
        /// 获得流程实例的审批列表
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="workflowInsId">流程实例Id</param>
        /// <returns>审批列表</returns>
        public DataTable GetAuditMessageTableByFlow(UserInfo userInfo, string workflowInsId)
        {
            var parameter = ParameterUtil.CreateWithOutMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName);
            var dataTable = new DataTable(AuditMessageTable.TableName);

            ServiceUtil.ProcessWorkFlowDb(userInfo, parameter, dbProvider =>
            {
                var manager = new AuditMessageManager(dbProvider, userInfo);
                dataTable   = manager.GetDT(AuditMessageTable.FieldWorkflowInsId, workflowInsId, AuditMessageTable.FieldAuditTime + " DESC ");
            });
            return(dataTable);
        }
        /// <summary>
        /// 获得流程变量列表
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="workflowId">流程模板Id</param>
        /// <returns>流程变量列表</returns>
        public DataTable GetWorkFlowAllVar(UserInfo userInfo, string workflowId)
        {
            var parameter = ParameterUtil.CreateWithOutMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName);
            var dataTable = new DataTable(TaskVarTable.TableName);

            ServiceUtil.ProcessWorkFlowDb(userInfo, parameter, dbProvider =>
            {
                var manager = new TaskVarManager(dbProvider, userInfo);
                dataTable   = manager.GetWorkflowAllVar(workflowId);
            });
            return(dataTable);
        }
        /// <summary>
        /// 获得指定处理者策略
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="operatorId">处理者Id</param>
        /// <returns>处理者策略</returns>
        public string GetOperRelation(UserInfo userInfo, string operatorId)
        {
            var parameter   = ParameterUtil.CreateWithOutMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName);
            var returnValue = string.Empty;

            ServiceUtil.ProcessWorkFlowDb(userInfo, parameter, dbProvider =>
            {
                var manager = new OperatorManager(dbProvider, userInfo);
                returnValue = manager.GetOperRelation(operatorId);
            });
            return(returnValue);
        }
        /// <summary>
        /// 判断任务变量是否存在
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="taskVarId">任务变量Id</param>
        /// <returns>true存在</returns>
        public bool ExistsTaskVar(UserInfo userInfo, string taskVarId)
        {
            var returnValue = false;
            var parameter   = ParameterUtil.CreateWithOutMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName);

            ServiceUtil.ProcessWorkFlowDbWithTransaction(userInfo, parameter, dbProvider =>
            {
                var manager = new TaskVarManager(dbProvider, userInfo);
                returnValue = manager.Exists(taskVarId);
            });
            return(returnValue);
        }
Esempio n. 17
0
        /// <summary>
        /// 获取列表
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <returns>数据表</returns>
        public DataTable GetDT(UserInfo userInfo)
        {
            var dataTable = new DataTable(testdemoTable.TableName);
            var parameter = ParameterUtil.CreateWithOutMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName);

            ServiceUtil.ProcessBusinessDb(userInfo, parameter, dbProvider =>
            {
                dataTable           = new testdemoManager(dbProvider, userInfo).GetDT(testdemoTable.FieldID);
                dataTable.TableName = testdemoTable.TableName;
            });
            return(dataTable);
        }
        /// <summary>
        /// 判断用户是否是该任务节点的操作者
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="userId">用户Id</param>
        /// <param name="workFlowId">流程模版Id</param>
        /// <param name="workTaskId">工作任务Id</param>
        /// <returns></returns>
        public bool IsTaskOperator(UserInfo userInfo, string userId, string workFlowId, string workTaskId)
        {
            bool returnValue = false;
            var  parameter   = ParameterUtil.CreateWithOutMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName);

            ServiceUtil.ProcessWorkFlowDb(userInfo, parameter, dbProvider =>
            {
                var manager = new AccreditUserManager(dbProvider, userInfo);
                returnValue = manager.IsTaskOperator(userId, workFlowId, workTaskId);
            });
            return(returnValue);
        }
Esempio n. 19
0
        /// <summary>
        /// 创建所有符合条件的任务实例
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="userId">处理人Id</param>
        /// <param name="workFlowId">工作流模板id</param>
        /// <param name="workTaskId">当前任务Id</param>
        /// <param name="workFlowInstanceId">工作流实例Id</param>
        /// <param name="workTaskInstanceId">原任务实例Id</param>
        /// <param name="operatorInstanceId">处理者实例Id</param>
        /// <param name="commandName">命令</param>
        /// <returns>
        /// 000002:没有配置后续任务
        /// 000000:操作成功
        /// </returns>
        public string CreateNextTaskInstance(UserInfo userInfo, string userId, string workFlowId, string workTaskId, string workFlowInstanceId, string workTaskInstanceId, string operatorInstanceId, string commandName)
        {
            string returnValue = string.Empty;
            var    parameter   = ParameterUtil.CreateWithOutMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName);

            ServiceUtil.ProcessWorkFlowDbWithTransaction(userInfo, parameter, dbProvider =>
            {
                var manager = new WorkFlowHelperManager(dbProvider, userInfo);
                // 调用方法,并且返回运行结果
                returnValue = manager.CreateNextTaskInstance(userId, workFlowId, workTaskId, workFlowInstanceId, workTaskInstanceId, operatorInstanceId, commandName);
            });
            return(returnValue);
        }
Esempio n. 20
0
        /// <summary>
        /// 根据数据字典主键得到字典明细数据
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="itemId">父级主键</param>
        /// <returns>数据表</returns>
        public DataTable GetItemDetailDTByItemId(UserInfo userInfo, string itemId)
        {
            var dataTable = new DataTable(CiItemDetailsTable.TableName);
            var parameter = ParameterUtil.CreateWithOutMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName);

            ServiceUtil.ProcessRDIReadDb(userInfo, parameter, dbProvider =>
            {
                var itemsDetailManager = new CiItemDetailsManager(dbProvider, userInfo);
                dataTable           = itemsDetailManager.GetDT(CiItemDetailsTable.FieldItemId, itemId, CiItemDetailsTable.FieldDeleteMark, 0, CiItemDetailsTable.FieldSortCode);
                dataTable.TableName = CiItemDetailsTable.TableName;
            });
            return(dataTable);
        }
Esempio n. 21
0
        /// <summary>
        /// 根据组织机构主键获取其指定分类下的子节点列表
        /// </summary>
        /// <param name="userInfo">用户信息</param>
        /// <param name="organizeId">组织机构主键</param>
        /// <returns></returns>
        public DataTable GetChildrensById(UserInfo userInfo, string organizeId)
        {
            var dataTable = new DataTable(PiOrganizeTable.TableName);
            var parameter = ParameterUtil.CreateWithOutMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName);

            ServiceUtil.ProcessRDIReadDb(userInfo, parameter, dbProvider =>
            {
                var manager         = new PiOrganizeManager(dbProvider, userInfo);
                dataTable           = manager.GetChildrens(PiOrganizeTable.FieldId, organizeId, PiOrganizeTable.FieldParentId, PiOrganizeTable.FieldSortCode, false);
                dataTable.TableName = PiOrganizeTable.TableName;
            });
            return(dataTable);
        }
        /// <summary>
        /// 未认领的任务(分页方式)
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="userId">用户Id</param>
        /// <param name="search">查询</param>
        /// <param name="recordCount">记录数</param>
        /// <param name="pageIndex">当前页</param>
        /// <param name="pageSize">每页显示</param>
        /// <param name="order">排序</param>
        /// <returns>未认领的任务列表</returns>
        public DataTable GetUnClaimedTaskByPage(UserInfo userInfo, string userId, string search, out int recordCount, int pageIndex = 0, int pageSize = 100, string order = null)
        {
            var parameter     = ParameterUtil.CreateWithOutMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName);
            var dataTable     = new DataTable(WorkTaskInstanceTable.TableName);
            int myrecordCount = 0;

            ServiceUtil.ProcessWorkFlowDb(userInfo, parameter, dbProvider =>
            {
                var manager = new WorkFlowInstanceManager(dbProvider, userInfo);
                dataTable   = manager.GetUnClaimedTaskByPage(userId, search, out myrecordCount, pageIndex, pageSize, order);
            });
            recordCount = myrecordCount;
            return(dataTable);
        }
        /// <summary>
        /// 获取授权范围
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="userId">用户主键</param>
        /// <returns>数据表</returns>
        public DataTable GetLicensedDT(UserInfo userInfo, string userId)
        {
            var dataTable = new DataTable(PiPermissionItemTable.TableName);
            var parameter = ParameterUtil.CreateWithOutMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName);

            ServiceUtil.ProcessRDIReadDb(userInfo, parameter, dbProvider =>
            {
                var permissionAdminManager = new PiPermissionItemManager(dbProvider, userInfo);
                var permissionItemId       = permissionAdminManager.GetId(PiPermissionItemTable.FieldDeleteMark, 0, PiPermissionItemTable.FieldCode, "Resource.ManagePermission");
                dataTable           = permissionAdminManager.GetDTByUser(userId, permissionItemId);
                dataTable.TableName = PiPermissionItemTable.TableName;
            });
            return(dataTable);
        }
        /// <summary>
        /// 取得列表
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <returns>数据表</returns>
        public DataTable GetDT(UserInfo userInfo)
        {
            var dataTable = new DataTable(CiDbLinkDefineTable.TableName);
            var parameter = ParameterUtil.CreateWithOutMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName);

            ServiceUtil.ProcessRDIReadDb(userInfo, parameter, dbProvider =>
            {
                var manager         = new CiDbLinkDefineManager(dbProvider, userInfo);
                dataTable           = manager.GetDT(CiDbLinkDefineTable.FieldDeleteMark, 0, CiDbLinkDefineTable.FieldSortCode);
                dataTable.TableName = CiDbLinkDefineTable.TableName;
            });

            return(dataTable);
        }
Esempio n. 25
0
        /// <summary>
        /// 分页获取列表
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="searchValue">查询关键字</param>
        /// <param name="recordCount">记录数</param>
        /// <param name="pageIndex">当前页</param>
        /// <param name="pageSize">每页显示记录条数</param>
        /// <param name="sortExpression">排序字段</param>
        /// <returns>数据表</returns>
        public List <testdemoEntity> GetListByPage(UserInfo userInfo, string searchValue, out int recordCount, int pageIndex = 1, int pageSize = 20, string sortExpression = null)
        {
            List <testdemoEntity> list = new List <testdemoEntity>();
            var returnRecordCount      = 0;
            var parameter = ParameterUtil.CreateWithOutMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName);

            ServiceUtil.ProcessBusinessDb(userInfo, parameter, dbProvider =>
            {
                var manager   = new testdemoManager(dbProvider, userInfo);
                var dataTable = manager.GetDTByPage(out returnRecordCount, pageIndex, pageSize, searchValue, sortExpression);
                list          = BaseEntity.GetList <testdemoEntity>(dataTable);
            });
            recordCount = returnRecordCount;
            return(list);
        }
        /// <summary>
        /// 取得列表
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <returns>数据表</returns>
        public List <CiDbLinkDefineEntity> GetList(UserInfo userInfo)
        {
            var parameter = ParameterUtil.CreateWithOutMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName);
            var list      = new List <CiDbLinkDefineEntity>();

            ServiceUtil.ProcessRDIReadDb(userInfo, parameter, dbProvider =>
            {
                var manager = new CiDbLinkDefineManager(dbProvider, userInfo);
                List <KeyValuePair <string, object> > parameters = new List <KeyValuePair <string, object> >
                {
                    new KeyValuePair <string, object>(CiDbLinkDefineTable.FieldDeleteMark, 0)
                };
                list = manager.GetList <CiDbLinkDefineEntity>(parameters, CiDbLinkDefineTable.FieldSortCode);
            });

            return(list);
        }
Esempio n. 27
0
        /// <summary>
        /// 获取用户实体
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="id">主键</param>
        /// <returns>实体</returns>
        public PiUserEntity GetEntity(UserInfo userInfo, string id)
        {
            PiUserEntity userEntity = null;
            //var parameter = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.UserService_GetEntity);
            //使用频率比较高,不用每次都做日志记录,提供效率
            var parameter = ParameterUtil.CreateWithOutMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName);

            ServiceUtil.ProcessRDIReadDb(userInfo, parameter, dbProvider =>
            {
                userEntity = new PiUserManager(dbProvider, userInfo).GetEntity(id);
                if (!string.IsNullOrEmpty(userEntity.RoleId))
                {
                    userEntity.RoleName = new PiRoleManager(dbProvider, userInfo).GetEntity(userEntity.RoleId).RealName;
                }
            });

            return(userEntity);
        }
        /// <summary>
        /// 分页获取查询引擎定义列表
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="searchValue">查询关键字</param>
        /// <param name="recordCount">记录数</param>
        /// <param name="pageIndex">当前页</param>
        /// <param name="pageSize">每页显示记录条数</param>
        /// <param name="sortExpression">排序字段</param>
        /// <returns>数据表</returns>
        public DataTable GetQueryEngineDefineDTByPage(UserInfo userInfo, string searchValue, out int recordCount, int pageIndex = 1, int pageSize = 20, string sortExpression = null)
        {
            var dataTable         = new DataTable(QueryEngineDefineTable.TableName);
            var returnRecordCount = 0;
            var parameter         = ParameterUtil.CreateWithOutMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName);

            ServiceUtil.ProcessRDIReadDb(userInfo, parameter, dbProvider =>
            {
                var manager = new QueryEngineDefineManager(dbProvider, userInfo);
                if (string.IsNullOrEmpty(searchValue))
                {
                    searchValue = QueryEngineDefineTable.FieldDeleteMark + " = 0 ";
                }
                else
                {
                    searchValue += " AND " + QueryEngineDefineTable.FieldDeleteMark + " = 0 ";
                }

                dataTable           = manager.GetDTByPage(out returnRecordCount, pageIndex, pageSize, searchValue, sortExpression);
                dataTable.TableName = QueryEngineDefineTable.TableName;

                // 这里是获数据库连接名称中文显示
                CiDbLinkDefineManager dbLinkManager = new CiDbLinkDefineManager(dbProvider, userInfo);
                if (!dataTable.Columns.Contains("LINKNAME_CHS"))
                {
                    dataTable.Columns.Add("LINKNAME_CHS");
                }

                foreach (DataRow dr in dataTable.Rows)
                {
                    string dbLinkId = BusinessLogic.ConvertToString(dr[QueryEngineDefineTable.FieldDataBaseLinkName]);
                    if (!string.IsNullOrEmpty(dbLinkId))
                    {
                        dr["LINKNAME_CHS"] = dbLinkManager.GetEntity(dbLinkId).LinkName;
                    }
                }
                dataTable.AcceptChanges();
            });
            recordCount = returnRecordCount;
            return(dataTable);
        }
        /// <summary>
        /// 获得主表单分页列表
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="search">查询</param>
        /// <param name="recordCount">记录数</param>
        /// <param name="pageIndex">当前页</param>
        /// <param name="pageSize">每页显示</param>
        /// <param name="order">排序</param>
        /// <returns>数据表</returns>
        public DataTable GetUserControlByPage(UserInfo userInfo, string search, out int recordCount, int pageIndex = 0, int pageSize = 50, string order = null)
        {
            var parameter     = ParameterUtil.CreateWithOutMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName);
            var dataTable     = new DataTable(WorkTaskInstanceTable.TableName);
            int myrecordCount = 0;

            ServiceUtil.ProcessWorkFlowDb(userInfo, parameter, dbProvider =>
            {
                var manager            = new UserControlsManager(dbProvider, userInfo);
                string whereExpression = UserControlsTable.FieldDeleteMark + " = 0 ";
                if (!string.IsNullOrEmpty(search))
                {
                    whereExpression += " AND " + search;
                }
                order = string.IsNullOrEmpty(order) ? UserControlsTable.FieldSortCode : order;

                dataTable = manager.GetDTByPage(out myrecordCount, pageIndex, pageSize, whereExpression, order);
            });
            recordCount = myrecordCount;
            return(dataTable);
        }
Esempio n. 30
0
        /// <summary>
        /// 通过条件得到模块
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="condition">条件表达式</param>
        /// <returns>数据库</returns>
        public DataTable GetDTByCondition(UserInfo userInfo, string condition)
        {
            var parameter = ParameterUtil.CreateWithOutMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName);
            var dataTable = new DataTable(PiModuleTable.TableName);

            ServiceUtil.ProcessRDIReadDb(userInfo, parameter, dbProvider =>
            {
                var moduleManager = new PiModuleManager(dbProvider, userInfo);
                if (string.IsNullOrEmpty(condition))
                {
                    condition = PiModuleTable.FieldDeleteMark + " = 0 ";
                }
                else
                {
                    condition += " AND " + PiModuleTable.FieldDeleteMark + " = 0 ";
                }
                dataTable = moduleManager.GetDTByCondition(condition);
                dataTable.DefaultView.Sort = PiModuleTable.FieldSortCode;
                dataTable.TableName        = PiModuleTable.TableName;
            });
            return(dataTable);
        }