Esempio n. 1
0
        /// <summary>
        /// 按父节点获取列表
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="parentId">父节点</param>
        /// <returns>数据表</returns>
        public DataTable GetDataTableByParent(BaseUserInfo userInfo, string parentId)
        {
            var result = new DataTable(BaseOrganizeEntity.TableName);

            var parameter = ServiceInfo.Create(userInfo, MethodBase.GetCurrentMethod());

            ServiceUtil.ProcessUserCenterReadDb(userInfo, parameter, (dbHelper) =>
            {
                // 获得组织机构列表
                var manager = new BaseOrganizeManager(dbHelper, userInfo);

                List <KeyValuePair <string, object> > parameters = new List <KeyValuePair <string, object> >();
                parameters.Add(new KeyValuePair <string, object>(BaseOrganizeEntity.FieldParentId, parentId));
                parameters.Add(new KeyValuePair <string, object>(BaseOrganizeEntity.FieldEnabled, 1));
                parameters.Add(new KeyValuePair <string, object>(BaseOrganizeEntity.FieldDeletionStateCode, 0));

                result = manager.GetDataTable(parameters, BaseOrganizeEntity.FieldSortCode);
                result.DefaultView.Sort = BaseOrganizeEntity.FieldSortCode;
                result.TableName        = BaseOrganizeEntity.TableName;
            });

            return(result);
        }