Beispiel #1
0
    /// <summary>
    /// 获取部门数据源,不走数据权限控制
    /// </summary>
    public DataSet GetDeptDs_NoPermissions()
    {
        HOrgnizationBB orgnizationBB = new HOrgnizationBB();
        DataSet ds = new DataSet();
        try
        {
            string strWhere = "isDel=0";

            ds = orgnizationBB.GetList(strWhere);
        }
        finally
        {
            orgnizationBB.Dispose();
        }
        return ds;
    }
    /// <summary>
    /// 绑定父级部门
    /// </summary>
    private void BindParentDepart()
    {
        HOrgnizationBB orgnizationBB = new HOrgnizationBB();
        DataSet ds = new DataSet();

        try
        {
            ds = orgnizationBB.GetList("isEffect=1 and isDel=0");
            DataTable dt = ds.Tables[0];

            //加载树
            this.drDepart.Items.Clear();
            this.drDepart.Items.Add(new ListItem("-请选择-", ""));
            DataRow[] drs = dt.Select("uppDepartId=0", "departNo");
            foreach (DataRow row in drs)
            {
                string departId = row["departId"].ToString();
                string text = row["departNm"].ToString();
                text = "╋" + text;
                this.drDepart.Items.Add(new ListItem(text, departId));
                int parentId = int.Parse(departId);
                string blank = "├";

                this.BindNode(parentId, dt, blank);
            }
            this.drDepart.DataBind();
        }
        finally
        {
            orgnizationBB.Dispose();
        }
    }