Пример #1
0
        public virtual OrganizationList GetAllOrganization(bool autoTreeIndexEnabled = false)
        {
            const string sql = @"SELECT org.Id, org.Name,org.treeindex
                      FROM T_RBAC_Organization org
                     where org.wf_approvalstatus = 300
                       and (org.DBI_IsPhantom = 0 or org.DBI_IsPhantom is null)";
            var          dt  = (this.DataQueryer as RdbDataQueryer).QueryTable(sql);

            var result = new OrganizationList {
                AutoTreeIndexEnabled = autoTreeIndexEnabled
            };

            if (dt != null && dt.Rows.Count > 0)
            {
                foreach (var row in dt.Rows)
                {
                    result.Add(new Organization {
                        Id        = Convert.ToInt64(row["Id"]),
                        Name      = Convert.ToString(row["Name"]),
                        TreeIndex = Convert.ToString(row["treeindex"])
                    });
                }
            }

            return(result);
        }
Пример #2
0
        /// <summary>
        /// 获取当前节点子节点
        /// </summary>
        /// <param name="treeIndex">当前节点</param>
        /// <returns>返回当前节点和当前节点的子节点</returns>
        private OrganizationList GetByTreeParentIndex(string treeIndex)
        {
            OrganizationList templist = new OrganizationList {
                AutoTreeIndexEnabled = false
            };

            if (HierarchicalStructureDataCache.OrganizationList.Where(o => o.TreeIndex.Trim().StartsWith(treeIndex)) != null)
            {
                foreach (var item in HierarchicalStructureDataCache.OrganizationList.Where(o => o.TreeIndex.Trim().StartsWith(treeIndex)))
                {
                    if (string.Compare(item.TreeIndex, treeIndex, false) != 0)
                    {
                        templist.Add(item);
                    }
                }
            }
            return(templist);
        }