Beispiel #1
0
        /// <summary>
        /// 依主键数组得到数据
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="ids">主鍵</param>
        /// <returns>DataTable</returns>
        public DataTable GetDTByIds(UserInfo userInfo, string[] ids)
        {
            var dataTable = new DataTable(PiOrganizeTable.TableName);
            var parameter = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.OrganizeService_GetDTByIds);

            ServiceUtil.ProcessRDIReadDb(userInfo, parameter, dbProvider =>
            {
                var manager         = new PiOrganizeManager(dbProvider, userInfo);
                dataTable           = manager.GetDT(PiOrganizeTable.FieldId, ids, PiOrganizeTable.FieldSortCode);
                dataTable.TableName = PiOrganizeTable.TableName;
            });
            return(dataTable);
        }
Beispiel #2
0
        /// <summary>
        /// 依据相应条件获取数据
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="names">字段</param>
        /// <param name="values">值</param>
        /// <returns>DataTable</returns>
        public DataTable GetDTByValues(UserInfo userInfo, string[] names, object[] values)
        {
            var dataTable = new DataTable(PiOrganizeTable.TableName);
            var parameter = ParameterUtil.CreateWithLog(userInfo, MethodBase.GetCurrentMethod());

            ServiceUtil.ProcessRDIReadDb(userInfo, parameter, dbProvider =>
            {
                var manager         = new PiOrganizeManager(dbProvider, userInfo);
                dataTable           = manager.GetDT(names, values);
                dataTable.TableName = PiOrganizeTable.TableName;
            });
            return(dataTable);
        }
Beispiel #3
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);
        }