コード例 #1
0
        /// <summary>
        /// 绑定文档类别树树 数据源
        /// </summary>
        private void DocuemntClassDataSource()
        {
            DataTable dt = new DataTable();

            //获取部门数据源
            BLL.BASE_ARTICLE_TYPE bll          = new BLL.BASE_ARTICLE_TYPE();
            Utility.UserSession   _userSession = (Utility.UserSession)Session["user"];
            if (_userSession == null)
            {
                Response.Redirect("~/AdminLogin.aspx", true);
            }
            dt = bll.GetList(string.Format("DEPTID={0}", _userSession.DEPTID.ToString()));

            TreeNode rootNode = new TreeNode();

            rootNode.Text     = "档案分类树";
            rootNode.Value    = "0";
            rootNode.Expanded = true;

            if (dt != null && dt.Rows.Count != 0)
            {
                InitTreeView(rootNode, dt);
            }

            this.trvControl.Nodes.Add(rootNode);
        }
コード例 #2
0
        private void Binging()
        {
            DataTable dt = new DataTable();

            /*当前用户部门下分类*/
            dt = bll.GetList(string.Format("DEPTID={0} AND STATUS=0", userSession.DEPTID.ToString()));

            //初始化分页数据
            AspNetPager1.RecordCount = dt.Rows.Count;
            PagedDataSource pds = new PagedDataSource();

            pds.DataSource       = dt.DefaultView;
            pds.AllowPaging      = true;
            pds.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1;
            pds.PageSize         = AspNetPager1.PageSize;

            //绑定分页后的数据
            grvAcceptList.DataSource = null;
            grvAcceptList.DataBind();

            grvAcceptList.DataSource = pds;
            grvAcceptList.DataBind();

            /*查询结果提示信息*/
            if (dt == null || dt.Rows.Count <= 0)
            {
                litmsg.Visible = true;
                litmsg.Text    = "<div style='font-size:16px; font-family:微软雅黑; color:red;font-weight:bold; text-align:center;'>没有公文分类数据!</div>";
            }
            else
            {
                litmsg.Visible = false;
            }
        }
コード例 #3
0
        private void BindingType()
        {
            DataTable dt = new DataTable();

            dt = bll.GetList(string.Format("DEPTID={0}", userSession.DEPTID.ToString()));

            RecursiveTree(ddlTypeId, dt, 0);
        }